TSM备份oracle数据库安装配置(精编版)_第1页
TSM备份oracle数据库安装配置(精编版)_第2页
TSM备份oracle数据库安装配置(精编版)_第3页
TSM备份oracle数据库安装配置(精编版)_第4页
TSM备份oracle数据库安装配置(精编版)_第5页
已阅读5页,还剩38页未读 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、备份和恢复Oracle 11gR2IBM Tivoli Storage Manager for Databases Data Protection for Oracle,以下简称: TDPO1、安装 TDPO、软件选择、软件安装、将所有需要安装的文件集上传到服务器上,假设上传到/tmp/soft/tsm/oracle目录。、进入软件集目录,然后执行安装命令:# cd /tmp/soft/tsm/oracle # smitty installInstall and Update Software Install and Update from ALL Available Software在* I

2、NPUT device / directory for software中输入 ./ SOFTWARE to install中输入 allACCEPT new license agreements?选项中 no 改为 yes然后按回车键安装,再按回车键确认后,软件安装完成。2、将RMAN 与 TDPO 重新链接a、设置 Oracle LD_LIBRARY_PATH选项修改 .proflie 文件,将 $ORACLE_HOME/lib放在 LD_LIBRARY_PATH 选项第一位,即:LD_LIBRARY_PATH=$ORACLE_HOME/libb、关闭使用 $ORACLE_HOME 的所有

3、 Oracle 实例c、转至 $ORACLE_HOME 目录d、将库文件符号连接到ln -s /usr/lib/ $ORACLE_HOME/lib/3、定义文件中的TDPO 选项# cd /usr/tivoli/tsm/client/oracle/bin64 # viDSMI_ORC_CONFIG/usr/tivoli/tsm/client/oracle/bin64/ DSMI_LOG/usr/tivoli/tsm/client/oracle/bin64TDPO_FSdb01_ora TDPO_NODEdb01_oracle TDPO_OWNERoracleTDPO_PSWDPATH/usr/

4、tivoli/tsm/client/oracle/bin64TDPO_DATE_FMT1TDPO_NUM_FMT1TDPO_TIME_FMT14、将TDPO 节点注册到 TSM 服务器register node db01_oracle password maxnummp=2 passexp=0 backdelete=yes5、在和文件中定义TSM 选项、配置# cd /usr/tivoli/tsm/client/oracle/bin64# viSErvername tsmserver注意:此文件必须位于中的dsmi_orc_config 指定的目录中。、配置# cd /usr/tivoli/t

5、sm/client/api/bin64 # viSErvername tsmserver COMMMethodTCPip TCPPort1500TCPServeraddressNODEnamedb01_oracle PASSWORDAccessprompt6、修改 TSM API和 TDPO 目录的权限# chmod -R 777 /usr/tivoli/tsm/client/api/bin64/# chmod -R 777 /usr/tivoli/tsm/client/oracle/bin64/6、配置 TSM 服务器、定义策略域tsm: TSMSERVER>define domain

6、 oradomain ANR1500I Policy domain ORADOMAIN defined.、定义策略tsm: TSMSERVER>define pol oradomain orapolANR1510I Policy set ORAPOL defined in policy domain ORADOMAIN.、定义管理类tsm: TSMSERVER>define mgmt oradomain orapol oramgmtANR1520I Management class ORAMGMT defined in policy domain ORADOMAIN, set OR

7、APOL.、指派缺省管理类tsm: TSMSERVER>assign defmgmt oradomain orapol oramgmtANR1538I Default management class set to ORAMGMT for policy domain ORADOMAIN,set ORAPOL.、定义存储池tsm: TSMSERVER>define stgpool orapool diskANR2200I Storage pool ORAPOOL defined (device class DISK).、定义存储池卷tsm: TSMSERVER>define v

8、olume orapool /tsm1/ formatsize=512 wait=yesANR0984I Process 9 for DEFINE VOLUME started in the FOREGROUND at 12:19:20. ANR2206I Volume /tsm1/ defined in storage pool ORAPOOL (device class DISK).ANR0986IProcess 9 for DEFINE VOLUME running in the FOREGROUND processed 1 itemsfor a total of 536,870,912

9、 bytes with acompletion state of SUCCESS at 12:19:26.、定义存储池空间触发器tsm:TSMSERVER>definespacetriggerstgstgpool=orapoolspaceexpansion=50 expansionprefix=/tsm1/ANR4485I A storage pool space trigger has been defined and enabled for storage poolORAPOOL.、定义副本组tsm: TSMSERVER>define copy oradomain orapol

10、 oramgmt dest=orapool verdeleted=0 retonly=0 Session established with server TSMSERVER: AIX-RS/6000Server Version 5, Release 5, LevelServer date/time: 09/03/1012:58:21 Last access: 09/03/1012:14:15ANR1530I Backup copy group STANDARD defined in policy domain ORADOMAIN, set ORAPOL, management class OR

