Duplicating an Active Database
-
Duplicating an Active Database
-
duplicate體系結構
-
搞點英語出來吧,英語不好的哥們就好好翻譯翻譯吧,這段英語是必須看懂的。。。。
You can duplicate a source database to a destination database, which can be on the same or different computers. The database instance associated with the duplicate database is called the auxiliary instance. All duplication techniques require a connection to the auxiliary instance. The diagram shows you the following techniques for database duplication:
-
From an active database, connected to the target and auxiliary instances
-
From backup, connected to the target and auxiliary instances
-
From backup, connected to the auxiliary instance, not connected to the target, but with recovery catalog connection
-
From backup, connected to the auxiliary instance, not connected to the target and the recovery catalog
Choosing a technique to duplicate your database—always with connection to the auxiliary instance:
簡單點就是 ①基於備份 ,而基於備份又分為3種情況 ②基於活動資料庫
-
本次實驗簡介
本次實驗就是基於active database的duplicate技術。
Active database duplication 通過網路,直接copy target 庫到auxiliary 庫,然後建立複製庫。 這種方法就不需要先用RMAN 備份資料庫,然後將備份檔案傳送到auxiliary端。這個功能的作用是非常大的。 尤其是對T級別的庫。 因為對這樣的庫進行備份,然後將備份集傳送到備庫,在進行duplicate 的代價是非常大的。 一備份要佔用時間,二要佔用備份空間,三在網路傳送的時候,還需要佔用頻寬和時間。所以Active database duplicate 很好的解決了以上的問題。 它對大庫的遷移非常有用。
-
本次實驗原理
-
環境及搭建要求
環境:
-
源資料庫和目標資料庫伺服器:RHEL6.5
-
RMAN客戶端:windows 7 系統下的rman client
-
source host : 192.168.59.129 sid:orcl database:11gR2
-
Destination host :192.168.59.133 sid:orcl database:11gR2
注意事項說明:
-
這裡的duplicate database 和 source database 的目錄結構完全一樣
-
源資料庫和輔助資料庫的幾種不同名稱:source/target database ---->>>>>----- (destination host)/duplicate database (auxiliary instance)
-
這裡我利用了windows下的rman client來連線目標和輔助資料庫,當然也可以利用目標庫或者輔助庫的rman client來操作
-
目標資料庫應該處於歸檔模式
source database環境:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
-
對輔助資料庫的要求
輔助資料庫應該提前安裝好資料庫,配置好環境變數。。。。。你懂的。。。。
輔助資料庫的環境變數配置:
[root@rhel6 ~]# su - oracle
[oracle@rhel6 ~]$ more .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export PATH=$PATH:/sbin/:$HOME/bin
# for oracle user
unset USERNAME
export GLOBAL_DB_UNIQUE_NAME=orcl
export ORACLE_HOSTNAME=192.168.59.133
export ORACLE_UNQNAME=orcl
export EDITOR=vi
export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH=$ORACLE_HOME/bin:$PATH
umask 022
#export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
export SQLPATH=$ORACLE_HOME/sqlplus/admin
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias asmcmd='rlwrap asmcmd'
alias alert_log='tail -200f $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace/alert_$ORACLE_SID.log'
alias alert_xml='tail -200f $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/alert/log.xml'
alias alert_listener='tail -200f $ORACLE_BASE/diag/tnslsnr/rhel6/listener/trace/listener.log'
[oracle@rhel6 ~]$
-
正式開始
-
duplicate database 設定
-
首先在duplicate database上進行設定:
-
建立pfile 引數檔案
[oracle@rhel6 ~]$ cd $ORACLE_HOME/dbs
[oracle@rhel6 dbs]$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/dbs
[oracle@rhel6 dbs]$ ll -h
total 4.0K
-rw-r--r--. 1 oracle oinstall 2.8K May 15 2009 init.ora
[oracle@rhel6 dbs]$ vi initorcl.ora
[oracle@rhel6 dbs]$ more initorcl.ora
DB_NAME=orcl
[oracle@rhel6 dbs]$
截圖:
-
建立密碼檔案
[oracle@rhel6 dbs]$ orapwd file=?/dbs/orapworcl password=lhr
[oracle@rhel6 dbs]$ ll -h
total 12K
-rw-r--r--. 1 oracle oinstall 2.8K May 15 2009 init.ora
-rw-r--r--. 1 oracle oinstall 13 Jul 20 16:03 initorcl.ora
-rw-r-----. 1 oracle oinstall 1.5K Jul 20 16:09 orapworcl
[oracle@rhel6 dbs]$
-
建立和source database的資料檔案相關的目錄結構
[oracle@rhel6 oracle]$ pwd
/u01/app/oracle
[oracle@rhel6 oracle]$ ll
total 8
drwxr-xr-x. 2 oracle oinstall 4096 May 18 17:14 checkpoints
drwxr-xr-x. 3 oracle oinstall 4096 May 18 16:04 product
[oracle@rhel6 oracle]$ mkdir -p /u01/app/oracle/oradata/orcl
[oracle@rhel6 oracle]$
不然在duplicate時會報如下錯誤:
ORA-19505: failed to identify file "/u01/app/oracle/oradata/orcl/users01.dbf"
ORA-27040: file create error, unable to create file
-
啟動Auxiliary 到nomout 狀態
[oracle@rhel6 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Jul 20 16:48:04 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 217157632 bytes
Fixed Size 2211928 bytes
Variable Size 159387560 bytes
Database Buffers 50331648 bytes
Redo Buffers 5226496 bytes
SQL>
-
在Target 和Auxiliary 都配置Oracle Net(Listener.ora and tnsnames.ora)
注意:
-
對於Listener.ora 的配置需要配置成靜態監聽,何謂靜態監聽???哈哈百度吧。。。。
-
target和auxiliary都需要配置listener.ora和tnsnames.ora
-
如果rman client不在target和auxiliary庫上,那麼也應該配置tnsnames.ora的
target database配置:
[oracle@rhel6 admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.129)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl.lhr.com)
(SID_NAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
)
(SID_DESC =
(GLOBAL_DBNAME = rman.lhr.com)
(SID_NAME = rman)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
)
)
[oracle@rhel6 admin]$ more tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.129)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.lhr.com)
)
)
lhr_dup =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.133)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
auxiliary database 配置:
[oracle@rhel6 admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.133)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(SID_NAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
[oracle@rhel6 admin]$ more tnsnames.ora
orcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.129)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.lhr.com)
)
)
lhr_dup =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.133)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
-
測試網路是否配置好
配置好網路後,首先測試一下源資料庫和duplicate資料庫是否可以連線上,如果不能正常連線說明listener和tnsnames沒有配置正確:
----------------源資料庫
C:\Users\Administrator>sqlplus sys/lhr@orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 7月 20 17:55:58 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
連線到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>exit
----------------duplicate資料庫
C:\Users\Administrator>sqlplus sys/lhr@lhr_dup as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 7月 20 17:41:28 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
連線到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exit
從 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 斷開
如果沒有配置好的話,可能在後邊執行duplicate命令的時候報錯:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: Duplicate Db 命令 (在 07/20/2014 17:28:11 上) 失敗
RMAN-03015: 在儲存的指令碼Memory Script中出現錯誤
RMAN-03009: backup 命令 (ORA_DISK_1 通道上, 在 07/20/2014 17:28:11 上) 失敗
ORA-17629: 無法連線到遠端資料庫伺服器
ORA-17627: ORA-12154: TNS: 無法解析指定的連線識別符號
ORA-17629: 無法連線到遠端資料庫伺服器
-
開始RMAN duplicate from active database
注意:如果target 和 Auxiliary庫的目錄結構相同,記得加上nofilenamecheck引數,不然會報如下錯誤:
RMAN-05001: auxiliary file name /u01/app/oracle/oradata/orcl/users01.dbf conflicts with a file used by the target database
這裡我利用的是本機電腦,即windows 7 系統上的rman client 來演示的。。。。。
C:\Users\Administrator>rman target sys/lhr@orcl auxiliary sys/lhr@lhr_dup
恢復管理器: Release 11.2.0.1.0 - Production on 星期日 7月 20 17:46:11 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
連線到目標資料庫: ORCL (DBID=1379935487)
已連線到輔助資料庫: ORCL (未裝載)
RMAN> duplicate target database to orcl from active database nofilenamecheck;
啟動 Duplicate Db 於 20-7月 -14
使用目標資料庫控制檔案替代恢復目錄
分配的通道: ORA_AUX_DISK_1
通道 ORA_AUX_DISK_1: SID=19 裝置型別=DISK
記憶體指令碼的內容:
{
sql clone "alter system set db_name =
''ORCL'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''ORCL'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/cntrlorcl.dbf';
alter clone database mount;
}
正在執行記憶體指令碼
sql 語句: alter system set db_name = ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql 語句: alter system set db_unique_name = ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle 例項已關閉
Oracle 例項已啟動
系統全域性區域總計 217157632 位元組
Fixed Size 2211928 位元組
Variable Size 159387560 位元組
Database Buffers 50331648 位元組
Redo Buffers 5226496 位元組
啟動 backup 於 20-7月 -14
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=47 裝置型別=DISK
通道 ORA_DISK_1: 啟動資料檔案副本
複製當前控制檔案
輸出檔名=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_orcl.f 標記=TAG20140720T174646 RECID=2 STAMP=853436808
通道 ORA_DISK_1: 資料檔案複製完畢, 經過時間: 00:00:07
完成 backup 於 20-7月 -14
資料庫已裝載
記憶體指令碼的內容:
{
set newname for datafile 1 to
"/u01/app/oracle/oradata/orcl/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/orcl/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/orcl/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/orcl/users01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/orcl/example01.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/u01/app/oracle/oradata/orcl/system01.dbf" datafile
2 auxiliary format
"/u01/app/oracle/oradata/orcl/sysaux01.dbf" datafile
3 auxiliary format
"/u01/app/oracle/oradata/orcl/undotbs01.dbf" datafile
4 auxiliary format
"/u01/app/oracle/oradata/orcl/users01.dbf" datafile
5 auxiliary format
"/u01/app/oracle/oradata/orcl/example01.dbf" ;
sql 'alter system archive log current';
}
正在執行記憶體指令碼
正在執行命令: SET NEWNAME
正在執行命令: SET NEWNAME
正在執行命令: SET NEWNAME
正在執行命令: SET NEWNAME
正在執行命令: SET NEWNAME
啟動 backup 於 20-7月 -14
使用通道 ORA_DISK_1
通道 ORA_DISK_1: 啟動資料檔案副本
輸入資料檔案: 檔案號=00001 名稱=/u01/app/oracle/oradata/orcl/system01.dbf
輸出檔名=/u01/app/oracle/oradata/orcl/system01.dbf 標記=TAG20140720T174700
通道 ORA_DISK_1: 資料檔案複製完畢, 經過時間: 00:01:35
通道 ORA_DISK_1: 啟動資料檔案副本
輸入資料檔案: 檔案號=00002 名稱=/u01/app/oracle/oradata/orcl/sysaux01.dbf
輸出檔名=/u01/app/oracle/oradata/orcl/sysaux01.dbf 標記=TAG20140720T174700
通道 ORA_DISK_1: 資料檔案複製完畢, 經過時間: 00:01:06
通道 ORA_DISK_1: 啟動資料檔案副本
輸入資料檔案: 檔案號=00003 名稱=/u01/app/oracle/oradata/orcl/undotbs01.dbf
輸出檔名=/u01/app/oracle/oradata/orcl/undotbs01.dbf 標記=TAG20140720T174700
通道 ORA_DISK_1: 資料檔案複製完畢, 經過時間: 00:00:35
通道 ORA_DISK_1: 啟動資料檔案副本
輸入資料檔案: 檔案號=00005 名稱=/u01/app/oracle/oradata/orcl/example01.dbf
輸出檔名=/u01/app/oracle/oradata/orcl/example01.dbf 標記=TAG20140720T174700
通道 ORA_DISK_1: 資料檔案複製完畢, 經過時間: 00:00:15
通道 ORA_DISK_1: 啟動資料檔案副本
輸入資料檔案: 檔案號=00004 名稱=/u01/app/oracle/oradata/orcl/users01.dbf
輸出檔名=/u01/app/oracle/oradata/orcl/users01.dbf 標記=TAG20140720T174700
通道 ORA_DISK_1: 資料檔案複製完畢, 經過時間: 00:00:03
完成 backup 於 20-7月 -14
sql 語句: alter system archive log current
記憶體指令碼的內容:
{
backup as copy reuse
archivelog like "/u01/app/oracle/flash_recovery_area/ORCL/archivelog/2014_07_20/o1_mf_1_32_9wq47c1r_.arc" auxiliary format
"/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_32_852154753.dbf" ;
catalog clone archivelog "/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_32_852154753.dbf";
switch clone datafile all;
}
正在執行記憶體指令碼
啟動 backup 於 20-7月 -14
使用通道 ORA_DISK_1
通道 ORA_DISK_1: 正在開始複製歸檔日誌
輸入歸檔日誌執行緒=1 序列=32 RECID=28 STAMP=853437035
輸出檔名=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_32_852154753.dbf RECID=0 STAMP=0
通道 ORA_DISK_1: 歸檔日誌複製完成, 經過時間: 00:00:03
完成 backup 於 20-7月 -14
已編目的歸檔日誌
歸檔日誌檔名=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_32_852154753.dbf RECID=28 STAMP=853437039
資料檔案 1 已轉換成資料檔案副本
輸入資料檔案副本 RECID=2 STAMP=853437039 檔名=/u01/app/oracle/oradata/orcl/system01.dbf
資料檔案 2 已轉換成資料檔案副本
輸入資料檔案副本 RECID=3 STAMP=853437039 檔名=/u01/app/oracle/oradata/orcl/sysaux01.dbf
資料檔案 3 已轉換成資料檔案副本
輸入資料檔案副本 RECID=4 STAMP=853437039 檔名=/u01/app/oracle/oradata/orcl/undotbs01.dbf
資料檔案 4 已轉換成資料檔案副本
輸入資料檔案副本 RECID=5 STAMP=853437039 檔名=/u01/app/oracle/oradata/orcl/users01.dbf
資料檔案 5 已轉換成資料檔案副本
輸入資料檔案副本 RECID=6 STAMP=853437039 檔名=/u01/app/oracle/oradata/orcl/example01.dbf
記憶體指令碼的內容:
{
set until scn 1397315;
recover
clone database
delete archivelog
;
}
正在執行記憶體指令碼
正在執行命令: SET until clause
啟動 recover 於 20-7月 -14
分配的通道: ORA_AUX_DISK_1
通道 ORA_AUX_DISK_1: SID=18 裝置型別=DISK
正在開始介質的恢復
執行緒 1 序列 32 的歸檔日誌已作為檔案 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_32_852154753.dbf 存在於磁碟上
歸檔日誌檔名=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_32_852154753.dbf 執行緒=1 序列=32
介質恢復完成, 用時: 00:00:00
完成 recover 於 20-7月 -14
記憶體指令碼的內容:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''ORCL'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
正在執行記憶體指令碼
資料庫已卸裝
Oracle 例項已關閉
已連線到輔助資料庫 (未啟動)
Oracle 例項已啟動
系統全域性區域總計 217157632 位元組
Fixed Size 2211928 位元組
Variable Size 159387560 位元組
Database Buffers 50331648 位元組
Redo Buffers 5226496 位元組
sql 語句: alter system set db_name = ''ORCL'' comment= ''Reset to original value by RMAN'' scope=spfile
sql 語句: alter system reset db_unique_name scope=spfile
Oracle 例項已關閉
已連線到輔助資料庫 (未啟動)
Oracle 例項已啟動
系統全域性區域總計 217157632 位元組
Fixed Size 2211928 位元組
Variable Size 159387560 位元組
Database Buffers 50331648 位元組
Redo Buffers 5226496 位元組
sql 語句: CREATE CONTROLFILE REUSE SET DATABASE "ORCL" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/app/oracle/oradata/orcl/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/u01/app/oracle/oradata/orcl/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/u01/app/oracle/oradata/orcl/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/u01/app/oracle/oradata/orcl/system01.dbf'
CHARACTER SET ZHS16GBK
記憶體指令碼的內容:
{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/orcl/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/orcl/sysaux01.dbf",
"/u01/app/oracle/oradata/orcl/undotbs01.dbf",
"/u01/app/oracle/oradata/orcl/users01.dbf",
"/u01/app/oracle/oradata/orcl/example01.dbf";
switch clone datafile all;
}
正在執行記憶體指令碼
正在執行命令: SET NEWNAME
臨時檔案 1 在控制檔案中已重新命名為 /u01/app/oracle/oradata/orcl/temp01.dbf
已將資料檔案副本列入目錄
資料檔案副本檔名=/u01/app/oracle/oradata/orcl/sysaux01.dbf RECID=1 STAMP=853437064
已將資料檔案副本列入目錄
資料檔案副本檔名=/u01/app/oracle/oradata/orcl/undotbs01.dbf RECID=2 STAMP=853437064
已將資料檔案副本列入目錄
資料檔案副本檔名=/u01/app/oracle/oradata/orcl/users01.dbf RECID=3 STAMP=853437064
已將資料檔案副本列入目錄
資料檔案副本檔名=/u01/app/oracle/oradata/orcl/example01.dbf RECID=4 STAMP=853437064
資料檔案 2 已轉換成資料檔案副本
輸入資料檔案副本 RECID=1 STAMP=853437064 檔名=/u01/app/oracle/oradata/orcl/sysaux01.dbf
資料檔案 3 已轉換成資料檔案副本
輸入資料檔案副本 RECID=2 STAMP=853437064 檔名=/u01/app/oracle/oradata/orcl/undotbs01.dbf
資料檔案 4 已轉換成資料檔案副本
輸入資料檔案副本 RECID=3 STAMP=853437064 檔名=/u01/app/oracle/oradata/orcl/users01.dbf
資料檔案 5 已轉換成資料檔案副本
輸入資料檔案副本 RECID=4 STAMP=853437064 檔名=/u01/app/oracle/oradata/orcl/example01.dbf
記憶體指令碼的內容:
{
Alter clone database open resetlogs;
}
正在執行記憶體指令碼
資料庫已開啟
完成 Duplicate Db 於 20-7月 -14
RMAN>
測試一下dbid:
C:\Users\Administrator>sqlplus sys/lhr@orcl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 7月 20 17:55:58 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
連線到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select name,dbid from v$database;
NAME DBID
--------- ----------
ORCL 1379935487
SQL> conn sys/lhr@lhr_dup as sysdba
已連線。
SQL> select name,dbid from v$database;
NAME DBID
--------- ----------
ORCL 1381217798
SQL>
-
drop database
刪掉資料庫準備做其它實驗:
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup mount restrict;
ORACLE instance started.
Total System Global Area 217157632 bytes
Fixed Size 2211928 bytes
Variable Size 159387560 bytes
Database Buffers 50331648 bytes
Redo Buffers 5226496 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@rhel6 orcl]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sun Jul 20 18:07:32 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1381217798, not open)
RMAN> drop database;
database name is "ORCL" and DBID is 1381217798
Do you really want to drop the database (enter YES or NO)? yes
database dropped
RMAN>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-1223247/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用RMAN複製資料庫 active database資料庫Database
- [Active Learning] Multi-Criteria-based Active Learning
- spring.profiles.active=@profiles.active@的含義Spring
- Active Record Associations
- The database owner SID recorded in the master database differs from the database owner SID recorded in database 'DB_NAME'DatabaseAST
- mysqldump: Error: Binlogging on server not activeMySqlErrorServer
- Oracle Database Cloud - Database as a Service Quick StartOracleDatabaseCloudUI
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- [擴充套件] hieu-le active 判斷導航元素的 active 狀態套件
- CSS E:active 選擇器CSS
- WebKit Insie: Active 樣式表WebKit
- [ABC163E] Active Infants
- Database TimeoutDatabase
- Database OverallDatabase
- database no shardingDatabase
- Oracle 12.2 使用Database Link優化Standby Database WorkloadOracleDatabase優化
- CSS 搞事技巧:hover+activeCSS
- Zabbix Agent active主動模式配置模式
- ORA-01153: an incompatible media recovery is active
- ORACLE database vaultOracleDatabase
- Relationship Database DesignDatabase
- 3.4 Quiescing a DatabaseUIDatabase
- idea--DatabaseIdeaDatabase
- Oracle clone databaseOracleDatabase
- database的connectDatabase
- Password is required when adding a database to AG group if the database has a master keyUIDatabaseAST
- ORA-16649: possible failover to another database prevents this database from beiAIDatabase
- vue 專案整合active控制元件Vue控制元件
- Zabbix Agent active主動模式監控模式
- onMounted is called when there is no active component 已解決
- Guide to Database as a Service (DBaaS)GUIIDEDatabase
- Oracle Database Scheduler整理OracleDatabase
- 3.4.1 About Quiescing a DatabaseUIDatabase
- 3.3 Shutting Down a DatabaseDatabase
- 3.2.2 Opening a Closed DatabaseDatabase
- 3.2.1 Mounting a Database to an InstanceDatabase
- 4.5.1.2 srvctl add databaseDatabase
- Laravel workflow with database and roleLaravelDatabase