重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
1.使用db2ckbkp -h
创新互联建站从2013年创立,先为彭阳等服务建站,彭阳等地企业,进行企业商务咨询服务。为彭阳企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。
[db2inst1@ESB-DB-J5 home]$ db2ckbkp -hDMSDEV.0.db2inst.NODE0000.CATN0000.20160513102947.001
===================== MEDIA HEADER REACHED: ===================== Server Database Name -- DMSDEV Server Database Alias -- DMSDEV Client Database Alias -- DMSDEV Timestamp -- 20160513102947 Database Partition Number -- 0 Instance -- db2inst Database Configuration Type -- 0 (Non-shared data) Sequence Number -- 1 Database Member ID -- 0 Release ID -- 0xD00 (DB2 v9.7) Database Seed -- 0x7903558C DB Comment's Codepage (Volume) --0 DB Comment (Volume) -- DB Comment's Codepage (System) --0 DB Comment (System) -- Authentication Value -- 255 (Not specified) Backup Mode -- 0 (Offline) Includes Logs -- 0 (No) Compression -- 0 (Uncompressed) Backup Type -- 0 (Database-level) Backup Granularity -- 0 (Non-incremental) Merged Backup Image -- 0 (No) Status Flags -- 0x1 Consistent onthis member System Catalogs in thisp_w_picpath -- 1 (Yes) Catalog Partition Number -- 0 DB Codeset -- UTF-8 DB Territory -- LogID -- 1458720781 LogPath --/db2data/db2inst/NODE0000/SQL00002/SQLOGDIR/ Backup Buffer Size -- 16781312 (4097 4K pages) Number of Sessions -- 1 Platform -- 0x1E (Linux-x86-64) The properp_w_picpath file name would be: DMSDEV.0.db2inst.DBPART000.20160513102947.001 [1] Buffersprocessed: ######################################################################################################################################################################################################################################## Image Verification Complete - successful.
2.新建数据库
新库与备份文件db2ckbkp的检查内容恢复一致
Instance -- db2inst Client Database Alias -- DMSDEV Timestamp -- 20160513102947 DB Codeset -- UTF-8 LogPath -- /db2data/db2inst/NODE0000/SQL00002/SQLOGDIR/
*强烈要求的注意事项:
(1)如果Instance名称不致,须新建与之一致的实例;
(2)要新建与原用户一致的home路径(以上则为/db2data)
--创建实例用户及fence用户
# su - root # useradd -m -gdb2iadm1 -d /home/db2inst db2inst # useradd -m -gdb2fadm1 -d /home/db2fenc db2fenc # passwd db2inst # passwd dbfenc
--创建新实例,与原实例命名一致
# su - root # cd/opt/ibm/db2/V10.5/instance # ./db2icrt -p 50100-u db2fenc db2inst
--创建新的数据库,与原数据库名一致
# su - db2inst # db2start # db2create database dmsdev using codesetutf-8 territory CN
--更改备份文件的所有权限
# su - root # chowndb2inst:db2iadm1 /home/DMSDEV.0.db2inst.NODE0000.CATN0000.20160513102947.001
--创建原实例home路径
# su - root # mkdir /db2data # chowndb2inst:db2iadm1 /db2data
--导入全备份文件
# su -db2inst # db2restore database dmsdev from /home taken at20160513102947 without rolling forward without prompting
--分配库的管理权限
# db2connect to dmsdev # db2grant dbadm on database to user dms
3.数据库配置工作
(1)修改/etc/service下的db2inst的端口号
(2)# db2setDB2COMM=tpcip
(3) # reboot