Pular para o conteúdo principal

Postagens

Mostrando postagens de fevereiro, 2011

Check status JVM Database

-- script to determine the status of the Oracle JVM and required packages connect / as sysdba spool jvm_stats.log set serveroutput on set echo on set pagesize500 set linesize 100 column comp_name format a40 select comp_name, version, status from dba_registry; select owner, status, count(*) from all_objects where object_type like '%JAVA%' group by owner, status; select owner, object_type, count(*) from all_objects where object_type like '%JAVA%' and status 'VALID' group by owner, object_type; select owner, status, object_type, object_name from all_objects where object_name like'%DBMS_JAVA%'; select owner, status, object_type, object_name from all_objects where object_name like'%INITJVMAUX%'; select role from dba_roles where role like '%JAVA%'; select * from v$sgastat where POOL = 'java pool' or NAME = 'free memory'; show parameter pool_size show parameter sga select owner, object_type, status, dbms_java.longname(object...

Script to Check Schemas with Stale Statistics

SET FEEDBACK OFF SET LINESIZE 250 SET SERVEROUTPUT ON DECLARE -- Variables declared P_OTAB DBMS_STATS.OBJECTTAB; MCOUNT NUMBER := 0; P_VERSION VARCHAR2(10); -- Cursor defined CURSOR c1 IS SELECT distinct schema FROM dba_registry ORDER by 1; -- Beginning of the anonymous block BEGIN -- Verifying version from v$instance SELECT version INTO p_version FROM v$instance; DBMS_OUTPUT.PUT_LINE(chr(13)); -- Defining Loop 1 for listing schema which have stale stats FOR x in c1 LOOP DBMS_STATS.GATHER_SCHEMA_STATS(OWNNAME=>x.schema,OPTIONS=>'LIST AUTO',OBJLIST=>p_otab); -- Defining Loop 2 to find number of objects containing stale stats FOR i in 1 .. p_otab.count LOOP IF p_otab(i).objname NOT LIKE 'SYS_%' AND p_otab(i).objname NOT IN ('CLU$','COL_USAGE$','FET$','INDPART$', 'MON_MODS$','TABPART$','HISTGRM$', 'MON_MODS_ALL$', 'HIST_HEAD$','IN $',...