Oraclerman recovery from different machines
| |
Oracle source host |
Oracle target host |
| Host Platform |
CentOS6.2 (final) |
CentOs6.2 (FInal) |
| Host Name |
Vick |
Rman |
| IP address |
192.168.1.11 |
192.168.1.10 |
| Instance name |
Orcl |
Orcl |
| Oracle version |
11.2.0.4 |
11. 2.0.4 |
| Oracle Data File Storage |
Filesystem |
Filesystem |
| Control File Path |
/U01/app/oracle/oradata |
/U01/app/oracle/oradata |
| Data File Path |
/U01/app/oracle/oradata |
/U01/app/oracle/oradata |
| Online redo log path |
/U01/app/oracle/oradata |
/U01/app/oracle/oradata |
View the control file information of the source database:
SQL> select name from v $ controlfile;
NAME
------------------------------------------------------------------------------
/U01/app/oracle/oradata/orcl/control01.ctl
/U01/app/oracle/fast_recovery_area/orcl/control02.ctl
Data File Information of the source database:
SQL> select file #, name from v $ datafile;
FILE # NAME
--------------------------------------------------------------------------------
1/u01/app/oracle/oradata/orcl/system01.dbf
2/u01/app/oracle/oradata/orcl/sysaux01.dbf
3/u01/app/oracle/oradata/orcl/undotbs01.dbf
4/u01/app/oracle/oradata/orcl/users01.dbf
5/u01/app/oracle/oradata/orcl/tbs_catalog.dbf
6/u01/app/oracle/oradata/orcl/dave01.dbf
Online redo log files in the source database:
SQL> select group #, member from v $ logfile;
GROUP # MEMBER
--------------------------------------------------------------------------------
1/u01/app/oracle/oradata/orcl/redo01.log
2/u01/app/oracle/oradata/orcl/redo02.log
3/u01/app/oracle/oradata/orcl/redo03.log
If there are different paths, you need to perform relevant operations.
Back up the database with rman on the source database, including the database
[Oracle @ vick ~] $ Mkdir/u01/backup
[Oracle @ vick ~] $ Rman target/
RMAN> run {
2> allocate channel c1 device type disk;
3> backup incremental level 0
4> format '/u01/backup/db_full _ % U. bkp'
5> tag '2017-11-14-full'
6> database plus archivelog;
7> release channel c1;
8>}
RMAN> backup current controlfile format '/u01/backup/control20141114. bak ';
RMAN> backup spfile format '/u01/backup/spfile20141114.bak ';
2. copy backup data on the target host and prepare related directories
Upload the backup to the target host
[oracle@vick backup]$ scp * 192.168.1.10:/u01/backupdb_full_3kpnjk76_1_1.bkp 100% 148MB 11.4MB/s 00:13db_full_3lpnjk7l_1_1.bkp 100% 1103MB 7.8MB/s 02:22control20141114 .bak 100% 9664KB 9.4MB/s 00:01spfile20141114.bak 100% 96KB 96.0KB/s 00:00
Create related directories
[oracle@rman orcl]$ mkdir {adump,bdump,cdump,dpdump,udump,pfile}[oracle@rman ~]$ mkdir -p /u01/app/oracle/oradata/orcl[oracle@rman ~]$ mkdir -p /u01/app/oracle/fast_recovery_area/ORCL
Create a password file:
[Oracle @ rman dbs] $ orapwd file = $ ORACLE_HOME/dbs/orapw $ ORACLE_SID password = oracle
Create an initorcl. ora File
[Oracle @ rman ~] $ Echo 'db _ name = orcl '> $ ORACLE_HOME/dbs/initorcl. ora
Recovery from different hosts --> the following operations are performed on the target host
Set DBID
View the DBID of the source host
SQL> select dbid from v$database;DBID----------1387254920[oracle@rman dbs]$ rman target /RMAN> set dbid 1387254920executing command: SET DBIDMAN> startup nomount;connected to target database (not started)Oracle instance startedTotal System Global Area 217157632 bytesFixed Size 2251816 bytesVariable Size 159384536 bytesDatabase Buffers 50331648 bytesRedo Buffers 5189632 bytes
Restore parameter files
RMAN> restore spfile from '/u01/backup/spfile20141114.bak'; Starting restore at 14-NOV-14allocated channel: ORA_DISK_1channel ORA_DISK_1: SID = 19 device type = DISKchannel ORA_DISK_1: restoring spfile from AUTOBACKUP/u01/backup/spfile20141114.bakchannel ORA_DISK_1: SPFILE restore from AUTOBACKUP completeFinished restore at 14-NOV-14 restart nomoutRMAN> startup nomount force; oracle instance startedTotal System Global Area 613797888 bytesFixed Size 2255712 bytesVariable Size 427820192 bytesDatabase Buffers 180355072 bytesRedo Buffers 3366912 bytes recovery control file RMAN> restore controlfile from '/u01/backup/control20141114. bak '; Starting restore at 14-NOV-14using channel ORA_DISK_1channel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00: 00: 01 output file name =/u01/app/oracle/oradata/orcl/control01.ctloutput file name =/u01/app/oracle/fast_recovery_area/orcl/Duplicate restore at 14-NOV-14RMAN> startup mountRMAN> restore database; if this step can not be executed can use list incarnation production to see the relevant information, switch and then execute reset database to incarnation XX; RMAN> recover database; RMAN-03002: failure of recover command at 11/14/2014 22: 19: 36RMAN-06053: unable to perform media recovery because of missing logRMAN-06025: no backup of archived log for thread 1 with sequence 13 and starting SCN of 1208284
An error was reported in this step. Later I found that the catalog was not executed.
Then I executed catalog start with '/u01/backup /';
Run recover again.
But the same error still occurred.
Then, after I run list backup of archivelog all to view the information, I can execute the following script:
RMAN> run {2> set until scn 1208284; 3> recover database; 4 >} executing command: SET until clauseStarting recover at 14-NOV-14using channel ORA_DISK_1using channel ORA_DISK_2using channel ORA_DISK_3using channel ORA_DISK_4starting media recoverymedia recovery complete, elapsed time: 00: 00: 00 Finished recover at 14-NOV-14 then log on to the database and execute SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-19751: cocould not create the change tracking fileORA-19750: change tracking file: '/u01/app/oracle/oradata/orcl/ORCL/changetracking/o1_mf_b511_77x _. chg 'ora-27040: file create error, unable to create fileLinux-x86_64 Error: 2: No such file or directoryAdditional information: 1ORA-27037: unable to obtain file statusLinux-x86_64 Error: 2: no such file or directoryAdditional information: 3
If an error occurs again, I will go to the/u01/app/oracle/oradata/orcl/ORCL/changetracking/directory to check whether this directory exists.
Then I executed
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
Then shut down the database shutdown immediate;
Execute startup;
Database started successfully
This is the first two days of recovery from a different machine. It has a big head and many solutions are useless. The above are my problems and I hope to help some friends who have encountered similar problems.
Change the location of the change tracking file
1) do not close the database
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE 'new _ location ';
Note: This method will lose the content of the change tracking file.