国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開發(fā) > 綜合 > 正文

在兩機(jī)器間克隆數(shù)據(jù)庫(kù)的兩種方法

2024-07-21 02:06:24
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

關(guān)于克隆數(shù)據(jù)庫(kù)的方法,最近一直在研究,偶爾在cnoug上閑逛,發(fā)現(xiàn)了兩篇帖子不錯(cuò),現(xiàn)作為以后工作中的參考:

方法一:
如何使用rman在兩機(jī)器間克隆數(shù)據(jù)庫(kù)

原文摘自:www.cnoug.org

關(guān)鍵字:目標(biāo)、目錄、克隆、日志、

目標(biāo)數(shù)據(jù)庫(kù)和克隆數(shù)據(jù)庫(kù)分別在兩臺(tái)機(jī)器,其環(huán)境都一樣:

windows 2000 server sp4、ie6.1, oracle9205

在本文中,使用的是目標(biāo)數(shù)據(jù)庫(kù)上的rman,目錄數(shù)據(jù)庫(kù)在第3臺(tái)機(jī)器上,

操作步驟:

1、連接目標(biāo)數(shù)據(jù)庫(kù),對(duì)目標(biāo)數(shù)據(jù)庫(kù)做全庫(kù)備份

d:/oracle/bin>rman

恢復(fù)管理器: 版本9.2.0.5.0 - production

copyright (c) 1995, 2002, oracle corporation. all rights reserved.

rman> connect catalog rman/[email protected]

連接到恢復(fù)目錄數(shù)據(jù)庫(kù)

rman> connect target /

連接到目標(biāo)數(shù)據(jù)庫(kù): encore (dbid=3146513770)
rman> run
2> {allocate channel d1 type disk maxpiecesize = 500m;
3> backup full database
4> format 'e:/rmanbak/db_%d_%s_%p_%t';
5> release channel d1;
6> }

分配的通道: d1
通道 d1: sid=16 devtype=disk

啟動(dòng) backup 于 2004-06-28 21:03:31
通道 d1: 正在啟動(dòng) full 數(shù)據(jù)文件備份集
通道 d1: 正在指定備份集中的數(shù)據(jù)文件
在備份集中包含當(dāng)前的 spfile
備份集中包括當(dāng)前控制文件
輸入數(shù)據(jù)文件 fno=00001 name=d:/oracle/oradata/encore ystem01.dbf
輸入數(shù)據(jù)文件 fno=00002 name=d:/oracle/oradata/encore/undotbs01.dbf
輸入數(shù)據(jù)文件 fno=00005 name=d:/oracle/oradata/encore/example01.dbf
輸入數(shù)據(jù)文件 fno=00008 name=d:/oracle/oradata/encore/tools01.dbf
輸入數(shù)據(jù)文件 fno=00010 name=d:/oracle/oradata/encore/xdb01.dbf
輸入數(shù)據(jù)文件 fno=00006 name=d:/oracle/oradata/encore/indx01.dbf
輸入數(shù)據(jù)文件 fno=00009 name=d:/oracle/oradata/encore/users01.dbf
輸入數(shù)據(jù)文件 fno=00003 name=d:/oracle/oradata/encore/cwmlite01.dbf
輸入數(shù)據(jù)文件 fno=00004 name=d:/oracle/oradata/encore/drsys01.dbf
輸入數(shù)據(jù)文件 fno=00007 name=d:/oracle/oradata/encore/odm01.dbf
通道 d1: 正在啟動(dòng)段 1 于 2004-06-28 21:03:37
通道 d1: 已完成段 1 于 2004-06-28 21:05:02
段 handle=e:/rmanbak/db_encore_1_1_530053412 comment=none
通道 d1: 正在啟動(dòng)段 2 于 2004-06-28 21:05:02
通道 d1: 已完成段 2 于 2004-06-28 21:06:07
段 handle=e:/rmanbak/db_encore_1_2_530053412 comment=none
通道 d1: 備份集已完成, 經(jīng)過(guò)時(shí)間:00:02:35
完成 backup 于 2004-06-28 21:06:07

釋放的通道: d1

rman>

2、備份目標(biāo)數(shù)據(jù)庫(kù)的參數(shù)文件

sql> create pfile from spfile;

文件已創(chuàng)建

sql>

