Saturday, May 26, 2012

Script to Report Stored Code

This report lists all stored code in the database. It can report on all objects, all objects by owner, or on a specific object name.

Script to Recompile Invalid Objects

This code will check for invalid stored objects in the database (views, PL/SQL, etc..) and then try to re-compile all invalid code.

Script to List Trigger Code

This script will extract the code for a specific trigger in your database.

Script to Report Type Methods

This script provides documentation with respect to the different type methods in the database.

Script to Report REF Columns in the Database

This script provides documentation with respect to the different REF columns in the database.

Script to Report Database Types


This script provides documentation with respect to the different collection types in the database.

Script to Report Collection Types

This script provides documentation with respect to the different collection types in the database.

Script to Generate DDL for Synonyms


This script will produce DDL required to recreate a synonym.

Tuesday, May 8, 2012

Script to Report Database Locks

Database locks are particularly troublesome when they are blocking other sessions. This report reports on database locking.
REM LOCATION:   Database Tuning\Contention Reports
REM FUNCTION:   Report all DB locks
REM TESTED ON:  7.3.3.5, 8.0.4.1, 8.1.5, 9.0.1, 10.2.0.3, 11.1.0.6
REM PLATFORM:   non-specific
REM REQUIRES:   sys.v_$session, sys.dba_locks
REM

Script ro Report Current Internal Locks

This script reports on internal locks (latches) held in the database, the type of lock and the locking mode that the lock is held in.

REM LOCATION:   Database Tuning\Contention Reports
REM FUNCTION:   Document current internal locks
REM TESTED ON:  7.3.3.5, 8.0.4.1, 8.1.5, 8.1.7, 9.0.1, 10.2.0.3, 11.1.0.6
REM PLATFORM:   non-specific
REM REQUIRES:   sys.dba_lock_internal, sys.v_$session
REM

Script to Report Datafile Archive Status

This script shows the status of your datafile backup.

REM LOCATION:   Backup Recovery\Reports
REM FUNCTION:   Show database datafile Archive status
REM TESTED ON:  7.3.3.5, 8.0.4.1, 8.1.5, 8.1.7, 9.0.1, 10.2.0.3, 11.1.0.6
REM PLATFORM:   non-specific
REM REQUIRES:   sys.v_$datafile, sys.v_$backup
REM

Script to Report System Privileges Granted to Users & Roles

Running this script will create a report of all the grants of roles to users and other roles.
REM LOCATION:   Backup Recovery\Generate Recreation Scripts
REM FUNCTION:   SCRIPT FOR CAPTURING SYSTEM PRIVILEGES GRANTED TO USERS AND ROLES
REM TESTED ON:  7.3.3.5, 8.0.4.1, 8.1.5, 8.1.7, 9.0.1, 10.2.0.3, 11.1.0.6
REM PLATFORM:   non-specific
REM REQUIRES:   dba_sys_privs

Script for Hot UNIX Backup

This script will create a hot backup script for a UNIX system.
REM FILE NAME: backup_unix.sql
REM LOCATION:  Backup Recovery\Hot Backup
REM FUNCTION:  Hot Unix backup
REM REQUIRES:

Report all invalid objects in a database

This report will show you all objects in the database that have an invalid status. This may be a normal condition in many cases, or it may indicate that an object has been removed. The removal of that object will cause the dependent objects to go invalid.

Wednesday, May 2, 2012