This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set verify off | |
| set trimspool on | |
| set lines 132 | |
| set pages 10000 | |
| set markup html on; | |
| set linesize 300 | |
| col INSTANCE_NAME format a10 | |
| col HOST_NAME format a30 | |
| col JOB format 9999999999 | |
| col SCHEMA_USER format a30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --REPORT_SQL_MONITOR_LIST | |
| SET LONG 1000000 | |
| SET LONGCHUNKSIZE 1000000 | |
| SET LINESIZE 1000 | |
| SET PAGESIZE 0 | |
| SET TRIM ON | |
| SET TRIMSPOOL ON | |
| SET ECHO OFF | |
| SET FEEDBACK OFF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set linesize 300 | |
| column REDOLOG_FILE_NAME format a50 | |
| SELECT | |
| a.GROUP#, | |
| a.THREAD#, | |
| a.SEQUENCE#, | |
| a.ARCHIVED, | |
| a.STATUS, | |
| b.MEMBER AS REDOLOG_FILE_NAME, | |
| (a.BYTES/1024/1024) AS SIZE_MB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 05 8-17 * * 1-5 /dbms/oracle/local/AMCMPRN1/etc/Scripts/awrreport_html_hourly.ksh AMCMPRN1 > /tmp/AWR_report_AMCMPRN1.out 2>&1 | |
| 08 8-17 * * 1-5 /dbms/oracle/local/AMCMPRN1/etc/Scripts/addmreport_hourly.ksh AMCMPRN1 > /tmp/addm_report_AMCMPRN1.out 2>&1 | |
| 05 8-17 * * 1-5 /dbms/oracle/monitor/bin/ashreport_html_hourly.ksh -sAMCMPRN1 -t60 > /tmp/AWR_report_AMCMPRN1.out 2>&1 | |
| AWR: | |
| oracle@mwamdb3p[DUMMY] /home/oracle => cat /dbms/oracle/local/AMCMPRN1/etc/Scripts/awrreport_html_hourly.ksh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DECLARE | |
| l_object_id NUMBER; | |
| BEGIN | |
| -- Create a segment advisor task for the PAPERLESS tablespace. | |
| DBMS_ADVISOR.create_task ( | |
| advisor_name => 'Segment Advisor', | |
| task_name => 'PAPERLESS_SEGMENT_ADVISOR', | |
| task_desc => 'Segment Advisor For PAPERLESS'); | |
| DBMS_ADVISOR.create_object ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET PAGESIZE 50000 | |
| SET FEEDBACK OFF | |
| SET MARKUP HTML ON SPOOL ON | |
| SET NUM 24 | |
| SPOOL PROD_PAPERLESS_SEGMENT_ADVISOR.xls | |
| -- Display the findings. | |
| SET LINESIZE 250 | |
| COLUMN task_name FORMAT A20 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This report uses data from views that are licensed with the Diagnostics and Tuning Pack. | |
| http://www.oracle.com/technetwork/database/manageability/sql-detail-099420.html | |
| How do I generate a SQL Details Active Report? | |
| From SQL*Plus, invoke the dbms_sqltune.report_sql_detail function and spool the output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --Creating Normal and Guaranteed Restore Points | |
| CREATE RESTORE POINT before_upgrade; | |
| CREATE RESTORE POINT before_upgrade GUARANTEE FLASHBACK DATABASE; | |
| --Listing Restore Points |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select extract(day from (sysdate - min(trunc(time))) day to second) + 1 | |
| from v$restore_point | |
| / | |
| I loaded the result into an environment variable. (Many thanks to whoever posted the code for that on this site. Experts Exchange rocks!) | |
| Then I used RMAN to delete the archivelogs like this: | |
| delete archivelog all completed before 'SYSDATE - $RESTORE_POINT_AGE'; | |
| rman |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rman target / | |
| crosscheck archivelog all; | |
| crosscheck backupset; | |
| catalog recovery area; | |
| delete expired archivelog all; |