RMAN backs up the database and restores it to another machine.

Source: Internet
Author: User

RMAN backs up the database and restores it to another machine.

1. dbid and data file name query on the source database run in archive Mode
Select dbid from v $ database;
Select file #, name from v $ datafile;
Create pfile from spfile
Select * from v $ logfile;
Close source database after rman backup
 
2. Create the same instance name on the target database. The database version must be consistent.
Network configuration file, password file, parameter file pfile, rman backup set (including control file, data file backup set), redo log copy to the corresponding directory
 
3. target database
Start to nomount: startup nomount pfile 'xx'
Rman target/
Start nomount
Set dbid = xxx (source database dbid)
Restore controlfile from backup set path
Alter database mount
Restore database
Recover database
Alter database open: consistent recovery or alter database open resetlogs; inconsistent recovery

-------------------------------------- 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 --------------------------------------
 
Note:
If the data file of the target database is different from the source database file path
Run {
Set newname for datafile 1 to 'd: \ oradata \ ocp \ SYSTEM01.DBF ';
Set newname for datafile 2 to 'd: \ oradata \ ocp \ UNDOTBS01.DBF ';
Set newname for datafile 3 to 'd: \ oradata \ ocp \ SYSAUX01.DBF ';
Set newname for datafile 4 to 'd: \ oradata \ ocp \ USERS01.DBF ';
Set newname for datafile 5 to 'd: \ oradata \ ocp \ EXAMPLE01.DBF ';
Set newname for datafile 6 to 'd: \ oradata \ ocp \ HYGEIA01.DBF ';
Set newname for datafile 7 to 'd: \ oradata \ ocp \ HYGEIA02.DBF ';
Restore database;
Switch datafile all;
}

Copy redo to the target database to the new path.
Alter database rename file 'original 'to 'destination Path'
Recover database;
Alter database open: consistent recovery or alter database open resetlogs; inconsistent recovery

 

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.