Oracle 9.2.0.1版本函數(shù)編譯的一個BUG
OS:Windows 2003 Server
ORACLE9.2.0.1
現(xiàn)象:在進(jìn)行PL/SQL 函數(shù)編譯時加上DEBUG會出現(xiàn)死機(jī),詳細(xì)描述如下:
下面是一個函數(shù):
SQL> create or replace function A2(arg_bh User_Tables.table_name%type) 2 return number is 3 Result VARCHAR2(50); 4 begin 5 select arg_bh || rpad(arg_bh, 46) || '(測試)' into Result from dual; 6 end A2; 7 / Function created SQL> alter function a2 compile; Function altered SQL> alter function a2 compile debug;
然后就出現(xiàn)了數(shù)據(jù)庫死機(jī)現(xiàn)象,CPU100%
會話處理等待狀態(tài),等待事件為null event
鎖住了以下系統(tǒng)表
SYS ERROR$SYS PROCEDUREINFO$SYS ARGUMENT$SYS PROCEDUREC$SYS PROCEDUREJAVA$SYS VTABLE$SYS PROCEDURE$SYS IDL_UB1$SYS IDL_CHAR$SYS IDL_UB2$SYS IDL_SB4$
使用KILL不能殺掉進(jìn)程,進(jìn)程一直處于killed狀態(tài),通過orakill命令才可以KILL進(jìn)程
做過一些測試,發(fā)現(xiàn)主要問題是以下代碼片段引起的:
arg_bh User_Tables.table_name%typearg_bh || rpad(arg_bh, 46) || '(測試)'
在數(shù)據(jù)庫 9.2.0.7中同樣的代碼編譯正常,說明這是9.2.0.1的BUG,具體不知道在什么版本中修復(fù)了,所以建議大家在開發(fā)時最好升級到高一些的版本。
