TRUNCATE TABLE ZHU_LOG
/
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
   job_name             => 'LIMPA_ZHU_LOG',
   job_type             => 'PLSQL_BLOCK',
   job_action           => 'delete zhu_log where TIMESTAMP < SYSDATE-30; commit;',
   start_date           => TO_DATE(TO_CHAR(SYSDATE, 'DD/MM/YYY')||' 00:00:00', 'DD/MM/YYYY HH24:MI:SS'),
   repeat_interval      => 'FREQ=DAILY', 
   enabled              =>  TRUE,
   comments             => 'Apagar registro de mais do 30 dias');
   dbms_scheduler.run_job('LIMPA_ZHU_LOG');
END;

CREATE TABLE RELACFILESERVER  (
   CDRELAC      	VARCHAR2(12) 		NOT NULL,
   DIRETORIO        	VARCHAR2(400) 		NOT NULL,
   FILESERVERLINK   	VARCHAR2(400) 		NOT NULL,
   NRORG                       	NUMBER DEFAULT 	 SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
   IDATIVO                    	VARCHAR2(1)     		DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_RELACFILESERVER   CHECK (IDATIVO IN ('S','N')),
   DTINCLUSAO             DATE                   		NULL,
   DTULTATU                  	DATE                  		NULL,
   NRORGINCLUSAO    NUMBER             		DEFAULT 1 NULL,
   CDOPERINCLUSAO  VARCHAR2(12)  		DEFAULT '1' NULL,
   NRORGULTATU          NUMBER             		DEFAULT 1 NULL,
   CDOPERULTATU        VARCHAR2(12)  		DEFAULT '1'
   )
/
ALTER TABLE INSCRESTAD ADD DSDIRCERTIFICADO VARCHAR2(500)