WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR  EXIT FAILURE ROLLBACK;

spool SYS_RUNTIME_EXP_LOG_ARCHIVE.log

prompt
prompt Creating table SYS_RUNTIME_EXP_LOG_ARCHIVE
prompt ============================
prompt

whenever sqlerror continue
drop table SYS_RUNTIME_EXP_LOG_ARCHIVE;
whenever sqlerror exit failure rollback

create table SYS_RUNTIME_EXP_LOG_ARCHIVE
(
  EXCEPTION_ID      NUMBER not null,
  EXCEPTION_TYPE    VARCHAR2(200),
  EXCEPTION_MESSAGE VARCHAR2(2000),
  REQUEST_ID        VARCHAR2(100),
  CONTEXT_DUMP      CLOB,
  ROOT_STACK_TRACE  CLOB,
  FULL_STACK_TRACE  CLOB,
  SESSION_ID        NUMBER,
  CREATION_TIME     DATE default sysdate
);

alter table SYS_RUNTIME_EXP_LOG_ARCHIVE
  add primary key (EXCEPTION_ID)
  using index ;

spool off

exit
