【正文】
nal 中軟國際 數(shù)據(jù)庫日常維護 — 備份數(shù)據(jù)庫 ? 備份數(shù)據(jù)庫要具有下列權(quán)限: SYSADM /SYSCTRL /SYSMAINT ? 兩種可以備份方式 ? 脫機數(shù)據(jù)庫備份,需要至數(shù)據(jù)庫的獨占連接,它將備份數(shù)據(jù)庫中的所有表空間; backup db sample to c:\backup with 3 buffers buffer 1000 without prompting ? 聯(lián)機數(shù)據(jù)庫備份,可以備份整個數(shù)據(jù)庫或者單個表空間。 backup db sample tablespace (userspace1) online to /dev/rmt0 without prompting 要執(zhí)行聯(lián)機備份,確保數(shù)據(jù)庫參數(shù) logretain = on 或 設(shè)置了logarchmetd1支持聯(lián)機備份 ? 獲得以前備份的數(shù)據(jù)庫的信息: list history backup all for database sample ChinaSoft International 中軟國際 數(shù)據(jù)庫日常維護 — 恢復數(shù)據(jù)庫 ? 恢復數(shù)據(jù)庫要具有下列權(quán)限: SYSADM / SYSCTRL / SYSMAINT 如果恢復至一個新數(shù)據(jù)庫,則需要 SYSADM或 SYSCTRL。 restore db sample tablespace (userspace1) online from /dev/rmt0 taken at 20220222082310 newlogpath /home/db2v8/newlogs without prompting restore database sample from /home/db2v8/backup into newdb without prompting ? 目標數(shù)據(jù)庫的代碼頁必須與備份數(shù)據(jù)庫映象的代碼頁匹配。 ? 如果平臺、 DB2 版本號和版本分序號都相同,則可以恢復到現(xiàn)有的遠程數(shù)據(jù)庫去。確保將要恢復的數(shù)據(jù)庫編目到本地機器上。 ? 恢復可以使用外部的存儲管理軟件如 QC等。