Netbackup 安装配置-DB2备份的配置

1.安装DB2软件选(此处省略)
2.安装NBU软件,并且增加DB2的liscense(此处省略)
3.打开数据库的归档
    db2 get db cfg for sample |grep -i log
    db2 update db cfg for sample using LOGRETAIN ON
    db2 update db cfg for sample using LOGARCHMETH1 'disk:/db2/db2data/archlog'
     db2 archive log for db sample
4.将 DB2 配置为与 NetBackup 一起工作
    ./db2_config
    logaudt1:[/usr/openv/netbackup/bin]# cd /usr/openv/netbackup/bin
    logaudt1:[/usr/openv/netbackup/bin]# ./db2_config
    Please specify the DB2 instance home path name:
    /db2/db2data
    Do you have other DB2 instances? (y/n) [n] 
    n
    Linking /db2/db2data/sqllib/adm/db2uext2 to /usr/openv/netbackup/bin/db2uext2.64.

    Copying /usr/openv/netbackup/ext/db_ext/db2/scripts/db2.conf to /db2/db2data/db2.conf.
5.配置/etc/hosts
     bak_svr3[/]#grep logaudt /etc/hosts
    10.32.208.55    logaudt1_per    logaudt1
     logaudt1:[/]# grep bak /etc/hosts
    10.32.208.16    bak_svr34_svc
    10.32.208.14    bak_svr3_per    bak_svr3
    10.32.208.15    bak_svr4_per    bak_svr4
6.配置db2.conf文件
    $ cp /usr/openv/netbackup/ext/db_ext/db2/scripts/db2.conf db2.conf
     vi db2.conf
    DATABASE SAMPLE
    OBJECTTYPE DATABASE
    POLICY DB2_DB_Sample
    SCHEDULE Default-Application-Backup
    ENDOPER
    DATABASE SAMPLE
    OBJECTTYPE ARCHIVE
    POLICY DB2_Log_Sample
    SCHEDULE User
    ARCFUNC SAVE    
    ENDOPER
7.配置bp.conf 文件
    logaudt1:[/db2/db2data]# more /usr/openv/netb*/bp.conf     
    SERVER = bak_svr34_svc    
    SERVER = logaudt1
    CLIENT_NAME = logaudt1

    CONNECT_OPTIONS = localhost 1 0 2
    USE_VXSS = PROHIBITED
    VXSS_SERVICE_TYPE = INTEGRITYANDCONFIDENTIALITY
    EMMSERVER = bak_svr34_svc

    HOST_CACHE_TTL = 3600
    bak_svr3[/usr/openv/netbackup]#grep log bp.conf 
    SERVER = logaudt1
8.配置db2的备份脚本
    logaudt1:[/usr/openv/netbackup/ext/db_ext/db2/scripts]# cp db2_* /usr/openv/db2/scr*
    logaudt1:[/usr/openv/db2/script]# ls -l
    total 48
    -r-xr-xr-x    1 root     system         5269 Jan 15 17:00 db2_all_backup_mpp
    -r-xr-xr-x    1 root     system         5383 Jan 15 17:00 db2_all_restore_mpp
    -r-xr-xr-x    1 root     system         1736 Jan 15 17:00 db2_backup
    -r-xr-xr-x    1 root     system         1245 Jan 15 17:00 db2_restore
    logaudt1:[/usr/openv/db2/script]# chmod 755 db2_*
    MY_LIB=/usr/openv/netbackup/bin/nbdb2.sl64
    MY_DB2=sample
    MY_USER=db2inst1
    time=`date '+%Y%m%d'`
    LOG=${0}${time}.out
    CMD_LINE="db2 BACKUP DATABASE $MY_DB2 $MY_SCHED LOAD $MY_LIB OPEN 4 SESSIONS BUFFER 1024  2>&1 >> $LOG"
9.创建pool 
    选择 volume pool ,新建 vp_test