11、AMGMT.、激活备份策略ANR1554W DEFAULT Management class ORAMGMT in policy set ORADOMAIN ORAPOL does not have an ARCHIVE copygroup: files willnot bearchived by default if this set is activated.Do you wish to proceed? (Yes (Y)/No (N) yANR1554W DEFAULT Management class ORAMGMT in policy set ORADOMAIN ORAPOL doe

12、s not have an ARCHIVE copygroup: files willnot bearchived by default if this set is activated.ANR1514I Policy set ORAPOL activated in policy domain ORADOMAIN.、更新客户端节点信息tsm: TSMSERVER>update node db01_oracle domain=oradomain ANR2063I Node DB01_ORACLE updated.注:将节点db01_oracle 的策略域改为oradomain.7、修改 T

13、DPO 节点密码# cd /usr/tivoli/tsm/client/oracle/bin64/ # tdpoconf password8、查看 TDOP 配置信息# cd /usr/tivoli/tsm/client/oracle/bin64/ # tdpoconf Showenvironment9、将数据库改为归档模式10、测试 TDPO 与 Oracle 数据库的连接db01:/home/oracle$sbttest testThe sbt function pointers are loaded from library.- sbtinit succeededReturn code

14、-1 from sbtinit, bsercoer = 0, bsercerrno = 0 Message 0 not found; product=RDBMS; facility=SBT如图:显示如上,表示测试成功,如果不成功,有可能是TDPO 目录或 TSM API目录权限设置不对或者文件配置错误。10、备份数据库、备份数据文件通过 RMAN 执行备份数据文件脚本,过程如下:db01:/home/oracle$rmanRecovery Manager: Release - Production on Sat Sep 4 06:46:33 2010 Copyright (c) 1982, 2

15、009, Oracle and/or its affiliates. All rights reserved.RMAN> connect targetconnected to target database: ZGWANG (DBID=3) MAN> run2> 3> allocate channel t1 type 'sbt_tape' parms4> 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/'5> backup6> filesperset 57&g

16、t; format 'df_%t_%s_%p'8> (database);9> allocated channel: t1channel t1: SID=237 instance=zgwang1 device type=SBT_TAPE channel t1: Data Protection for Oracle: version backup at 04-SEP-10 channel t1: starting full datafile backup setchannel t1: specifying datafile(s) in backup setinput

17、datafile file number=00002 name=+ZGWANG/zgwang/ input datafile file number=00001 name=+ZGWANG/zgwang/ input datafile file number=00003 name=+ZGWANG/zgwang/ input datafile file number=00005 name=+ZGWANG/zgwang/ input datafile file number=00004 name=+ZGWANG/zgwang/ channel t1: starting piece 1 at 04-S

18、EP-10channel t1: finished piece 1 at 04-SEP-10piece handle=df_5_4_1 tag=TAGT065805 comment=API Version ,MMS Version t1: backup set complete, elapsed time: 00:05:07channel t1: starting full datafile backup set channel t1: specifying datafile(s) in backup set including current control file in backup s

19、et including current SPFILE in backup setchannel t1: starting piece 1 at 04-SEP-10channel t1: finished piece 1 at 04-SEP-10piece handle=df_3_5_1 tag=TAGT065805 comment=API Version ,MMS Version t1: backupset complete, elapsed time: 00:02:23Finished backup at 04-SEP-10released channel: t1如下图:、全备数据库(包括

20、 spfile 文件、数据文件、控制文件、归档日志文件) 脚本如下:# Backup Database Full rman target / << EOF_RMANrunallocatechannelt1type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/'allocatechannelt2type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bi

21、n64/'allocatechannelt3type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/'allocatechannelt4type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/'allocatechannelt5type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/

22、tivoli/tsm/client/oracle/bin64/'allocatechannelt6type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/'backup full tag 'dbfull' format 'dbfull_%t_%s_%p' diskratio=0 database include current controlfile; sql 'alter system archive log curre

23、nt'backup format 'arch%t_%s_%p' diskratio=0 archivelog all delete input; release channel t1;release channel t2; release channel t3; release channel t4; release channel t5; release channel t6; EOF_RMAN# Delete Old Backups rman << EOF_RMAN connect target;allocatechannelformaintenance

24、type'sbt_tape'parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/'crosscheck backup; crosscheck archivelog all; report obsolete;delete noprompt obsolete recovery window of 90 days;delete noprompt expired backup; release channel;EOF_RMAN、增量备份数据库(包括 spfile 文件、数据文件、控制文件、归档日志文件

25、) 脚本如下:# Backup Database Full rman target /<< EOF_RMAN runallocatechannelt1type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/'allocatechannelt2type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/'allocatechannelt3t

