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