10.配置db2的备份策略DB2_DB_Sample、DB2_Log_Sample 
logaudt1:[/usr/openv/db2/script]# bppllist DB2_DB_Sample -U
------------------------------------------------------------
Policy Name:       DB2_DB_Sample
  Policy Type:         DB2
  Active:              yes
  Effective date:      01/15/2013 17:15:22
  Mult. Data Streams:  no
  Client Encrypt:      no
  Checkpoint:          no
  Policy Priority:     0
  Max Jobs/Policy:     Unlimited
  Disaster Recovery:   0
  Collect BMR info:    no
  Residence:           bak_svr34_svc-hcart3-robot-tld-0
  Volume Pool:         vp_test
  Server Group:        *ANY*
  Keyword:             (none specified)
  Data Classification:       -
  Residence is Storage Lifecycle Policy:    no
  Application Discovery:      no
  Discovery Lifetime:      0 seconds
  Granular Restore Info:  no
  Ignore Client Direct:  no
  HW/OS/Client:  RS6000        AIX5          logaudt1
  Include:  /usr/openv/db2/script/db2_backup_sample
  Schedule:          full
    Type:            Automatic Full Backup
    Frequency:       every 7 days
    Synthetic:       0
    PFI Recovery:    0
    Retention Level: 1 (2 weeks)
    Residence is Storage Lifecycle Policy:     0
    Daily Windows:
          Sunday     11:00:00  -->  Sunday     12:00:00
          Monday     11:00:00  -->  Monday     12:00:00
          Tuesday    11:00:00  -->  Tuesday    12:00:00
          Wednesday  11:00:00  -->  Wednesday  12:00:00
          Thursday   11:00:00  -->  Thursday   12:00:00
          Friday     11:00:00  -->  Friday     12:00:00
          Saturday   11:00:00  -->  Saturday   12:00:00
  Schedule:          Default-Application-Backup
    Type:            Application Backup
    Maximum MPX:     1
    Synthetic:       0
    PFI Recovery:    0
    Retention Level: 1 (2 weeks)
    Number Copies:   1
    Fail on Error:   0
    Residence:       (specific storage unit not required)
    Volume Pool:     (same as policy volume pool)
    Server Group:    (same as specified for policy)
    Residence is Storage Lifecycle Policy:     0
    Daily Windows:
          Sunday     00:00:00  -->  Sunday     24:00:00
          Monday     00:00:00  -->  Monday     24:00:00
          Tuesday    00:00:00  -->  Tuesday    24:00:00
          Wednesday  00:00:00  -->  Wednesday  24:00:00
          Thursday   00:00:00  -->  Thursday   24:00:00
          Friday     00:00:00  -->  Friday     24:00:00
          Saturday   00:00:00  -->  Saturday   24:00:00

logaudt1:[/usr/openv/db2/script]# bppllist DB2_Log_Sample -U
------------------------------------------------------------
Policy Name:       DB2_Log_Sample
  Policy Type:         Standard
  Active:              yes
  Effective date:      01/16/2013 13:42:18
  Client Compress:     no
  Follow NFS Mounts:   no
  Cross Mount Points:  no
  Collect TIR info:    yes, with move detection
  Block Incremental:   no
  Mult. Data Streams:  no
  Client Encrypt:      no
  Checkpoint:          no
  Policy Priority:     0
  Max Jobs/Policy:     Unlimited
  Disaster Recovery:   0
  Collect BMR info:    yes
  Residence:           bak_svr34_svc-hcart3-robot-tld-0
  Volume Pool:         vp_test
  Server Group:        *ANY*
  Keyword:             (none specified)
  Data Classification:       -
  Residence is Storage Lifecycle Policy:    no
  Application Discovery:      no
  Discovery Lifetime:      0 seconds
  Granular Restore Info:  no
  Ignore Client Direct:  no
  HW/OS/Client:  RS6000        AIX5          logaudt1
  Include:      (none defined)
  Schedule:          DB2_Log_User
    Type:            User Archive
    Maximum MPX:     1
    Synthetic:       0
    PFI Recovery:    0
    Retention Level: 1 (2 weeks)
    Number Copies:   1
    Fail on Error:   0
    Residence:       (specific storage unit not required)
    Volume Pool:     (same as policy volume pool)
    Server Group:    (same as specified for policy)
    Residence is Storage Lifecycle Policy:     0
    Daily Windows:
          Sunday     00:00:00  -->  Sunday     23:59:59
          Monday     00:00:00  -->  Monday     23:59:59
          Tuesday    00:00:00  -->  Tuesday    23:59:59
          Wednesday  00:00:00  -->  Wednesday  23:59:59
          Thursday   00:00:00  -->  Thursday   23:59:59
          Friday     00:00:00  -->  Friday     23:59:59
          Saturday   00:00:00  -->  Saturday   23:59:59

你可能感兴趣的:(数据库,备份,DB2,Netbackup,Netbackup)