昨晚進行一很小DB的遷移,也就100M的樣子,卻用了我蠻長時間,
其中過程中的小細節值得記錄下來。
1.DB重新命名,停止用戶連線使用:
dbaccess->sysmaster->rename hsescm to hsescm_0705;
2.過濾schema中index,synonym中部分,加快執行速度,在導入data後再進行建立。
卻發現有一table也不過18M而已卻花掉我70min時間,有點不可思議。
查找原因發有幾個trigger關聯這張table,這也就是慢的原因。
其實應該把index,synoym,trigger,procedure全部過濾出來,再進行數據導入的,而後再進行相應結構建立,不僅提高速度,也避免log的產生。
3.最後進行DB日志模式的更改:
#ontape -s -U hsescm -L 0
備存失敗 - 變更登錄狀態錯誤 - 'hsescm'. iserrno 107.
程式結束.
#finderr 107
-107 ISAM error: record is locked.
Another user request has locked the record that you requested or the
file (table) that contains it. This condition is normally transient. A
program can recover by rolling back the current transaction, waiting a
short time, and re-executing the operation. For interactive SQL, redo
the operation. For C-ISAM programs, review the program logic and make
sure that it can handle this case, which is a normal event in
multiprogramming systems. You can obtain exclusive access to a table by
passing the ISEXCLLOCK flag to isopen. For SQL programs, review the
program logic and make sure that it can handle this case, which is a
normal event in multiprogramming systems. The simplest way to handle
this error is to use the statement SET LOCK MODE TO WAIT. For bulk
updates, see the LOCK TABLE statement and the EXCLUSIVE clause of the
DATABASE statement.
有其它用戶連接此數據庫,確定退出後,再重復以上,OK.
久不練手,生疏了很多,此次作業有點小不滿意。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7836221/viewspace-667352/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7836221/viewspace-667352/