Rman 實現oracle11g資料庫clone
Rman clone資料庫的文件看了好幾次了,就是沒時間做,今天試試看:
cd $ORACLE_HOME/dbs
cp initnqaddite.ora initclone.ora
cp orapwnqaddite orapwclone 或者
orapwd file=$ORACLE_HOME/dbs/orapwclone password=clone entries=4
修改initclone.ora
[@more@]手動替換nqaddite 成 clone vi 執行 :%s/nqaddite/clone/g
或者 perl -p -i -e 's/nqaddite/clone/g' initclone.ora
新增到引數檔案裡面
*.db_file_name_convert = ('nqaddite','clone')
*.log_file_name_convert = ('nqaddite','clone')
nomount啟動clone資料庫例項
export ORACLE_SID=clone
sqlplus "/ as sysdba" < --create spfile from pfile; startup nomount; exit; EOF 執行clone : 如果需要配置dbconsole的話 EMCA 開始於 2008-8-1 9:02:05 輸入以下資訊: 已指定以下設定 資料庫 ORACLE_HOME ................ /oracle/product/11.1.0/11g 本地主機名 ................ nq-data-center ----------------------------------------------------------------- 2008-8-1 9:10:49 oracle.sysman.emcp.EMReposConfig invoke 應改是 emca -config dbcontrol db -repos create 快一些
2> ALLOCATE auxiliary channel d1 device TYPE DISK;
3> duplicate target DATABASE TO "CLONE";
4> }
channel d1: SID=152 device type=DISK
released channel: d1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/01/2008 07:24:16
RMAN-20208: UNTIL CHANGE is before RESETLOGS change
2> SET UNTIL logseq 1583 thread 1;
3> ALLOCATE auxiliary channel d1 TYPE DISK;
4> duplicate target DATABASE TO "CLONE";
5> }
channel d1: SID=152 device type=DISK
released channel: d1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/01/2008 07:24:24
RMAN-20208: UNTIL CHANGE is before RESETLOGS change
2> SET UNTIL scn 946655988;
3> ALLOCATE auxiliary channel d1 TYPE DISK;
4> duplicate target DATABASE TO "CLONE";
5> }
channel d1: SID=152 device type=DISK
released channel: d1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/01/2008 07:24:44
RMAN-06457: UNTIL SCN (946655988) is ahead of last SCN in archived logs ()
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/oradata/nqaddite/archive
Oldest online log sequence 1581
Next log sequence to archive 1583
Current log sequence 1583
2> SET UNTIL logseq 1583 thread 1;
3> ALLOCATE auxiliary channel d1 TYPE DISK;
4> duplicate target DATABASE TO "CLONE";
5> }
channel d1: SID=152 device type=DISK
{
set until scn 946741401;
set newname for datafile 1 to
"/oracle/oradata/clone/system01.dbf";
set newname for datafile 2 to
"/oracle/oradata/clone/sysaux01.dbf";
set newname for datafile 3 to
"/oracle/oradata/clone/undotbs01.dbf";
set newname for datafile 4 to
"/oracle/oradata/clone/users01.dbf";
set newname for datafile 5 to
"/oracle/oradata/clone/example01.dbf";
set newname for datafile 6 to
"/oracle/oradata/clone/ADDITEM.dbf";
set newname for datafile 7 to
"/oracle/oradata/clone/ADDITEM2.dbf";
set newname for datafile 8 to
"/oracle/oradata/clone/ADDITEM_INDEX.dbf";
set newname for datafile 9 to
"/oracle/oradata/clone/ADDITEM_INDEX2.dbf";
set newname for datafile 10 to
"/oracle/oradata/clone/ADDITEM_INDEX3.dbf";
set newname for datafile 11 to
"/oracle/oradata/clone/ADDITEM3.dbf";
set newname for datafile 12 to
"/oracle/oradata/clone/ADDFILE.dbf";
set newname for datafile 13 to
"/oracle/oradata/clone/ADDITEM4.dbf";
restore
clone database
;
}
executing Memory Script
channel d1: specifying datafile(s) to restore from backup set
channel d1: restoring datafile 00001 to /oracle/oradata/clone/system01.dbf
channel d1: restoring datafile 00002 to /oracle/oradata/clone/sysaux01.dbf
channel d1: restoring datafile 00003 to /oracle/oradata/clone/undotbs01.dbf
channel d1: restoring datafile 00004 to /oracle/oradata/clone/users01.dbf
channel d1: restoring datafile 00005 to /oracle/oradata/clone/example01.dbf
channel d1: restoring datafile 00006 to /oracle/oradata/clone/ADDITEM.dbf
channel d1: restoring datafile 00007 to /oracle/oradata/clone/ADDITEM2.dbf
channel d1: restoring datafile 00008 to /oracle/oradata/clone/ADDITEM_INDEX.dbf
channel d1: restoring datafile 00009 to /oracle/oradata/clone/ADDITEM_INDEX2.dbf
channel d1: restoring datafile 00010 to /oracle/oradata/clone/ADDITEM_INDEX3.dbf
channel d1: restoring datafile 00011 to /oracle/oradata/clone/ADDITEM3.dbf
channel d1: restoring datafile 00012 to /oracle/oradata/clone/ADDFILE.dbf
channel d1: restoring datafile 00013 to /oracle/oradata/clone/ADDITEM4.dbf
channel d1: reading from backup piece /oracle/flash_recovery_area/NQADDITEM/backupset/2008_08_01/o1_mf_nnndf_TAG20080801T070607_494kcb1w_.bkp
channel d1: piece handle=/oracle/flash_recovery_area/NQADDITEM/backupset/2008_08_01/o1_mf_nnndf_TAG20080801T070607_494kcb1w_.bkp tag=TAG20080801T070607
channel d1: restored backup piece 1
channel d1: restore complete, elapsed time: 00:05:59
Finished restore at 01-AUG-08
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 1168
LOGFILE
GROUP 1 ( '/oracle/oradata/clone/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/oracle/oradata/clone/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/oracle/oradata/clone/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/oracle/oradata/clone/system01.dbf'
CHARACTER SET ZHS16GBK
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
input datafile copy RECID=1 STAMP=661592112 file name=/oracle/oradata/clone/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=661592112 file name=/oracle/oradata/clone/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=661592112 file name=/oracle/oradata/clone/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=661592112 file name=/oracle/oradata/clone/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=661592112 file name=/oracle/oradata/clone/ADDITEM.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=661592112 file name=/oracle/oradata/clone/ADDITEM2.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=661592112 file name=/oracle/oradata/clone/ADDITEM_INDEX.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=8 STAMP=661592112 file name=/oracle/oradata/clone/ADDITEM_INDEX2.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=9 STAMP=661592112 file name=/oracle/oradata/clone/ADDITEM_INDEX3.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=10 STAMP=661592112 file name=/oracle/oradata/clone/ADDITEM3.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=11 STAMP=661592112 file name=/oracle/oradata/clone/ADDFILE.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=12 STAMP=661592112 file name=/oracle/oradata/clone/ADDITEM4.dbf
{
set until scn 946741401;
recover
clone database
delete archivelog
;
}
executing Memory Script
archived log file name=/oracle/oradata/nqaddite/archive/1_1582_649874090.dbf thread=1 sequence=1582
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-AUG-08
{
shutdown clone immediate;
startup clone nomount ;
}
executing Memory Script
Oracle instance shut down
Oracle instance started
Variable Size 159386880 bytes
Database Buffers 50331648 bytes
Redo Buffers 5296128 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONE" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 1168
LOGFILE
GROUP 1 ( '/oracle/oradata/clone/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/oracle/oradata/clone/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/oracle/oradata/clone/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/oracle/oradata/clone/system01.dbf'
CHARACTER SET ZHS16GBK
contents of Memory Script:
{
set newname for tempfile 1 to
"/oracle/oradata/clone/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/oracle/oradata/clone/sysaux01.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/undotbs01.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/users01.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/example01.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/ADDITEM.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/ADDITEM2.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/ADDITEM_INDEX.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/ADDITEM_INDEX2.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/ADDITEM_INDEX3.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/ADDITEM3.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/ADDFILE.dbf";
catalog clone datafilecopy "/oracle/oradata/clone/ADDITEM4.dbf";
switch clone datafile all;
}
executing Memory Script
datafile copy file name=/oracle/oradata/clone/sysaux01.dbf RECID=1 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/undotbs01.dbf RECID=2 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/users01.dbf RECID=3 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/example01.dbf RECID=4 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/ADDITEM.dbf RECID=5 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/ADDITEM2.dbf RECID=6 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/ADDITEM_INDEX.dbf RECID=7 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/ADDITEM_INDEX2.dbf RECID=8 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/ADDITEM_INDEX3.dbf RECID=9 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/ADDITEM3.dbf RECID=10 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/ADDFILE.dbf RECID=11 STAMP=661592126
datafile copy file name=/oracle/oradata/clone/ADDITEM4.dbf RECID=12 STAMP=661592126
input datafile copy RECID=1 STAMP=661592126 file name=/oracle/oradata/clone/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=661592126 file name=/oracle/oradata/clone/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=661592126 file name=/oracle/oradata/clone/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=661592126 file name=/oracle/oradata/clone/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=661592126 file name=/oracle/oradata/clone/ADDITEM.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=661592126 file name=/oracle/oradata/clone/ADDITEM2.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=661592126 file name=/oracle/oradata/clone/ADDITEM_INDEX.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=8 STAMP=661592126 file name=/oracle/oradata/clone/ADDITEM_INDEX2.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=9 STAMP=661592126 file name=/oracle/oradata/clone/ADDITEM_INDEX3.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=10 STAMP=661592126 file name=/oracle/oradata/clone/ADDITEM3.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=11 STAMP=661592126 file name=/oracle/oradata/clone/ADDFILE.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=12 STAMP=661592126 file name=/oracle/oradata/clone/ADDITEM4.dbf
{
Alter clone database open resetlogs;
}
executing Memory Script
Finished Duplicate Db at 01-AUG-08
[oracle@nq~]$ emca -config dbcontrol db -repos recreate
EM Configuration Assistant, 11.1.0.5.0 正式版
版權所有 (c) 2003, 2005, Oracle。保留所有權利。
資料庫 SID: clone
監聽程式埠號: 1521
SYS 使用者的口令:
DBSNMP 使用者的口令:
SYSMAN 使用者的口令:
SYSMAN 使用者的口令: 通知的電子郵件地址 (可選): heming@netqin.com
通知的發件 (SMTP) 伺服器 (可選): mail.netqin.com
-----------------------------------------------------------------
監聽程式埠號 ................ 1521
資料庫 SID ................ clone
通知的電子郵件地址 ............... heming@netqin.com
通知的發件 (SMTP) 伺服器 ............... mail.netqin.com
是否繼續? [是(Y)/否(N)]: y
2008-8-1 9:02:54 oracle.sysman.emcp.EMConfig perform
資訊: 正在將此操作記錄到 /oracle/cfgtoollogs/emca/clone/emca_2008_08_01_09_02_05.log。
2008-8-1 9:02:55 oracle.sysman.emcp.EMReposConfig invoke
資訊: 正在刪除 EM 資料檔案庫 (此操作可能需要一段時間)...
資訊: 已成功刪除資料檔案庫
2008-8-1 9:10:49 oracle.sysman.emcp.EMReposConfig createRepository
資訊: 正在建立 EM 資料檔案庫 (此操作可能需要一段時間)...
2008-8-1 9:17:43 oracle.sysman.emcp.EMReposConfig invoke
資訊: 已成功建立資料檔案庫
2008-8-1 9:17:48 oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
資訊: 正在將配置資料上載到 EM 資料檔案庫 (此操作可能需要一段時間)...
2008-8-1 9:18:36 oracle.sysman.emcp.EMReposConfig invoke
資訊: 已成功上載配置資料
2008-8-1 9:18:39 oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
資訊: 軟體庫已配置成功。
2008-8-1 9:18:39 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
資訊: 正在部署預配檔案...
2008-8-1 9:18:48 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
資訊: 預配檔案部署成功。
2008-8-1 9:18:48 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
資訊: 正在保護 Database Control (此操作可能需要一段時間)...
2008-8-1 9:19:02 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
資訊: 已成功保護 Database Control。
2008-8-1 9:19:02 oracle.sysman.emcp.util.DBControlUtil startOMS
資訊: 正在啟動 Database Control (此操作可能需要一段時間)...
2008-8-1 9:19:31 oracle.sysman.emcp.EMDBPostConfig performConfiguration
資訊: 已成功啟動 Database Control
2008-8-1 9:19:31 oracle.sysman.emcp.EMDBPostConfig performConfiguration
資訊: >>>>>>>>>>> Database Control URL 為
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9614263/viewspace-1008219/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ZT:資料庫Oracle11g新特性RMAN資料庫Oracle
- Rman-ORACLE資料庫RMAN實現自動備份Oracle資料庫
- rman duplicate clone庫的尷尬
- 【RMAN】Oracle11g使用rman遷移升級資料庫(win_to_linux)Oracle資料庫Linux
- clone oracle資料庫的方法Oracle資料庫
- 使用手工方法Clone異名資料庫實驗資料庫
- gitlab如何實現批次clone倉庫Gitlab
- RMAN COPY實現ORACLE資料庫儲存遷移的方案Oracle資料庫
- 利用rman來實現linux平臺資料庫複製到windows平臺資料庫Linux資料庫Windows
- 【RMAN】oracle11g單機資料通過RMAN恢復至RACOracle
- 【RMAN】oracle11g單機資料透過RMAN恢復至RACOracle
- 【RMAN】catalog資料庫資料庫
- rman全備資料庫資料庫
- RMAN恢復資料庫資料庫
- 使用 RMAN 同步資料庫資料庫
- 資料庫所有檔案丟失後透過RMAN實現恢復資料庫
- Oracle11g 手工建立資料庫Oracle資料庫
- 用rman遷移資料庫資料庫
- 使用RMAN備份資料庫資料庫
- RMAN複製資料庫(十)資料庫
- RMAN複製資料庫(九)資料庫
- RMAN複製資料庫(八)資料庫
- RMAN複製資料庫(七)資料庫
- RMAN複製資料庫(六)資料庫
- RMAN複製資料庫(五)資料庫
- RMAN複製資料庫(四)資料庫
- RMAN複製資料庫(三)資料庫
- RMAN複製資料庫(二)資料庫
- RMAN複製資料庫(一)資料庫
- 使用RMAN複製資料庫資料庫
- 使用RMAN建立Duplicate資料庫資料庫
- 為RMAN操作配置資料庫資料庫
- 利用RMAN建立STANDBY資料庫資料庫
- oracle rman複製資料庫Oracle資料庫
- 使用rman建立standby資料庫資料庫
- 【轉】RMAN建立duplicate資料庫資料庫
- rman 全庫恢復asm資料庫ASM資料庫
- 使用RMAN Duplicate方法搭建異名資料庫實驗資料庫