设为首页 加入收藏

TOP

Netbackup恢复步骤-01(四)
2014-11-24 02:35:14 来源: 作者: 【 】 浏览:16
Tags:Netbackup 恢复 步骤 -01
_TAPE';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
BACKUP
$BACKUP_TYPE
SKIP INACCESSIBLE
TAG hot_db_bk_level0
FILESPERSET 5
# recommended format
FORMAT 'bk_%s_%p_%t'
DATABASE;
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
# backup all archive logs
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
BACKUP
filesperset 20
FORMAT 'al_%s_%p_%t'
ARCHIVELOG ALL DELETE INPUT;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
#
# Note: During the process of backing up the database, RMAN also backs up the
# control file. This version of the control file does not contain the
# information about the current backup because "nocatalog" has been specified.
# To include the information about the current backup, the control file should
# be backed up as the last step of the RMAN section. This step would not be
# necessary if we were using a recovery catalog.
#
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
BACKUP
# recommended format
FORMAT 'cntrl_%s_%p_%t'
CURRENT CONTROLFILE;
RELEASE CHANNEL ch00;
}
EOF
"
echo "$CMD_STR" >> $RMAN_LOG_FILE
# Initiate the command string

if [ "$CUSER" = "root" ]
then
su - $ORACLE_USER -c "$CMD_STR" >> $RMAN_LOG_FILE
RSTAT=$
else
/usr/bin/sh -c "$CMD_STR" >> $RMAN_LOG_FILE
RSTAT=$
fi

# ---------------------------------------------------------------------------
# Log the completion of this script.
# ---------------------------------------------------------------------------

if [ "$RSTAT" = "0" ]
then
LOGMSG="ended successfully"
else
LOGMSG="ended in error"
fi

echo >> $RMAN_LOG_FILE
echo Script $0 >> $RMAN_LOG_FILE
echo ==== $LOGMSG on `date` ==== >> $RMAN_LOG_FILE
echo >> $RMAN_LOG_FILE

exit $RSTAT
oracle@sg2as059:/usr/openv/netbackup/ext/db_ext/oracle/test>
从备份脚本得知,备份的log是同目录下的,和备份脚本同名的.out文件。
因此我们可以检查一下备份的log,看看是否备份成功,以及获取其他还原时需要的信息:

oracle@sg2as059:/usr/openv/netbackup/ext/db_ext/oracle/test> cat hot_database_backup.sh.out

Script /usr/openv/netbackup/ext/db_ext/oracle/test/hot_database_backup.sh
==== started on Mon Jun 13 16:11:33 WAUST 2011 ====


RMAN: /u01/app/oracle/OraHome1/bin/rman
ORACLE_SID: test
ORACLE_USER: oracle
ORACLE_HOME: /u01/app/oracle/OraHome1

NB_ORA_FULL: 1
NB_ORA_INCR: 0
NB_ORA_CINC: 0
NB_ORA_SERV: sg2ts001
NB_ORA_POLICY: sg2as059_oracle_nbutest_backup

Full backup requested

ORACLE_HOME=/u01/app/oracle/OraHome1
export ORACLE_HOME
ORACLE_SID=test
export ORACLE_SID
/u01/app/oracle/OraHome1/bin/rman target / nocatalog msglog /usr/openv/netbackup/ext/db_ext/oracle/test/hot_database_backup.sh.out append << EOF
RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
BACKUP
INCREMENTAL LEVEL=0
SKIP INACCESSIBLE
TAG hot_db_bk_level0
FILESPERSET 5
# recommended format
FORMAT 'bk_%s_%p_%t'
DATABASE;
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
# backup all archive logs
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
BACKUP
filesperset 20
FORMAT 'al_%s_%p_%t'
ARCHIVELOG ALL DELETE INPUT;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
#
# Note: During the process of backing up the database, RMAN also backs up the
# control file. This version of the control file does not contain the
# information about the current backup because nocatalog has been specified.
# To include the information ab

首页 上一页 1 2 3 4 5 6 下一页 尾页 4/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Oracle中删除用户下所有对象的多.. 下一篇Oracle基本步骤前滚和回滚简析

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: