Copy a database using RMAN backup

Source: Internet
Author: User

1. Use rman to back up Oracle Data in the open state

Rman backup must be in archive Mode

Check whether the archive mode is used.

SQL> archivelog list;

Change to archive Mode

Shutdown immediate

Startup mount

Alter database archivelog; (alter database noarchivelog)

1. Use rman to connect to the source database on the third machine

Rman target sys/sysdba @ demo1

2. Start automatic backup

RMAN> configure controlfile autobackup on;

3. Backup

RMAN> backup database plus archivelog delete input format '/u01/rmanbackup/dup _ % U ';

4. View backup information

RMAN> list backup;

5. Copy the spfile and password file to dbs and create init + Instance name. ora.

Input

Db_name = Instance name

Example: db_name = 'demo1'

6. Copy the generated rman backup to the corresponding directory.

7. Start the target database to the nomount status

Startup nomount

8.create dup.txt on the connector

Input

Run {

Allocate auxiliary channel dup1 type disk;

Duplicate database to demo1 spfile backup location '/u01/rmanbackup 'nofilenamecheck

Logfile

Group 1 ('/u01/app/oracle/oradata/redo01_1.rdo', '/u01/app/oracle/oradata/redo01_2.rdo') size 52428800,

Group 2 ('/u01/app/oracle/oradata/redo02_1.rdo', '/u01/app/oracle/oradata/redo02_2.rdo') size 52428800,

Group 3 ('/u01/app/oracle/oradata/redo03_1.rdo', '/u01/app/oracle/oradata/redo03_2.rdo') 52428800 size;

}

9. Use rman to connect to the database

RMAN> connect auxiliary sys/sysdba @ demo2

10. Execute the script

RMAN> @dup.txt

11. When an execution error occurs and a process cannot be started

[Oracle @ localhost u01] $ ipcs

[Oracle @ localhost u01] $ ipcrm-s semid

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.