Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Usage of the dbms_stats.gather_database_stats() procedure

Re: Usage of the dbms_stats.gather_database_stats() procedure

From: Juan Carlos Reyes Pacheco <juancarlosreyesp_at_gmail.com>
Date: Mon, 13 Feb 2006 13:21:39 -0400
Message-ID: <cd4305c10602130921k613cbdefyc09aa5f37ee124ca@mail.gmail.com>


I created this function to be caleld from a jobs, If you have some improvement tellme please.
CREATE OR REPLACE PROCEDURE SYS.DB_CALCULAESTADISTICAS( cTipo VARCHAR2 DEFAULT 'P' )
   IS
BEGIN
-- enables monitoring in tables don't having monitoring enabled

DECLARE
  nJobNumber NUMBER;
BEGIN
  EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_DATE_LANGUAGE=''AMERICAN''';   DBMS_JOB.SUBMIT

	(job => nJobNumber
	,what =>'BEGIN DB_CALCULAESTADISTICAS; END;' -- Código/función a ejecutar
	,next_date => TRUNC(SYSDATE)+25/24 -- Fecha hora de inicio del job
	,interval =>  'SYSDATE+1' -- Intervalo de ejecución para el job
	);

COMMIT;
END;
/
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Feb 13 2006 - 11:21:39 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US