Oracle Rman Recovery for different machines

Source: Internet
Author: User

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


To view the control file information for the Source library:

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 for the Source library:

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

Source Library Online Redo log file:

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 the path has a different place then you need to do something about it

Back up the database with Rman on the source database, including the database

[Email protected] ~]$ Mkdir/u01/backup

[[email protected] ~]$ 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 ' 2014-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 ';

Second, copy the backup data on the target host and prepare the relevant directory.

Uploading a backup to a target host

[Email protected] backup]$ SCP * 192.168.1.10:/u01/backup

DB_FULL_3KPNJK76_1_1.BKP 100% 148MB 11.4mb/s 00:13
DB_FULL_3LPNJK7L_1_1.BKP 100% 1103MB 7.8mb/s 02:22

control20141114. bak 100% 9664KB 9.4mb/s 00:01
Spfile20141114.bak 100% 96KB 96.0kb/s 00:00

Create a related directory

[[email protected] orcl]$ mkdir {adump,bdump,cdump,dpdump,udump,pfile}

[Email protected] ~]$ mkdir-p/U01/APP/ORACLE/ORADATA/ORCL

[Email protected] ~]$ mkdir-p/U01/APP/ORACLE/FAST_RECOVERY_AREA/ORCL

To create a password file:

[Email protected] dbs]$ orapwd file= $ORACLE _home/dbs/orapw$oracle_sid password=oracle

Create a Initorcl.ora file

[[email protected] ~]$ echo ' DB_NAME=ORCL ' > $ORACLE _home/dbs/initorcl.ora

The following operations are performed on the target host

Set dbid

View Sourcing host dbid

Sql> select dbid from V$database;

DBID
----------
1387254920

[[email protected] dbs]$ Rman target/

Rman> set dbid 1387254920


Executing Command:set DBID

man> startup Nomount;


Connected to target database (not started)
Oracle instance started


Total System Global area 217157632 bytes


Fixed Size 2251816 bytes
Variable Size 159384536 bytes
Database buffers 50331648 bytes
Redo buffers 5189632 bytes

Recover parameters File

rman> restore SPFile from '/u01/backup/spfile20141114.bak ';

Starting restore at 14-nov-14
Allocated Channel:ora_disk_1
Channel ora_disk_1:sid=19 Device Type=disk

Channel ora_disk_1:restoring SPFile from Autobackup/u01/backup/spfile20141114.bak
Channel Ora_disk_1:spfile Restore from Autobackup complete
Finished restore at 14-nov-14

Restart Nomout
rman> startup Nomount Force;
Oracle instance started
Total System Global area 613797888 bytes

Fixed Size 2255712 bytes
Variable Size 427820192 bytes
Database buffers 180355072 bytes
Redo buffers 3366912 bytes

Recovery control files

rman> restore Controlfile from '/u01/backup/control20141114. Bak ';
Starting restore at 14-nov-14
Using channel Ora_disk_1

Channel ora_disk_1:restoring Control File
Channel Ora_disk_1:restore complete, elapsed time:00:00:01
Output File Name=/u01/app/oracle/oradata/orcl/control01.ctl
Output File Name=/u01/app/oracle/fast_recovery_area/orcl/control02.ctl
Finished restore at 14-nov-14


Rman> Startup Mount

Rman>restore database;

If this step doesn't work, you can use list incarnation to see the 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:36
Rman-06053:unable to perform media recovery because of missing log
Rman-06025:no Backup of archived log for thread 1 with sequence and starting SCN of 1208284

This step unexpectedly error, later I found that did not execute the catalog

Then I executed the catalog start with '/u01/backup/';

Run recover again.

But it's still a mistake.

Then I perform the list backup of Archivelog all view and execute the following script.

Rman> Run {
2> set until SCN 1208284;
3> Recover database;
4>}


Executing command:set until clause


Starting recover at 14-nov-14
Using channel Ora_disk_1
Using channel Ora_disk_2
Using channel Ora_disk_3
Using channel Ora_disk_4


Starting Media recovery
Media recovery complete, elapsed time:00:00:00


Finished recover at 14-nov-14


Then log in to the database to execute

sql> ALTER DATABASE open resetlogs;
ALTER DATABASE open Resetlogs
*
ERROR at line 1:
Ora-19751:could not create the change tracking file
Ora-19750:change Tracking File:
'/u01/app/oracle/oradata/orcl/orcl/changetracking/o1_mf_b51rj77x_.chg '
Ora-27040:file create error, unable to create file
linux-x86_64 error:2: No such file or directory
Additional Information:1
Ora-27037:unable to obtain file status
linux-x86_64 error:2: No such file or directory
Additional Information:3

I went to the/u01/app/oracle/oradata/orcl/orcl/changetracking/directory to see if there is no such directory.

And then I executed.

Sql>alter DATABASE DISABLE BLOCK change TRACKING;

Then close the database shutdown immediate;

Execute startup again;

Database started successfully


Make this machine recovery, first engaged for 2 days, the head is big, a lot of solutions are useless, the above for personal problems, I hope to some friends who have encountered similar problems to help


Changing the location of change tracking file
1) How to not shut down the database
sql> ALTER DATABASE DISABLE BLOCK change TRACKING;
sql> ALTER DATABASE ENABLE BLOCK change TRACKING USING FILE ' new_location ';
Note: This method loses the contents of the Change tracking file






Oracle Rman Recovery for different machines

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.