您好,登錄后才能下訂單哦!
1.使用db2ckbkp -h <db_backup_file_name>檢查備份文件
[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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。