免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1207 | 回复: 0
打印 上一主题 下一主题

10g上的一次rman全备份 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-02-09 10:27 |只看该作者 |倒序浏览
脚本内容:
[oracle@oracle oracle]$ more rmanfull.sh
#!/bin/bash
back_path="/home/oracle/rmanbackup";
back_log="/home/oracle/rmanbackup/log";
rman_name="rman";
rman_pw="rman";
rman_log_name="rman";
rman_log_pass="rman";
rman_sid="mydb";
rman_bin="/opt/oracle/product/10.2.0.1/bin/rman";
date_w=`date +%w`;

case $date_w in

2|3|5|6|7)   ----这里指在周二,三,五,六,日可执行如下命令
$rman_bin log $back_log/level0_`date +%Y-%m-%d`.log  RMAN> RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> RMAN> RMAN> RMAN> RMAN> RMAN> [oracle@oracle oracle]$
[oracle@oracle oracle]$ cd rmanbackup/
[oracle@oracle rmanbackup]$ ls
20100122_archivelog_MYDB_23_1_0nl44eoi.bak  20100122_full_MYDB_19_1_0jl44elq.bak  20100122_full_MYDB_21_1_0ll44eo7.bak  log
20100122_archivelog_MYDB_24_1_0ol44eoi.bak  20100122_full_MYDB_20_1_0kl44elq.bak  20100122_full_MYDB_22_1_0ml44eo8.bak
查看日志记录的执行过程
[oracle@oracle oracle]$ cd rmanbackup/log/
[oracle@oracle log]$ ls
level0_2010-01-22.log
[oracle@oracle log]$ more level0_2010-01-22.log

Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jan 22 19:51:11 2010

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

RMAN>
connected to recovery catalog database

RMAN>
connected to target database: MYDB (DBID=2623955059)

RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10>
allocated channel: d1
channel d1: sid=159 devtype=DISK

allocated channel: d2
channel d2: sid=140 devtype=DISK

Starting backup at 22-JAN-10
channel d1: starting full datafile backupset
channel d1: specifying datafile(s) in backupset
input datafile fno=00001 name=/opt/oracle/oradata/mydb/system01.dbf
input datafile fno=00004 name=/opt/oracle/oradata/mydb/users01.dbf
input datafile fno=00002 name=/opt/oracle/oradata/mydb/undotbs01.dbf
channel d1: starting piece 1 at 22-JAN-10
channel d2: starting full datafile backupset
channel d2: specifying datafile(s) in backupset
input datafile fno=00003 name=/opt/oracle/oradata/mydb/sysaux01.dbf
input datafile fno=00006 name=/opt/oracle/oradata/mydb/catalog_tbs.dbf
input datafile fno=00005 name=/opt/oracle/oradata/mydb/jiajia.dbf
channel d2: starting piece 1 at 22-JAN-10
channel d1: finished piece 1 at 22-JAN-10
piece handle=/home/oracle/rmanbackup/20100122_full_MYDB_19_1_0jl44elq.bak tag=FULL comment=NONE
channel d1: backup set complete, elapsed time: 00:01:16
channel d1: starting full datafile backupset
channel d1: specifying datafile(s) in backupset
including current control file in backupset
channel d1: starting piece 1 at 22-JAN-10
channel d2: finished piece 1 at 22-JAN-10
piece handle=/home/oracle/rmanbackup/20100122_full_MYDB_20_1_0kl44elq.bak tag=FULL comment=NONE
channel d2: backup set complete, elapsed time: 00:01:17
channel d2: starting full datafile backupset
channel d2: specifying datafile(s) in backupset
channel d1: finished piece 1 at 22-JAN-10
piece handle=/home/oracle/rmanbackup/20100122_full_MYDB_21_1_0ll44eo7.bak tag=FULL comment=NONE
channel d1: backup set complete, elapsed time: 00:00:02
including current SPFILE in backupset
channel d2: starting piece 1 at 22-JAN-10
channel d2: finished piece 1 at 22-JAN-10
piece handle=/home/oracle/rmanbackup/20100122_full_MYDB_22_1_0ml44eo8.bak tag=FULL comment=NONE
channel d2: backup set complete, elapsed time: 00:00:02
Finished backup at 22-JAN-10

sql statement: alter system archive log current

Starting backup at 22-JAN-10
current log archived
channel d1: starting archive log backupset
channel d1: specifying archive log(s) in backup set
input archive log thread=1 sequence=3 recid=1 stamp=708983567
channel d1: starting piece 1 at 22-JAN-10
channel d2: starting archive log backupset
channel d2: specifying archive log(s) in backup set
input archive log thread=1 sequence=4 recid=2 stamp=708983568
channel d2: starting piece 1 at 22-JAN-10
channel d1: finished piece 1 at 22-JAN-10
piece handle=/home/oracle/rmanbackup/20100122_archivelog_MYDB_23_1_0nl44eoi.bak tag=TAG20100122T195249 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:02
channel d1: deleting archive log(s)
archive log filename=/opt/oracle/flash_recovery_area/MYDB/archivelog/2010_01_22/o1_mf_1_3_5om4dg3l_.arc recid=1 stamp=708983567
channel d2: finished piece 1 at 22-JAN-10
piece handle=/home/oracle/rmanbackup/20100122_archivelog_MYDB_24_1_0ol44eoi.bak tag=TAG20100122T195249 comment=NONE
channel d2: backup set complete, elapsed time: 00:00:02
channel d2: deleting archive log(s)
archive log filename=/opt/oracle/flash_recovery_area/MYDB/archivelog/2010_01_22/o1_mf_1_4_5om4djdd_.arc recid=2 stamp=708983568
Finished backup at 22-JAN-10

released channel: d2

released channel: d1

RMAN>
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=159 devtype=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/rmanbackup/20100122_full_MYDB_20_1_0kl44elq.bak recid=11 stamp=708983483
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/rmanbackup/20100122_full_MYDB_19_1_0jl44elq.bak recid=12 stamp=708983483
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/rmanbackup/20100122_full_MYDB_21_1_0ll44eo7.bak recid=13 stamp=708983559
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/rmanbackup/20100122_full_MYDB_22_1_0ml44eo8.bak recid=14 stamp=708983561
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/rmanbackup/20100122_archivelog_MYDB_24_1_0ol44eoi.bak recid=15 stamp=708983571
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/home/oracle/rmanbackup/20100122_archivelog_MYDB_23_1_0nl44eoi.bak recid=16 stamp=708983571
Crosschecked 6 objects


RMAN>
using channel ORA_DISK_1

RMAN>
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
no obsolete backups found

RMAN>
starting full resync of recovery catalog
full resync complete

RMAN>

Recovery Manager complete.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/93765/showart_2180551.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP