Db2恢復注意事項

zgy13121發表於2009-05-22
一、 用Quest Central for db2匯入檔案時,當檔案較大時(超過1g),機器看起來像當機一樣! 二、 當匯入的表有 Id BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1, CACHE 20, MINVALUE 1, MAXVALUE 9223372036854775807, NO CYCLE, NO ORDER) 這種欄位時,是不能用全表匯入匯出這種方式的,必須將欄位id去掉,才能匯入。 出現以下情況後 SQL0289N 不能在表空間 "USERSPACE1" 中分配新頁。 SQLSTATE=57011 再次匯入會報錯如下 SQL0668N 由於表 "BASEINFO.R010213_V_POUT_QUERY_ZW_A" 上的原因碼為 "3",所以不允許操作。 SQLSTATE=57016 解決方法: 透過分別發出帶有 RESTART 或 TERMINATER 選項的 LOAD來重新啟動或終止先前失敗的對此表的 LOAD 操作。 三、 建議資料庫備份在要求時間的情況下,儘可能的用backup db進行全庫備份與恢復。在用邏輯備份的情況下用db2move db load比db2move db import要快。 四、 對於大表,可用兩資料庫直連方式,進行匯入恢復。 db2 connect to db100 user baseinfo using baseinfo 資料庫連線資訊 資料庫伺服器 = DB2/NT 9.1.0 SQL 授權標識 = BASEINFO 本地資料庫別名 = DB100 db2 "declare c1 cursor database std198 user baseinfo using baseinfo for SELECT REQNO, BDG_YEAR, ORI_DP_ID, ORI_BAL_DP_ID, ORI_UNIT_ID, ORI_OUT_TYPE_CODE, ORI_QUATOTYPE, ORI_BDGT_ID_TYPE, ORI_BDGT_ID, BDGT_NAME, PRJ_CODE, PLANMONTH, YSZH, STATUS_Z, STATUS_F, FILL_FORM, REQDATE, RECHECKER, RECHECKER1TIME, RECHECKER2, RECHECKER2TIME, ZFZH, MAKER_BY, CREATEVCHTIME, RECHECKER_VCH, VCHOKTIME, VCHPRINTTIME, VCHER, VCHOVERTIME, IF_COLL_PAY, ACCOUNTBANK, COLL_PAY_ACCOUNTBANK, PAY_ACCOUNTBANK, ACCOUNTBANK2, COLL_PAY_ACCOUNTBANK2, USE_DESC, PAY_ACCOUNTBANK2, ACCESS_SLT, ACCESS_NO, IF_SALARY, NOTES, SOURCE, ITEM_CODE, NOR_OUTLAY, VCH_STATUS, OUT_VCH_NO, ZW_FCOID_ZF, ZW_PERIOD_ZF, ZW_FCOID_GK, ZW_PERIOD_GK, FLAG_SEC, VCH_BDGT_ID_TYPE, VCH_BDGT_ID, CO_BDGT_ID, ZX_BDGT_ID, ORI_USE_UNIT_ID, ACCOUNT, FSERIALNUM_GK, PAY_AMT, COLL_ACCOUNTNAME, COLL_BANKNAME, COLL_ACCOUNT, ACCOUNTNAME, BANKNAME, ACCOUNT_DB2, UNIT_ID, USE_UNIT_ID, DP_ID, BAL_DP_ID, OUT_TYPE_CODE, BDGT_ID, WB_BDGT_ID, QUATOTYPE, WB_QUATOTYPE, BDGT_ID_TYPE, WB_BDGT_ID_TYPE, BDGT_TYPE_NAME, CO_BDGT_NAME, PRJ_DES, QUATONAME, OUT_TYPE_NAME, UNIT_NAME, WB_BAL_DP_ID, WB_DP_ID, WB_OUT_TYPE_CODE, WB_UNIT_ID FROM BASEINFO.R010213_V_POUT_QUERY_FJZ_A" DB20000I SQL 命令成功完成。 db2 "load from c1 of cursor messages d:R010213_V_POUT_QUERY_FJZ_A.msg insert into BASEINFO.R010213_V_POUT_QUERY_FJZ_A( REQNO, BDG_YEAR, ORI_DP_ID, ORI_BAL_DP_ID, ORI_UNIT_ID, ORI_OUT_TYPE_CODE, ORI_QUATOTYPE, ORI_BDGT_ID_TYPE, ORI_BDGT_ID, BDGT_NAME, PRJ_CODE, PLANMONTH, YSZH, STATUS_Z, STATUS_F, FILL_FORM, REQDATE, RECHECKER, RECHECKER1TIME, RECHECKER2, RECHECKER2TIME, ZFZH, MAKER_BY, CREATEVCHTIME, RECHECKER_VCH, VCHOKTIME, VCHPRINTTIME, VCHER, VCHOVERTIME, IF_COLL_PAY, ACCOUNTBANK, COLL_PAY_ACCOUNTBANK, PAY_ACCOUNTBANK, ACCOUNTBANK2, COLL_PAY_ACCOUNTBANK2, USE_DESC, PAY_ACCOUNTBANK2, ACCESS_SLT, ACCESS_NO, IF_SALARY, NOTES, SOURCE, ITEM_CODE, NOR_OUTLAY, VCH_STATUS, OUT_VCH_NO, ZW_FCOID_ZF, ZW_PERIOD_ZF, ZW_FCOID_GK, ZW_PERIOD_GK, FLAG_SEC, VCH_BDGT_ID_TYPE, VCH_BDGT_ID, CO_BDGT_ID, ZX_BDGT_ID, ORI_USE_UNIT_ID, ACCOUNT, FSERIALNUM_GK, PAY_AMT, COLL_ACCOUNTNAME, COLL_BANKNAME, COLL_ACCOUNT, ACCOUNTNAME, BANKNAME, ACCOUNT_DB2, UNIT_ID, USE_UNIT_ID, DP_ID, BAL_DP_ID, OUT_TYPE_CODE, BDGT_ID, WB_BDGT_ID, QUATOTYPE, WB_QUATOTYPE, BDGT_ID_TYPE, WB_BDGT_ID_TYPE, BDGT_TYPE_NAME, CO_BDGT_NAME, PRJ_DES, QUATONAME, OUT_TYPE_NAME, UNIT_NAME, WB_BAL_DP_ID,WB_DP_ID, WB_OUT_TYPE_CODE, WB_UNIT_ID )" 讀取行數 = 7044 跳過行數 = 0 裝入行數 = 7044 拒絕行數 = 0 刪除行數 = 0 落實行數 = 7044[@more@]

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

相關文章