達夢資料庫手工恢復相關命令

dmcatding發表於2021-08-21

#新建還原用資料庫

dminit path=/dm/dmdbms/data db_name=XX auto_overwrite=1



dm.ini手工編輯,ctl檔案可以手工修改


利用dmctlcvt轉換工具,將dm.ctl檔案轉換成txt型別進行修改

./dmctlcvt c2t /dm/dmdbms/data/DAMENG/dm.ctl  /dm/dmdbms/data/XXX/dmctl.txt


修改路徑:

sed -i "s#/dm/dmdbms/data#/XXX#g" dmctl.txt


修改完成之後,再將dmctl.txt轉換成dm.ctl格式

./dmctlcvt t2c  /dm/dmdbms/data/XXX/dmctl.txt  /dm/dmdbms/data/DAMENG/dm.ctl



#還原

RMAN> RESTORE DATABASE '/dm/dmdbms/data/XXX/dm.ini' FROM BACKUPSET' /dmback/full_test1_5236/';


#恢復

RMAN> RECOVER DATABASE '/dm/dmdbms/data/XXX/dm.ini' FROM BACKUPSET' /dmback/full_test1_5236/';


差異增量還原:

RMAN> RESTORE DATABASE '/dm/dmdbms/data/other_restore_test/dm.ini' FROM BACKUPSET '/dmback/increment_test1_5236_02' WITH BACKUPDIR '/dmback' RENAME TO 'other_restore_test';

差異增量恢復:

RMAN> RECOVER DATABASE '/dm/dmdbms/data/other_restore_test/dm.ini' FROM BACKUPSET '/dmback/increment_test1_5236_02';


累積增量還原:

RMAN> RESTORE DATABASE '/dm/dmdbms/data/other_restore_test/dm.ini' FROM BACKUPSET '/dmback/cumulative_test1_5236_01' WITH BACKUPDIR '/dmback' RENAME TO 'other_restore_test';

累積增量恢復:

RMAN> RECOVER DATABASE '/dm/dmdbms/data/other_restore_test/dm.ini' FROM BACKUPSET '/dmback/cumulative_test1_5236_01';




#更新資料庫DB_MAGIC

RECOVER DATABASE '/dm/dmdbms/data/XXX/dm.in' UPDATE DB_MAGIC;




#修改埠號

修改埠號,透過修改  dm.ini 檔案中的  PORT_NUM 選項實現



#註冊為系統服務

$DM_HOME/scripts/root/dm_service_installer.sh -t dmserver -dm_ini /dm/dmdbms/data/XXX/dm.ini -p XXXX




#啟動資料庫

$DM_HOME/bin/DmServiceXXXX start


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30327022/viewspace-2788132/,如需轉載,請註明出處,否則將追究法律責任。

相關文章