- 浏览: 302832 次
最新评论
-
com_xpp:
思创工作一年小结 -
aijuans1:
思创
思创工作一年小结 -
mixer_a:
一切都是对象
JavaScript 也可以面向对象 -
dyllove98:
不错,面向对象就容易阅读和理解
JavaScript 也可以面向对象 -
spyker:
楼主男人女人?
舞蹈和编程的一点乱想
RMAN 备份异机恢复 并创建新DBID
测试平台信息:
Oracle:11gR2
操作系统:Redhat 5.5
Target DB:dave
几点说明:
(1)RMAN 异机恢复的时候,db_name必须相同。 如果说要想改成其他的实例名,可以在恢复成功后,用nid 命令修改。 实例名的信息会记录到控制文件里,所以如果在恢复的时候,如果实例名不一致,恢复的时候会报错。
(2)如果恢复的路径和源库不一致,就需要在restore时用set 命令指定新位置。 并且使用switch datafile all将信息更新的到控制文件。
在做duplicate的时候,RMAN 会自动根据pfile中的log_file_name_convert和db_file_name_convert来进行set 的转换。 手工restore时,只能只只能使用set 命令。
(3)异机恢复对相同目录和不同目录都做了说明。
(4)最后测试了NID 修改DBID 和DBNAME.
一. Target 库准备工作:
1. 查询DBID
SQL> select name,dbid from v$database;
NAME DBID
--------- ----------
DAVE 808234286
2. 备份DB
关于RMAN 的shell 备份脚本,参考:
Nocatalog 下的RMAN 增量备份 shell脚本
http://blog.csdn.net/tianlesoftware/archive/2011/01/26/6164931.aspx
在这里我用0级和1级备份了下DB。
[oracle@qs-dmm-rh1 backup]$ ls
arch_0pm6qt8q_1_1_20110309 dave_lev0_0jm6qt77_1_1_20110309 dave_lev1_0um6qtcq_1_1_20110309
arch_0qm6qt8q_1_1_20110309 dave_lev0_0km6qt77_1_1_20110309 dave_lev1_0vm6qtcq_1_1_20110309
arch_13m6qtda_1_1_20110309 dave_lev0_0lm6qt77_1_1_20110309 dave_lev1_11m6qtd7_1_1_20110309
arch_14m6qtda_1_1_20110309 dave_lev0_0nm6qt7c_1_1_20110309 dave_spfile_16m6qtde_1_1_20110309
ctl_file_15m6qtdc_1_1_20110309 dave_lev1_0tm6qtcq_1_1_20110309
二. Auxiliary库准备工作:
1. 创建口令文件
[oracle@qs-dmm-rh2 trace]$ orapwd file=?/dbs/orapwdave password=oracle
2. 创建相关的目录
[oracle@qs-dmm-rh2 u01]$ mkdir oradata
[oracle@qs-dmm-rh2 oradata]$ pwd
/u01/oradata
3. 创建初始化参数
将Target 库的pfile 文件copy过来。
也可以使用RMAN 从我们Target库的备份集中恢复,因为我们之前备份过spfile。不过使用RMAN, DB要先启动到nomout 状态。 这个可以用默认的init.ora 来启动。
[oracle@qs-dmm-rh2 backup]$ export ORACLE_SID=dave
[oracle@qs-dmm-rh2 backup]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Mar 11 15:11:31 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DAVE (not mounted)
RMAN> restore spfile to pfile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initdave2.ora' from '/u01/backup/dave_spfile_16m6qtde_1_1_20110309';
Starting restore at 11-MAR-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /u01/backup/dave_spfile_16m6qtde_1_1_20110309
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 11-MAR-11
如果修改数据文件保存的位置,那么要修改控制文件的相关的参数:
*.control_files='/u01/oradata/control01.ctl','/u01/oradata/control02.ctl','/u01/oradata/control03.ctl'
*.db_name='dave'
4. 将用pfile将Auxiliary库启动到nomout 状态
SQL> startup nomount pfile=?/dbs/initdave.ora
5. 恢复控制文件
[oracle@qs-dmm-rh2 dbs]$ export ORACLE_SID=dave
[oracle@qs-dmm-rh2 dbs]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Mar 11 15:25:55 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DAVE (not mounted)
RMAN> restore controlfile from '/u01/backup/ctl_file_15m6qtdc_1_1_20110309';
Starting restore at 11-MAR-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/oradata/control01.ctl
output file name=/u01/oradata/control02.ctl
output file name=/u01/oradata/control03.ctl
Finished restore at 11-MAR-11
restore 的时候需要控制文件,控制文件恢复的位置,是我们在pfile中的control_files参数控制的。
6. 将DB 启动到mout状态
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
7. restore 数据库
7.1 恢复目录不同的情况:
因为我们的路径不同,所以我们需要使用set 命令转换一下路径。
到Target 库查询一下:
SQL> select file_id,file_name from dba_data_files;
FILE_ID FILE_NAME
---------- -------------------------------------------
4 /u01/app/oracle/oradata/dave/users01.dbf
3 /u01/app/oracle/oradata/dave/undotbs01.dbf
2 /u01/app/oracle/oradata/dave/sysaux01.dbf
1 /u01/app/oracle/oradata/dave/system01.dbf
SQL> select file_id,file_name from dba_temp_files;
FILE_ID FILE_NAME
---------- ------------------------------------------
1 /u01/app/oracle/oradata/dave/temp01.dbf
注意,restore 的时候不会对temp 表空间进行restore。所以等restore 之后,我们需要手工创建temp表空间。
RMAN> run
2> {
set newname for datafile 1 to "/u01/oradata/system01.dbf";
3> 4> set newname for datafile 2 to "/u01/oradata/sysaux01.dbf";
5> set newname for datafile 3 to "/u01/oradata/undotbs01.dbf";
6> set newname for datafile 4 to "/u01/oradata/users01.dbf";
7> restore database;
8> switch datafile all;
9> }
对switch datafile all的说明:
--对于nocatalog 模式下,rman备份的信息是保存在控制文件里的,包括文件的路径信息。 这里的switch datafile all的作用,就是更新控制文件里的信息。
executing command: SET NEWNAME
released channel: ORA_DISK_1
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 11-MAR-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to /u01/oradata/undotbs01.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev0_0lm6qt77_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/dave_lev0_0lm6qt77_1_1_20110309 tag=DAVE_LEV0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to /u01/oradata/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev0_0nm6qt7c_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/dave_lev0_0nm6qt7c_1_1_20110309 tag=DAVE_LEV0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to /u01/oradata/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev0_0km6qt77_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/dave_lev0_0km6qt77_1_1_20110309 tag=DAVE_LEV0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/oradata/system01.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev0_0jm6qt77_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/dave_lev0_0jm6qt77_1_1_20110309 tag=DAVE_LEV0
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 11-MAR-11
datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=745522150 file name=/u01/oradata/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=6 STAMP=745522150 file name=/u01/oradata/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=745522150 file name=/u01/oradata/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=745522150 file name=/u01/oradata/users01.dbf
7.2 恢复目录相同
这种情况比较简单,直接:
RMAN> restore database;
8. recover DB
RMAN> recover database;
Starting recover at 11-MAR-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /u01/oradata/system01.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev1_0tm6qtcq_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/dave_lev1_0tm6qtcq_1_1_20110309 tag=DAVE_LEV1
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: /u01/oradata/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev1_0um6qtcq_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/dave_lev1_0um6qtcq_1_1_20110309 tag=DAVE_LEV1
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00003: /u01/oradata/undotbs01.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev1_0vm6qtcq_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/dave_lev1_0vm6qtcq_1_1_20110309 tag=DAVE_LEV1
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00004: /u01/oradata/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev1_11m6qtd7_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/dave_lev1_11m6qtd7_1_1_20110309 tag=DAVE_LEV1
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
starting media recovery
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_DISK_1: reading from backup piece /u01/backup/arch_13m6qtda_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/arch_13m6qtda_1_1_20110309 tag=ARC_BAK
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_7_745352047.dbf thread=1 sequence=7
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_DISK_1: reading from backup piece /u01/backup/arch_14m6qtda_1_1_20110309
channel ORA_DISK_1: piece handle=/u01/backup/arch_14m6qtda_1_1_20110309 tag=ARC_BAK
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch1_8_745352047.dbf thread=1 sequence=8
unable to find archived log
archived log thread=1 sequence=9
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/11/2011 17:32:00
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 9 and starting SCN of 823627
RMAN>
之后会报一个错误:
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 9 and starting SCN of 823627
这里是提醒恢复到一个未知的scn号。在alter database mount之后,通过set until scn或者set until time命令设置恢复到的scn号或时间。就可以避免这个错误。
9. 用open resetlogs 打开数据库
SQL> alter database open resetlogs;
Database altered.
我测试的平台是11gR2的版本,在open resetlogs 之后,自动在原来默认的路径创建了temp 表空间和3组redo 文件。
如果恢复目录和原来相同,就不用修改。
如果目录不同,我们就需要把这些文件移到我们现在的data目录。
源目录:
[oracle@qs-dmm-rh2 dave]$ pwd
/u01/app/oracle/oradata/dave
[oracle@qs-dmm-rh2 dave]$ ls
redo01.log redo02.log redo03.log temp01.dbf
现在的目录:
[oracle@qs-dmm-rh2 dave]$ cd /u01/oradata/
[oracle@qs-dmm-rh2 oradata]$ ls
control01.ctl control02.ctl control03.ctl sysaux01.dbf system01.dbf undotbs01.dbf users01.dbf
(1)处理online redo log
SQL> select group#,bytes/1024/1024||'M',status from v$log;
GROUP# BYTES/1024/1024||'M' STATUS
---------- ----------------------------------------- ----------------
1 50M INACTIVE
2 50M CURRENT
3 50M UNUSED
SQL> select group#,member from v$logfile;
GROUP# MEMBER
---------- ---------------------------------------------------------------------
3 /u01/app/oracle/oradata/dave/redo03.log
2 /u01/app/oracle/oradata/dave/redo02.log
1 /u01/app/oracle/oradata/dave/redo01.log
oracle 至少有2组redo log。 所以我们可以将已经完成归档的redo drop掉, 重新创建。
SQL> alter database drop logfile group 3;
Database altered.
SQL> alter database add logfile group 3 ('/u01/oradata/redo03.log') size 50m;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> select group#,bytes/1024/1024||'M',status from v$log;
GROUP# BYTES/1024/1024||'M' STATUS
---------- ----------------------------------------- ----------------
1 50M INACTIVE
2 50M ACTIVE
3 50M CURRENT
SQL> alter database drop logfile group 1;
Database altered.
SQL> alter database add logfile group 1 ('/u01/oradata/redo01.log') size 50m;
Database altered.
SQL> alter system switch logfile;
System altered.
SQL> alter database drop logfile group 2;
Database altered.
SQL> alter database add logfile group 2 ('/u01/oradata/redo02.log') size 50m;
Database altered.
SQL> select group#,member from v$logfile;
GROUP# MEMBER
---------- ---------------------------------------------------------------------
3 /u01/oradata/redo03.log
2 /u01/oradata/redo02.log
1 /u01/oradata/redo01.log
(2)处理temp 临时表空间
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/dave/temp01.dbf
--表空间offline
SQL> alter database tempfile '/u01/app/oracle/oradata/dave/temp01.dbf' offline;
Database altered.
--在OS 级别移动temp 的数据文件
SQL> !mv /u01/app/oracle/oradata/dave/temp01.dbf /u01/oradata/temp01.dbf
--修改控制文件中temp文件的信息
SQL> alter database rename file '/u01/app/oracle/oradata/dave/temp01.dbf' to '/u01/oradata/temp01.dbf';
Database altered.
--temp 表空间online
SQL> alter database tempfile '/u01/oradata/temp01.dbf' online;
Database altered.
--验证
SQL> select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/u01/oradata/temp01.dbf
10. NID 修改DBID和DBNAME
先查看,这个和我们之前的一样
SQL> select name,dbid from v$database;
NAME DBID
--------- ----------
DAVE 808234286
几点说明:
(1)在修改DBID期间仍然可能会遇到不可恢复的错误。所以修改之前备份数据库,特使是控制文件。因为nid 会修改控制文件中的信息。
(2)需要将DB 启动到mount 状态才能修改。
SQL> shutdown immediate
SQL> startup mount;
在执行NID 命令之前:一定要关闭所有的session连接。
nid 命令到执行的最后会关闭数据库,如果有session 连接,就会阻止这个操作,修改dbid就会被挂死。如果中断这个操作。修改就会失败,数据库就不能mount。需要恢复。
(1)只改DBID, 不改db_name
[oracle@qs-dmm-rh2 trace]$ nid target=sys/oracle
DBNEWID: Release 11.2.0.1.0 - Production on Fri Mar 11 18:36:33 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to database DAVE (DBID=808234286)
Connected to server version 11.2.0
Control Files in database:
/u01/oradata/control01.ctl
/u01/oradata/control02.ctl
/u01/oradata/control03.ctl
Change database ID of database DAVE? (Y/[N]) => y
Proceeding with operation
Changing database ID from 808234286 to 808418162
Control File /u01/oradata/control01.ctl - modified
Control File /u01/oradata/control02.ctl - modified
Control File /u01/oradata/control03.ctl - modified
Datafile /u01/app/oracle/oradata/dave/system01.db - dbid changed
Datafile /u01/app/oracle/oradata/dave/sysaux01.db - dbid changed
Datafile /u01/app/oracle/oradata/dave/undotbs01.db - dbid changed
Datafile /u01/app/oracle/oradata/dave/users01.db - dbid changed
Datafile /u01/app/oracle/oradata/dave/temp01.db - dbid changed
Control File /u01/oradata/control01.ctl - dbid changed
Control File /u01/oradata/control02.ctl - dbid changed
Control File /u01/oradata/control03.ctl - dbid changed
Instance shut down
Database ID for database DAVE changed to 808418162.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database ID.
DBNEWID - Completed succesfully.
重启打开数据库:
[oracle@qs-dmm-rh2 ~]$ export ORACLE_SID=dave
[oracle@qs-dmm-rh2 ~]$ sqlplus / as sysdba;
SQL*Plus: Release 11.2.0.1.0 Production on Fri Mar 11 18:37:57 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 196681728 bytes
Fixed Size 1335444 bytes
Variable Size 83890028 bytes
Database Buffers 109051904 bytes
Redo Buffers 2404352 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
SQL> alter database open resetlogs;
Database altered.
SQL> select name,dbid from v$database;
NAME DBID
--------- ----------
DAVE 808418162
SQL>
(2)修改DBID 和DB_NAME
注意一点,修改DB_NAME 之前,要将spfile 创建成pfile,因为修改dbname之后,原来的参数文件就没用了。所以要保证最新的参数。 还有修改DB_NAME的值为最新值。 修改完之后,然后用这个新参数启动DB.
[oracle@qs-dmm-rh2 trace]$ nid target=sys/oracle dbname=anqing
DBNEWID: Release 11.2.0.1.0 - Production on Fri Mar 11 18:41:01 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to database DAVE (DBID=808418162)
Connected to server version 11.2.0
Control Files in database:
/u01/oradata/control01.ctl
/u01/oradata/control02.ctl
/u01/oradata/control03.ctl
Change database ID and database name DAVE to DBA? (Y/[N]) => y
Proceeding with operation
Changing database ID from 808418162 to 1204743549
Changing database name from DAVE to DBA
Control File /u01/oradata/control01.ctl - modified
Control File /u01/oradata/control02.ctl - modified
Control File /u01/oradata/control03.ctl - modified
Datafile /u01/app/oracle/oradata/dave/system01.db - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/dave/sysaux01.db - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/dave/undotbs01.db - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/dave/users01.db - dbid changed, wrote new name
Datafile /u01/app/oracle/oradata/dave/temp01.db - dbid changed, wrote new name
Control File /u01/oradata/control01.ctl - dbid changed, wrote new name
Control File /u01/oradata/control02.ctl - dbid changed, wrote new name
Control File /u01/oradata/control03.ctl - dbid changed, wrote new name
Instance shut down
Database name changed to DBA.
Modify parameter file and generate a new password file before restarting.
Database ID for database DBA changed to 1204743549.
All previous backups and archived redo logs for this database are unusable.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
验证:
SQL> select name,dbid from v$database;
NAME DBID
--------- ----------
ANQING 676458969
---------------------------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
网上资源: http://tianlesoftware.download.csdn.net
相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
DBA1 群:62697716(满); DBA2 群:62697977(满) DBA3 群:62697850(满)
DBA 超级群:63306533(满); DBA4 群: 83829929 DBA5群: 142216823
聊天 群:40132017
--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请
相关推荐
- 安装相同版本的Oracle数据库软件,并创建必要的目录结构。 - 设置目标实例的参数文件`init<dbname>.ora`,例如: ```bash *.db_name='xzdb' *.enable_pluggable_database=true ``` - 这些步骤确保了目标...
3. **参数文件的恢复:** 在目标服务器上启动数据库到nomount状态,并通过RMAN命令恢复参数文件,如: ``` $ export ORACLE_SID=ora11 $ RMAN TARGET/ (nocatalog下) RMAN> SET DBID 840418022; RMAN> STARTUP ...
服务器A运行着名为ERPDATA的数据库,我们的目标是将其复制到服务器B,并使用服务器C作为RMAN的备份恢复环境。 **准备工作** 1. 在服务器B上安装与服务器A相同版本的Oracle 10g软件,并创建一个新的数据库,也命名...
以下是对RMAN备份与恢复的详细解析,特别是异机恢复的过程。 首先,异机恢复主要涉及到全备的情况,这意味着在目标机器上恢复整个数据库,而不是部分数据。在执行此操作时,源数据库和服务目标数据库的SID必须保持...
RMAN (Recovery Manager) 是...了解并熟练掌握以上RMAN备份概念和操作,将使你能够更有效地管理和保护你的Oracle数据库,确保在数据丢失时能迅速恢复。同时,记得定期测试备份的完整性和恢复过程,以验证备份的有效性。
恢复到异机** 当需要将数据恢复到不同的机器上时,可以使用 `duplicate` 命令来创建一个新的数据库实例。 ### 结论 通过上述内容,我们可以看到RMAN作为Oracle数据库的重要工具,不仅提供了强大的备份和恢复能力...
4. **RMAN备份源库**: 使用RMAN对源数据库执行完整备份,包括数据文件、控制文件、redo logs等。例如,`RUN { BACKUP DATABASE PLUS ARCHIVELOG; }` 5. **添加配置监听**: 确保源库和辅助库之间的网络连接畅通...
Oracle RMAN 备份恢复详细指南 本篇文章将详细介绍 Oracle RMAN 备份恢复的完整过程,包括连接本地数据库、连接远程数据库、启动和关闭数据库、备份和恢复数据库等内容。通过本篇文章,读者将能够掌握 RMAN 备份...
在数据库中创建对象,如临时表空间、数据表空间,然后创建用户并分配表空间权限,是进行RMAN备份前的准备工作。RMAN备份的对象包括数据库、表空间、数据文件、控制文件和归档日志。备份操作如`BACKUP DATABASE`进行...
总结,RMAN备份数据库涉及多个步骤,包括设置数据库为归档模式,创建恢复目录,分配权限,注册数据库,以及实际执行备份。这些步骤确保了数据库的完整性和安全性,使得在数据丢失或系统故障时能够快速恢复。
虽然主要用途是备份与恢复,但在 RMAN 中也可以执行与备份恢复紧密相关的数据库操作,例如关闭或打开数据库: ```sql shutdown immediate; ``` 然而,并不是所有的数据库操作都可以在 RMAN 中执行。例如,尝试创建...
这个过程涉及到NetBackup的Oracle插件,它使得在异机恢复过程中能有效地管理备份集,从而确保数据的完整性和一致性。在整个过程中,监控恢复日志以确保每个步骤都正确无误,这对于确保业务连续性和数据安全至关重要...
综上所述,RMAN备份恢复是Oracle数据库管理的关键组成部分,它提供了高效、安全的数据库保护手段,尤其是在需要进行异机恢复时,RMAN的灵活性和自动化特性使得这一过程变得相对简单。通过理解并熟练掌握RMAN的使用,...
- **恢复目录(RMAN Catalog):** 存储有关RMAN备份和恢复作业的信息,有助于跟踪和管理备份历史。 - **介质管理库(Media Management Library):** 提供与外部存储设备(如磁带驱动器)交互的功能。 - **RMAN包:** ...