NBU备份DB2

查看状态
$ db2 list database directory
$ db2 get db cfg for BZDB
$ db2 list tablespaces
$ db2 list tables
$ db2 select * from table
· 创建数据库
$db2 create database BZDB
· 连接数据库
$db2 connect to BZDB
· 创建表
$ db2 create table test (name char(8) not null primary key,depid smallint,pay bigint)
· 插入数据
$ db2 insert into test values(‘li‘,1,1)
· 创建实例
DB2_install=/usr/opt/db2_08_01/instance
./db2icrt -u db2test db2test
· 删除数据库
db2 drop db db2test
db2stop
· 删除实例
cd DB2_install
./db2idrop -f db2test # -f参数一定要添加否则删除完了会报错!
· 删除用户
smitty user
选择Remove a User

  • User NAME [db2test] +
    Remove AUTHENTICATION information? yes
    删除用户目录
    rm -rf db2test
    vx:j8517870727

    · 查看归档
    [[email protected] ]$ db2 get db cfg|grep -i log
    Log retain for recovery status = NO
    User exit for logging status = YES
    Log buffer size (4KB) (LOGBUFSZ) = 256
    Log file size (4KB) (LOGFILSIZ) = 2000
    Number of primary log files (LOGPRIMARY) = 20
    Number of secondary log files (LOGSECOND) = 30
    Changed path to log files (NEWLOGPATH) =
    Path to log files = /home/db2inst1/db2inst1/NODE0000/SQL00001/SQLOGDIR/
    Overflow log path (OVERFLOWLOGPATH) =
    Mirror log path (MIRRORLOGPATH) =
    First active log file = S0000001.LOG
    Block log on disk full (BLK_LOG_DSK_FUL) = NO
    Block non logged operations (BLOCKNONLOGGED) = NO
    Percent max primary log space by transaction (MAX_LOG) = 0
    Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0
    Percent log file reclaimed before soft chckpt (SOFTMAX) = 100
    Log retain for recovery enabled (LOGRETAIN) = OFF
    User exit for logging enabled (USEREXIT) = OFF
    HADR log write synchronization mode (HADR_SYNCMODE) = NEARSYNC
    First log archive method (LOGARCHMETH1) = DISK:/db2src/TS/backup/
    Options for logarchmeth1 (LOGARCHOPT1) =
    Second log archive method (LOGARCHMETH2) = OFF
    Options for logarchmeth2 (LOGARCHOPT2) =
    Failover log archive path (FAILARCHPATH)
    ###########################################################################################
    · 关闭第二归档方式
    $ db2 update db cfg for BZDB using LOGARCHMETH2 OFF
    · 将LOGARCHMETH1设为VENDOR
    $ db2 update database configuration for BZDB using LOGARCHMETH1 VENDOR:C:\progra~1\Veritas\NetBackup\bin\nbdb2.dll
    · 修改logretain状态为recovery
    $ db2 update db cfg for BZDB using userexit on
    · 修改userexit状态为on
    $db2 update db cfg for BZDB using logretain on
    · 使数据库能够增量备份
    $ db2 update db cfg for BZDB using trackmod yes
    · 执行离线备份,使归档日志模式生效
    $ db2 force application all
    win:
    $ db2 backup database nbutest to c:\db2_log
    linux:
    $ db2 backup database nbutest to /backup
    1、nbu配置
    创建db策略
    Attributes
    Policy type: DB2
    Schedules
    Name: DBFULL
    Type of Backup:Automatic Full Backup
    Schedule:
    Name: Default-Appplication-Backup-DB
    Type of Backup: Application Backup
    Clients: db2服务器主机名
    Backup Selections:db2_backup_nbu_online.cmd
    创建db log策略
    Attributes:
    Policy type: DB2
    Schedules:
    Name: Default-Application-Backup-LOG
    Type of backup: Application Backup
    Schedule:
    Name: LOGFuLL
    Type of backup:Automatic Full Backup
    Clients: DB2数据库主机
    Backup Selections:注此处为空

2、配置环境变量:db2.conf
从install_path\NetBackup\dbext\db2\samples\db2.conf 复制到 Install_path\NetBackup\dbext\db2\db2.conf

