Oracle NBU備份&異機恢復 for Linux

1 篇文章 0 订阅

Oracle NBU備份&異機恢復 for Linux

1.    NBU Linux客戶端軟件安裝

    A.     增加NBU Server到linux服務器

    B.     運行安裝軟件

        上傳軟件到linux服務器

        修改/etc/hosts文件。增加NBU server

     [root@SWHAP1DB01~]# cat /etc/hosts

     #Do not remove the following line, or various programs

     #that require network functionality will fail.

     127.0.0.1               localhost.localdomain localhost

     ::1             localhost6.localdomain6 localhost6

     192.168.1.1   servername

運行安裝軟件

[root@SWHAP1DB01 NetBackup_7.5_CLIENTS]# pwd

/root/NetBackup_7.5_CLIENTS

[root@SWHAP1DB01 NetBackup_7.5_CLIENTS]# ./install

……

Do you wish to continue? [y,n] (y) y

Do you want to install the NetBackup client software for thisclient? [y,n] (y) y

……

Enter the name of the NetBackup server : servername

Would you like to use "SWHAP1DB01" as the configured

name of the NetBackup client? [y,n] (y) y

………

File /usr/openv/tmp/install_trace.32057 contains a trace of thisinstall.

That file can be deleted after you are sure the install wassuccessful.

安裝結束。

2.    NBU備份

步驟:

A.  客戶端建立link庫文件

B.  Oracle服務器生成備份腳本

C.   NBU服務器製作排程

客戶端建立link 库文件libobk.so

          [root@SWHAP1DB01~]# su - oracle

          [oracle@SWHAP1DB01~]$ /usr/openv/netbackup/bin/oracle_link

          WedNov 27 09:03:37 CST 2013

          AllOracle instances should be shutdown before running this script.

          Pleaselog into the Unix system as the Oracle owner for running this script

          Do youwant to continue? (y/n) [n] y

          LIBOBKpath: /usr/openv/netbackup/bin

          ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1

          Oracleversion: 11.2.0.3.0

          Platformtype: x86_64

          LinkingLIBOBK:

  ln-s/usr/openv/netbackup/bin/libobk.so64                                             /u01/app/oracle/product/11.2.0/dbhome_1/lib/libobk.soDone

         Pleasecheck the trace file located in /tmp/make_trace.1699

         to make sure the linking process wassuccessful.----link成功

 創建備份腳本

/ usr/openv/netbackup/ext/db_ext/oracle/rman/samples/rman下的hot_database_backup.sh修改一下。

主要修改$ORACLE_HONE,$ORACLE_SID,ORACLE_USER

 

  服務器端設置Policy,这里就不截图了,相对简单

 

3.    異機恢復

a、在NBU server上增加異機恢復文件

C:\ProgramFiles\Veritas\NetBackup\db\

此目錄是A服務器上NBU的安裝目錄)這個目錄下新建altnames文件夾,然後在文件夾內新建No.Restrictions文件即可

 

b、查看備份記錄(查看是否有controlfile、spfile等)

在NBU Server上cmd執行

C:\ProgramFiles\Veritas\NetBackup\bin>bplist -C xxxxx -t 4 -R -l /

前面路徑是nbu軟件所在位置,xxxx處寫源備份機電腦名)

如果出現跟蹤文件不對,則需檢查adump文件有不有,查看init*SID.ora文件中的路徑是否在目標機上都有

 

c.恢復spfile(RMAN中執行,數據啟動到nomount階段)

run{

   ALLOCATECHANNEL ch00 TYPE 'SBT_TAPE';

       send'NB_ORA_SERV=xxxx1,NB_ORA_CLIENT=localhost.localdomain';

       restore spfile from 'xxxxx3';

   release channel ch00;

       }

(其中xxx1是NBU server電腦名,xxxx2是源備份主機名,xxxxx3是根據步驟2查到的spfile備份文件名)

 

d.恢復controlfile(RMAN中執行,數據啟動到nomount階段)

run{

ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';

 send'NB_ORA_SERV=whfs02,NB_ORA_CLIENT=swhhmddb03.ecmms.foxconn';

restorecontrolfile from 'controlfile_nbutest_20131213';

release channelch00;

   }

 

e.mount數據庫

 

f.恢復database(RMAN中執行,數據啟動到mount階段)

run {

    allocate channel ch00 type 'SBT_TAPE';

send'nb_ora_serv=scqdbatest001.ecmms.foxconn,nb_ora_client=localhost.localdomain';

restoredatabase;

recover database;

release channelch00;

    }

g.打開數據庫

alter databaseopen resetlogs;

 

特別要注意init*SID.ora文件中的每個路徑要存在,切在5步驟的時候注意數據文件是否恢復成功,不成功則多半是目錄不存在導致


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Ty_FFTQ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值