Regarding the method of cloning the database, I have been studying in CNOUG, I found two posts, I found that the reference: Method 1: How to use RMAN to clone the database in the original text: www.cnoug .org Keywords: Target, Directory, Cloning, Logs, Target Databases, and Cloning Databases Same in two machines, their environment: Windows 2000 Server SP4, IE6.1, Oracle9205 In this article, the target database is used. RMAN, directory database on the 3rd machine, steps: 1. Connect the target database, make a full storage backup of the target database D: / Oracle / bin> RMAN recovery Manager: Version 9.2.0.5.0 - ProductionCopyRight (c) 1995, 2002, Oracle Corporation. All Rights Reserved.rman> Connect Catalog RMAN / RMAN @ 187 Connection to Recovery Directory Database RMAN> Connect Target / Connect to Target Database: Encore (DBID = 3146513770) Rman> Run2> {Allocate Channel D1 Type Disk maxpiecesize = 500m; 3> Backup Full Database4> Format 'E: / RMANBAK / DB_% D_% S_% P_% T'; 5> Release Channel D1; 6>} Assignment Channel: D1 Channel D1: SID = 16 DevType = Disk starts backup on 2004-06-28 21:03:31 Channel D1: Start Full Data File Backup Channel D1: The data file being specified in the backup set In the backup set contains the current SPFILE backup set, including the current control file input data File FNO = 00001 Name = D: /oacle/oradata/encore/system01.dbf Enter data file fno = 00002 name = d: /oacle/oradata/encore/undotbs01.dbf Enter data file fno = 00005 Name = D: / Oracle / OraData/encore/example01.dbf Enter data file fno = 00008 name = d: /oracle/oradata/encore/tools01.dbf Enter data file fno = 00010 Name = D: /oracle/oradata/encore/xdb01.dbf input data file fno = 00006 name = d: /oacle/oradata/encore/indx01.dbf input data file fno = 00009 name = d: / oracle / oraData / encore / users01 .Dbf input data file fno = 00003 name = d: /oracle/oradata/encore/cwmlite01.dbf input data file fno = 00004 name = d: /oracle/oradata/encore/drsys01.dbf input data file fno = 00007 name = D: /oracle/oradata/encore/odm01.dbf channel D1: starting segment 1 at 2004-06-28 21:03:37 channel D1: Completed paragraph 1 on 2004-06-28 21:05:02 Paragraph Handle = E: / RMANBAK / DB_ENCORE_1_1_530053412 Comment =
None Channel D1: Start Section 2 At 2004-06-28 21:05:02 Channel D1: Completed Section 2 At 2004-06-28 21:06:07 Paragraph Handle = E: / RMANBAK / DB_ENCORE_1_2_530053412 Comment = None Channel D1: The backup set has been completed. After the time: 00: 02: 35 Complete BACKUP at 2004-06-28 21:06:07 Free passage: D1RMAN> 2, back up the target database parameter file SQL> CREATE PFILE from SPFILE; Created SQL> 3, - Copy the parameter file of the target database (step 2) to the clone machine, modify the corresponding parameters (mainly the implementation name and database name, and the tracking file of bdump, udump, cdump) The path of the store, this article, the instance of the cloned database is called clone, the database name is clone_db), then create an instance D: / Oracle / bin> ORADIM -NEW -SID Clone -pfile D: / Oracle / Database / Initclone.ora -intpwd sys1d: / oracle / bin> 4, modify the listener of the cloned database, increase the monitoring of the cloned database (para. 3) SID_LIST_LISTENER = (SID_LIST = (SID_NAME = PLSEXTPROC) (Oracle_Home = D: / Oracle) (SID_DESC = (Global_DBNAME = ORACLE) (SID_NAME = ORACLE92) (SID_DESC = (Global_DBNAME = Clone_DB) (Oracle_Home = D: / Oracle) SID_NAME = Clone)) 5, modify the TNSNAMES.ORA file on the RMAN machine, increase this connection string, to ensure that RMAN can connect to the instance of the clone database to clone database clone = (deSCription = (address = (protocol = TCP) (host = 192.168.0.194) (port = 1521))))))))))))))))))))))))))))))))) (connect_data = (service_name = clone_db ) 5, copy the backup set of the target database to the same location of the clone database machine, start the clone database (NOMOUNT state) 6, due to the no backup log in the first step, use RMAN> Run2> {Allocate Auxiliary Channel D1 TYPE DISK; 3> Set newname for datafile 1 to 'f: /clone/data/system01.dbf'; Script clone database, there is an error such as NO Backup Copy, which is added to the backup target database, RMAN> Run2> {Allocate Channel D1 Type Disk Maxpiecesize = 500m; 3> Backup ArchiveLog All4> Format 'E: / RMANBAK / LOG_% D_% S_% P_% T'; 5> Release Channel D1; 6>} Assignment Channel: D1 Channel D1 : SID = 11 DevType =
Disk starts backup on 2004-06-28 21:42:18 Current log already archive channel D1: Start archive log backup set channel D1: Archive log entered in the specified backup set input Archive log thread = 1 sequence = 107 record ID = 107 Time stamp = 528371132 input archive log thread = 1 sequence = 108 record ID = 108 time stamp = 530053839 input archive log thread = 1 sequence = 109 record ID = 109 time stamp = 530054855 Enter archive log thread = 1 sequence = 110 record ID = 110 Time Stamp = 530055437 Enter Archive Log Terring = 1 Sequence = 111 Record ID = 111 Time Stamp = 530055540 Input Archive Log Tail = 1 Sequence = 112 Record ID = 112 Time Stamp = 530055739 Channel D1: Start Segment 1 in 2004-06 -28 21:42:23 Channel D1: Completed Segment 1 on 2004-06-28 21:42:26 Paragraph Handle = E: / Rmanbak / Log_Encore_2_1_53005742 Comment = None Channel D1: Backup Set Completed, After Time: 00: 00:04 Complete the passage released from 2004-06-28 21:42:26: D17, copy the log backup set to the same directory of the clone machine, return to the RMAN, connect the auxiliary (clone) database, execute the script, The rest of the RMAN will do RMAN> Connect Auxiliary Sys / Sys1 @ Clone has been connected to the alternate database: clone_db (not installed) RMAN> Run2> {Allocate Auxiliary channel D1 Type Disk; 3> Set Newname for DataFile 1 To 'f: /Clone/data/system01.dbf'; 4> set newname for datafile 2 to 'f: /clone/data/undotbs01.dbf'; 5> set newname for datafile 3 to 'f: /clone/data/cwmlite01.dbf '; 6> set newname for datafile 4 to' f: /clone/data/drsys01.dbf '; 7> set newname for datafile 5 to' f: / clone / Data / example01.dbf '; 8> set newname for data/indx01.dbf'; 9> set newname for datafile 7 to 'f: /clone/data/odm01.dbf'; 10 > set newname for datafile 8 to 'f: /clone/data/tools01.dbf'; 11> set newname for data/Users01.dbf '; 12> set newname for datafile 10 to' F: /clone/data/xdb01.dbf '; 13> duplicate target database to clone_db14> logfile15> group 1 (' f: /clone/data/redo01.dbf ') Size 10M, 16> Group 2 ('
F: /clone/data/redo02.dbf ') Size 10M, 17> Group 3 (' f: /clone/data/redo03.dbf ') Size 10m; 18>} Assign channel: D1 channel D1: SID = 8 DevType = Disk is executing command: set newname is executing command: set newname is executing command: set newname is executing command: set newname is executing command: set newname is executing command: set NewName is executing the command: set newname is executing the command: set newname launches Duplicate DB on 2004-06-28 21:43:51 Printing Scripts: Memory Script {set Until SCN 261688166; SET NEWNAME for DataFile 1 to "f: /Clone/data/system01.dbf";set newname for datafile 2 to "f: /clone/data/undotbs01.dbf"; set newname for datafile 3 to "f: /clone/data/cwmlite01.dbf"; set newname For DataFile 4 to "f: /clone/data/drsys01.dbf"; set newname for datafile 5 to "f: /clone/data/example01.dbf"; set newname for datafile 6 to "f: / clone / data / INDX01.DBF "; Set NewName for DataFile 7 to" f: /clone/data/odm01.dbf "; set newname for datafile 8 to" f: /clone/data/tools01.dbf "; set newname for datafile 9 to" F: /clone/data/Users01.dbf "; set newname for datafile 10 to" f: /clone/data/xdb01.dbf "; restoreCheck ReadonlyClone Database;
} Executing scripts: Memory Script is executing the command: set newname is executing the command: set newname is executing the command: set newname is executing the command: set newname is executing the command: set newname Is executing a command: set newname is executing the command: set newname is executing the command: set newname launches restore at 2004-06-28 21:43:54 Channel D1: Start recovery data file backup set channel D1: The data file that is specified from the backup set will be restored to F: /clone/data/system01.dbf is recovering the data file 00002 to f: /clone/data/undotbs01.dbf is recovering data file 00003 to F: /clone/data/cwmlite01.dbf is returning data file 00004 to f: /clone/data/drsys01.dbf is recovering data file 00005 to f: /clone/data/example01.dbf is recovering data file 00006 To f: /clone/data/indx01.dbf is recovering data file 00007 to f: /clone/data/odm01.dbf is recovering data file 00008 to f: /clone/data/tools01.dbf is being file 00009 Restore to F: /clone/data/Users01.dbf is recovering data file 00010 to f: /clone/data/xdb01.dbf channel D1: recovered backup segment 1 paragraph Handle = E: / rmanbak / db_encore_1_1_530053412 Tag = tag20040628t210331 params = NULL channel d1: 2 segment restored backup segment handle = E: / RMANBAK / DB_ENCORE_1_2_530053412 tag = TAG20040628T210331 params = NULL channel d1: complete recovery to restore completion 2004-06-28 21: 46: 35sql statement: CREATE CONTROLFILE REUSE SET DATABASE "Clone_db" replandlogs ar CHIVELOGMAXLOGFILES 50MAXLOGMEMBERS 5MAXDATAFILES 100MAXINSTANCES 1MAXLOGHISTORY 226LOGFILEGROUP 1 ( 'F: /clone/data/REDO01.DBF') SIZE 10485760, GROUP 2 ( 'F: /clone/data/REDO02.DBF') SIZE 10485760, GROUP 3 ( 'F: / Clone / Data / Redo03.dbf ') Size 10485760DataFile'f: /clone/data/system01.dbf'Character Set ZHS16GBK is printing a store: Memory script {switch clone datafile all;} is executing scripts: Memory Script Data File 2 Converted into data file copy input data file copy RECID = 1 stamp = 530056505 file name = f: /clone/data/undotbs01.dbf data file 3 has been converted into data file copy input data file copy RECID = 2 stamp = 530056505 file name = F: /clone/data/cwmlite01.dbf Data File 4 has been converted into data file copy input data file copy RECID = 3 stamp = 530056505 file name =
F: /clone/data/drsys01.dbf Data File 5 The converted into data file copy input data file copy Recid = 4 stamp = 530056505 file name = f: /clone/data/example01.dbf data file 6 has been converted into data files Replica input data file copy RECID = 5 stamp = 530056505 file name = f: /clone/data/indx01.dbf data file 7 has been converted into data file copy input data file copy RECID = 6 stamp = 530056505 file name = f: / clone /Data/odm01.dbf data file 8 has been converted into data file copy input data file copy RECID = 7 stamp = 530056505 file name = f: /clone/data/tools01.dbf data file 9 has been converted into data file copy input data file Copy Recid = 8 stamp = 530056505 file name = f: /clone/data/Users01.dbf data file 10 has been converted into data file copy input data file copy RECID = 9 stamp = 530056505 file name = f: / clone / data / xdb01 .Dbf is printing a script: Memory script {set uncle SCN 261688166; RecoverClone DatabaseDelete archivelog; Recovery channel D1: Archive log recovery channel D1 is being started to the default target D1: Restore archive log archive log thread = 1 sequence = 108 channel D1: Restore archive log archive log thread = 1 sequence = 109 channel D1: Restore archive Log archive log thread = 1 sequence = 110 channel D1: Restore archive log archive log thread = 1 sequence = 111 channel D1: Restore archive log archive log thread = 1 Sequence = 112 channel D1: Restored backup segment 1 Handle = E: / RMANBAK / LOG_ENCORE_2_1_530055742 Tag = Tag20040628T214221 params = NULL channel D1: Restore completion archive log file name = f: /clone/log/ARC00108.001 thread = 1 sequence = 108 channel clone_default: is deleting archive log archive log file name = f: /clone/log/ARC00108.001 record ID = 3 time stamp = 530056510 Archive log file name = f: /clone/log/arc00109.001 thread = 1 sequence = 109 channel clone_default: Remove archive log archive log file name = f: /clone/log/ARC00109.001 record ID = 4 timestamp = 530056510 Archive log file name = f: /clone/log/arc00110.001 thread = 1 Sequence = 110 channel clONE_DEFAULT: Remove archive log archive log file name = f: /clone/log/ARC00110.001 record ID = 5 Time stamp = 530056510 Archive log file name = f: /clone/log/ARC0011.001 thread = 1 Sequence = 111 Channel Clone_Default: Remove Archive Log Archive Log File Name = f: /clone/log/ARC00111.001 Record ID = 2 Time Stamp = 530056510 Archive Log File Name = f: /clone/log/arc00112.001 Thread =
1 Sequence = 112 Channel Clone_Default: Removing Archive Log Archive Log File Name = f: /clone/log/ARC00112.001 Record ID = 1 Time Stamp = 530056510 Completion Rehabilitation Complete Recover at 2004-06-28 21:46: 47 Script is being printed: Memory script {shutdown clone; startup clone nomount;} is executing the script: Memory Script Database has been uninstalling the Oracle routine Closed Connected to the standby database (not started) Oracle routine has started system global region total 319889436 bytes Fixed Size 454684 bytes Variable Size 109051904 bytes Database Buffers 209715200 bytes Redo Buffers 667648 bytes sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE_DB" RESETLOGS ARCHIVELOGMAXLOGFILES 50MAXLOGMEMBERS 5MAXDATAFILES 100MAXINSTANCES 1MAXLOGHISTORY 226LOGFILEGROUP 1 ( 'F: / clone / data /Redo01.dbf ') Size 10485760, Group 2 (' f: /clone/data/redo02.dbf ') Size 10485760, Group 3 (' f: /clone/data/redo03.dbf ') Size 10485760DataFile'f: / cLONE / DATA / SYSTEM01.DBF'CHARACTER SET ZHS16GBK being printed stored script: memory script {catalog clone datafilecopy "F: /CLONE/DATA/UNDOTBS01.DBF"; catalog clone datafilecopy "F: /CLONE/DATA/CWMLITE01.DBF "; Catalog Clone DataFileCopy" f: /clone/data/drsys01.dbf "; Catalog Clone DataFileCopy" F: / Clone / Data / EXAMPLE 01.dbf "; Catalog Clone DataFileCopy" f: /clone/data/indx01.dbf "; Catalog Clone DataFileCopy" F: /clone/data/odm01.dbf "; Catalog Clone DataFileCopy" f: / clone / data / Tools01. DBF "; Catalog Clone DataFileCopy" f: /clone/data/users01.dbf "; Catalog Clone DataFileCopy" f: /clone/data/xdb01.dbf "; Switch Clone DataFile All;} is executing script: Memory Script has filed data File copy included in the directory data file copy filename = f: /clone/data/undotbs01.dbf Recid = 1 stamp = 530056530 The data file copy has been included in the directory data file copy filename = f: /clone/data/cwmlite01.dbf Recid = 2 stamp = 530056530 The data file copy is included in the directory data file copy filename = f: /clone/data/drsys01.dbf Recid = 3 stamp =
530056531 The data file copy is included in the directory data file copy filename = f: /clone/data/example01.dbf recid = 4 stamp = 530056531 The data file copy has been included in the directory data file copy filename = f: / clone / Data / INDX01.DBF Recid = 5 stamp = 530056531 The data file copy has been included in the directory data file copy filename = f: /clone/data/odm01.dbf Recid = 6 stamp = 530056531 The data file copy has been included in the directory data file copy filename = F: /clone/data/tools01.dbf recid = 7 stamp = 530056532 The data file copy is included in the directory data file copy filename = f: /clone/data/Users01.dbf recid = 8 stamp = 530056532 Data file Copy included directory data file copy filename = f: /clone/data/xdb01.dbf Recid = 9 stamp = 530056532 Data file 2 has been converted into data file copy input data file copy RECID = 1 stamp = 530056530 file name = f: / Clone / data / undotbs01.dbf data file 3 has been converted into data file copy input data file copy RECID = 2 stamp = 530056530 file name = f: /clone/data/cwmlite01.dbf data file 4 has been converted into data file copy input data File copy RECID = 3 stamp = 530056531 file name = f: /clone/data/drsys01.dbf data file 5 has been converted into data file copy input data file copy RECID = 4 stamp = 530056531 file name = f: / clone / data / EXAMPLE01.DBF Data File 6 The converted into data file copy input data file copy RECID = 5 stamp = 530056531 file name = f: /clone/data/indx01.dbf data file 7 has been converted into data file copy input data file copy RECID = 6 stamp = 530056531 file name = f: /clone/data/odm01.dbf data file 8 has been converted into data file copy input data file copy RECID = 7 stamp = 5 : /Clone/data/tools01.dbf Data File 9 Reconned Data File Replica Entering Data File Replica Recid = 8 stamp = 530056532 File Name = f: /clone/data/Users01.dbf Data File 10 has been converted into data file copy Enter data file copy RECID = 9 stamp = 530056532 file name = f: /clone/data/xdb01.dbf is printing a store: Memory script {alter clone database open resetLogs;} is executing scripts: Memory Script Database has been opened RMAN>> - To do this step Need Note: Avoid connecting the cloning database, otherwise, RMAN will not be able to close the clone database (Shutdown Clone), and the remaining steps cannot continue.
8. Test clone database D: / Oracle / bin> SQLUSSQL * Plus: Release 9.2.0.5.0 - Production on Mon Jun 28 22:01:46 2004Copyright (C) 1982, 2002, Oracle Corporation. All Rights Reserved.enter User -name: sys / sys1 @ clone as sysdbaConnected to: Oracle9i Enterprise Edition Release 9.2.0.5.0 - ProductionWith the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining optionsJServer Release 9.2.0.5.0 - ProductionSQL> select status from v $ instance; STATUS ------------ OPENSQL> archive log list; Database log mode Archive ModeAutomatic archival EnabledArchive destination F: / CLONE / logOldest online log sequence 0Next log sequence to archive 1Current log sequence 1SQL> summary: In the two machines, use the RMAN clone database, individuals believe that there is two points to note: 1. When making a full storage backup of the target database, pay attention to the simultaneous backup log, lack this step, RMAN will report NO backup Copy when cloning Errors. 2, to copy the backup set of the target database backup to the same directory of the clone machine (with the directory of backup set in the backup of the target database), otherwise, RMAN will report: No XXXX backup set. DBCA is a tool that can be configured, managed, and established databases. During the initial database installation, if you choose to "create a database option (create a database option", this tool starts and runs. You can build a template-based database or import a new template from the previous example.
Many managers don't know, just type DBCA in the command line to enter the DBCA environment. Once this tool starts, you can create a new database, configure the database's init.ora option, delete an existing database, or manage the database template. These database templates are similar to templates generated during installation (such as General Purpose, Data Warehouse, and Transaction Processing).
During the installation process, alert dialog box appears to ask if you need to save your template. You can click NO or you can define your database when you install. The DBCA tool is able to check the database settings and generate a template based on the current operating system, and even selectively output the current data. This feature enables it to transfer a database to another machine or embed a database to other valuable tools.
The DBCA tool stores the template in a file with a .dbc extension. A.dbc file contains the init.ora parameter, location data file, log file, and a list of control files in XML format in the database. If you choose to include your database data, this tool also generates a file that extends .dbj, that is, a zip compressed file that contains images of your data file. Some users will think of building a backup of all of these settings to avoid the need to re-establish a database on a new machine.
Method 2: Clone a database using DBCA
There are many variables to allow DBCA to install files to Oracle software to proper path, such as {Oracle_Base}, and {db_name}. Since these are just simple XML, you can quickly view the difference between these templates using a DIFF function. For example, the difference between the General Purpose and Data Warehouse database templates is Data Warehouse Templates in Oracle 9i 9.2.0.0: Temp TableSpace is less than 1m.
The init.ora parameter includes:
Star_transformation_enabled is activated.
PGA_AGGREGATE_TARGET is compared.
Query_rewrite_enabled is activated.
DB_FILE_MULTIBLOCK_READ_COUNT is double.
Sort_area_size is double.
Hash_area_size is not set.
DB_CACHE_SIZE is relatively small.
For Transaction Processing Templates, the difference is:
Oracle OLAP options are not activated.
The init.ora parameter includes:
DB_BLOCK_SIZE is half.
Undo_retrion is relatively small.
PGA_AGGREGATE_TARGET is relatively small.
DB_FILE_MULTIBLOCK_READ_COUNT is half.
Hash_join_ENABLED is turned off.
DB_CACHE_SIZE is relatively large.
There is no need to create a CWMLite TableSpace (because the OLAP option has been turned off).
Example and System TableSpaces are relatively small.
Temp TableSpace is double size.
When you use the DBCA tool to output data from the database, DBCA will generate a file with a .dfj extension, a ZIP compressed file that contains a source image of each data file. This means that these data guarantee security during the transfer process. However, these documents are not well received by Exp and IMP documentation and support. Similarly, most of these images are written directly to the disk, not similar to the IMP written by SQL.