3、修改脚本:db2_backup_db_online.cmd
从install_path\NetBackup\ DbExt\sample\ db2_backup_db_online.cmd 复制到D盘 D:\db2_backup_nbu_online.cmd

4、修改db2uext2.exe
将C:\Program Files\Veritas\NetBackup\DbExt\DB2\db2uext2.exe复制到D:\SQLLIB\BIN

原文地址:http://blog.51cto.com/718689/2331993

时间: 2024-10-29 18:31:59

NBU备份DB2的相关文章

多备份与Symantec NBU备份软件对比

多备份 Symantec NBU备份软件 备份架构 基于本地与公有云的分层级备份体系,采用HyperIndex技术实现超大备份索引,可备份海量文件数据:永久增量备份.. 采用传统的C/S结构,架构单一,仅仅只适合在局域网内部署. 部署方式 可采用本地私有云部署以及云部署的多种方式组合:简洁安装,7*24在线服务,远程帮助接入,自助式备份策略设置,自助式恢复. 主要是基于企业内外环境的部署,需要专业工程师进行现场部署实施,部署周期长,实施较复杂. 空间占用 本地+云端的备份模式,可同时在本地和云端

1.1.1 NBU备份之Oracle问题故障的排查

1. Create debug folders under the following directories on database client: All log directories should be created under /usr/openv/netbackup/logs with 777 permissions. /usr/openv/netbackup/logs/bphdb /usr/openv/netbackup/logs/bpcd /usr/openv/netbacku

NBU 备份 SAP HANA

一. 链接libelf.so.0 检查并确定 libelf.so.0 通过符号链接到 libelf.so.0.8.13 文件.这些文件位于 /usr/lib64/ sapprd01:/#cd /usr/lib64/ sapprd01:/usr/lib64 #ln -s libelf.so.0.8.13 libelf.so.0 如果 libelf.so.0.8.12 文件没有出现在 /usr/lib64/ 位置,请将libelf.so.0.8.13 文件从 SUSE SLES 11 SP1 安装程

NBU备份oracle全备脚本注释

[email protected] # more hot_database_backup.sh #!/bin/sh # $Header: hot_database_backup.sh,v 1.3 2010/08/04 17:56:02 $ # #bcpyrght #********************************************************************* #* $VRTScprght: Copyright 2014 Symantec Corpora

【Teradata】DSA+NBU备份1148错误

1.问题描述 备份过程中在viewpoint中查看备份失败代码为1148,具体描述如下: 1148, DSA DSMAIN-BARNC Communication Exception:1001:(cedw-edwbak2) BSASendData failed retcode=3: "System detected error, operation aborted." BSAGetLastError: "Check logs in /usr/openv/netbackup/l

NBU 备份 SQL Server

添加SA密码 在SQL 服务器上打开Netbackup MS SQL Client 添加SA密码 生成备份脚本 在SQL 服务器上打开Netbackup MS SQL Client 选择Backup SQL Server Objects 选择要备份的库,备份类型为全备或者差异备份 创建SQL备份策略 选择备份类型为MS-SQL 添加计划 添加计算机 添加生成的脚本

NBU备份

日志: 2017/8/31 11:32:50 - begin Restore2017/9/2 1:41:37 - 1 images required2017/9/2 1:41:37 - media 0961L6 required2017/9/2 1:41:37 - media 0966L6 required2017/9/2 1:41:38 - restoring image bsb-front01_14986692012017/9/2 1:41:39 - Info bpbrm(pid=2996)

nbu备份虚拟机

http://blog.sina.com.cn/s/blog_6965d96d0102viee.html https://download.csdn.net/download/shixiaona01998/10181944 http://blog.51cto.com/3402313/1241421 https://wenku.baidu.com/view/b256fa950242a8956bece4ed.html https://jingyan.baidu.com/article/a3aad71

db2操作 连接、备份、恢复db2

db2默认需要切换到db2inst1这个默认用户才能执行操作 [[email protected] instance]# su - db2inst1 [[email protected] ~]$ db2start [[email protected] ~]$ db2 force application all [[email protected] ~]$ db2stop [[email protected] DB2]$ db2stop force 显示所有的实例[[email protected