- 作者:zhaozj
- 发表时间:2020-12-23 10:55
- 来源:未知
Cloning a Windows Database
1.cold backup database
2.Connect to the source database test via svrmgr or SQL*Plus using an account that has the SYSDBA, SYSOPER SQL> alter database backup controlfile to trace resetlogs; examples: on NT C:/> set ORACLE_SID=prodx1 C:/> set ORACLE_HOME=e:/oracle/ora81741 C:/> %ORACLE_HOME%/bin/sqlplus sys/change_on_install as sysdba SQL> alter database backup controlfile to trace resetlogs;
trace file in user_dump_dest examples:e:/oracle/admin/prodx1/udump / Navigate to the directory selected above, identify the most recent .trc file and rename it to recr_con.sql. C:/> move e:/oracle/admin/prodx1/udump/<trace_file> e:/oracle/admin/prodx1/udump/recr_con.sql
3.Perform a "Clean" Shutdown of the new Database
A clean shutdown is necessary in order to make sure all data files and control files are synchronized with the most recent transactions. The following command will give you a clean shutdown: SQL> shutdown immediate;
You must connect as a user (i.e. SYS) who has privileges (i.e. SYSDBA) to shut down the database examples: On Windows Operating System:
- Create administrative directories: % mkdir e:/oracle/admin/prodx2 % mkdir e:/oracle/admin/prodx2/bdump % mkdir e:/oracle/admin/prodx2/udump % mkdir e:/oracle/admin/prodx2/cdump % mkdir e:/oracle/admin/prodx2/pfile
- Create data file directory: % mkdir e:/oradata/prodx2
- Copy Database Files C:> copy e:/oradata/prodx1/*.dbf e:/oradata/prodx2/ C:> copy e:/oradata/prodx1/*.log e:/oradata/prodx2/ C:> copy e:/oracle/admin/prodx1/pfile/initprodx1.ora e:/oracle/admin/prodx2/pfile/initprodx2.ora C:> copy e:/oracle/admin/prodx1/udump/recr_con.sql e:/oracle/admin/prodx2/udump/recr_con.sql
4. Modify the Parameter File for the Cloned Database
5 Modify the Trace Output Script File
On Windows Operating System: e:/oracle/admin/prodx2/udump/recr_con.sql modified: STARTUP NOMOUNT PFILE=e:/oracle/admin/prodx2/pfile/initprodx2.ora CREATE CONTROLFILE SET DATABASE "prodx2" RESETLOGS NOARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 2 MAXDATAFILES 96 MAXINSTANCES 1 MAXLOGHISTORY 226 LOGFILE GROUP 1 'E:/ORADATA/prodx2/REDO01.LOG' SIZE 10M, GROUP 2 'E:/ORADATA/prodx2/REDO02.LOG' SIZE 10M DATAFILE 'E:/ORADATA/prodx2/SYSTEM01.DBF', 'E:/ORADATA/prodx2/RBS01.DBF', 'E:/ORADATA/prodx2/TEMP01.DBF', 'E:/ORADATA/prodx2/USERS01.DBF', 'E:/ORADATA/prodx2/TOOLS01.DBF', 'E:/ORADATA/prodx2/OCL_TEMP1.DBF', 'E:/ORADATA/prodx2/OCL_APP.DBF', 'E:/ORADATA/prodx2/OCL_APP_IDX.DBF', 'E:/ORADATA/prodx2/OCL_DEF.DBF', 'E:/ORADATA/prodx2/OCL_DEF_IDX.DBF', 'E:/ORADATA/prodx2/OCL_GLIB.DBF', 'E:/ORADATA/prodx2/OCL_GLIB_IDX.DBF', 'E:/ORADATA/prodx2/OCL_LI.DBF', 'E:/ORADATA/prodx2/OCL_LI_IDX.DBF', 'E:/ORADATA/prodx2/OCL_DCMQ.DBF', 'E:/ORADATA/prodx2/OCL_DCMQ_IDX.DBF', 'E:/ORADATA/prodx2/OCL_DCD.DBF', 'E:/ORADATA/prodx2/OCL_DCD_IDX.DBF', 'E:/ORADATA/prodx2/OCL_RESP.DBF', 'E:/ORADATA/prodx2/OCL_RESP_IDX.DBF', 'E:/ORADATA/prodx2/OCL_DISC.DBF', 'E:/ORADATA/prodx2/OCL_DISC_IDX.DBF', 'E:/ORADATA/prodx2/OCL_VRV.DBF', 'E:/ORADATA/prodx2/OCL_VRV_IDX.DBF', 'E:/ORADATA/prodx2/OCL_DES.DBF', 'E:/ORADATA/prodx2/OCL_DES_IDX.DBF', 'E:/ORADATA/prodx2/OCL_LR.DBF', 'E:/ORADATA/prodx2/OCL_LR_IDX.DBF', 'E:/ORADATA/prodx2/OCL_TEST_DATA.DBF', 'E:/ORADATA/prodx2/OCL_TEST_INDEX.DBF', 'E:/ORADATA/prodx2/OCL_TEMP_DATA.DBF', 'E:/ORADATA/prodx2/OCL_DISC_REP_DATA.DBF' CHARACTER SET WE8ISO8859P1 ; ALTER DATABASE OPEN RESETLOGS;