2026-03-12 20:23:15
This commit is contained in:
12
timhall/11g/admin_privs.sql
Normal file
12
timhall/11g/admin_privs.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/admin_privs.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays the users who currently have admin privileges.
|
||||
-- Requirements : Access to the V$ views.
|
||||
-- Call Syntax : @min_datafile_size
|
||||
-- Last Modified: 30/11/2011
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SELECT *
|
||||
FROM v$pwfile_users
|
||||
ORDER BY username;
|
||||
48
timhall/11g/autotask_change_window_schedules.sql
Normal file
48
timhall/11g/autotask_change_window_schedules.sql
Normal file
@@ -0,0 +1,48 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/autotask_change_window_schedules.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Use this script to alter the autotask window schedules.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @autotask_change_window_schedules.sql
|
||||
-- Last Modified: 14-JUL-2016
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
DECLARE
|
||||
TYPE t_window_tab IS TABLE OF VARCHAR2(30)
|
||||
INDEX BY BINARY_INTEGER;
|
||||
|
||||
l_tab t_window_tab;
|
||||
l_repeat_interval VARCHAR2(100);
|
||||
l_duration NUMBER;
|
||||
BEGIN
|
||||
|
||||
-- Windows of interest.
|
||||
l_tab(1) := 'SYS.MONDAY_WINDOW';
|
||||
l_tab(2) := 'SYS.TUESDAY_WINDOW';
|
||||
l_tab(3) := 'SYS.WEDNESDAY_WINDOW';
|
||||
l_tab(4) := 'SYS.THURSDAY_WINDOW';
|
||||
l_tab(5) := 'SYS.FRIDAY_WINDOW';
|
||||
--l_tab(6) := 'SYS.SATURDAY_WINDOW';
|
||||
--l_tab(7) := 'SYS.SUNDAY_WINDOW';
|
||||
|
||||
-- Adjust as required.
|
||||
l_repeat_interval := 'freq=weekly; byday=mon; byhour=12; byminute=0; bysecond=0;';
|
||||
l_duration := 120; -- minutes
|
||||
|
||||
FOR i IN l_tab.FIRST .. l_tab.LAST LOOP
|
||||
DBMS_SCHEDULER.disable(name => l_tab(i), force => TRUE);
|
||||
|
||||
DBMS_SCHEDULER.set_attribute(
|
||||
name => l_tab(i),
|
||||
attribute => 'REPEAT_INTERVAL',
|
||||
value => l_repeat_interval);
|
||||
|
||||
DBMS_SCHEDULER.set_attribute(
|
||||
name => l_tab(i),
|
||||
attribute => 'DURATION',
|
||||
value => numtodsinterval(l_duration, 'minute'));
|
||||
|
||||
DBMS_SCHEDULER.enable(name => l_tab(i));
|
||||
END LOOP;
|
||||
END;
|
||||
/
|
||||
25
timhall/11g/autotask_job_history.sql
Normal file
25
timhall/11g/autotask_job_history.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/autotask_job_history.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays the job history for the automatic maintenance tasks.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @autotask_job_history.sql
|
||||
-- Last Modified: 14-JUL-2016
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
COLUMN client_name FORMAT A40
|
||||
COLUMN window_name FORMAT A20
|
||||
COLUMN job_start_time FORMAT A40
|
||||
COLUMN job_duration FORMAT A20
|
||||
COLUMN job_status FORMAT A10
|
||||
|
||||
SELECT client_name,
|
||||
window_name,
|
||||
job_start_time,
|
||||
job_duration,
|
||||
job_status,
|
||||
job_error
|
||||
FROM dba_autotask_job_history
|
||||
ORDER BY job_start_time;
|
||||
|
||||
COLUMN FORMAT DEFAULT
|
||||
19
timhall/11g/autotask_schedule.sql
Normal file
19
timhall/11g/autotask_schedule.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/autotask_schedule.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays the window schedule the automatic maintenance tasks.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @autotask_schedule.sql
|
||||
-- Last Modified: 14-JUL-2016
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
COLUMN window_name FORMAT A20
|
||||
COLUMN start_time FORMAT A40
|
||||
COLUMN duration FORMAT A20
|
||||
|
||||
SELECT *
|
||||
FROM dba_autotask_schedule
|
||||
ORDER BY start_time;
|
||||
|
||||
|
||||
COLUMN FORMAT DEFAULT
|
||||
18
timhall/11g/database_block_corruption.sql
Normal file
18
timhall/11g/database_block_corruption.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/database_block_corruption.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays the users who currently have admin privileges.
|
||||
-- Requirements : Access to the V$ and DBA views.
|
||||
-- Assumes a RMAN VALIDATE has been run against a datafile, tablespace
|
||||
-- or the whole database before this query is run.
|
||||
-- Call Syntax : @database_block_corruption
|
||||
-- Last Modified: 29/11/2018
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
COLUMN owner FORMAT A30
|
||||
COLUMN segment_name FORMAT A30
|
||||
|
||||
SELECT DISTINCT owner, segment_name
|
||||
FROM v$database_block_corruption dbc
|
||||
JOIN dba_extents e ON dbc.file# = e.file_id AND dbc.block# BETWEEN e.block_id and e.block_id+e.blocks-1
|
||||
ORDER BY 1,2;
|
||||
13
timhall/11g/default_passwords.sql
Normal file
13
timhall/11g/default_passwords.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/default_passwords.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays users with default passwords.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @default_passwords
|
||||
-- Last Modified: 26-NOV-2011
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SELECT a.username, b.account_status
|
||||
FROM dba_users_with_defpwd a
|
||||
JOIN dba_users b ON a.username = b.username
|
||||
ORDER BY 1;
|
||||
14
timhall/11g/diag_info.sql
Normal file
14
timhall/11g/diag_info.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/diag_info.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays the contents of the v$diag_info view.
|
||||
-- Requirements : Access to the V$ views.
|
||||
-- Call Syntax : @diag_info
|
||||
-- Last Modified: 23/08/2008
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SET LINESIZE 200
|
||||
COLUMN name FORMAT A30
|
||||
COLUMN value FORMAT A110
|
||||
|
||||
SELECT *
|
||||
FROM v$diag_info;
|
||||
16
timhall/11g/extended_stats.sql
Normal file
16
timhall/11g/extended_stats.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/extended_stats.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Provides information about extended statistics.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @extended_stats
|
||||
-- Last Modified: 30/11/2011
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SET LINESIZE 200
|
||||
COLUMN owner FORMAT A20
|
||||
COLUMN extension_name FORMAT A15
|
||||
COLUMN extension FORMAT A50
|
||||
|
||||
SELECT owner, table_name, extension_name, extension
|
||||
FROM dba_stat_extensions
|
||||
ORDER by owner, table_name;
|
||||
25
timhall/11g/fda.sql
Normal file
25
timhall/11g/fda.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/fda.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays information about flashback data archives.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @fda
|
||||
-- Last Modified: 06-JAN-2015
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SET LINESIZE 150
|
||||
|
||||
COLUMN owner_name FORMAT A20
|
||||
COLUMN flashback_archive_name FORMAT A22
|
||||
COLUMN create_time FORMAT A20
|
||||
COLUMN last_purge_time FORMAT A20
|
||||
|
||||
SELECT owner_name,
|
||||
flashback_archive_name,
|
||||
flashback_archive#,
|
||||
retention_in_days,
|
||||
TO_CHAR(create_time, 'DD-MON-YYYY HH24:MI:SS') AS create_time,
|
||||
TO_CHAR(last_purge_time, 'DD-MON-YYYY HH24:MI:SS') AS last_purge_time,
|
||||
status
|
||||
FROM dba_flashback_archive
|
||||
ORDER BY owner_name, flashback_archive_name;
|
||||
23
timhall/11g/fda_tables.sql
Normal file
23
timhall/11g/fda_tables.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/fda_tables.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays information about flashback data archives.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @fda_tables
|
||||
-- Last Modified: 06-JAN-2015
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SET LINESIZE 150
|
||||
|
||||
COLUMN owner_name FORMAT A20
|
||||
COLUMN table_name FORMAT A20
|
||||
COLUMN flashback_archive_name FORMAT A22
|
||||
COLUMN archive_table_name FORMAT A20
|
||||
|
||||
SELECT owner_name,
|
||||
table_name,
|
||||
flashback_archive_name,
|
||||
archive_table_name,
|
||||
status
|
||||
FROM dba_flashback_archive_tables
|
||||
ORDER BY owner_name, table_name;
|
||||
21
timhall/11g/fda_ts.sql
Normal file
21
timhall/11g/fda_ts.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/fda_ts.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays information about flashback data archives.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @fda_ts
|
||||
-- Last Modified: 06-JAN-2015
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SET LINESIZE 150
|
||||
|
||||
COLUMN flashback_archive_name FORMAT A22
|
||||
COLUMN tablespace_name FORMAT A20
|
||||
COLUMN quota_in_mb FORMAT A11
|
||||
|
||||
SELECT flashback_archive_name,
|
||||
flashback_archive#,
|
||||
tablespace_name,
|
||||
quota_in_mb
|
||||
FROM dba_flashback_archive_ts
|
||||
ORDER BY flashback_archive_name;
|
||||
14
timhall/11g/identify_trace_file.sql
Normal file
14
timhall/11g/identify_trace_file.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/identify_trace_file.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays the name of the trace file associated with the current session.
|
||||
-- Requirements : Access to the V$ views.
|
||||
-- Call Syntax : @identify_trace_file
|
||||
-- Last Modified: 23/08/2008
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SET LINESIZE 100
|
||||
COLUMN value FORMAT A60
|
||||
|
||||
SELECT value
|
||||
FROM v$diag_info
|
||||
WHERE name = 'Default Trace File';
|
||||
17
timhall/11g/job_credentials.sql
Normal file
17
timhall/11g/job_credentials.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/job_credentials.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays scheduler information about job credentials.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @job_credentials
|
||||
-- Last Modified: 23/08/2008
|
||||
-- -----------------------------------------------------------------------------------
|
||||
COLUMN credential_name FORMAT A25
|
||||
COLUMN username FORMAT A20
|
||||
COLUMN windows_domain FORMAT A20
|
||||
|
||||
SELECT credential_name,
|
||||
username,
|
||||
windows_domain
|
||||
FROM dba_scheduler_credentials
|
||||
ORDER BY credential_name;
|
||||
42
timhall/11g/job_output_file.sql
Normal file
42
timhall/11g/job_output_file.sql
Normal file
@@ -0,0 +1,42 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/job_output_file.sql
|
||||
-- Author : DR Timothy S Hall
|
||||
-- Description : Displays scheduler job information for previous runs.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @job_output_file (job-name) (credential-name)
|
||||
-- Last Modified: 06/06/2014
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SET VERIFY OFF
|
||||
|
||||
SET SERVEROUTPUT ON
|
||||
DECLARE
|
||||
l_clob CLOB;
|
||||
l_additional_info VARCHAR2(4000);
|
||||
l_external_log_id VARCHAR2(50);
|
||||
BEGIN
|
||||
SELECT additional_info, external_log_id
|
||||
INTO l_additional_info, l_external_log_id
|
||||
FROM (SELECT log_id,
|
||||
additional_info,
|
||||
REGEXP_SUBSTR(additional_info,'job[_0-9]*') AS external_log_id
|
||||
FROM dba_scheduler_job_run_details
|
||||
WHERE job_name = UPPER('&1')
|
||||
ORDER BY log_id DESC)
|
||||
WHERE ROWNUM = 1;
|
||||
|
||||
DBMS_OUTPUT.put_line('ADDITIONAL_INFO: ' || l_additional_info);
|
||||
DBMS_OUTPUT.put_line('EXTERNAL_LOG_ID: ' || l_external_log_id);
|
||||
|
||||
DBMS_LOB.createtemporary(l_clob, FALSE);
|
||||
|
||||
DBMS_SCHEDULER.get_file(
|
||||
source_file => l_external_log_id ||'_stdout',
|
||||
credential_name => UPPER('&2'),
|
||||
file_contents => l_clob,
|
||||
source_host => NULL);
|
||||
|
||||
DBMS_OUTPUT.put_line('stdout:');
|
||||
DBMS_OUTPUT.put_line(l_clob);
|
||||
END;
|
||||
/
|
||||
35
timhall/11g/job_run_details.sql
Normal file
35
timhall/11g/job_run_details.sql
Normal file
@@ -0,0 +1,35 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/job_run_details.sql
|
||||
-- Author : DR Timothy S Hall
|
||||
-- Description : Displays scheduler job information for previous runs.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @job_run_details (job-name | all)
|
||||
-- Last Modified: 06/06/2014
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SET LINESIZE 300 VERIFY OFF
|
||||
|
||||
COLUMN log_date FORMAT A35
|
||||
COLUMN owner FORMAT A20
|
||||
COLUMN job_name FORMAT A30
|
||||
COLUMN error FORMAT A20
|
||||
COLUMN req_start_date FORMAT A35
|
||||
COLUMN actual_start_date FORMAT A35
|
||||
COLUMN run_duration FORMAT A20
|
||||
COLUMN credential_owner FORMAT A20
|
||||
COLUMN credential_name FORMAT A20
|
||||
COLUMN additional_info FORMAT A30
|
||||
|
||||
SELECT log_date,
|
||||
owner,
|
||||
job_name,
|
||||
status
|
||||
error,
|
||||
req_start_date,
|
||||
actual_start_date,
|
||||
run_duration,
|
||||
credential_owner,
|
||||
credential_name,
|
||||
additional_info
|
||||
FROM dba_scheduler_job_run_details
|
||||
WHERE job_name = DECODE(UPPER('&1'), 'ALL', job_name, UPPER('&1'))
|
||||
ORDER BY log_date;
|
||||
17
timhall/11g/memory_dynamic_components.sql
Normal file
17
timhall/11g/memory_dynamic_components.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/memory_dynamic_components.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Provides information about dynamic memory components.
|
||||
-- Requirements : Access to the v$ views.
|
||||
-- Call Syntax : @memory_dynamic_components
|
||||
-- Last Modified: 09/05/2017
|
||||
-- -----------------------------------------------------------------------------------
|
||||
COLUMN component FORMAT A30
|
||||
|
||||
SELECT component,
|
||||
ROUND(current_size/1024/1024) AS current_size_mb,
|
||||
ROUND(min_size/1024/1024) AS min_size_mb,
|
||||
ROUND(max_size/1024/1024) AS max_size_mb
|
||||
FROM v$memory_dynamic_components
|
||||
WHERE current_size != 0
|
||||
ORDER BY component;
|
||||
25
timhall/11g/memory_resize_ops.sql
Normal file
25
timhall/11g/memory_resize_ops.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/memory_resize_ops.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Provides information about memory resize operations.
|
||||
-- Requirements : Access to the v$ views.
|
||||
-- Call Syntax : @memory_resize_ops
|
||||
-- Last Modified: 09/05/2017
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SET LINESIZE 200
|
||||
|
||||
COLUMN parameter FORMAT A25
|
||||
|
||||
SELECT start_time,
|
||||
end_time,
|
||||
component,
|
||||
oper_type,
|
||||
oper_mode,
|
||||
parameter,
|
||||
ROUND(initial_size/1024/1024) AS initial_size_mb,
|
||||
ROUND(target_size/1024/1024) AS target_size_mb,
|
||||
ROUND(final_size/1024/1024) AS final_size_mb,
|
||||
status
|
||||
FROM v$memory_resize_ops
|
||||
ORDER BY start_time;
|
||||
11
timhall/11g/memory_target_advice.sql
Normal file
11
timhall/11g/memory_target_advice.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/memory_target_advice.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Provides information to help tune the MEMORY_TARGET parameter.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @memory_target_advice
|
||||
-- Last Modified: 23/08/2008
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SELECT *
|
||||
FROM v$memory_target_advice
|
||||
ORDER BY memory_size;
|
||||
24
timhall/11g/network_acl_privileges.sql
Normal file
24
timhall/11g/network_acl_privileges.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/network_acl_privileges.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays privileges for the network ACLs.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @network_acl_privileges
|
||||
-- Last Modified: 30/11/2011
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SET LINESIZE 150
|
||||
|
||||
COLUMN acl FORMAT A50
|
||||
COLUMN principal FORMAT A20
|
||||
COLUMN privilege FORMAT A10
|
||||
|
||||
SELECT acl,
|
||||
principal,
|
||||
privilege,
|
||||
is_grant,
|
||||
TO_CHAR(start_date, 'DD-MON-YYYY') AS start_date,
|
||||
TO_CHAR(end_date, 'DD-MON-YYYY') AS end_date
|
||||
FROM dba_network_acl_privileges
|
||||
ORDER BY acl, principal, privilege;
|
||||
|
||||
SET LINESIZE 80
|
||||
18
timhall/11g/network_acls.sql
Normal file
18
timhall/11g/network_acls.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/network_acls.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays information about network ACLs.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @network_acls
|
||||
-- Last Modified: 30/11/2011
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SET LINESIZE 150
|
||||
|
||||
COLUMN host FORMAT A40
|
||||
COLUMN acl FORMAT A50
|
||||
|
||||
SELECT host, lower_port, upper_port, acl
|
||||
FROM dba_network_acls
|
||||
ORDER BY host;
|
||||
|
||||
SET LINESIZE 80
|
||||
12
timhall/11g/result_cache_objects.sql
Normal file
12
timhall/11g/result_cache_objects.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/result_cache_objects.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays information about the objects in the result cache.
|
||||
-- Requirements : Access to the V$ views.
|
||||
-- Call Syntax : @result_cache_objects
|
||||
-- Last Modified: 07/11/2012
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SET LINESIZE 1000
|
||||
|
||||
SELECT *
|
||||
FROM v$result_cache_objects;
|
||||
11
timhall/11g/result_cache_report.sql
Normal file
11
timhall/11g/result_cache_report.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/result_cache_report.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays the result cache report.
|
||||
-- Requirements : Access to the DBMS_RESULT_CACHE package.
|
||||
-- Call Syntax : @result_cache_report
|
||||
-- Last Modified: 07/11/2012
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SET SERVEROUTPUT ON
|
||||
EXEC DBMS_RESULT_CACHE.memory_report(detailed => true);
|
||||
19
timhall/11g/result_cache_statistics.sql
Normal file
19
timhall/11g/result_cache_statistics.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/result_cache_statistics.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays result cache statistics.
|
||||
-- Requirements : Access to the V$ views.
|
||||
-- Call Syntax : @result_cache_statistics
|
||||
-- Last Modified: 07/11/2012
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
COLUMN name FORMAT A30
|
||||
COLUMN value FORMAT A30
|
||||
|
||||
SELECT id,
|
||||
name,
|
||||
value
|
||||
FROM v$result_cache_statistics
|
||||
ORDER BY id;
|
||||
|
||||
CLEAR COLUMNS
|
||||
10
timhall/11g/result_cache_status.sql
Normal file
10
timhall/11g/result_cache_status.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/result_cache_status.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays the status of the result cache.
|
||||
-- Requirements : Access to the DBMS_RESULT_CACHE package.
|
||||
-- Call Syntax : @result_cache_status
|
||||
-- Last Modified: 07/11/2012
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SELECT DBMS_RESULT_CACHE.status FROM dual;
|
||||
19
timhall/11g/session_fix.sql
Normal file
19
timhall/11g/session_fix.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/session_fix.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Provides information about session fixes for the specified phrase and version.
|
||||
-- Requirements : Access to the V$ views.
|
||||
-- Call Syntax : @session_fix (session_id | all) (phrase | all) (version | all)
|
||||
-- Last Modified: 30/11/2011
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SET VERIFY OFF
|
||||
SET LINESIZE 300
|
||||
|
||||
COLUMN sql_feature FORMAT A35
|
||||
COLUMN optimizer_feature_enable FORMAT A9
|
||||
|
||||
SELECT *
|
||||
FROM v$session_fix_control
|
||||
WHERE session_id = DECODE('&1', 'all', session_id, '&1')
|
||||
AND LOWER(description) LIKE DECODE('&2', 'all', '%', '%&2%')
|
||||
AND optimizer_feature_enable = DECODE('&3', 'all', optimizer_feature_enable, '&3');
|
||||
30
timhall/11g/statistics_global_prefs.sql
Normal file
30
timhall/11g/statistics_global_prefs.sql
Normal file
@@ -0,0 +1,30 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/statistics_global_prefs.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays the top-level global statistics preferences.
|
||||
-- Requirements : Access to the DBMS_STATS package.
|
||||
-- Call Syntax : @statistics_global_prefs
|
||||
-- Last Modified: 13-DEC-2016
|
||||
-- -----------------------------------------------------------------------------------
|
||||
|
||||
SET SERVEROUTPUT ON
|
||||
DECLARE
|
||||
PROCEDURE display(p_param IN VARCHAR2) AS
|
||||
l_result VARCHAR2(50);
|
||||
BEGIN
|
||||
l_result := DBMS_STATS.get_prefs (pname => p_param);
|
||||
DBMS_OUTPUT.put_line(RPAD(p_param, 30, ' ') || ' : ' || l_result);
|
||||
END;
|
||||
BEGIN
|
||||
display('AUTOSTATS_TARGET');
|
||||
display('CASCADE');
|
||||
display('DEGREE');
|
||||
display('ESTIMATE_PERCENT');
|
||||
display('METHOD_OPT');
|
||||
display('NO_INVALIDATE');
|
||||
display('GRANULARITY');
|
||||
display('PUBLISH');
|
||||
display('INCREMENTAL');
|
||||
display('STALE_PERCENT');
|
||||
END;
|
||||
/
|
||||
18
timhall/11g/system_fix.sql
Normal file
18
timhall/11g/system_fix.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/system_fix.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Provides information about system fixes for the specified phrase and version.
|
||||
-- Requirements : Access to the V$ views.
|
||||
-- Call Syntax : @system_fix (phrase | all) (version | all)
|
||||
-- Last Modified: 30/11/2011
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SET VERIFY OFF
|
||||
SET LINESIZE 300
|
||||
|
||||
COLUMN sql_feature FORMAT A35
|
||||
COLUMN optimizer_feature_enable FORMAT A9
|
||||
|
||||
SELECT *
|
||||
FROM v$system_fix_control
|
||||
WHERE LOWER(description) LIKE DECODE('&1', 'all', '%', '%&1%')
|
||||
AND optimizer_feature_enable = DECODE('&2', 'all', optimizer_feature_enable, '&2');
|
||||
13
timhall/11g/system_fix_count.sql
Normal file
13
timhall/11g/system_fix_count.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/system_fix_count.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Provides information about system fixes per version.
|
||||
-- Requirements : Access to the V$ views.
|
||||
-- Call Syntax : @system_fix_count
|
||||
-- Last Modified: 30/11/2011
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SELECT optimizer_feature_enable,
|
||||
COUNT(*)
|
||||
FROM v$system_fix_control
|
||||
GROUP BY optimizer_feature_enable
|
||||
ORDER BY optimizer_feature_enable;
|
||||
10
timhall/11g/temp_free_space.sql
Normal file
10
timhall/11g/temp_free_space.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- -----------------------------------------------------------------------------------
|
||||
-- File Name : https://oracle-base.com/dba/11g/temp_free_space.sql
|
||||
-- Author : Tim Hall
|
||||
-- Description : Displays information about temporary tablespace usage.
|
||||
-- Requirements : Access to the DBA views.
|
||||
-- Call Syntax : @temp_free_space
|
||||
-- Last Modified: 23-AUG-2008
|
||||
-- -----------------------------------------------------------------------------------
|
||||
SELECT *
|
||||
FROM dba_temp_free_space;
|
||||
Reference in New Issue
Block a user