안녕하세요, 초보개발자 입니다.
트리거를 만들어서 Table에 트리거를 걸고 확인한결과
ORA-01403: no data found(ORA-00060도 같이 발생)
ORA-06512: at "접속자ID.T2", line 8
ORA-04088: error during execution of trigger '테이블.T2'
하였습니다. 검색을 한결과 :NEW, :OLD부분에서 문제가 있는것 같은데 이해가 안가서 질문드립니다
다음은 트리거를 만들었을때의 쿼리문 입니다.
create or replace trigger t2 AFTER insert on 테이블 for each row declare t_svc_nm varchar2(50) := ''; t_mon_nm varchar2(30) := ''; begin if (:NEW.MON_NAME <> 'ARGOS' and :NEW.MON_NAME <> 'WATAS') then SELECT service_name into t_svc_nm FROM service_info WHERE server_name = :NEW.SERVER_NAME; else t_svc_nm = :NEW.SERVICE_NAME; end if; INSERT INTO ALARM_HISTORY VALUES(:NEW.INDEX_TIME, :NEW.MON_NAME, :NEW.MON_EVENT_ID, :NEW.LAYER, :NEW.TIER, t_svc_nm, :NEW.SERVER_NAME, :NEW.IP, :NEW.SCENARIO, :NEW.FIRST_TIME, :NEW.LAST_TIME, :NEW.SEVERITY, :NEW.COUNT, :NEW.ALARM_STATUS, :NEW.ALARM_NAME, :NEW.ALARM_VALUE, :NEW.MESSAGE, :NEW.DETAIL_MESSAGE, :NEW.ALARM_TYPE, :NEW.POLICY, TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS'), TO_CHAR(SYSDATE, 'YYYYMMDDHH24MISS'), NULL, NULL); end;
다음은 에러로그 입니다.
2016-03-03 09:27:38,956 [ERROR] 로그관련 내용
java.sql.SQLException: ORA-01403: no data found
ORA-06512: at "접속자ID.T2", line 8
ORA-04088: error during execution of trigger '접속자ID.T2'
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1046) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3694) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1354) ~[ojdbc6.jar:11.2.0.4.0]
at com.ksign.wizlook.load.LoadThread.call(LoadThread.java:145) [LoadThread.class:?]
at com.ksign.wizlook.load.LoadThread.call(LoadThread.java:1) [LoadThread.class:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0.03-hp-ux]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0.03-hp-ux]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0.03-hp-ux]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0.03-hp-ux]
2016-03-03 09:27:49,183 [ERROR] 로그관련내용
java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource
ORA-06512: at "접속자ID.T2", line 24
ORA-04088: error during execution of trigger '접속자ID.T2'
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1046) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3694) ~[ojdbc6.jar:11.2.0.4.0]
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1354) ~[ojdbc6.jar:11.2.0.4.0]
at com.ksign.wizlook.load.LoadThread.call(LoadThread.java:145) [LoadThread.class:?]
at com.ksign.wizlook.load.LoadThread.call(LoadThread.java:1) [LoadThread.class:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0.03-hp-ux]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0.03-hp-ux]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0.03-hp-ux]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0.03-hp-ux]
이렇게 되는 상황입니다.
ORA-01403: no data found
SELECT INTO 절의 결과가 없어서 발생하는 에러입니다.
결과가 없을 때 예외처리를 해야 할 듯 하네요.
BEGIN SELECT service_name INTO t_svc_nm FROM service_info WHERE server_name = :NEW.server_name ; EXCEPTION WHEN NO_DATA_FOUND THEN t_svc_nm := ''; END;
ORA-00060: deadlock detected while waiting for resource
2개의 작업이 서로 상태방이 가진 자원을 무한 대기하는 교착상태시 발생하는 에러입니다.
교착상태의 원인을 파악하셔야 합니다.
창을 여러개 띄워 작업중이시라면 모두 닫고 다시 시도해 보세요.