« Oracle10g已经废弃log_archive_start参数 |
Blog首页
| 进京两周年记-Eygle在北京的生活之九 »
对即将上线的Oracle10g ASM生产数据库进行备份恢复测试
作者:
eygle |【转载时请以超链接形式标明文章
出处和作者信息及
本声明】
链接:
http://www.eygle.com/archives/2005/04/oeieiessaeoracl.html
新的10g ASM生产数据库即将上线,以下是上线前做的简单的备份恢复测试:
1.首先执行备份
$ 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 {
2> backup database plus archivelog delete all input;
3> delete obsolete;
4> }
5>
Starting backup at 13-APR-05
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
Starting 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
Starting 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
Starting Control File and SPFILE Autobackup 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 will be applied to the command
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
no obsolete backups found
Recovery Manager complete.
|
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"
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.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
With the Partitioning and Data Mining options
SQL> shutdown immediate;
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
|
3.执行恢复
$ rman target /
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
database mounted
Total System Global Area 3204448256 bytes
Fixed Size 1304912 bytes
Variable Size 651957936 bytes
Database Buffers 2550136832 bytes
Redo Buffers 1048576 bytes
RMAN> restore database;
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: starting datafile backupset restore
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
RMAN> recover database;
Starting recover at 13-APR-05
using channel ORA_DISK_1
starting media recovery
media recovery complete
Finished recover at 13-APR-05
RMAN> alter database open;
database opened
RMAN>
|
4.最后不要忘记解冻HA
$ exit
# id
uid=0(root) gid=1(other)
# hagrp -unfreeze MMSDB -persistent
|
测试过程,仅供参考.
-----
这篇 【
对即将上线的Oracle10g ASM生产数据库进行备份恢复测试】来自
www.eygle.com |
CSDN技术网摘|
del.icio.us|
365Key
By eygle on 2005-04-13 10:17 |
Comments (7) |
Posted to
Backup&Recovery | Edit |Pageviews:
网上相关主题:
请教大侠,一个零级备份+三个一级备份+6个二级备份+当天的归档文件
用RMAN共恢复50G的数据,大致需要多长时间?
硬件大致:
2 * 2.8GHz CPU /4GB RAM,
CPQ 36.4GB 10K ULTRA320 磁盘阵列。
请以您的经验估算一下,不一定非常准确,谢谢
Posted by: Adam at April 14, 2005 8:13 AM
Posted by: eygle at April 14, 2005 11:31 AM
thanks a lot.
还有一个小问题,
RMAN使用的是LARGE_POOL_SIZE,其设置有什么准则么?
比如根据备份恢复数据量有什么不同的设置,或是说只要物理内存足够就尽量的设大?
Posted by: adam at April 14, 2005 11:48 AM
有个公式:
LARGE_POOL_SIZE = number_of_allocated_channels *
(16MB+( 4 * size_of_tape_buffer))
不知道大哥觉得是否合适?
Posted by: adam at April 14, 2005 11:51 AM
关于Large_pool_size的设置,通常如果没有特殊需求,一般在20~30M就足够了。
如果分配多通道,你可以考虑参考你给出的公式。
LARGE_POOL_SIZE = number_of_allocated_channels *
(16MB+( 4 * size_of_tape_buffer))
Posted by: eygle at April 14, 2005 1:39 PM
otn上的这篇文章可供参考:
http://otn.oracle.com/deploy/availability/pdf/rman_performance_wp.pdf
Posted by: eygle at April 14, 2005 1:44 PM
Posted by: adma at April 15, 2005 3:53 PM
发表留言: