新的10g asm生产数据库即将上线,以下是上线前做的简单的备份恢复测试: $ rman target / @full_bak.sql recovery manager: release 10.1.0.3.0 - 64bit production copyright (c) 1995, 2004, oracle. all rights reserved. connected to target database: mmsdb (dbid=799462343) rman> run { starting backup at 13-apr-05 starting backup at 13-apr-05 starting backup at 13-apr-05 starting control file and spfile autobackup at 13-apr-05 rman retention policy will be applied to the command recovery manager complete. sql*plus: release 10.1.0.3.0 - production on wed apr 13 10:19:28 2005 copyright (c) 1982, 2004, oracle. all rights reserved. sql> shutdown immediate; 3.执行恢复 recovery manager: release 10.1.0.3.0 - 64bit production copyright (c) 1995, 2004, oracle. all rights reserved. connected to target database (not started) rman> startup mount; oracle instance started total system global area 3204448256 bytes fixed size 1304912 bytes rman> restore database; channel ora_disk_1: starting datafile backupset restore rman> recover database; starting media recovery finished recover at 13-apr-05 rman> alter database open; rman> 4.最后不要忘记解冻ha 测试过程,仅供参考.
1.首先执行备份
2> backup database plus archivelog delete all input;
3> delete obsolete;
4> }
5>
current log archived
using target database controlfile instead of recovery catalog
allocated channel: ora_disk_1
channel ora_disk_1: sid=162 devtype=disk
channel ora_disk_1: starting archive log backupset
channel ora_disk_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=28 recid=2 stamp=555502358
channel ora_disk_1: starting piece 1 at 13-apr-05
channel ora_disk_1: finished piece 1 at 13-apr-05
piece handle=/msflsh/mmsdb/backupset/2005_04_13/o1_mf_annnn_tag20050413t101239_15s00ry0_.bkp
comment=none
channel ora_disk_1: backup set complete, elapsed time: 00:00:02
channel ora_disk_1: deleting archive log(s)
archive log filename=/msflsh/mmsdb/archivelog/2005_04_13/o1_mf_1_28_15s00pg2_.arc recid=2
stamp=555502358
finished backup at 13-apr-05
using channel ora_disk_1
channel ora_disk_1: starting full datafile backupset
channel ora_disk_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+datadg/mmsdb/datafile/system.259.3
input datafile fno=00003 name=+datadg/mmsdb/datafile/sysaux.257.3
input datafile fno=00002 name=+datadg/mmsdb/datafile/undotbs1.258.3
input datafile fno=00004 name=+datadg/mmsdb/datafile/users.256.3
channel ora_disk_1: starting piece 1 at 13-apr-05
channel ora_disk_1: finished piece 1 at 13-apr-05
piece handle=/msflsh/mmsdb/backupset/2005_04_13/o1_mf_nnndf_tag20050413t101242_15s00thq_.bkp
comment=none
channel ora_disk_1: backup set complete, elapsed time: 00:00:15
finished backup at 13-apr-05
current log archived
using channel ora_disk_1
channel ora_disk_1: starting archive log backupset
channel ora_disk_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=29 recid=3 stamp=555502377
channel ora_disk_1: starting piece 1 at 13-apr-05
channel ora_disk_1: finished piece 1 at 13-apr-05
piece handle=/msflsh/mmsdb/backupset/2005_04_13/o1_mf_annnn_tag20050413t101257_15s01bwm_.bkp
comment=none
channel ora_disk_1: backup set complete, elapsed time: 00:00:02
channel ora_disk_1: deleting archive log(s)
archive log filename=/msflsh/mmsdb/archivelog/2005_04_13/o1_mf_1_29_15s019mj_.arc recid=3
stamp=555502377
finished backup at 13-apr-05
piece handle=/msflsh/mmsdb/autobackup/2005_04_13/o1_mf_s_555502380_15s01df2_.bkp
comment=none
finished control file and spfile autobackup at 13-apr-05
rman retention policy is set to redundancy 2
using channel ora_disk_1
no obsolete backups found
2.冻结ha,停止数据库进行恢复
$ id
uid=101(oracle) gid=101(dba)
$ exit
# id
uid=0(root) gid=1(other)
# hagrp -freeze mmsdb -persistent
# su - oracle
sun microsystems inc. sunos 5.8 generic patch october 2001
you have new mail.
$ id
uid=101(oracle) gid=101(dba)
$ sqlplus "/ as sysdba"
connected to:
oracle database 10g enterprise edition release 10.1.0.3.0 - 64bit production
with the partitioning and data mining options
database closed.
database dismounted.
oracle instance shut down.
sql> exit
disconnected from oracle database 10g enterprise edition release 10.1.0.3.0 - 64bit production
with the partitioning and data mining options
$ rman target /
database mounted
variable size 651957936 bytes
database buffers 2550136832 bytes
redo buffers 1048576 bytes
starting restore at 13-apr-05
using target database controlfile instead of recovery catalog
allocated channel: ora_disk_1
channel ora_disk_1: sid=160 devtype=disk
channel ora_disk_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +datadg/mmsdb/datafile/system.259.3
restoring datafile 00002 to +datadg/mmsdb/datafile/undotbs1.258.3
restoring datafile 00003 to +datadg/mmsdb/datafile/sysaux.257.3
restoring datafile 00004 to +datadg/mmsdb/datafile/users.256.3
channel ora_disk_1: restored backup piece 1
piece handle=/msflsh/mmsdb/backupset/2005_04_13/o1_mf_nnndf_tag20050413t101242_15s00thq_.bkp
tag=tag20050413t101242
channel ora_disk_1: restore complete
finished restore at 13-apr-05
starting recover at 13-apr-05
using channel ora_disk_1
media recovery complete
database opened
$ exit
# id
uid=0(root) gid=1(other)
# hagrp -unfreeze mmsdb -persistent
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器