3、--將目標(biāo)數(shù)據(jù)庫(kù)的參數(shù)文件(第2步創(chuàng)建)拷貝到克隆機(jī)器上,修改相應(yīng)的參數(shù)(主要是實(shí)例名和
數(shù)據(jù)庫(kù)名,和bdump、udump、cdump 等后臺(tái)進(jìn)程的跟蹤文件存放的路徑,本文中,克隆數(shù)據(jù)庫(kù)
的實(shí)例名為 clone,數(shù)據(jù)庫(kù)名為 clone_db),然后在克隆機(jī)器上創(chuàng)建實(shí)例

d:/oracle/bin>oradim -new -sid clone -pfile d:/oracle/database/initclone.ora -intpwd sys1

d:/oracle/bin>


4、--修改克隆數(shù)據(jù)庫(kù)的監(jiān)聽器,增加對(duì)克隆數(shù)據(jù)庫(kù)的監(jiān)聽(第3段)

sid_list_listener =
(sid_list =
(sid_desc =
(sid_name = plsextproc)
(oracle_home = d:/oracle)
(program = extproc)
)
(sid_desc =
(global_dbname = oracle)
(oracle_home = d:/oracle)
(sid_name = oracle92)
)
(sid_desc =
(global_dbname = clone_db)
(oracle_home = d:/oracle)
(sid_name = clone)
)
)

5、修改rman機(jī)器上的tnsnames.ora文件,增加此連接串,保證rman使用此連接串能夠連接到
克隆數(shù)據(jù)庫(kù)的實(shí)例

clone =
(description =
(address_list =
(address = (protocol = tcp)(host = 192.168.0.194)(port = 1521))
)
(connect_data =
(service_name = clone_db)
)
)

5、將目標(biāo)數(shù)據(jù)庫(kù)的備份集拷貝到克隆數(shù)據(jù)庫(kù)機(jī)器的同一位置,并啟動(dòng)克隆數(shù)據(jù)庫(kù)(nomount 狀態(tài))

6、由于第1步驟中沒有備份日志,在使用

rman> run
2> {allocate auxiliary channel d1 type disk;
3> set newname for datafile 1 to 'f:/clone/data ystem01.dbf';

腳本克隆數(shù)據(jù)庫(kù)時(shí),出現(xiàn) no backup copy 之類的錯(cuò)誤,
之后補(bǔ)充備份目標(biāo)數(shù)據(jù)庫(kù)的日志,

rman> run
2> {allocate channel d1 type disk maxpiecesize = 500m;
3> backup archivelog all
4> format 'e:/rmanbak/log_%d_%s_%p_%t';
5> release channel d1;
6> }

分配的通道: d1
通道 d1: sid=11 devtype=disk

啟動(dòng) backup 于 2004-06-28 21:42:18
當(dāng)前日志已存檔
通道 d1: 正在啟動(dòng)存檔日志備份集
通道 d1: 正在指定備份集中的存檔日志
輸入存檔日志線程 =1 序列 =107 記錄 id=107 時(shí)間戳=528371132
輸入存檔日志線程 =1 序列 =108 記錄 id=108 時(shí)間戳=530053839
輸入存檔日志線程 =1 序列 =109 記錄 id=109 時(shí)間戳=530054855
輸入存檔日志線程 =1 序列 =110 記錄 id=110 時(shí)間戳=530055437
輸入存檔日志線程 =1 序列 =111 記錄 id=111 時(shí)間戳=530055540
輸入存檔日志線程 =1 序列 =112 記錄 id=112 時(shí)間戳=530055739
通道 d1: 正在啟動(dòng)段 1 于 2004-06-28 21:42:23
通道 d1: 已完成段 1 于 2004-06-28 21:42:26
段 handle=e:/rmanbak/log_encore_2_1_530055742 comment=none
通道 d1: 備份集已完成, 經(jīng)過(guò)時(shí)間:00:00:04
完成 backup 于 2004-06-28 21:42:26

釋放的通道: d1


7、將日志備份集拷貝到克隆機(jī)器的同一目錄后,回到rman處,連接輔助(克隆)數(shù)據(jù)庫(kù),
執(zhí)行腳本,剩下的rman自己會(huì)做


rman> connect auxiliary sys/[email protected]

已連接到備用數(shù)據(jù)庫(kù): clone_db (未安裝)

rman> run
2> {allocate auxiliary channel d1 type disk;
3> set newname for datafile 1 to 'f:/clone/data ystem01.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 datafile 6 to 'f:/clone/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 datafile 9 to 'f:/clone/data/users01.dbf';
12> set newname for datafile 10 to 'f:/clone/data/xdb01.dbf';
13> duplicate target database to clone_db
14> logfile
15> 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> }

分配的通道: d1
通道 d1: sid=8 devtype=disk

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

啟動(dòng) duplicate db 于 2004-06-28 21:43:51

正在打印存儲(chǔ)的腳本: memory script
{
set until scn 261688166;
set newname for datafile 1 to
"f:/clone/data ystem01.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";
restore
check readonly
clone database
;
}
正在執(zhí)行腳本: memory script

正在執(zhí)行命令: set until clause

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

正在執(zhí)行命令: set newname

啟動(dòng) restore 于 2004-06-28 21:43:54

通道 d1: 正在開始恢復(fù)數(shù)據(jù)文件備份集
通道 d1: 正在指定從備份集恢復(fù)的數(shù)據(jù)文件
正將數(shù)據(jù)文件00001恢復(fù)到f:/clone/data ystem01.dbf
正將數(shù)據(jù)文件00002恢復(fù)到f:/clone/data/undotbs01.dbf
正將數(shù)據(jù)文件00003恢復(fù)到f:/clone/data/cwmlite01.dbf
正將數(shù)據(jù)文件00004恢復(fù)到f:/clone/data/drsys01.dbf
正將數(shù)據(jù)文件00005恢復(fù)到f:/clone/data/example01.dbf
正將數(shù)據(jù)文件00006恢復(fù)到f:/clone/data/indx01.dbf
正將數(shù)據(jù)文件00007恢復(fù)到f:/clone/data/odm01.dbf
正將數(shù)據(jù)文件00008恢復(fù)到f:/clone/data/tools01.dbf
正將數(shù)據(jù)文件00009恢復(fù)到f:/clone/data/users01.dbf
正將數(shù)據(jù)文件00010恢復(fù)到f:/clone/data/xdb01.dbf
通道 d1: 已恢復(fù)備份段 1
段 handle=e:/rmanbak/db_encore_1_1_530053412 tag=tag20040628t210331 params=null
通道 d1: 已恢復(fù)備份段 2
段 handle=e:/rmanbak/db_encore_1_2_530053412 tag=tag20040628t210331 params=null
通道 d1: 恢復(fù)完成
完成 restore 于 2004-06-28 21:46:35
sql 語(yǔ)句: create controlfile reuse set database "clone_db" resetlogs archivelog
maxlogfiles 50
maxlogmembers 5
maxdatafiles 100
maxinstances 1
maxloghistory 226
logfile
group 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 10485760
datafile
'f:/clone/data ystem01.dbf'
character set zhs16gbk


正在打印存儲(chǔ)的腳本: memory script
{
switch clone datafile all;
}
正在執(zhí)行腳本: memory script

數(shù)據(jù)文件 2 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=1 stamp=530056505 文件名=f:/clone/data/undotbs01.dbf
數(shù)據(jù)文件 3 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=2 stamp=530056505 文件名=f:/clone/data/cwmlite01.dbf
數(shù)據(jù)文件 4 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=3 stamp=530056505 文件名=f:/clone/data/drsys01.dbf
數(shù)據(jù)文件 5 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=4 stamp=530056505 文件名=f:/clone/data/example01.dbf
數(shù)據(jù)文件 6 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=5 stamp=530056505 文件名=f:/clone/data/indx01.dbf
數(shù)據(jù)文件 7 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=6 stamp=530056505 文件名=f:/clone/data/odm01.dbf
數(shù)據(jù)文件 8 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=7 stamp=530056505 文件名=f:/clone/data/tools01.dbf
數(shù)據(jù)文件 9 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=8 stamp=530056505 文件名=f:/clone/data/users01.dbf
數(shù)據(jù)文件 10 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=9 stamp=530056505 文件名=f:/clone/data/xdb01.dbf

正在打印存儲(chǔ)的腳本: memory script
{
set until scn 261688166;
recover
clone database
delete archivelog
;
}
正在執(zhí)行腳本: memory script

正在執(zhí)行命令: set until clause

啟動(dòng) recover 于 2004-06-28 21:46:37

正在開始介質(zhì)的恢復(fù)

通道 d1: 正在啟動(dòng)到默認(rèn)目標(biāo)的存檔日志恢復(fù)
通道 d1: 正在恢復(fù)存檔日志
存檔日志線程 =1 序列=108
通道 d1: 正在恢復(fù)存檔日志
存檔日志線程 =1 序列=109
通道 d1: 正在恢復(fù)存檔日志
存檔日志線程 =1 序列=110
通道 d1: 正在恢復(fù)存檔日志
存檔日志線程 =1 序列=111
通道 d1: 正在恢復(fù)存檔日志
存檔日志線程 =1 序列=112
通道 d1: 已恢復(fù)備份段 1
段 handle=e:/rmanbak/log_encore_2_1_530055742 tag=tag20040628t214221 params=null
通道 d1: 恢復(fù)完成
存檔日志文件名 =f:/clone/log/arc00108.001 線程 =1 序列 =108
通道 clone_default: 正在刪除存檔日志
存檔日志文件名 =f:/clone/log/arc00108.001 記錄 id=3 時(shí)間戳 =530056510
存檔日志文件名 =f:/clone/log/arc00109.001 線程 =1 序列 =109
通道 clone_default: 正在刪除存檔日志
存檔日志文件名 =f:/clone/log/arc00109.001 記錄 id=4 時(shí)間戳 =530056510
存檔日志文件名 =f:/clone/log/arc00110.001 線程 =1 序列 =110
通道 clone_default: 正在刪除存檔日志
存檔日志文件名 =f:/clone/log/arc00110.001 記錄 id=5 時(shí)間戳 =530056510
存檔日志文件名 =f:/clone/log/arc00111.001 線程 =1 序列 =111
通道 clone_default: 正在刪除存檔日志
存檔日志文件名 =f:/clone/log/arc00111.001 記錄 id=2 時(shí)間戳 =530056510
存檔日志文件名 =f:/clone/log/arc00112.001 線程 =1 序列 =112
通道 clone_default: 正在刪除存檔日志
存檔日志文件名 =f:/clone/log/arc00112.001 記錄 id=1 時(shí)間戳 =530056510
完成介質(zhì)的恢復(fù)
完成 recover 于 2004-06-28 21:46:47

正在打印存儲(chǔ)的腳本: memory script
{
shutdown clone;
startup clone nomount ;
}
正在執(zhí)行腳本: memory script

數(shù)據(jù)庫(kù)已卸載
oracle 例程已關(guān)閉

已連接到備用數(shù)據(jù)庫(kù) (未啟動(dòng))
oracle 例程已啟動(dòng)

系統(tǒng)全局區(qū)域總計(jì) 319889436 字節(jié)

fixed size 454684 字節(jié)
variable size 109051904 字節(jié)
database buffers 209715200 字節(jié)
redo buffers 667648 字節(jié)
sql 語(yǔ)句: create controlfile reuse set database "clone_db" resetlogs archivelog
maxlogfiles 50
maxlogmembers 5
maxdatafiles 100
maxinstances 1
maxloghistory 226
logfile
group 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 10485760
datafile
'f:/clone/data ystem01.dbf'
character set zhs16gbk


正在打印存儲(chǔ)的腳本: 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/example01.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;
}
正在執(zhí)行腳本: memory script

已將數(shù)據(jù)文件副本列入目錄
數(shù)據(jù)文件副本 filename=f:/clone/data/undotbs01.dbf recid=1 stamp=530056530

已將數(shù)據(jù)文件副本列入目錄
數(shù)據(jù)文件副本 filename=f:/clone/data/cwmlite01.dbf recid=2 stamp=530056530

已將數(shù)據(jù)文件副本列入目錄
數(shù)據(jù)文件副本 filename=f:/clone/data/drsys01.dbf recid=3 stamp=530056531

已將數(shù)據(jù)文件副本列入目錄
數(shù)據(jù)文件副本 filename=f:/clone/data/example01.dbf recid=4 stamp=530056531

已將數(shù)據(jù)文件副本列入目錄
數(shù)據(jù)文件副本 filename=f:/clone/data/indx01.dbf recid=5 stamp=530056531

已將數(shù)據(jù)文件副本列入目錄
數(shù)據(jù)文件副本 filename=f:/clone/data/odm01.dbf recid=6 stamp=530056531

已將數(shù)據(jù)文件副本列入目錄
數(shù)據(jù)文件副本 filename=f:/clone/data/tools01.dbf recid=7 stamp=530056532

已將數(shù)據(jù)文件副本列入目錄
數(shù)據(jù)文件副本 filename=f:/clone/data/users01.dbf recid=8 stamp=530056532

已將數(shù)據(jù)文件副本列入目錄
數(shù)據(jù)文件副本 filename=f:/clone/data/xdb01.dbf recid=9 stamp=530056532

數(shù)據(jù)文件 2 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=1 stamp=530056530 文件名=f:/clone/data/undotbs01.dbf
數(shù)據(jù)文件 3 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=2 stamp=530056530 文件名=f:/clone/data/cwmlite01.dbf
數(shù)據(jù)文件 4 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=3 stamp=530056531 文件名=f:/clone/data/drsys01.dbf
數(shù)據(jù)文件 5 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=4 stamp=530056531 文件名=f:/clone/data/example01.dbf
數(shù)據(jù)文件 6 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=5 stamp=530056531 文件名=f:/clone/data/indx01.dbf
數(shù)據(jù)文件 7 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=6 stamp=530056531 文件名=f:/clone/data/odm01.dbf
數(shù)據(jù)文件 8 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=7 stamp=530056532 文件名=f:/clone/data/tools01.dbf
數(shù)據(jù)文件 9 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=8 stamp=530056532 文件名=f:/clone/data/users01.dbf
數(shù)據(jù)文件 10 已轉(zhuǎn)換成數(shù)據(jù)文件副本
輸入數(shù)據(jù)文件副本 recid=9 stamp=530056532 文件名=f:/clone/data/xdb01.dbf

正在打印存儲(chǔ)的腳本: memory script
{
alter clone database open resetlogs;
}
正在執(zhí)行腳本: memory script

數(shù)據(jù)庫(kù)已打開

rman>

--執(zhí)行此步驟需要注意:避免連接克隆數(shù)據(jù)庫(kù),否則,rman將無(wú)法正常關(guān)閉克隆數(shù)據(jù)庫(kù)
(shutdown clone),剩下的步驟無(wú)法繼續(xù)執(zhí)行。

8、測(cè)試克隆數(shù)據(jù)庫(kù)

d:/oracle/bin>sqlplus

sql*plus: release 9.2.0.5.0 - production on mon jun 28 22:01:46 2004

copyright (c) 1982, 2002, oracle corporation. all rights reserved.

enter user-name: sys/[email protected] as sysdba

connected to:
oracle9i enterprise edition release 9.2.0.5.0 - production
with the partitioning, oracle label security, olap and oracle data mining options
jserver release 9.2.0.5.0 - production

sql> select status from v$instance;

status
------------
open

sql> archive log list;
database log mode archive mode
automatic archival enabled
archive destination f:/clone/log
oldest online log sequence 0
next log sequence to archive 1
current log sequence 1
sql>


總結(jié):在兩臺(tái)機(jī)器間用rman克隆數(shù)據(jù)庫(kù),個(gè)人認(rèn)為,有兩點(diǎn)需要注意:

1、在對(duì)目標(biāo)數(shù)據(jù)庫(kù)做全庫(kù)備份時(shí),要注意同時(shí)備份日志,缺少此步驟,rman在克隆時(shí)將報(bào)no backup copy 之類的錯(cuò)誤.
2、要將目標(biāo)數(shù)據(jù)庫(kù)備份的備份集拷貝到克隆機(jī)器的同一個(gè)目錄(同備份目標(biāo)數(shù)據(jù)庫(kù)時(shí)備份集存放的目錄)下,否則,rman將報(bào):找不到xxxx備份集.


dbca是一款可以配置、管理和建立數(shù)據(jù)庫(kù)的工具。在初始數(shù)據(jù)庫(kù)安裝過(guò)程中,如果你選擇“建立一個(gè)數(shù)據(jù)庫(kù)選項(xiàng)(create a database option)”,這一工具就會(huì)啟動(dòng)并運(yùn)行。你可以建立一個(gè)基于模板的數(shù)據(jù)庫(kù),也可以從先前的范例中導(dǎo)入一個(gè)新的模板。
很多管理人員并不知道,只要在命令行中鍵入dbca這可以進(jìn)入到dbca環(huán)境。一旦這一工具啟動(dòng),你可以建立一個(gè)新的數(shù)據(jù)庫(kù),配置數(shù)據(jù)庫(kù)的init.ora選項(xiàng),刪除一個(gè)現(xiàn)有的數(shù)據(jù)庫(kù),或者管理數(shù)據(jù)庫(kù)模板。這些數(shù)據(jù)庫(kù)模板與安裝時(shí)生成的模板類似(比如general purpose, data warehouse,以及transaction processing)。

