Rman recovery from different machines and rman recovery

Source: Internet
Author: User

Rman recovery from different machines and rman recovery
Rman recovery from different machines

Note:

1. the directory structure of the source database and target database is the same

2. The target database only needs to install the ORACLE software (but the directory specified in the parameter file must be created)

3. Back up data files, parameter files, control files, password files, and archive logs of the source database.

 

1. source database backup

 

Automatic Backup of parameter files and Control Files

Configure controlfile autobackup on;
Configure controlfile autobackup format for device type disk to '/home/oracle/rmanback/level_cont_spfile _ % F ';

Back up databases and archive logs

Backup incremental level 0 database format'/home/oracle/rmanback/level0 _ % d _ % s _ % p _ % u. bak'
Plus archivelog format'/home/oracle/rmanback/level0arclog _ % d _ % s _ % p _ % u. bak 'delete all input;

2. Copy the backup file to the same path of the target database.

 

Scp level * 192.170.100.12:/home/oracle/rmanback

3. Start the database to nomount

 

[Oracle @ server8 ~] $ Rman target/

Recovery Manager: Release 11.2.0.3.0-Production on Wed Jan 7 13:53:54 2015

Copyright (c) 1982,201 1, Oracle and/or its affiliates. All rights reserved.

Connected to target database (not started)

RMAN> startup nomount;

Startup failure: ORA-01078: failure in processing system parameters
LRM-00109: cocould not open parameter file '/home/u01/app/oracle/product/11.2.0/db_1/dbs/initghsjdb. ora'

Starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area 158662656 bytes

Fixed Size 2226456 bytes
Variable Size 130025192 bytes
Database Buffers 20971520 bytes
Redo Buffers 5439488 bytes

4. Restore the parameter file

 

RMAN> restore spfile to pfile '/home/u01/app/oracle/product/11.2.0/db_1/dbs/initghsjdb. ora' from '/home/oracle/rmanback/level_cont_spfile_c-1442539879-20150107-00'
2>;

RMAN> SQL 'create spfile from pfile ';

SQL statement: create spfile from pfile

5. Create the specified path in the parameter file

 

Mkdir-p admin/ghsjdb/adump
Mkdir-p oradata/ghsjdb
Mkdir-p fast_recovery_area/ghsjdb
Mkdir archivelog
6. Restart to nomount

 

RMAN> startup force nomount;

Oracle instance started

Total System Global Area 11858636800 bytes

Fixed Size 2239176 bytes
Variable Size 7818183992 bytes
Database Buffers 3758096384 bytes
Redo Buffers 280117248 bytes

7. Restore Control File

 

RMAN> restore controlfile from '/home/oracle/rmanback/back ';

Starting restore at 07-JAN-15
Using target database control file instead of recovery catalog
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 1141 device type = DISK

Channel ORA_DISK_1: restoring control file
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Output file name =/home/u01/app/oracle/oradata/ghsjdb/control01.ctl
Output file name =/home/u01/app/oracle/fast_recovery_area/ghsjdb/control02.ctl
Finished restore at 07-JAN-15

8. Start the database to the mount status.

 

RMAN> alter database mount;

Database mounted
Released channel: ORA_DISK_1

9. Because the Backup Paths of the target database and the source database are the same, you do not need to register them in the control file again.

 

RMAN> catalog start with '/home/oracle/rmanback ';

 

10. restore database;

 

RMAN> restore database;

Starting restore at 07-JAN-15
Starting implicit crosscheck backup at 07-JAN-15
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 1141 device type = DISK
Allocated channel: ORA_DISK_2
Channel ORA_DISK_2: SID = 7 device type = DISK
Allocated channel: ORA_DISK_3
Channel ORA_DISK_3: SID = 574 device type = DISK
Allocated channel: ORA_DISK_4
Channel ORA_DISK_4: SID = 1142 device type = DISK
Crosschecked 7 objects
Crosschecked 2 objects
Finished implicit crosscheck backup at 07-JAN-15

Starting implicit crosscheck copy at 07-JAN-15
Using channel ORA_DISK_1
Using channel ORA_DISK_2
Using channel ORA_DISK_3
Using channel ORA_DISK_4
Finished implicit crosscheck copy at 07-JAN-15

Searching for all files in the recovery area
Cataloging files...
No files cataloged

Using channel ORA_DISK_1
Using channel ORA_DISK_2
Using channel ORA_DISK_3
Using channel ORA_DISK_4

