[Use rman to copy the Database 10 Gb -- clone-1]

Source: Internet
Author: User
Target Database: result database replicated by jadl0g: d10g Note: ***** the target database and clone result database are on the same host ***** 1. viu01oracle10gnetworkadmintnsnames. oraD10G (DESCRIPTION (ADDRESS (PROTOCOLTCP) (HOSToracle.db.com) (PORT1521) (CONNECT_DATA (SE

Target Database: result database copied by jadl0g: d10g note: * *** the target database and clone result database are on the same host. *** 1.vi/u01/oracle/10g/network/admin/tnsnames. ora D10G = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = oracle.db.com) (PORT = 1521) (CONNECT_DATA = (SE

Target Database: jadl0g

Replicated result Database: d10g

Note: *** the target database and clone result database are on the same host ****

1. vi/u01/oracle/10g/network/admin/tnsnames. ora

D10G =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = oracle.db.com)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = d10g))(failover = on))

2. vi/u01/oracle/10g/network/admin/listener. ora

SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(GLOBAL_DBNAME=jadl10g)(SID_NAME = jadl10g)(ORACLE_HOME = /u01/oracle/10g))(SID_DESC =(GLOBAL_DBNAME=d10g)(SID_NAME = d10g)(ORACLE_HOME = /u01/oracle/10g)))

3. Restart the listener

lsnrctl stoplsnrctl starttnsping d10gtnsping jadl10g

4. Create a password file and a parameter file

[Oracle @ oracle ~] $ Cd/u01/oracle/10g/dbs/[oracle @ oracle dbs] $ orapwd file = orapwd10g password = oracle [oracle @ oracle dbs] $ strings spfilejadl10g. ora> initd10g. ora [oracle @ oracle dbs] $ vi initd10g. ora: 1, $ s/jadl10g/d10g/g --- execute this command [oracle @ oracle dbs] $ grep u01 initd10g. ora *. audit_file_dest = '/u01/oracle/admin/d10g/adump '*. background_dump_dest = '/u01/oracle/admin/d10g/bdump '*. control_files = '/u01/oracle/oradata/d10g/control01.ctl', '/u01/oracle/flash_recovery_area/d10g/control02.ctl' # Restore Controlfile *. core_dump_dest = '/u01/oracle/admin/d10g/cdump '*. db_recovery_file_dest = '/u01/oracle/flash_recovery_area '*. user_dump_dest = '/u01/oracle/admin/d10g/udump' 5. create the corresponding file [oracle @ oracle dbs] $ mkdir/u01/oracle/admin/d10g/adump-p [oracle @ oracle dbs] $ mkdir/u01/oracle/admin/d10g /bdump-p [oracle @ oracle dbs] $ mkdir/u01/oracle/admin/d10g/cdump-p [oracle @ oracle dbs] $ mkdir/u01/oracle/admin/d10g /udump-p [oracle @ oracle dbs] $ mkdir/u01/oracle/oradata/d10g [oracle @ oracle dbs] $ export ORACLE_SID = d10g [oracle @ oracle dbs] $ rman target /Recovery Manager: release 10.2.0.5.0-Production on Fri Nov 7 12:59:20 2014 Copyright (c) 1982,200 7, Oracle. all rights reserved. connected to target database (not started) RMAN> startup nomountOracle instance startedTotal System Global Area 599785472 bytesFixed Size 2098112 bytesVariable Size 171969600 bytesDatabase Buffers 419430400 bytesRedo Buffers 6287360 bytesRMAN> exitRecovery Manager complete. [oracle @ oracle dbs] $ sqlplus/as sysdbaSQL * Plus: Release 10.2.0.5.0-Production on Fri Nov 7 13:00:15 2014 Copyright (c) 1982,201 0, Oracle. all Rights Reserved. connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit ProductionWith the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engineand Real Application Testing optionsSQL> create spfile from pfile; File created. shutdownORA-01507: database not mountedORACLE instance shut down. SQL> startup nomountORACLE instance started. total System Global Area 599785472 bytesFixed Size 2098112 bytesVariable Size 171969600 bytesDatabase Buffers 419430400 bytesRedo Buffers 6287360 bytesSQL> collect from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit ProductionWith the Partitioning, Oracle Label Security, OLAP, data Mining Scoring Engineand Real Application Testing options *************************** [oracle @ oracle dbs] $ rman target sys/oracle @ jadl10g auxiliary sys/oracle @ d10gRecovery Manager: release 10.2.0.5.0-Production on Fri Nov 7 13:26:11 2014 Copyright (c) 1982,200 7, Oracle. all rights reserved. RMAN-00571: ========================================================== ============================== RMAN-00569: ================ error message stack follows ============================ RMAN-00571: ========================================================== ============================== RMAN-00554: initialization of internal recovery manager package failedRMAN-04005: error from target database: ORA-01031: insufficient privileges

