Atempo公司的TimeNevigator带库介质管理软件-RMAN WITH CATALOG备份策略

Atempo公司的TimeNevigator是第三方的备份管理软件.声称:"带有Oracle模块的Time Navigator通过提供Oracle数据库高性能在线备份和恢复来提供增强了的应用软件实用性而不影响终端用户。该应用软件能提供一个Oracle数据库对象的逻辑视图,提供先进的诊断工具并实现小部分或完整的恢复。"

其工程师告知针对ORACLE数据库有两种备份方式,一种是RMAN调用,一种是数据文件读取方式,不通过RMAN. RMAN备份大家都理解,对于直接读取数据文件的方式其实就是置表空间为BEGIN BACKUP和END BACKUP状态,并无其他神奇之处.

[@more@]

对于直接读取数据文件不通过RMAN备份的方式,实际上就是使用BEGIN BACKUP和END BACKUP实现.

在BACKUP AND RECOVERY CONCEPT文档CHAPTER 2中,指出:"When you back up an individual datafile or online tablespace with an operating system utility (rather than with RMAN), you must use a different method to handle fractured blocks. You must first place the online tablespace in backup mode with the ALTER TABLESPACE BEGIN BACKUP statement. As a result, Oracle stops recording checkpoints to the tablespace's datafiles. You must put a tablespace in backup mode to make user-managed backups of datafiles in an online, read/write tablespace. After an online backup is completed, Oracle advances the file header to the current database checkpoint, but only after you run the ALTER TABLESPACE ... END BACKUP or ALTER DATABASE END BACKUP statement to take the tablespace out of backup mode".

这种方式BEGIN BACKUP时锁定数据文件的SCN,虽然不影响该数据文件的读写事务提交,但会产生大量的redo logs, 把改变的数据块的内容全部写入redo log, 当执行END BACKUP时,从锁定的SCN开始执行更新操作直至与数据库的SCN同步.

当RMAN推出,该种备份方式已不被ORACLE建议,但atempo工程师首选此种方式,但发现并不支持OCFS格式.无法认知.

以下是RAC环境,备份磁带库,两个驱动器,归档放在各自实例的本地磁盘上. 调度和备份脚本如下:

sd1_p1[/]#crontab -l

# Entry for monitoring status of the EMSHAProvider

* * * * * sleep 15;/etc/opt/resmon/lbin/mon_EMSHAProvider_state.sh

5,20,35,50 * * * * /opt/sfm/bin/restart_sfm.sh

0 19 * * 5 /oracle/app/oracle/rman-sh/0.sh

0 19 * * 0,1,2,3,4,6 /oracle/app/oracle/rman-sh/1.sh

0 22 * * * /oracle/app/oracle/rman-sh/ar.sh

on 10.128.137.151:

target database: TJGSJZX (DBID=1529882075)

catalog database: TJGOA (remote rac db)

sqlplus "/ as sysdba"

CREATE SMALLFILE TABLESPACE "RMAN_TS" DATAFILE'+ORADATA' SIZE 500M LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

CREATE USER rman IDENTIFIED BY RMAN

TEMPORARY TABLESPACE temp

DEFAULT TABLESPACE RMAN_TS

QUOTA UNLIMITED ON RMAN_TS;

GRANT RECOVERY_CATALOG_OWNER TO rman;

RMAN> connect catalog rman/rman

connected to recovery catalog database

RMAN> create catalog;

recovery catalog created

----sqlplus validation: SELECT TABLE_NAME FROM USER_TABLES;

vi $ORACLE_HOME/network/admin/tnsnames.ora

CATDB-TJORA1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.128.137.153)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = tjora)

(INSTANCE_NAME = tjora1)

)

)

$ rman target / catalog rman/rman@catdb-tjgoa1

Recovery Manager: Release 10.2.0.3.0 - Production on Wed Mar 19 16:48:04 2008

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

connected to target database: TJGSJZX (DBID=1529882075)

connected to recovery catalog database

RMAN> register database;

database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

RMAN> report schema;

RMAN> RESYNC CATALOG;

starting full resync of recovery catalog

full resync complete

***************************************

脚本0.sh

#!/sbin/sh
# rman script: 0 level

# define globally used paths/variables
ORACLE_BASE=/oracle/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0
PATH=$ORACLE_HOME/bin:$ORACLE_CRS_HOME/bin:/usr/sbin:$PATH
ORACLE_SID=tjgsjzx1
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
#TERM=vt100
NLS_LANG=AMERICAN
export ORACLE_HOME ORACLE_BASE PATH ORACLE_SID LD_LIBRARY_PATH NLS_LANG
NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'; export NLS_DATE_FORMAT
export dt=`date +%Y%m%d%H%M`

# make a backup copy of the init.ora file
#cp

# make a backup copy of the orapwd file
#cp

# start the rman backup
su - oracle -c "$ORACLE_HOME/bin/rman 'target / catalog rman/rman@catdb-tjgoa1'"<< EOF
spool log to '/oracle/app/oracle/rman-log/0levelBK_$dt.log' append;
#$ORACLE_HOME/bin/rman target / << EOF
#configure retention policy to redundancy 3;