在安裝過(guò)程中,出現(xiàn)一個(gè)警示對(duì)話框以詢問(wèn)是否需要保存你的模板。你可以點(diǎn)擊no,或者可以在安裝時(shí)就人工定義你的數(shù)據(jù)庫(kù)。dbca工具能夠檢查數(shù)據(jù)庫(kù)設(shè)置并生成一個(gè)基于當(dāng)前操作系統(tǒng)的模板,甚至可以有選擇性地輸出當(dāng)前數(shù)據(jù)。這一特性就使得它成為將一個(gè)數(shù)據(jù)庫(kù)轉(zhuǎn)移到另一機(jī)器或者將一個(gè)數(shù)據(jù)庫(kù)嵌入到其它有價(jià)值產(chǎn)品的優(yōu)秀工具。

dbca工具將模板存儲(chǔ)在一個(gè)以.dbc擴(kuò)展名的文件。一個(gè).dbc文件包含init.ora參數(shù)、位置數(shù)據(jù)文件、日志文件、以及數(shù)據(jù)庫(kù)中以xml格式的控制文件的列表。如果你選擇包含你的數(shù)據(jù)庫(kù)數(shù)據(jù),這一工具也會(huì)生成一個(gè)擴(kuò)展名為.dbj的文件,即一個(gè)包含你的數(shù)據(jù)文件的圖像的zip壓縮文件。有些用戶會(huì)想到建立所有這些設(shè)置的一個(gè)備份,以避免在一個(gè)新機(jī)器上重新建立一個(gè)數(shù)據(jù)庫(kù)的必要。

方法二:
使用dbca克隆一個(gè)數(shù)據(jù)庫(kù)

有很多變量允許dbca為oracle軟件將文件安裝到合適的路徑,比如{oracle_base}以及{db_name}。由于這些只是簡(jiǎn)單的xml,可以使用一個(gè)diff函數(shù)快速查看這些模板之間的差別。例如,general purpose 和 data warehouse數(shù)據(jù)庫(kù)模板之間的差別是在于oracle 9i 9.2.0.0的data warehouse模板:

temp tablespace小于1m.

init.ora參數(shù)包括:

star_transformation_enabled被激活。

pga_aggregate_target比較在。

query_rewrite_enabled被激活。

db_file_multiblock_read_count為雙倍。

sort_area_size為雙倍。

hash_area_size沒有被設(shè)置。

db_cache_size比較小。

對(duì)于transaction processing模板,差別在于:

oracle olap選項(xiàng)沒有被激活。

init.ora參數(shù)包括:

db_block_size為一半。

undo_retention比較小。

pga_aggregate_target比較小。

db_file_multiblock_read_count為一半。

hash_join_enabled被關(guān)閉。

db_cache_size比較大。

無(wú)需建立一個(gè)cwmlite tablespace(因?yàn)閛lap選項(xiàng)已經(jīng)被關(guān)閉)。

example 和 system tablespaces比較小。

temp tablespace為雙倍大小。

當(dāng)你使用dbca工具從數(shù)據(jù)庫(kù)中輸出數(shù)據(jù)時(shí),dbca將生成一個(gè)以.dfj擴(kuò)展名的文件,即一個(gè)包含每一數(shù)據(jù)文件的源圖像的zip壓縮文件。這就意味著這些數(shù)據(jù)在轉(zhuǎn)移過(guò)程中保證了安全性。然而,這些文件并沒有很好被exp和imp文檔化和支持。同樣,這些圖像絕大多數(shù)直接寫入到磁盤,而不是類似于imp的通過(guò)sql寫入。


收集最實(shí)用的網(wǎng)頁(yè)特效代碼!

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 扬州市| 大理市| 梅河口市| 崇仁县| 城步| 枝江市| 茂名市| 安泽县| 溆浦县| 龙陵县| 乌什县| 潞城市| 定南县| 梨树县| 喀喇沁旗| 棋牌| 潞西市| 嘉鱼县| 临沭县| 大庆市| 定襄县| 青岛市| 镇坪县| 福安市| 玉屏| 孝昌县| 凤冈县| 白水县| 旺苍县| 万荣县| 寿光市| 金乡县| 郓城县| 阜新市| 福海县| 兴安县| 永春县| 江陵县| 梁山县| 庆元县| 长岛县|