This error is caused by the absence of a password file in my target database.
The solution is to create a password file.

[Oracle @ oracle dbs] $ orapwd file = orapwjadl10g password = oracle ************************** ** [oracle @ oracle dbs] $ rman target sys/oracle @ jadl10g auxiliary sys/oracle @ d10gRecovery Manager: release 10.2.0.5.0-Production on Fri Nov 7 13:34:12 2014 Copyright (c) 1982,200 7, Oracle. all rights reserved. connected to target database: JADL10G (DBID = 2011530396) connected to auxiliary database: D10G (not mounted) execute the following command (note that it must be in the remote and local order ): RMAN> duplicate target database to "D10G" nofilenamecheck2> db_file_name_convert ('/u01/oracle/oradata/jadl10g/', '/u01/oracle/oradata/d10g /') 3> logfile '/u01/oracle/oradata/d10g/redo01.log' size 10 m, 4> '/u01/oracle/oradata/d10g/redo02.log' size 10 m; starting Duplicate Db at 07-NOV-14using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: sid = 156 devtype = DISKcontents of Memory Script: {set until scn 556591; set newname for datafile 1 to "/u01/oracle/oradata/d10g/system01.dbf"; set newname for datafile 2 to "/u01/oracle/oradata/d10g/undotbs01.dbf "; set newname for datafile 3 to "/u01/oracle/oradata/d10g/sysaux01.dbf"; set newname for datafile 4 to "/u01/oracle/oradata/d10g/users01.dbf "; set newname for datafile 5 to "/u01/oracle/oradata/d10g/logs"; restorecheck readonlyclone database;} executing Memory Scriptexecuting command: SET until clauseexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting restore at 07-NOV-14using channel ORA_AUX_DISK_1skipping datafile 1; alrea [this article is from Internet ( http://www.68idc.cn ) Dy restored to file/u01/oracle/oradata/d10g/system01.dbfskipping datafile 2; already restored to file/u01/oracle/oradata/d10g/1_datafile 3; already restored to file/u01/oracle/oradata/d10g/1_datafile 4; already restored to file/u01/oracle/oradata/d10g/users01.dbfskipping datafile 5; already restored to file/u01/oracle/oradata/d10g/example01.dbfrestore not done; all files readonly, offline, or already restoredFinished restore at 07-NOV-14sql statement: create controlfile reuse set database "D10G" RESETLOGS limit 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILEGROUP 1'/u01/oracle/oradata/d10g/redo01.log 'SIZE 10 M, GROUP 2 '/u01/oracle/oradata/d10g/redo02.log 'size 10 mdatafile'/u01/oracle/oradata/d10g/system01.dbf' character set AL32UTF8contents of Memory Script: {switch clone datafile all ;} executing Memory Scriptdatafile 2 switched to datafile copyinput datafile copy recid = 1 stamp = 863013896 filename =/u01/oracle/oradata/d10g/Listen 3 switched to datafile copyinput datafile copy recid = 2 stamp = 863013896 filename =/u01/oracle/oradata/d10g/4154 switched to datafile copyinput datafile copy recid = 3 stamp = 863013896 filename =/u01/oracle/oradata/d10g/users01.dbfdatafile 5 switched to datafile copyinput datafile copy recid = 4 stamp = 863013896 filename =/u01/oracle/oradata/d10g/example01.dbfcontents of Memory Script: {set until scn 556591; recoverclone databasedelete archivelog;} executing Memory Scriptexecuting command: SET until clauseStarting recover at least channel available media recoveryarchive log thread 1 sequence 1 is already on disk as file/u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/pai _. arcarchive log thread 1 sequence 2 is already on disk as file/u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_2_b5qkpk0o _. arcarchive log thread 1 sequence 1 is already on disk as file/u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_1_b5rqv1_q _. arcarchive log thread 1 sequence 2 is already on disk as file/u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_2_b5rqvmxf _. arcarchive log filename =/u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_1_b5qkpgh1 _. arc thread = 1 sequence = 1 archive log filename =/u01/oracle/flash_recovery_area/JADL10G/archivelog/2014_11_07/o1_mf_1_2_b5qkpk0o _. arc thread = 1 sequence = 2 media recovery complete, elapsed time: 00: 00: 23 Finished recover at 07-NOV-14contents of Memory Script: {shutdown clone; startup clone nomount ;} executing Memory Scriptdatabase dismountedOracle instance shut downconnected to auxiliary database (not started) Oracle instance startedTotal System Global Area 599785472 bytes Size 2098112 bytesVariable Size 171969600 bytesDatabase Buffers 419430400 bytesRedo Buffers 6287360 bytessql statement: create controlfile reuse set database "D10G" RESETLOGS limit 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILEGROUP 1'/u01/oracle/oradata/d10g/redo01.log 'SIZE 10 M, GROUP 2 '/u01/oracle/oradata/d10g/redo02.log 'size 10 mdatafile'/u01/oracle/oradata/d10g/system01.dbf' character set AL32UTF8contents of Memory Script: {set newname for tempfile 1 to "/u01/oracle/oradata/d10g/temp01.dbf"; switch clone tempfile all; catalog clone datafilecopy "/u01/oracle/oradata/d10g/undotbs01.dbf"; catalog clone datafilecopy "/u01/oracle/oradata/d10g/sysaux01.dbf "; catalog clone datafilecopy "/u01/oracle/oradata/d10g/users01.dbf"; catalog clone datafilecopy "/u01/oracle/oradata/d10g/example01.dbf"; switch clone datafile all ;} executing Memory Scriptexecuting command: SET destination temporary file 1 to/u01/oracle/oradata/d10g/temp01.dbf in control filecataloged datafile copydatafile copy filename =/u01/oracle/oradata/d10g/destination recid = 1 stamp = 863013929 cataloged datafile copydatafile copy filename =/u01/oracle/oradata/d10g/Duplicate recid = 2 stamp = 863013929 cataloged datafile copydatafile copy filename =/u01/oracle/oradata/d10g/export recid = 3 stamp = 863013929 cataloged datafile copydatafile copy filename =/u01/oracle/oradata/d10g/example01.dbf recid = 4 stamp = 863013929 datafile 2 switched to datafile copyinput datafile copy recid = 1 stamp = 863013929 filename =/u01/oracle/oradata/d10g/Listen 3 switched to datafile copyinput datafile copy recid = 2 stamp = 863013929 filename =/u01/oracle/oradata/d10g/sysaux01.dbfdatafile 4 switched datafile copyinput datafile copy recid = 3 stamp = 863013929 filename =/u01/oracle/oradata/d10g/users01.dbfdatafile 5 switched to datafile copyinput datafile copy recid = 4 stamp = 863013929 filename =/u01/ oracle/oradata/d10g/example01.dbfcontents of Memory Script: {Alter clone database open resetlogs;} executing Memory Scriptdatabase openedFinished Duplicate Db at 07-NOV-14RMAN> exitRecovery Manager complete. verify whether the clone is successful: [oracle @ oracle dbs] $ sqlplus/as sysdbaSQL * Plus: Release 10.2.0.5.0-Production on Fri Nov 7 14:21:20 2014 Copyright (c) 1982,201 0, Oracle. all Rights Reserved. connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0-64bit ProductionWith the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engineand Real Application Testing optionsSQL> select instance_name from v $ instance; INSTANCE_NAME ---------------- d10g



1. Password File Problems
2. Network Problems
3. Parameter Problems
4. the syntax of the rman statement db_file_name_convert is incorrect on the same server.
5. Make sure that a backup is required. If the backup is remote, copy the backup to the target database.

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.