● ITPUB名人堂嘉宾 ● ChinaUnix社区博客专家 ● ChinaUnix社区Oracle板块版主 ● 优酷网认证音乐牛人:EricGuitar ● SDOUG 核心成员 ●E-mail:gaoqiangdba@163.com
分类: Oracle
2013-08-15 11:45:13
归档模式的设置:
如果没有设置归档模式,会出现如下情况:
RMAN> backup database;
Starting backup at 02-AUG-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=9 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 08/02/2013 01:45:49
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode -------看到了没?直接不让你搞啊... ...
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 02-AUG-13
channel ORA_DISK_1: finished piece 1 at 02-AUG-13
piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/04og8fed_1_1 tag=TAG20130802T014548 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 08/02/2013 01:45:49
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
打开归档模式(单节点):
RMAN> shutdown immediate;
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 730714112 bytes
Fixed Size 2216944 bytes
Variable Size 486542352 bytes
Database Buffers 234881024 bytes
Redo Buffers 7073792 bytes
归档模式开启方法:
在RMAN命令符下执行打开归档命令,在sqlplus下直接输入“alter database archivelog;”回车即可。
RMAN> sql 'alter database archivelog';
sql statement: alter database archivelog --------------归档已打开,当然,你也可以在sqlplus下执行alter database archivelog命令,那样的话执行结果返回提示更直观一些,自己动手体验 一把吧,多做比多看更有效果。
归档模式已打开,我们再来备份一下,看看效果如何?
RMAN> backup database;
Starting backup at 02-AUG-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/app/oradata/ORCL/datafile/o1_mf_system_8xm4839m_.dbf
input datafile file number=00002 name=/oracle/app/oradata/ORCL/datafile/o1_mf_sysaux_8xm483f7_.dbf
input datafile file number=00005 name=/oracle/app/oradata/ORCL/datafile/o1_mf_example_8xm4gzck_.dbf
input datafile file number=00003 name=/oracle/app/oradata/ORCL/datafile/o1_mf_undotbs1_8xm483gd_.dbf
input datafile file number=00004 name=/oracle/app/oradata/ORCL/datafile/o1_mf_users_8xm483jk_.dbf
channel ORA_DISK_1: starting piece 1 at 02-AUG-13
channel ORA_DISK_1: finished piece 1 at 02-AUG-13
piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/05og8fns_1_1 tag=TAG20130802T015052 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:26
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 02-AUG-13
channel ORA_DISK_1: finished piece 1 at 02-AUG-13
piece handle=/oracle/app/oracle/product/11.2.0/db_1/dbs/06og8fsf_1_1 tag=TAG20130802T015052 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 02-AUG-13