Channel ORA_DISK_1: starting datafile backup set restore
Channel ORA_DISK_1: specifying datafile (s) to restore from backup set
Channel ORA_DISK_1: restoring datafile 00003 to/home/u01/app/oracle/oradata/ghsjdb/undotbs01.dbf
Channel ORA_DISK_1: restoring datafile 00004 to/home/u01/app/oracle/oradata/ghsjdb/users01.dbf
Channel ORA_DISK_1: restoring datafile 00009 to/home/u01/app/oracle/oradata/ghsjdb/shine_fm.dbf
Channel ORA_DISK_1: restoring datafile 00017 to/home/u01/app/oracle/oradata/ghsjdb/tbs_ogg.dbf
Channel ORA_DISK_1: restoring datafile 00018 to/home/u01/app/oracle/oradata/ghsjdb/ghsj_pwjc.dbf
Channel ORA_DISK_1: reading from backup piece/home/oracle/rmanback/level0_ghsjdb_14625_10991ps538h.bak
Channel ORA_DISK_2: starting datafile backup set restore
Channel ORA_DISK_2: specifying datafile (s) to restore from backup set
Channel ORA_DISK_2: restoring datafile 00001 to/home/u01/app/oracle/oradata/ghsjdb/system01.dbf
Channel ORA_DISK_2: restoring datafile 00008 to/home/u01/app/oracle/oradata/ghsjdb/sde. dbf
Channel ORA_DISK_2: restoring datafile 00012 to/home/u01/app/oracle/oradata/ghsjdb/ts_platform_index.dbf
Channel ORA_DISK_2: restoring datafile 00016 to/home/u01/app/oracle/oradata/ghsjdb/index_assess.dbf
Channel ORA_DISK_2: reading from backup piece/home/oracle/rmanback/level0_ghsjdb_14626_41792ps538h.bak
Channel ORA_DISK_3: starting datafile backup set restore
Channel ORA_DISK_3: specifying datafile (s) to restore from backup set
Channel ORA_DISK_3: restoring datafile 00006 to/home/u01/app/oracle/oradata/ghsjdb/GHSJ_JCSJ.dbf
Channel ORA_DISK_3: restoring datafile 00010 to/home/u01/app/oracle/oradata/ghsjdb/shine_fm_index.dbf
Channel ORA_DISK_3: restoring datafile 00011 to/home/u01/app/oracle/oradata/ghsjdb/ts_platform.dbf
Channel ORA_DISK_3: restoring datafile 00013 to/home/u01/app/oracle/oradata/ghsjdb/GHSJ_pwgl.dbf
Channel ORA_DISK_3: reading from backup piece/home/oracle/rmanback/level0_GHSJDB_14627_1_93ps538h.bak
Channel ORA_DISK_4: starting datafile backup set restore
Channel ORA_DISK_4: specifying datafile (s) to restore from backup set
Channel ORA_DISK_4: restoring datafile 00002 to/home/u01/app/oracle/oradata/ghsjdb/sysaux01.dbf
Channel ORA_DISK_4: restoring datafile 00005 to/home/u01/app/oracle/oradata/ghsjdb/ghsj_xm.dbf
Channel ORA_DISK_4: restoring datafile 00007 to/home/u01/app/oracle/oradata/ghsjdb/ghsj_index.dbf
Channel ORA_DISK_4: restoring datafile 00014 to/home/u01/app/oracle/oradata/ghsjdb/ghsj_psdb.dbf
Channel ORA_DISK_4: restoring datafile 00015 to/home/u01/app/oracle/oradata/ghsjdb/dgh. dbf
Channel ORA_DISK_4: reading from backup piece/home/oracle/rmanback/level0_GHSJDB_14628_1_94ps538h.bak
Channel ORA_DISK_1: piece handle =/home/oracle/rmanback/level0_ghsjdb_14625_42591ps538h.bak tag = tag201501_t185510
Channel ORA_DISK_1: restored backup piece 1
Channel ORA_DISK_1: restore complete, elapsed time: 00:06:36
Channel ORA_DISK_2: piece handle =/home/oracle/rmanback/level0_ghsjdb_14626_41792ps538h.bak tag = tag201501_t185510
Channel ORA_DISK_2: restored backup piece 1
Channel ORA_DISK_2: restore complete, elapsed time: 00:08:36
Channel ORA_DISK_3: piece handle =/home/oracle/rmanback/level0_GHSJDB_14627_1_93ps538h.bak tag = tag201501_t185510
Channel ORA_DISK_3: restored backup piece 1
Channel ORA_DISK_3: restore complete, elapsed time: 00:11:56
Channel ORA_DISK_4: piece handle =/home/oracle/rmanback/level0_GHSJDB_14628_1_94ps538h.bak tag = tag201501_t185510
Channel ORA_DISK_4: restored backup piece 1
Channel ORA_DISK_4: restore complete, elapsed time: 00:12:06
Finished restore at 07-JAN-15

 

11. recover database

RMAN> recover database;

Starting recover at 07-JAN-15
Using channel ORA_DISK_1
Using channel ORA_DISK_2
Using channel ORA_DISK_3
Using channel ORA_DISK_4

Starting media recovery

Channel ORA_DISK_1: starting archived log restore to default destination
Channel ORA_DISK_1: restoring archived log
Archived log thread = 1 sequence = 991
Channel ORA_DISK_1: reading from backup piece/home/oracle/rmanback/level0arclog_ghsjdb_14631_000097ps540p.bak
Channel ORA_DISK_1: piece handle =/home/oracle/rmanback/level0arclog_ghsjdb_14631_000097ps540p.bak tag = tag201501_t0000808
Channel ORA_DISK_1: restored backup piece 1
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Archived log file name =/home/u01/app/oracle/archivelog/route 9921383791688.dbf thread = 1 sequence = 991
Unable to find archived log
Archived log thread = 1 sequence = 992
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error message stack follows ==========================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of recover command at 01/07/2015 14:47:41
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 992 and starting SCN of 1836854473

 

RMAN> recover database until scn 1836854473;

Starting recover at 07-JAN-15
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:01

Finished recover at 07-JAN-15

 

12. Open the database

RMAN> alter database open resetlogs;

Database opened

 

Check whether the information in the library is correct.

 

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.