RMAN复制数据库

Oracle9i初始化参数中文说明

一、手工创建辅助实例
1
。创建密码文件
orapwd file=F:oracleproduct10.1.0em_1databasePWDaux1.ora password=liang
2.
创建参数文件initaux1.ora
DB_NAME=test(
注:与源数据库的db_name相同)
DB_UNIQUE_NAME=aux1_test
(注:需要唯一名字)
sga_target=250000000
(需要足够大,否则出现ora-4031错误。当sga_target为默认值时,依然出现ORA-04031: unable to allocate 100 bytes of shared memory ("shared
pool","declare fullname varchar2 ( ...","PL/SQL MPCODE","Machine Code Part Holder")

CONTROL_FILES="F:oracleproduct10.1.0oradataaux1control01.ctl"
REMOTE_LOGIN_PASSWORDFILE=exclusive
COMPATIBLE =10.2.0.1.0
DB_BLOCK_SIZE=8192
指定辅助集文件的位置:
db_file_name_convert=("F:oracleproduct10.1.0oradatatest", "F:oracleproduct10.1.0oradataaux1")
log_file_name_convert=("F:oracleproduct10.1.0oradatatest", "F:oracleproduct10.1.0oradataaux1")
3
。创建oracle实例aux1
oradim -new -sid aux1
以上是创建辅助实例的过程,创建好后可以用rman 连接(必须事先做好rman全备份)

二。
Microsoft Windows XP [
版本 5.1.2600]
(C)
版权所有 1985-2001 Microsoft Corp.

C:Documents and Settingsliang>set oracle_sid=aux1(用操作系统认证,需设置该环境变量)

C:Documents and Settingsliang>rman target sys/liang@test auxiliary /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jan 30 19:13:16 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: TEST (DBID=1911386690)
connected to auxiliary database: TEST (not mounted)


Recovery Manager complete.

C:Documents and Settingsliang>set oracle_sid=aux1

C:Documents and Settingsliang>rman target sys/liang@test auxiliary /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jan 30 22:46:03 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: TEST (DBID=1911386690)
connected to auxiliary database: AUX1 (not mounted)

RMAN> run{
2> ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
3> DUPLICATE TARGET DATABASE TO aux1
4> LOGFILE
5> 'F:oracleproduct10.1.0oradataux1redo01a.log' SIZE 16000K,
6> 'F:oracleproduct10.1.0oradataux1redo02a.log' SIZE 16000K,
7> 'F:oracleproduct10.1.0oradataux1redo03a.log' SIZE 16000K;
8> }

using target database control file instead of recovery catalog
allocated channel: aux1
channel aux1: sid=157 devtype=DISK

Starting Duplicate Db at 2007-01-30 22:46:12

contents of Memory Script:
{
set until scn 498379;
set newname for datafile 1 to
"F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSTEM01.DBF";
set newname for datafile 2 to
"F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF";
set newname for datafile 3 to
"F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF";
restore
check readonly
clone database
;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 2007-01-30 22:46:14

channel aux1: starting datafile backupset restore
channel aux1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSTEM01.DBF
restoring datafile 00002 to F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF
restoring datafile 00003 to F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF
channel aux1: reading from backup piece F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTBACKUPSET2007_01_30O1_MF_NNNDF_TAG20070130T170959_2VY2V889_.BKP
channel aux1: restored backup piece 1
piece handle=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTBACKUPSET2007_01_30O1_MF_NNNDF_TAG20070130T170959_2VY2V889_.BKP tag=TAG20070130T170959
channel aux1: restore complete, elapsed time: 00:00:55
Finished restore at 2007-01-30 22:47:09
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUX1" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 'F:oracleproduct10.1.0oradataux1redo01a.log' SIZE 16000 K ,
GROUP 2 'F:oracleproduct10.1.0oradataux1redo02a.log' SIZE 16000 K ,
GROUP 3 'F:oracleproduct10.1.0oradataux1redo03a.log' SIZE 16000 K
DATAFILE
'F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSTEM01.DBF'
CHARACTER SET ZHS16GBK


contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script

datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=613262831 filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=613262831 filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF

contents of Memory Script:
{
set until scn 498379;
recover
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 2007-01-30 22:47:10

starting media recovery

archive log thread 1 sequence 24 is already on disk as file F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_24_2VY31OJ3_.ARC
archive log thread 1 sequence 25 is already on disk as file F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_25_2VY31RXS_.ARC
archive log thread 1 sequence 26 is already on disk as file F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_26_2VY31Y1Y_.ARC
archive log thread 1 sequence 27 is already on disk as file F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_27_2VYB48KL_.ARC
archive log filename=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_24_2VY31OJ3_.ARC thread=1 sequence=24
archive log filename=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_25_2VY31RXS_.ARC thread=1 sequence=25
archive log filename=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_26_2VY31Y1Y_.ARC thread=1 sequence=26
archive log filename=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_27_2VYB48KL_.ARC thread=1 sequence=27
media recovery complete, elapsed time: 00:00:06
Finished recover at 2007-01-30 22:47:18

contents of Memory Script:
{
shutdown clone;
startup clone nomount ;
}
executing Memory Script

database dismounted
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 251658240 bytes

Fixed Size 1248356 bytes
Variable Size 79692700 bytes
Database Buffers 163577856 bytes
Redo Buffers 7139328 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUX1" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 'F:oracleproduct10.1.0oradataux1redo01a.log' SIZE 16000 K ,
GROUP 2 'F:oracleproduct10.1.0oradataux1redo02a.log' SIZE 16000 K ,
GROUP 3 'F:oracleproduct10.1.0oradataux1redo03a.log' SIZE 16000 K
DATAFILE
'F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSTEM01.DBF'
CHARACTER SET ZHS16GBK


contents of Memory Script:
{
set newname for tempfile 1 to
"F:ORACLEPRODUCT10.1.0ORADATAAUX1TEMP01.DBF";
switch clone tempfile all;
catalog clone datafilecopy "F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF";
catalog clone datafilecopy "F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF";
switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to F:ORACLEPRODUCT10.1.0ORADATAAUX1TEMP01.DBF in control file

cataloged datafile copy
datafile copy filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF recid=1 stamp=613262847

cataloged datafile copy
datafile copy filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF recid=2 stamp=613262847

datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=613262847 filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=613262847 filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF

contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/30/2007 22:47:29
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database: ORA-00344: unable to re-create online log 'F:ORACLEPRODUCT10.1.0ORADATAUX1REDO01A.LOG'
ORA-27040: file create error, unable to create file
OSD-04002: unable to open file
O/S-Error: (OS 3) ???????????
'F:ORACLEPRODUCT10.1.0ORADATAUX1REDO01A.LOG'写错了ORADATAUX1应为ORADATAAUX1

RMAN>低级错误,折腾一晚上!!!!!!!!!!

Recovery Manager complete.

C:Documents and Settingsliang>set oracle_sid=aux1

C:Documents and Settingsliang>rman target sys/liang@test auxiliary /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jan 30 22:53:37 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: TEST (DBID=1911386690)
connected to auxiliary database: AUX1 (not mounted)

RMAN> run{
2> ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
3> DUPLICATE TARGET DATABASE TO aux1
4> LOGFILE
5> 'F:oracleproduct10.1.0oradataaux1redo01a.log' SIZE 16000K,
6> 'F:oracleproduct10.1.0oradataaux1redo02a.log' SIZE 16000K,
7> 'F:oracleproduct10.1.0oradataaux1redo03a.log' SIZE 16000K;
8> }

using target database control file instead of recovery catalog
allocated channel: aux1
channel aux1: sid=157 devtype=DISK

Starting Duplicate Db at 2007-01-30 22:53:49

contents of Memory Script:
{
set until scn 498379;
set newname for datafile 1 to
"F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSTEM01.DBF";
set newname for datafile 2 to
"F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF";
set newname for datafile 3 to
"F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF";
restore
check readonly
clone database
;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 2007-01-30 22:53:50

channel aux1: starting datafile backupset restore
channel aux1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSTEM01.DBF
restoring datafile 00002 to F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF
restoring datafile 00003 to F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF
channel aux1: reading from backup piece F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTBACKUPSET2007_01_30O1_MF_NNNDF_TAG20070130T170959_2VY2V889_.BKP
channel aux1: restored backup piece 1
piece handle=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTBACKUPSET2007_01_30O1_MF_NNNDF_TAG20070130T170959_2VY2V889_.BKP tag=TAG20070130T170959
channel aux1: restore complete, elapsed time: 00:00:55
Finished restore at 2007-01-30 22:54:45
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUX1" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 'F:oracleproduct10.1.0oradataaux1redo01a.log' SIZE 16000 K ,
GROUP 2 'F:oracleproduct10.1.0oradataaux1redo02a.log' SIZE 16000 K ,
GROUP 3 'F:oracleproduct10.1.0oradataaux1redo03a.log' SIZE 16000 K
DATAFILE
'F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSTEM01.DBF'
CHARACTER SET ZHS16GBK


contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script

datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=613263288 filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=613263288 filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF

contents of Memory Script:
{
set until scn 498379;
recover
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 2007-01-30 22:54:47

starting media recovery

archive log thread 1 sequence 24 is already on disk as file F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_24_2VY31OJ3_.ARC
archive log thread 1 sequence 25 is already on disk as file F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_25_2VY31RXS_.ARC
archive log thread 1 sequence 26 is already on disk as file F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_26_2VY31Y1Y_.ARC
archive log thread 1 sequence 27 is already on disk as file F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_27_2VYB48KL_.ARC
archive log filename=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_24_2VY31OJ3_.ARC thread=1 sequence=24
archive log filename=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_25_2VY31RXS_.ARC thread=1 sequence=25
archive log filename=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_26_2VY31Y1Y_.ARC thread=1 sequence=26
archive log filename=F:ORACLEPRODUCT10.1.0FLASH_RECOVERY_AREATESTARCHIVELOG2007_01_30O1_MF_1_27_2VYB48KL_.ARC thread=1 sequence=27
media recovery complete, elapsed time: 00:00:06
Finished recover at 2007-01-30 22:54:56

contents of Memory Script:
{
shutdown clone;
startup clone nomount ;
}
此处需注意,要关闭所有连接,否则会挂起!!!!!!executing Memory Script

database dismounted
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 251658240 bytes

Fixed Size 1248356 bytes
Variable Size 79692700 bytes
Database Buffers 163577856 bytes
Redo Buffers 7139328 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUX1" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 'F:oracleproduct10.1.0oradataaux1redo01a.log' SIZE 16000 K ,
GROUP 2 'F:oracleproduct10.1.0oradataaux1redo02a.log' SIZE 16000 K ,
GROUP 3 'F:oracleproduct10.1.0oradataaux1redo03a.log' SIZE 16000 K
DATAFILE
'F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSTEM01.DBF'
CHARACTER SET ZHS16GBK


contents of Memory Script:
{
set newname for tempfile 1 to
"F:ORACLEPRODUCT10.1.0ORADATAAUX1TEMP01.DBF";
switch clone tempfile all;
catalog clone datafilecopy "F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF";
catalog clone datafilecopy "F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF";
switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to F:ORACLEPRODUCT10.1.0ORADATAAUX1TEMP01.DBF in control file

cataloged datafile copy
datafile copy filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF recid=1 stamp=613263302

cataloged datafile copy
datafile copy filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF recid=2 stamp=613263303

datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=613263302 filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1UNDOTBS01.DBF
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=613263303 filename=F:ORACLEPRODUCT10.1.0ORADATAAUX1SYSAUX01.DBF

contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 2007-01-30 22:55:24

RMAN>


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/92530/viewspace-128033/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/92530/viewspace-128033/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值