DBA_实践指南系列4_Oracle Erp R12系统备份和恢复Backup(案例)

2013-12-04 Created By BaoXinjian

一、摘要


1. ERP系统的数据分类

(1). 操作文件系统

(2). Oracle 11g数据库的程序文件

(3). Oracle数据库的参数文件

(4). Oracle数据库的数据文件

(5). Oracle数据库的日志和追踪文件

(6). Oracle在线事物处理文件

(7). Oracle数据库控制文件

(8). Oracle数据库归档日志文件

(9). Oracle Erp的应用程序文件

(10). Oracle Erp应用的输出和日志文件

(11). Catelog服务器文件及第三方备份软件文件

2. 备份的备份方法

(1).  物理备份

(2).  逻辑备份

(3).  RMAN备份

3. 备份的备份内容

(1).  备份数据库

(2).  备份应用系统

(3).  备份操作系统

 

二、备份的备份方法


1. 物理备份

cd /u01/oracle/vis
tar cvf apps20130101.tar ./apps

cd /u01/oracle/vis
tar cvf inst20130101.tar ./inst

cd /u01/oracle/vis
tar cvf db20130101.tar ./db

2. 逻辑备份

expdb system/manager dumpfile=vis_full_$today.dmp directory=exp_imp_dump full=y logfile=vis_full_$today.log

3. RMAN备份

非常重要的数据库的备份方式,每个Oracle DBA都需要掌握的技术,具体可参考博客中Oracle RMAN Category

http://www.cnblogs.com/eastsea/category/637524.html

 

三、备份内容 - 数据库


1. Cron Job 定义样式

##--For test system backup--##

00 20 * * * su - oracle -c "/oracle/home/scripts/testsystem_expdp.sh" ##--Database full backup--## 00 00 * * * su -oracle -c "/oracle/home/scripts/testsystem_expdp.sh"
##
--Backup archivelog to tsm and delete every one hour--## 00 * * * * /oracle/home/rman/arc.sh 1>/dev/null 2>/dev/null

2. 逻辑导出脚本样式

##--Test system expdp backup--##
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib; export LD_LIBRARY_PATH
LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib; export LIBPATH
ORACLE_SID=TEST; export ORACLE_SID
PATH=$ORACLE_HOME/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/oracle/app/oracle/product/10.2.0/OPatch; export PATH
TODAY='date+%y%m%d%H%M; export TODAY
expdp system/manager dumpfile=test_full_$TODAY.dmp directory=exp_imp_dump full=y logfile=test_full_$TODAY.log

3. 归档日志备份脚本样式

CMDFILE=/oracle/home/rman/arcbackup
LOGFILE=/oracle/home/rman/arc.log
su - oracle -c "rman target / cmdfile $CMDFILE msglog $LOGFILE"
/oracle/home/rman/arcbackup
run {
allocate channel t1 type 'sbt_tape' parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel t2 type 'sbt_tape' parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
sql 'alter system archive log current';
backup format 'arch%t_%s_%p' diskratio=0 archivelog all delete input;
release channel t1;
release chennel t2;
}

 4. 数据库全备份脚本样式

CMDFILE=/oralce/home/rman/fullbackup
LOGFILE=/oralce/home/rman/full.log
su - oracle -c "rman target / cmdfile $CMDFILE mslog $LOGFILE"
/oracle/home/rman/fullbakcup
run {
allocate channel t1 type 'sbt_tape' parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
bakcup incremental level 0 filesperset 7 copies=1
database format 'dbfull_%t_%s_%p' diskratio=0 database include current contorlfile;
sql 'alter system archive log current';
backup format 'arch%t_%s_%p' diskratio=0 archivelog all delete input;
release channel t1;
}

5. 数据库程序文件备份

数据库程序文件在不打补丁和不升级的情况向,几乎不变化,可以在数据库正常关闭的情况下,进行物理备份

 

四、备份内容 - 应用程式


应用层的备份一帮先采用预克隆操作,在备份应用系统的文件

1. 可以采用操作系统命令的方式备份

2. 第三方软件管理工具支持文件系统的备份

在备份应用层时,最好将应用层系统进程正常停止,再备份

 

五、备份内容 - 操作系统


一般由操作系统管理员进行备份

 

Thanks and Regards

学习笔记:朱龙春 - ERP DBA实践指南

原文地址:https://www.cnblogs.com/eastsea/p/4215221.html