Mongolerman recovered to a remote or remote location

Source: Internet
Author: User
The original Oracle database server uses rman to back up the entire database, and then restores the same database on the remote server.

The original Oracle database server uses rman to back up the entire database, and then restores the same database on the remote server.

The original Oracle database server uses rman to back up the entire database, and then restores the same database on the remote server.

1.1 original server backup database

Step 1: view the database instance name and DBID

Connected to target database: DB3 (DBID = 2060124769, not open)

Step 2: perform full backup

Backup as compressed backupset database

Include current controlfile format '/orabak/db _ % d _ % T _ % s'

Plus archivelog format '/orabak/arch _ % d _ % T _ % s ';

Step 3: view the location of the database file:/home/oracle/oradata/db3/

Step 4: copy the backup file arch_DB3_20140910_8 and db _ DB3_20140910_7 to/home/oracle/orabak

1.2 create a database on the target server

Step 1: Create a database with the same instance name (db3) and database files in the same location (/home/oracle/oradata/db3.

Step 2: Shut down the instance and start it to nomount. SQL> startup nomount;

Step 3: set the same dbid as the original database dbid

Rman target/

Recovery Manager: Release 10.2.0.5.0-Production on Thu Sep 11 19:53:50 2014

Copyright (c) 1982,200 7, Oracle. All rights reserved.

Connected to target database: db3 (not mounted)

RMAN> set dbid 2060124769

Executing command: SET DBID

Step 4: Restore the control file

RMAN> restore controlfile from '/home/oracle/db_DB3_20140910_7 ';

Starting restore at 11-SEP-14

Using target database control file instead of recovery catalog

Allocated channel: ORA_DISK_1

Channel ORA_DISK_1: sid = 153 devtype = DISK

Channel ORA_DISK_1: restoring control file

Channel ORA_DISK_1: restore complete, elapsed time: 00:00:05

Output filename =/home/oracle/oradata/db3/db3/control01.ctl

Output filename =/home/oracle/oradata/db3/db3/control02.ctl

Output filename =/home/oracle/oradata/db3/db3/control03.ctl

Finished restore at 11-SEP-14

Step 5: mount the database

RMAN> alter database mount;

Database mounted

Released channel: ORA_DISK_1

Step 6: register the backup set copied from the source database to rman.

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

Searching for all files that match the pattern/home/oracle/orabak

List of Files Unknown to the Database

============================================

File Name:/home/oracle/orabak/arch_DB3_20140910_8

File Name:/home/oracle/orabak/db_DB3_20140910_7

Do you really want to catalog the above files (enter YES or NO )? Yes

Cataloging files...

Cataloging done

Step 7: restore archived logs

RMAN> restore archivelog all;

Starting restore at 11-SEP-14

Using channel ORA_DISK_1

Archive log thread 1 sequence 6 is already on disk as file/oracle/product/10.2.0.5/dbs/arch1_6_857918757.dbf

Channel ORA_DISK_1: starting archive log restore to default destination

Channel ORA_DISK_1: restoring archive log

Archive log thread = 1 sequence = 3

Channel ORA_DISK_1: reading from backup piece/home/oracle/orabak/arch_DB3_20140910_1

Channel ORA_DISK_1: restored backup piece 1

Piece handle =/home/oracle/orabak/arch_DB3_20140910_1 tag = TAG20140910T172944

(Note: If archiving logs are not restored,

RMAN> recover database;

Starting recover at 11-SEP-14

Using channel ORA_DISK_1

Starting media recovery

Unable to find archive log

Archive log thread = 1 sequence = 7)

Step 8: Restore the database file (because the data file location of the target database and the original database is the same, it is simpler)

RMAN> restore database;

Starting restore at 11-SEP-14

Using channel ORA_DISK_1

Channel ORA_DISK_1: starting datafile backupset restore

Channel ORA_DISK_1: specifying datafile (s) to restore from backup set

Restoring datafile 00001 to/home/oracle/oradata/db3/system01.dbf

Restoring datafile 00002 to/home/oracle/oradata/db3/undotbs01.dbf

Restoring datafile 00003 to/home/oracle/oradata/db3/sysaux01.dbf

Restoring datafile 00004 to/home/oracle/oradata/db3/users01.dbf

Channel ORA_DISK_1: reading from backup piece/home/oracle/orabak/db_DB3_20140910_6

Channel ORA_DISK_1: restored backup piece 1

Piece handle =/home/oracle/orabak/db_DB3_20140910_6 tag = TAG20140910T173540

Step 9: Restore the database

RMAN> recover database;

Starting recover at 11-SEP-14

Using target database control file instead of recovery catalog

Allocated channel: ORA_DISK_1

Channel ORA_DISK_1: sid = 152 devtype = DISK

Starting media recovery

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

Finished recover at 11-SEP-14

Step 10: Start the database

Alter database open resetlogs;

-------------------------------------- Recommended reading --------------------------------------

RMAN: Configure an archive log deletion policy

Basic Oracle tutorial-copying a database through RMAN

Reference for RMAN backup policy formulation

RMAN backup learning notes

Oracle Database Backup encryption RMAN Encryption

-------------------------------------- Split line --------------------------------------

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.