您好,登錄后才能下訂單哦!
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.新建數(shù)據(jù)庫(kù)
新庫(kù)與備份文件db2ckbkp的檢查內(nèi)容恢復(fù)一致
Instance -- db2inst Client Database Alias -- DMSDEV Timestamp -- 20160513102947 DB Codeset -- UTF-8 LogPath -- /db2data/db2inst/NODE0000/SQL00002/SQLOGDIR/
*強(qiáng)烈要求的注意事項(xiàng):
(1)如果Instance名稱(chēng)不致,須新建與之一致的實(shí)例;
(2)要新建與原用戶(hù)一致的home路徑(以上則為/db2data)
--創(chuàng)建實(shí)例用戶(hù)及fence用戶(hù)
# su - root # useradd -m -gdb2iadm1 -d /home/db2inst db2inst # useradd -m -gdb2fadm1 -d /home/db2fenc db2fenc # passwd db2inst # passwd dbfenc
--創(chuàng)建新實(shí)例,與原實(shí)例命名一致
# su - root # cd/opt/ibm/db2/V10.5/instance # ./db2icrt -p 50100-u db2fenc db2inst
--創(chuàng)建新的數(shù)據(jù)庫(kù),與原數(shù)據(jù)庫(kù)名一致
# su - db2inst # db2start # db2create database dmsdev using codesetutf-8 territory CN
--更改備份文件的所有權(quán)限
# su - root # chowndb2inst:db2iadm1 /home/DMSDEV.0.db2inst.NODE0000.CATN0000.20160513102947.001
--創(chuàng)建原實(shí)例home路徑
# su - root # mkdir /db2data # chowndb2inst:db2iadm1 /db2data
--導(dǎo)入全備份文件
# su -db2inst # db2restore database dmsdev from /home taken at20160513102947 without rolling forward without prompting
--分配庫(kù)的管理權(quán)限
# db2connect to dmsdev # db2grant dbadm on database to user dms
3.數(shù)據(jù)庫(kù)配置工作
(1)修改/etc/service下的db2inst的端口號(hào)
(2)# db2setDB2COMM=tpcip
(3) # reboot
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。