#show all;
run {
allocate channel c1 type 'sbt_tape'
parms="SBT_LIBRARY=/usr/Atempo/tina/Lib/libtina_rman.sl,
ENV=(TINA_HOME=/usr/Atempo/tina,TINA_SERVICE_NAME=tina,TINA_RMAN_CATALOG=cat,
TINA_RMAN_FOLDER=rman1,TINA_RMAN_USER=oracle)" trace=2;
backup incremental level 0 database include current controlfile;
#backup incremental level 1 database include current controlfile;

#sql 'alter system archive log current';
#backup archivelog all delete input;

release channel c1;
}
#list backup;
exit;

EOF

***************************************

脚本1.sh

#!/sbin/sh
# rman script: 1 level

# define globally used paths/variables
ORACLE_BASE=/oracle/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0
PATH=$ORACLE_HOME/bin:$ORACLE_CRS_HOME/bin:/usr/sbin:$PATH
ORACLE_SID=tjgsjzx1
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
#TERM=vt100
NLS_LANG=AMERICAN
export ORACLE_HOME ORACLE_BASE PATH ORACLE_SID LD_LIBRARY_PATH NLS_LANG
NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'; export NLS_DATE_FORMAT
export dt=`date +%Y%m%d%H%M`

# make a backup copy of the init.ora file
#cp

# make a backup copy of the orapwd file
#cp

# start the rman backup
su - oracle -c "$ORACLE_HOME/bin/rman 'target / catalog rman/rman@catdb-tjgoa1'"<< EOF
spool log to '/oracle/app/oracle/rman-log/1evelBK_$dt.log' append;
#$ORACLE_HOME/bin/rman target / << EOF
#configure retention policy to redundancy 3;

#show all;
run {
allocate channel c1 type 'sbt_tape'
parms="SBT_LIBRARY=/usr/Atempo/tina/Lib/libtina_rman.sl,
ENV=(TINA_HOME=/usr/Atempo/tina,TINA_SERVICE_NAME=tina,TINA_RMAN_CATALOG=cat,
TINA_RMAN_FOLDER=rman1,TINA_RMAN_USER=oracle)" trace=2;
# backup incremental level 0 database include current controlfile;
backup incremental level 1 database include current controlfile;

#sql 'alter system archive log current';
#backup archivelog all delete input;

release channel c1;
}
#list backup;
exit;

EOF

***************************************

脚本ar.sh

#!/sbin/sh
# rman script: achivelog backup

# define globally used paths/variables
ORACLE_BASE=/oracle/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0
PATH=$ORACLE_HOME/bin:$ORACLE_CRS_HOME/bin:/usr/sbin:$PATH
ORACLE_SID=tjgsjzx1
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
#TERM=vt100
NLS_LANG=AMERICAN
export ORACLE_HOME ORACLE_BASE PATH ORACLE_SID LD_LIBRARY_PATH NLS_LANG
NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'; export NLS_DATE_FORMAT
export dt=`date +%Y%m%d%H%M`

# make a backup copy of the init.ora file
#cp

# make a backup copy of the orapwd file
#cp

# start the rman backup
su - oracle -c "$ORACLE_HOME/bin/rman 'target / catalog rman/rman@catdb-tjgoa1'"<< EOF
#spool log to '/oracle/app/oracle/rman-log/archBK_$dt.log' append;
#$ORACLE_HOME/bin/rman target / << EOF
#configure retention policy to redundancy 3;

#show all;
run {
allocate channel c1 type 'sbt_tape' connect 'sys/oracle@tjgsjzx1'
parms="SBT_LIBRARY=/usr/Atempo/tina/Lib/libtina_rman.sl,
ENV=(TINA_HOME=/usr/Atempo/tina,TINA_SERVICE_NAME=tina,TINA_RMAN_CATALOG=cat,
TINA_RMAN_FOLDER=rman1,TINA_RMAN_USER=oracle)" trace=2;
allocate channel c2 type 'sbt_tape' connect 'sys/oracle@tjgsjzx2'
parms="SBT_LIBRARY=/usr/Atempo/tina/Lib/libtina_rman.sl,
ENV=(TINA_HOME=/usr/Atempo/tina,TINA_SERVICE_NAME=tina,TINA_RMAN_CATALOG=cat,
TINA_RMAN_FOLDER=rman1,TINA_RMAN_USER=oracle)" trace=2;
#backup incremental level 0 database include current controlfile;
#backup incremental level 1 database include current controlfile;

sql 'alter system archive log current';
backup not backed up 3 times fileperset 20 archivelog all;

release channel c1;
release channel c2;
}

run {
allocate channel c1 type 'sbt_tape' connect 'sys/oracle@tjgsjzx1'
parms="SBT_LIBRARY=/usr/Atempo/tina/Lib/libtina_rman.sl,
ENV=(TINA_HOME=/usr/Atempo/tina,TINA_SERVICE_NAME=tina,TINA_RMAN_CATALOG=cat,
TINA_RMAN_FOLDER=rman1,TINA_RMAN_USER=oracle)" trace=2;
allocate channel c2 type 'sbt_tape' connect 'sys/oracle@tjgsjzx2'
parms="SBT_LIBRARY=/usr/Atempo/tina/Lib/libtina_rman.sl,
ENV=(TINA_HOME=/usr/Atempo/tina,TINA_SERVICE_NAME=tina,TINA_RMAN_CATALOG=cat,
TINA_RMAN_FOLDER=rman1,TINA_RMAN_USER=oracle)" trace=2;

delete noprompt archivelog until time 'sysdate-30';

release channel c1;
release channel c2;
}

#list backup;
exit;

EOF

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/87149/viewspace-1001415/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/87149/viewspace-1001415/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值