http://inthirties.com:90/thread-1296-1-1.html
备份很全,可以开始复制数据库了。
先启动目标库到nomount
[oracle@inthrac01 oracle]$ sqlplus sys/1qaz2wsx@single as sysdba
SQL> startup nomount;
ORACLE instance started.Total System Global Area 230686720 bytes
Fixed Size 2082944 bytes
Variable Size 83888000 bytes
Database Buffers 138412032 bytes
Redo Buffers 6303744 bytes
SQL> show parameter control;
下面开始duplicate数据库了
[oracle@inthrac01 oracle]$ rman target / auxiliary sys/1qaz2wsx@single
Recovery Manager: Release 10.2.0.4.0 - Production on Fri Mar 26 08:04:09 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: INTHRAC (DBID=1794719859)
connected to auxiliary database: SINGLE (not mounted)RMAN> duplicate target database to single;
Starting Duplicate Db at 26-MAR-10
…….
executing Memory Scriptdatabase opened
Finished Duplicate Db at 26-MAR-10
RMAN>
现在复制数据库已经成功
检查目标库
数据文件
SQL> select file_name, file_id from dba_data_files;
FILE_NAME FILE_ID
——————————————— ———-
+DG1/single/datafile/system.315.714643485 1
+DG1/single/datafile/undotbs1.310.714643497 2
+DG1/single/datafile/sysaux.314.714643489 3
+DG1/single/datafile/users.308.714643501 4
+DG1/single/datafile/undotbs2.312.714643491 5
+DG1/single/datafile/xpr91ts.1 66 rows selected.
日志文件
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
———- ——- ——- ——————————————— —
2 ONLINE +DG1/single/onlinelog/group_2.302.714643733 NO
1 ONLINE +DG1/single/onlinelog/group_1.303.714643731 NO
3 ONLINE +DG1/single/onlinelog/group_3.306.714643723 NO
4 ONLINE +DG1/single/onlinelog/group_4.304.714643727 NO
控制文件
SQL> select * from v$controlfile;
STATUS NAME IS_ BLOCK_SIZE FILE_SIZE_BLKS
——- ————————————————– — ———- ————–
+DG1/single/controlfile/current01.ctl NO 16384 952
现在复制成功,把你的spfile建到asm里吧
SQL> create spfile=’+DG1/single/spfilesingle’ from pfile=’/u01/app/oracle/product/10.2.0/db_1/dbs/initsingle.ora’;
File created.
修改你的/u01/app/oracle/product/10.2.0/db_1/dbs /initsingle.ora
将spfile定位到ASM的DG上
vi /u01/app/oracle/product/10.2.0/db_1/dbs/initsingle.ora
spfile=’+DG1/single/spfilesingle’
启动数据库
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
SQL> show parameter spfile;
NAME TYPE VALUE
———————————— ———– ——————————
spfile string +DG1/single/spfilesingle
[oracle@inthrac01 oracle]$ rman target /