26、ype'sbt_tape'parms'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/'allocatechannelt4type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/'allocatechannelt5type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin

27、64/'allocatechannelt6type'sbt_tape'parms 'ENV=(tdpo_optfile=/usr/tivoli/tsm/client/oracle/bin64/'backup incremental level 1 tag 'dbincr' format '%d_full_%s_%p' filesperset 5 diskratio=0 database include current controlfile;sql 'alter system archive log current

28、'backup format 'arch%t_%s_%p' diskratio=0 archivelog all delete input; release channel t1;release channel t2;release channel t3; release channel t4; release channel t5; release channel t6;EOF_RMAN# Delete Old Backups rman << EOF_RMAN connect target;allocatechannelformaintenancetype

29、'sbt_tape'parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/'crosscheck backup; crosscheck archivelog all; report obsolete;delete noprompt obsolete recovery window of 90 days; delete noprompt expired backup;release channel;EOF_RMAN、查看已备份的数据RMAN> list backup;List of Back

30、up Sets=BS Key Type LV SizeDevice Type Elapsed Time Completion Time- 3FullSBT_TAPE00:05:0304-SEP-10BP Key: 3Status: AVAILABLE Compressed: NO Tag: TAGT065805 Handle: df_5_4_1Media: 26List of Datafiles in backup set 3File LV Type Ckp SCNCkp Time Name- - - - - -1 Full 352964704-SEP-10 +ZGWANG/zgwang/2

31、Full 352964704-SEP-10 +ZGWANG/zgwang/3 Full 352964704-SEP-10 +ZGWANG/zgwang/4 Full 352964704-SEP-10 +ZGWANG/zgwang/5 Full 352964704-SEP-10 +ZGWANG/zgwang/BS Key Type LV SizeDevice Type Elapsed Time Completion Time- 4FullSBT_TAPE00:02:1704-SEP-10BP Key: 4Status: AVAILABLE Compressed: NO Tag: TAGT0658

32、05Handle: df_3_5_1Media: 26SPFILE Included: Modification time: 04-SEP-10 SPFILE db_unique_name: ZGWANGControl File Included: Ckp SCN: 3531130Ckp time: 04-SEP-10如下图:12、恢复数据库、恢复单个控制文件注:此恢复与备份无关,完全是测试Oracle 自身的多文件备份功能。以下为测试步骤、模拟单个控制文件丢失:# su - grid db01:/home/grid$ls oradiag_grid db01:/home/grid$asmcmd

33、 ASMCMD> lsDATA/ ZGWANG/ASMCMD> cd zgwang/zgwangASMCMD> lsARCHIVELOG/ CONTROLFILE/ DATAFILE/ ONLINELOG/ TEMPFILE/archive/ASMCMD> cp archive/copying +zgwang/zgwang/ -> +zgwang/zgwang/archive/ARCHIVELOG/ CONTROLFILE/ DATAFILE/ ONLINELOG/ TEMPFILE/archive/ASMCMD> rm ASMCMD> lsARCHI

34、VELOG/CONTROLFILE/ DATAFILE/ ONLINELOG/ TEMPFILE/archive/ASMCMD> exit、试图启动 Oracle 数据库db01:/home/oracle$sqlplus '/as sysdba'SQL*Plus: Release Production on Tue Sep 7 15:25:38 2010Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to an idle instance.SQL> startupORACLE insta

35、nce started.Total System Global Area +10 bytes Fixed Size2214712 bytesVariable Size+10 bytesDatabase Buffers+10 bytes Redo BuffersbytesORA-00205: error in identifying control file, check alert log for more infoSQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release - 64bit Produ

36、ction With the Partitioning, Real Application Clusters, OLAP, Data Miningand Real Application Testing options、恢复单个控制文件db01:/home/grid$asmcmdASMCMD> cd zgwang/zgwangASMCMD> ls ARCHIVELOG/ CONTROLFILE/ DATAFILE/ ONLINELOG/ TEMPFILE/archive/ASMCMD> cpcopying +zgwang/zgwang/ -> +zgwang/zgwan

37、g/ASMCMD> exit、重新启动 Oracle 数据库# su - oracle db01:/home/oracle$sqlplus '/as sysdba'SQL*Plus: Release Production on Tue Sep 7 15:26:36 2010Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release - 64bit ProductionWith the Partitionin

38、g, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing optionsSQL> startupORA-01081: cannot start already-running ORACLE - shut it down first SQL> shutdown immediateORA-01507: database not mountedORACLE instance shut down.SQL> startupORACL

39、E instance started.Total System Global Area +10 bytes Fixed Size2214712 bytesVariable Size+10 bytes Database Buffers+10 bytes Redo Buffersbytes Database mounted.Database opened.SQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release - 64bit ProductionWith the Partitioning, Real

40、Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options、恢复 spfile 文件注:此功能与备份无关,只是测试通过pfile 文件重建spfile 文件的功能。、模拟 spfile 文件丢失db01:/home/grid$asmcmd ASMCMD> cd zgwang/zgwang ASMCMD> lsARCHIVELOG/ CONTROLFILE/DATAFILE/ONLINELOG/ TEMPFILE/archive/A

41、SMCMD> cp archive/copying +zgwang/zgwang/ -> +zgwang/zgwang/archive/ ASMCMD> lsARCHIVELOG/CONTROLFILE/ONLINELOG/ TEMPFILE/archive/ASMCMD> rm ASMCMD> ls ARCHIVELOG/ CONTROLFILE/ DATAFILE/ONLINELOG/ TEMPFILE/archive/ASMCMD> exit、试图启动 Oracle 数据库db01:/home/oracle$sqlplus '/as sysdb

42、a'SQL*Plus: Release Production on Tue Sep 7 15:13:37 2010Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real

43、Application Testing optionsSQL> shutdown immediate Database closed.Database dismounted. ORACLE instance shut down. SQL> startupORA-01078: failure in processing system parameters ORA-01565: error in identifying file '+ZGWANG/zgwang/'ORA-17503: ksfdopn:2 Failed to open file +ZGWANG/zgwan

44、g/ ORA-15056: additional error messageORA-17503: ksfdopn:DGOpenFile05 Failed to open file +ZGWANG/zgwang/ORA-17503: ksfdopn:2 Failed to open file +ZGWANG/zgwang/ ORA-15173: entry '' does not exist in directory 'zgwang'ORA-06512: at line 4、重建 spfile 文件SQL>createspfile='+ZGWANG/

45、zgwang/'frompfile='/data/app/oracle/admin/zgwang/scripts/'File created.、启动 Oracle 数据库SQL> startupORACLE instance started.Total System Global Area +10 bytes Fixed Size2214712 bytesVariable Size+10 bytes Database Buffers+10 bytes Redo Buffersbytes Database mounted.Database opened.、恢复文件、

46、模拟 users*.dbf 文件丢失db01:/home/grid$asmcmd lsASMCMD>DATA/ ZGWANG/ASMCMD> cd zgwang/zgwang ASMCMD> lsARCHIVELOG/ CONTROLFILE/ DATAFILE/ ONLINELOG/ TEMPFILE/archive/ASMCMD> rm ASMCMD> ls ARCHIVELOG/CONTROLFILE/ DATAFILE/ ONLINELOG/ TEMPFILE/archive/ASMCMD> exit如图:、试图启动 Oracle 数据库,同时注意文

47、件编号db01:/home/oracle$sqlplus '/as sysdba'SQL*Plus: Release Production on Tue Sep 7 14:25:56 2010Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to an idle instance.SQL> startupORACLE instance started.Total System Global Area +10 bytes Fixed Size2214712 bytesVariable Size+1

48、0 bytes Database Buffers+10 bytes Redo Buffersbytes Database mounted.ORA-01157: cannot identify/lock data file 4 - see DBWR trace file ORA-01110: data file 4: '+ZGWANG/zgwang/'SQL> exitDisconnected from Oracle Database 11g Enterprise Edition Release - 64bit Production With the Partitionin

49、g, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing options如图:在这里我们可以看到文件编号为4、通过 RMAN 恢复 users*.dbf 文件(附脚本)db01:/home/oracle$rman target /Recovery Manager: Release - Production on Tue Sep 7 14:30:35 2010Copyright (c) 1982, 2009, Oracle and/or its

50、 affiliates. All rights reserved.connected to target database: ZGWANG (DBID=3, not open)RMAN> report schema;using target database control file instead of recovery catalogReport of database schema for database with db_unique_name ZGWANGList of Permanent Datafiles=File Size(MB) TablespaceRB segs Da

51、tafile Name-1700SYSTEM*+ZGWANG/zgwang/2840SYSAUX*+ZGWANG/zgwang/350UNDOTBS1*+ZGWANG/zgwang/40USERS*+ZGWANG/zgwang/525UNDOTBS2*+ZGWANG/zgwang/List of Temporary Files=File Size(MB) TablespaceMaxsize(MB) Tempfile Name-120TEMP32767+ZGWANG/zgwang/RMAN> exitRecovery Manager complete. db01:/home/oracle$

52、sqlplus '/as sysdba'SQL*Plus: Release Production on Tue Sep 7 14:33:09 2010Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing optionsSQL> startup mount ORACLE instance start

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论