<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3064691157026501809</id><updated>2011-11-27T15:23:26.787-08:00</updated><category term='compile_invalid_objects.sql'/><category term='Check the patch level'/><category term='Complete guide to becoming an Oracle database administrator'/><category term='Determine Version and options of database examined'/><category term='grant_select.sql'/><category term='disable_fkeys.sql'/><category term='library cache pin - p1raw'/><category term='grant_insert.sql'/><category term='Prevent granting of privileges that have WITH GRANT option'/><category term='Check which user has been granted with the &apos;RESOURCE&apos; role'/><category term='Oracle&apos;s history'/><category term='high_water_mark.sql'/><category term='Truncating Listener Log File'/><category term='Detailed report of all invalid objects in the database.'/><category term='compile_all_trigs.sql'/><category term='Indexes and Columns'/><category term='Refreshing stale statistics using the DBMS_STATS package and the GATHER AUTO option.'/><category term='REMOTE_LOGIN_PASSWORDFILE'/><category term='Oracle Critical File Protection'/><category term='shrink table in Oracle'/><category term='Check if DBA Includes Non-default Account'/><category term='Audit Table Permissions'/><category term='compile_all_funcs.sql'/><category term='Check for Restricted PL/SQL Packages'/><category term='Password Reuse'/><category term='open_cursors.sql'/><category term='Check which user has been granted with the &apos;CONNECT&apos; role'/><category term='locked_objects.sql'/><category term='grant_delete.sql'/><category term='Statistics on Tables'/><category term='Password Verify Function'/><category term='Account Lock Time'/><category term='Password Life Time'/><category term='active_sessions.sql'/><category term='Roles Granted With Admin'/><category term='Oracle Predefined Roles'/><category term='BIND VARIABLE PEEKING'/><category term='Check Developer Privileges on Shared Systems'/><category term='Check for Active Schema Owner Account'/><category term='Prevent granting of CREATE LIBRARY'/><category term='PUBLIC is granted with Object Permissions'/><category term='Failed Login Attempts'/><category term='Get table and index DDL  using DBMS_METADATA.GET_DDL'/><category term='compile_all_bodies.sql'/><category term='Oracle 10g Data Dictionary Table Statistics'/><category term='Check for Default Tablespace'/><category term='create_data.sql'/><category term='Welcome to Oracle DBA Scripts Blog'/><category term='Shrink undo tablespace in 10g'/><category term='PUBLIC is granted with System Privileges'/><category term='top_sessions.sql'/><category term='Check for privileges with &apos;ANY&apos; keywordgranted.'/><category term='Idle Time Resource Usage Limit'/><category term='Account Permissions'/><category term='Auditing of Commands'/><category term='Get the name of the DB'/><category term='top_sql.sql'/><category term='access.sql'/><category term='Check Privileges Granted With Admin'/><category term='Oracle database links'/><category term='unusable_indexes.sql'/><category term='determine if pl/sql code is wrapped or not'/><category term='Check for Role Permissions'/><category term='Resource Limits Not Enabled'/><category term='Check for Access to System Tables/DBA Views'/><category term='Difference between the PFILE'/><category term='Hot Backup Script'/><category term='Oracle  Database 11g'/><category term='users or roles granted ALL PRIVILEGES or too many privileges'/><category term='enable_fkeys.sql'/><category term='&apos;user_dump_dest&apos; and &apos;background_dump_dest&apos;'/><category term='table_dep.sql'/><category term='Replication Account Use'/><category term='db_info.sql'/><category term='compile_all_views.sql'/><category term='GLOBAL_NAMES Parameter'/><category term='Finding locked oracle database user account information'/><category term='Oracle Redo log files'/><category term='SPFILE and INIT.ORA'/><category term='Check for Roles Assigned to PUBLIC'/><category term='Check for Unauthorized Object Owner'/><category term='user_hit_ratio.sql'/><category term='SYSDBA Privilege Assignments'/><category term='compile_all_procs.sql'/><category term='grant_execute.sql'/><category term='Check for System Privilege Assignments'/><category term='Check for Tablespace Quotas'/><category term='Default Oracle System Identifier'/><category term='compile_all_specs.sql'/><category term='Check which user has &apos;ALTER SESSION&apos; and &apos;ALTER SYSTEM&apos; privileges'/><category term='session_io.sql'/><category term='compile_all.sql'/><category term='Find the tables/indexes that have stale statistics in a database'/><title type='text'>Oracle DBA Scripts</title><subtitle type='html'>Oracle Production support DBA Tips</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>98</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6579232380184323409</id><published>2010-08-27T07:22:00.000-07:00</published><updated>2010-08-27T07:25:10.633-07:00</updated><title type='text'>When we last gathered stats in Oracle 11G</title><content type='html'>select * from dba_optstat_operations;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To see the current retention value,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;select dbms_stats.get_stats_history_retention from dual;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6579232380184323409?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6579232380184323409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6579232380184323409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6579232380184323409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6579232380184323409'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/08/when-we-last-gathered-stats-in-oracle.html' title='When we last gathered stats in Oracle 11G'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-7221368709955586225</id><published>2010-08-23T12:42:00.001-07:00</published><updated>2010-08-23T12:42:50.258-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BIND VARIABLE PEEKING'/><title type='text'>BIND VARIABLE PEEKING</title><content type='html'>There are 3 things that might put you at risk of unstable plans due to bind variable peeking.&lt;br /&gt;1. Histograms: The histogram tells Oracle about data distribution&lt;br /&gt;2. Partitions,&lt;br /&gt;3. Range-based predicates&lt;br /&gt;&lt;br /&gt;select column_name, endpoint_number, endpoint_value&lt;br /&gt;from dba_tab_histograms&lt;br /&gt;where table_name='TEST_INVOICE';&lt;br /&gt;&lt;br /&gt;Just get rid of any histogram that does nothing but messes up your execution plans.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;exec dbms_stats.gather_table_stats('table_owner', 'test_invoice', method_opt =&gt; 'for columns invoice_id size 1', cascade =&gt; true);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-7221368709955586225?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/7221368709955586225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=7221368709955586225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7221368709955586225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7221368709955586225'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/08/bind-variable-peeking.html' title='BIND VARIABLE PEEKING'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1396458643826749572</id><published>2010-08-20T06:45:00.000-07:00</published><updated>2010-08-20T06:46:15.568-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Shrink undo tablespace in 10g'/><title type='text'>shrink the undo tablespace to free up some disk space after some unusual database activity</title><content type='html'>1. define a new temporary undo tablespace&lt;br /&gt;CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE '/u01/oradata/xxxx/undotbs201.dbf' SIZE 100M&lt;br /&gt;AUTOEXTEND ON NEXT 10240K MAXSIZE 32767M ;&lt;br /&gt;2. issue the alter system command to point to the temporary tablespace&lt;br /&gt;alter system set undo_tablespace = UNDOTBS2 ;&lt;br /&gt;3. drop the original undo tablespace including datafile&lt;br /&gt;drop tablespace "UNDOTBS" INCLUDING CONTENTS AND DATAFILES ;&lt;br /&gt;4. recreate the original one using the original name ( optional and size according to your needs )&lt;br /&gt;CREATE UNDO TABLESPACE "UNDOTBS" DATAFILE '/u01/oradata/xxxx/undotbs01.dbf' SIZE 100M&lt;br /&gt;AUTOEXTEND ON NEXT 10240K MAXSIZE 32767M ;&lt;br /&gt;5. Repeat step 2 to switch back to the original named tablespace&lt;br /&gt;6. drop the tablespace created in step 1 using the syntax in step 3&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1396458643826749572?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1396458643826749572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1396458643826749572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1396458643826749572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1396458643826749572'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/08/shrink-undo-tablespace-to-free-up-some.html' title='shrink the undo tablespace to free up some disk space after some unusual database activity'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4828052039134261109</id><published>2010-07-16T18:07:00.000-07:00</published><updated>2010-07-16T18:24:29.497-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shrink table in Oracle'/><title type='text'>shrink table in Oracle 10g/11g</title><content type='html'>In oracle 9i and below you need to export the table, drop the table and import the table to reclaim the unused space. In oracle 10g you need to perform following sql commands to reclaim the table unused space. &lt;br /&gt;&lt;br /&gt;SQL&gt;alter table sachi enable row movement;&lt;br /&gt;SQL&gt;alter table sachi shrink space;&lt;br /&gt;SQL&gt;alter table sachi shrink space cascade;(shrink tables and indexes on this tables)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That's it.&lt;br /&gt;&lt;br /&gt;Finding Candidates for Shrinking:&lt;br /&gt;&lt;br /&gt;you can use Oracle 10g/11g segment advisor to check if particular table or index requires shrinking.&lt;br /&gt;&lt;br /&gt;Before performing an online shrink, you may want to find out the biggest bang-for-the-buck by identifying the segments that can be most &lt;br /&gt;fully compressed. Simply use the built-in function verify_shrink_candidate in the package dbms_space. &lt;br /&gt;Execute this PL/SQL code to test if the segment can be shrunk to 1,500,000 bytes:&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;   if (dbms_space.verify_shrink_candidate&lt;br /&gt;         ('GUEST','SACHI','TABLE',1500000)&lt;br /&gt;   ) then&lt;br /&gt;       :x := 'T';&lt;br /&gt;   else&lt;br /&gt;       :x := 'F';&lt;br /&gt;   end if;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; print x&lt;br /&gt;&lt;br /&gt;X&lt;br /&gt;--------------------------------&lt;br /&gt;T&lt;br /&gt;&lt;br /&gt;If you use a low number for the target shrinkage, say 10,0000:&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;   if (dbms_space.verify_shrink_candidate&lt;br /&gt;         ('GUEST','SACHI','TABLE',100000)&lt;br /&gt;   ) then&lt;br /&gt;       :x := 'T';&lt;br /&gt;   else&lt;br /&gt;       :x := 'F';&lt;br /&gt;   end if;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;the value of the variable x is set to 'F', meaning the table cannot be shrunk to 10,0000 bytes. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Summary:&lt;br /&gt;1.Create table As Select (CTAS) - This copies the table rows into a clean area, lowering the high-water-mark, packing the rows densely (as dictated by PCTFREE) and releasing free space.&lt;br /&gt;2.Online reorg - Using the dbms_redefinition package you can use parallel CTAS to reorganize tables, while the tables continue to accept updates.&lt;br /&gt;3.Data pump (expdp, impdp) - Rarely used in high-speed production apps, except for backups.&lt;br /&gt;4.Alter table move - The alter table xxx move command moves rows down into un-used space and adjusts the HWM but does not adjust the segments extents, and the table size remains the same.  The alter table move syntax also preserves the index and constraint definitions.&lt;br /&gt;5.Alter table shrink space - Using the "alter table xxx shrink space compact" command will re-pack the rows, move down the HWM, and releases unused extents.  With standard Oracle tables, you can reclaim space with the "alter table shrink space" command&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4828052039134261109?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4828052039134261109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4828052039134261109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4828052039134261109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4828052039134261109'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/07/shrink-table-in-oracle-10g11g.html' title='shrink table in Oracle 10g/11g'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8749454826805477985</id><published>2010-07-15T05:55:00.000-07:00</published><updated>2010-07-15T06:02:20.532-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='library cache pin - p1raw'/><title type='text'>Problem with "library cache pin' when deplyoing the package</title><content type='html'>Problem: Today i have been asked to deploy a package in the production. Same package has been deployed in staging and UAT successfully with in a minute. When I deployed the same package in production it did not go through. after 10 min I got following error.&lt;br /&gt;&lt;br /&gt;SQL&gt; @PKGALERTS.pkb;&lt;br /&gt;CREATE OR REPLACE PACKAGE BODY         Pkgalerts AS&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-04021: timeout occurred while waiting to lock object&lt;br /&gt;&lt;br /&gt;I tried it couple of time but got the same error again.  Please help.&lt;br /&gt;&lt;br /&gt;Solution: &lt;br /&gt;&lt;br /&gt; select sid, event, p1raw, seconds_in_wait,wait_time&lt;br /&gt; from v$session_wait &lt;br /&gt; where event = 'library cache pin'&lt;br /&gt; and state = 'WAITING';&lt;br /&gt; &lt;br /&gt; SID,EVENT,P1RAW,SECONDS_IN_WAIT,WAIT_TIME&lt;br /&gt; 4962,library cache pin,070000031733BDF8,51,0&lt;br /&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; SELECT kglnaown "Owner", kglnaobj "Object" &lt;br /&gt;     FROM x$kglob WHERE kglhdadr='070000031733BDF8'&lt;br /&gt;&lt;br /&gt;  SELECT s.sid, s.serial#, s.username, s.osuser, s.machine, s.status, &lt;br /&gt;kglpnmod "Mode", kglpnreq "Req"&lt;br /&gt;    FROM x$kglpn p, v$session s WHERE p.kglpnuse=s.saddr AND &lt;br /&gt;kglpnhdl='070000031733BDF8'&lt;br /&gt;&lt;br /&gt;  SELECT 'alter system kill session ''' || s.sid || ','  || s.serial# || ''';'&lt;br /&gt;  FROM x$kglpn p, v$session s&lt;br /&gt;  WHERE p.kglpnuse=s.saddr&lt;br /&gt;  AND kglpnhdl='070000031733BDF8'&lt;br /&gt;&lt;br /&gt;and then compile the object.&lt;br /&gt;SQL&gt; @PKGALERTS.pkb&lt;br /&gt;&lt;br /&gt;Package body created.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8749454826805477985?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8749454826805477985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8749454826805477985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8749454826805477985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8749454826805477985'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/07/problem-with-library-cache-pin-when.html' title='Problem with &quot;library cache pin&apos; when deplyoing the package'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8067540896566451086</id><published>2010-01-13T10:48:00.000-08:00</published><updated>2010-01-13T10:50:03.923-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Critical File Protection'/><title type='text'>Oracle Critical File Protection</title><content type='html'>-- Step 1: Collect the file locations for control, redo log, and data files:&lt;br /&gt;-- Step 2: Check file permission&lt;br /&gt;&lt;br /&gt;Select 'Control Files: '||value from v$parameter where name= 'control_files';&lt;br /&gt;Select 'Control Files: '||value from v$parameter where name= 'spfile';&lt;br /&gt;select 'Logfile: '||member from v$logfile;&lt;br /&gt;select 'Datafile: '||name from v$datafile;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8067540896566451086?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8067540896566451086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8067540896566451086' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8067540896566451086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8067540896566451086'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/oracle-critical-file-protection.html' title='Oracle Critical File Protection'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-294893320169201931</id><published>2010-01-13T10:47:00.001-08:00</published><updated>2010-01-13T10:47:46.965-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Redo log files'/><title type='text'>Oracle Redo log files</title><content type='html'>-- Step 1: Check how many redo log files exist.&lt;br /&gt;&lt;br /&gt;select member from v$logfile;&lt;br /&gt;&lt;br /&gt;-- Step 2: Check whether each group has more than 1 members.&lt;br /&gt;&lt;br /&gt;select count(*) from V$LOG where members &gt;1;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-294893320169201931?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/294893320169201931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=294893320169201931' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/294893320169201931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/294893320169201931'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/oracle-redo-log-files.html' title='Oracle Redo log files'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-5705635660240960118</id><published>2010-01-13T10:46:00.001-08:00</published><updated>2010-01-13T10:46:41.550-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Auditing of Commands'/><title type='text'>Auditing of Commands</title><content type='html'>SELECT name &lt;br /&gt;   FROM   stmt_audit_option_map&lt;br /&gt;   WHERE  name not in (select audit_option from dba_stmt_audit_opts)&lt;br /&gt;   AND    name not like 'SELECT%' &lt;br /&gt;   AND    name not like 'INSERT%' &lt;br /&gt;   AND    name not like 'UPDATE%' &lt;br /&gt;   AND    name not like 'DELETE%' &lt;br /&gt;   AND    name not like 'EXECUTE%' &lt;br /&gt;   AND    name not like 'LOCK%' &lt;br /&gt;   AND    name not in &lt;br /&gt;               ('CREATE DIRECTORY','DROP DIRECTORY','GRANT LIBRARY',&lt;br /&gt;                'WRITEDOWN DBLOW','READUP DBHIGH','WRITEUP DBHIGH',&lt;br /&gt;                'WRITEDOWN','READUP','WRITEUP','EXISTS','SUMMARY',&lt;br /&gt;                'NETWORK','DEBUG CONNECT USER','DEBUG CONNECT ANY',&lt;br /&gt;                'CREATE CLUSTER','CREATE DATABASE LINK','CREATE DIMENSION',&lt;br /&gt;                'CREATE LIBRARY','CREATE PROCEDURE','CREATE ROLE',&lt;br /&gt;                'CREATE SEQUENCE','CREATE TABLE','CREATE TRIGGER',&lt;br /&gt;                'CREATE TYPE','CREATE VIEW')&lt;br /&gt;   AND    decode(name, 'TABLESPACE', 3,&lt;br /&gt;                       'PUBLIC DATABASE LINK', 2,&lt;br /&gt;                       'PUBLIC SYNONYM', 2,&lt;br /&gt;                       'ROLLBACK SEGMENT', 3,&lt;br /&gt;                       'TABLESPACE', 3,&lt;br /&gt;                       'USER', 3, 100) &gt;&lt;br /&gt;                   (SELECT COUNT(*) &lt;br /&gt;                    FROM   dba_stmt_audit_opts&lt;br /&gt;                    WHERE  audit_option LIKE '%'||name||'%')&lt;br /&gt;  UNION ALL&lt;br /&gt;    select name from system_privilege_map&lt;br /&gt;                where name not in &lt;br /&gt;                  (select privilege from dba_priv_audit_opts)&lt;br /&gt;               and name not in (select name from stmt_audit_option_map)&lt;br /&gt;                and name not in ('EXTENDS TYPE','ALTER OPERATOR')&lt;br /&gt;                and name not like '%ROLE%'&lt;br /&gt;                and name not like '%SECURITY%'&lt;br /&gt;                and name not like '%EXECUTE%'&lt;br /&gt;                and name not like '%RULE%';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-5705635660240960118?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/5705635660240960118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=5705635660240960118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5705635660240960118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5705635660240960118'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/auditing-of-commands.html' title='Auditing of Commands'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3879546258378713802</id><published>2010-01-13T10:45:00.002-08:00</published><updated>2010-01-13T10:46:09.452-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Audit Table Permissions'/><title type='text'>Audit Table Permissions</title><content type='html'>select grantee from dba_tab_privs &lt;br /&gt;       where table_name='AUD$' &lt;br /&gt;        and grantee not in ('DELETE_CATALOG_ROLE')&lt;br /&gt;        and grantee not in &lt;br /&gt;         (select grantee from dba_role_privs where granted_role='DBA')&lt;br /&gt;        order by grantee;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3879546258378713802?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3879546258378713802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3879546258378713802' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3879546258378713802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3879546258378713802'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/audit-table-permissions.html' title='Audit Table Permissions'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2197244606732865389</id><published>2010-01-13T10:45:00.001-08:00</published><updated>2010-01-13T10:45:27.542-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Account Permissions'/><title type='text'>Account Permissions</title><content type='html'>select grantee||': '||privilege||': '||owner||'.'||table_name &lt;br /&gt;      from dba_tab_privs where grantee not in (select role from dba_roles)&lt;br /&gt;      and grantee not in ('ORDSYS','OUTLN','PUBLIC','SYS','SYSTEM',&lt;br /&gt;        'CTXSYS','MDSYS','ODM','OLAPSYS','WKSYS','WMSYS','XDB','LBACSYS',&lt;br /&gt;        'OSE$HTTP$ADMIN','AURORA$JIS$UTILITY$','REPADMIN','PERFSTAT','SYSMAN')&lt;br /&gt;      and table_name&lt;&gt;'DBMS_REPCAT_INTERNAL_PACKAGE'&lt;br /&gt;      and table_name not like '%RP'&lt;br /&gt;      and grantee not in &lt;br /&gt;       (select grantee from dba_tab_privs where table_name in ('DBMS_DEFER','DEFLOB'))&lt;br /&gt;      and grantee not in (select grantee from dba_role_privs where granted_role='DBA');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2197244606732865389?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2197244606732865389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2197244606732865389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2197244606732865389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2197244606732865389'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/account-permissions.html' title='Account Permissions'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-5361332353491488566</id><published>2010-01-13T10:44:00.001-08:00</published><updated>2010-01-13T10:44:40.775-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Resource Limits Not Enabled'/><title type='text'>Resource Limits Not Enabled</title><content type='html'>show parameter resource_limit;&lt;br /&gt;&lt;br /&gt;-- OR&lt;br /&gt;&lt;br /&gt;Select value from v$parameter where name='resource_limit';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-5361332353491488566?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/5361332353491488566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=5361332353491488566' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5361332353491488566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5361332353491488566'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/resource-limits-not-enabled.html' title='Resource Limits Not Enabled'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3961055422697195687</id><published>2010-01-13T10:43:00.002-08:00</published><updated>2010-01-13T10:44:11.124-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='REMOTE_LOGIN_PASSWORDFILE'/><title type='text'>REMOTE_LOGIN_PASSWORDFILE</title><content type='html'>Show parameter remote_login_passwordfile;&lt;br /&gt;&lt;br /&gt;-- OR&lt;br /&gt;&lt;br /&gt;Select value from v$parameter where name='remote_login_passwordfile';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3961055422697195687?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3961055422697195687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3961055422697195687' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3961055422697195687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3961055422697195687'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/remoteloginpasswordfile.html' title='REMOTE_LOGIN_PASSWORDFILE'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-928145797882746791</id><published>2010-01-13T10:43:00.001-08:00</published><updated>2010-01-13T10:43:36.035-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Failed Login Attempts'/><title type='text'>Failed Login Attempts</title><content type='html'>select profile||': '||limit from dba_profiles,&lt;br /&gt;           (SELECT limit AS def_login_attmpts&lt;br /&gt;            FROM   dba_profiles &lt;br /&gt;            WHERE  profile = 'DEFAULT'&lt;br /&gt;            AND    resource_name = 'FAILED_LOGIN_ATTEMPTS')&lt;br /&gt;    WHERE  resource_name='FAILED_LOGIN_ATTEMPTS'    &lt;br /&gt;    AND    ((replace(limit,'DEFAULT',def_login_attmpts) IN ('UNLIMITED',NULL))&lt;br /&gt;      OR    (lpad(replace(limit,'DEFAULT',def_login_attmpts),40,'0') &gt;&lt;br /&gt;             lpad('3',40,'0')));&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-928145797882746791?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/928145797882746791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=928145797882746791' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/928145797882746791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/928145797882746791'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/failed-login-attempts.html' title='Failed Login Attempts'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-794437730389759813</id><published>2010-01-13T10:42:00.002-08:00</published><updated>2010-01-13T10:43:06.978-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Idle Time Resource Usage Limit'/><title type='text'>Idle Time Resource Usage Limit</title><content type='html'>Select limit from DBA_PROFILES where profile='DEFAULT' and resource_name='IDLE_TIME';&lt;br /&gt;select profile||': '||limit &lt;br /&gt;    FROM   dba_profiles,&lt;br /&gt;           (SELECT limit AS def_idl_tm&lt;br /&gt;            FROM   dba_profiles &lt;br /&gt;            WHERE  profile = 'DEFAULT'&lt;br /&gt;            AND    resource_name = 'IDLE_TIME')&lt;br /&gt;    WHERE  resource_name='IDLE_TIME'&lt;br /&gt;    AND    ((replace(limit,'DEFAULT',def_idl_tm) IN ('UNLIMITED', NULL))&lt;br /&gt;      OR    (lpad(replace(limit,'DEFAULT',def_idl_tm),40,'0') &gt;&lt;br /&gt;             lpad('15',40,'0')));&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-794437730389759813?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/794437730389759813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=794437730389759813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/794437730389759813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/794437730389759813'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/idle-time-resource-usage-limit.html' title='Idle Time Resource Usage Limit'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-5348953011575532307</id><published>2010-01-13T10:42:00.001-08:00</published><updated>2010-01-13T10:42:35.612-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='users or roles granted ALL PRIVILEGES or too many privileges'/><title type='text'>users or roles granted ALL PRIVILEGES or too many privileges</title><content type='html'>-- Check for all privs:&lt;br /&gt;&lt;br /&gt;(select count(*) from system_privilege_map) intersect&lt;br /&gt;(select count(*) from dba_sys_privs group by grantee);&lt;br /&gt;&lt;br /&gt;-- Check for number of privs in case too many:&lt;br /&gt;&lt;br /&gt;select count(*) from system_privilege_map;&lt;br /&gt;&lt;br /&gt;-- Check how many privileges each account has:&lt;br /&gt;&lt;br /&gt;select count(*),grantee&lt;br /&gt;from dba_sys_privs&lt;br /&gt;group by grantee;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-5348953011575532307?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/5348953011575532307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=5348953011575532307' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5348953011575532307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5348953011575532307'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/users-or-roles-granted-all-privileges.html' title='users or roles granted ALL PRIVILEGES or too many privileges'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1700026578063633047</id><published>2010-01-13T10:41:00.002-08:00</published><updated>2010-01-13T10:42:01.749-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PUBLIC is granted with Object Permissions'/><title type='text'>PUBLIC is granted with Object Permissions</title><content type='html'>select owner||'.'||table_name||': '||privilege from dba_tab_privs&lt;br /&gt;where grantee='PUBLIC'&lt;br /&gt;and owner not in('SYS','CTXSYS','MDSYS','ODM','OLAPSYS','MTSSYS',&lt;br /&gt;'ORDPLUGINS','ORDSYS','SYSTEM','WKSYS','WMSYS','XDB','LBACSYS',&lt;br /&gt;'PERFSTAT','SYSMAN','DMSYS','EXFSYS');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1700026578063633047?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1700026578063633047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1700026578063633047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1700026578063633047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1700026578063633047'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/public-is-granted-with-object.html' title='PUBLIC is granted with Object Permissions'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8492812913700285613</id><published>2010-01-13T10:41:00.001-08:00</published><updated>2010-01-13T10:41:32.329-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Roles Granted With Admin'/><title type='text'>Roles Granted With Admin</title><content type='html'>select grantee||': '||granted_role from dba_role_privs&lt;br /&gt;where grantee not in('DBA','SYS','SYSTEM','WKSYS','LBACSYS','WMSYS')&lt;br /&gt;and admin_option='YES' &lt;br /&gt;and grantee not in (select distinct owner from dba_objects)&lt;br /&gt;and grantee not in (select grantee from dba_role_privs where granted_role='DBA');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8492812913700285613?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8492812913700285613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8492812913700285613' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8492812913700285613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8492812913700285613'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/roles-granted-with-admin.html' title='Roles Granted With Admin'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3735169854864685935</id><published>2010-01-13T10:40:00.002-08:00</published><updated>2010-01-13T10:41:03.637-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PUBLIC is granted with System Privileges'/><title type='text'>PUBLIC is granted with System Privileges</title><content type='html'>select privilege from dba_sys_privs where grantee='PUBLIC';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3735169854864685935?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3735169854864685935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3735169854864685935' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3735169854864685935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3735169854864685935'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/public-is-granted-with-system.html' title='PUBLIC is granted with System Privileges'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-5552374406715137367</id><published>2010-01-13T10:40:00.001-08:00</published><updated>2010-01-13T10:40:33.539-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check which user has been granted with the &apos;CONNECT&apos; role'/><title type='text'>Check which user has been granted with the 'CONNECT' role</title><content type='html'>select grantee&lt;br /&gt;from dba_role_privs r, dba_users u&lt;br /&gt;where granted_role ='CONNECT' and&lt;br /&gt;   r.grantee = u.username and&lt;br /&gt;   u.account_status not like '%LOCKED%' and&lt;br /&gt;   grantee not in ('SYS','SYSTEM','DBSNMP')&lt;br /&gt;union&lt;br /&gt;select grantee&lt;br /&gt;from dba_role_privs r, dba_users u&lt;br /&gt;where r.grantee = u.username and&lt;br /&gt;  u.account_status not like '%LOCKED%' and&lt;br /&gt;  grantee not in ('SYS','SYSTEM','DBSNMP') and&lt;br /&gt;  granted_role in &lt;br /&gt;    (select grantee&lt;br /&gt;     from dba_role_privs&lt;br /&gt;     where granted_role = 'CONNECT' and&lt;br /&gt;       grantee &lt;&gt; 'DBA');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-5552374406715137367?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/5552374406715137367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=5552374406715137367' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5552374406715137367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5552374406715137367'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-which-user-has-been-granted-with_13.html' title='Check which user has been granted with the &apos;CONNECT&apos; role'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3319474096823522903</id><published>2010-01-13T10:39:00.002-08:00</published><updated>2010-01-13T10:40:07.200-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check which user has been granted with the &apos;RESOURCE&apos; role'/><title type='text'>Check which user has been granted with the 'RESOURCE' role</title><content type='html'>select grantee&lt;br /&gt;from dba_role_privs r, dba_users u&lt;br /&gt;where granted_role ='RESOURCE' and&lt;br /&gt;   r.grantee = u.username and&lt;br /&gt;   u.account_status not like '%LOCKED%' and&lt;br /&gt;   grantee not in ('SYS','SYSTEM','DBSNMP')&lt;br /&gt;union&lt;br /&gt;select grantee&lt;br /&gt;from dba_role_privs r, dba_users u&lt;br /&gt;where r.grantee = u.username and&lt;br /&gt;  u.account_status not like '%LOCKED%' and&lt;br /&gt;  grantee not in ('SYS','SYSTEM','DBSNMP') and&lt;br /&gt;  granted_role in&lt;br /&gt;    ( select grantee&lt;br /&gt;      from dba_role_privs&lt;br /&gt;      where granted_role = 'RESOURCE' and&lt;br /&gt;        grantee &lt;&gt; 'DBA');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3319474096823522903?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3319474096823522903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3319474096823522903' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3319474096823522903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3319474096823522903'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-which-user-has-been-granted-with.html' title='Check which user has been granted with the &apos;RESOURCE&apos; role'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3843469571769994190</id><published>2010-01-13T10:39:00.001-08:00</published><updated>2010-01-13T10:39:32.179-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check which user has &apos;ALTER SESSION&apos; and &apos;ALTER SYSTEM&apos; privileges'/><title type='text'>Check which user has 'ALTER SESSION' and 'ALTER SYSTEM' privileges</title><content type='html'>select grantee from dba_sys_privs where privilege = 'ALTER SESSION';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select grantee from dba_sys_privs where privilege = 'ALTER SYSTEM';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3843469571769994190?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3843469571769994190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3843469571769994190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3843469571769994190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3843469571769994190'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-which-user-has-alter-session-and.html' title='Check which user has &apos;ALTER SESSION&apos; and &apos;ALTER SYSTEM&apos; privileges'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6408012044637501472</id><published>2010-01-13T10:38:00.000-08:00</published><updated>2010-01-13T10:39:05.203-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Prevent granting of CREATE LIBRARY'/><title type='text'>Prevent granting of CREATE LIBRARY</title><content type='html'>select * from dba_sys_privs where privilege='CREATE LIBRARY';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6408012044637501472?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6408012044637501472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6408012044637501472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6408012044637501472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6408012044637501472'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/prevent-granting-of-create-library.html' title='Prevent granting of CREATE LIBRARY'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2744470922005153130</id><published>2010-01-13T10:37:00.002-08:00</published><updated>2010-01-13T10:38:21.902-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for privileges with &apos;ANY&apos; keywordgranted.'/><title type='text'>Check for privileges with 'ANY' keywordgranted.</title><content type='html'>select grantee&lt;br /&gt;from dba_sys_privs s, dba_users u &lt;br /&gt;where s.grantee = u.username and&lt;br /&gt;   u.account_status not like '%LOCKED%' and&lt;br /&gt;   privilege like '%ANY%' and&lt;br /&gt;   grantee &lt;&gt; 'DBA' and&lt;br /&gt;   grantee not in ('SYS','SYSTEM','MDSYS','CTXSYS',&lt;br /&gt;         'ORDSYS','ORDPLUGINS','AURORA$JIS$UTILITY$',&lt;br /&gt;         'HR','ODM','ODM_MTR','OE','OLAPDBA','OLAPSYS',&lt;br /&gt;         'OSE$HTTP$ADMIN','OUTLN','TRACESVR','REPADMIN',&lt;br /&gt;         'PM','QS','QS_ADM','QS_CB','QS_CBADM', 'DBSNMP',&lt;br /&gt;         'QS_CS','QS_ES','QS_OS','QS_WS','RMAN','SH','WKSYS',&lt;br /&gt;         'WMSYS','XDB','WKPROXY','LBACSYS','OLAPSVR', 'PERFSTAT')&lt;br /&gt;union&lt;br /&gt;select grantee&lt;br /&gt;from dba_role_privs r, dba_users u&lt;br /&gt;where    r.grantee = u.username and&lt;br /&gt;  u.account_status not like '%LOCKED%' and &lt;br /&gt;  granted_role in &lt;br /&gt;    ( select grantee&lt;br /&gt;      from dba_sys_privs&lt;br /&gt;      where privilege like '%ANY%' and&lt;br /&gt;        grantee &lt;&gt; 'DBA'&lt;br /&gt;    ) and&lt;br /&gt;    grantee not in ('SYS','SYSTEM','MDSYS','CTXSYS',&lt;br /&gt;         'ORDSYS','ORDPLUGINS','AURORA$JIS$UTILITY$',&lt;br /&gt;         'HR','ODM','ODM_MTR','OE','OLAPDBA','OLAPSYS',&lt;br /&gt;         'OSE$HTTP$ADMIN','OUTLN','TRACESVR','REPADMIN',&lt;br /&gt;         'PM','QS','QS_ADM','QS_CB','QS_CBADM', 'DBSNMP',&lt;br /&gt;         'QS_CS','QS_ES','QS_OS','QS_WS','RMAN','SH','WKSYS',&lt;br /&gt;         'WMSYS','XDB','WKPROXY','LBACSYS','OLAPSVR', 'PERFSTAT')&lt;br /&gt;union&lt;br /&gt;select grantee&lt;br /&gt;from dba_role_privs r, dba_users u&lt;br /&gt;where r.grantee = u.username and&lt;br /&gt;  u.account_status not like '%LOCKED%' and &lt;br /&gt;  granted_role &lt;&gt; 'DBA' and&lt;br /&gt;  granted_role in &lt;br /&gt;     ( select grantee&lt;br /&gt;       from dba_role_privs&lt;br /&gt;       where granted_role in &lt;br /&gt;          ( select grantee&lt;br /&gt;            from dba_sys_privs&lt;br /&gt;            where privilege like '%ANY%' and&lt;br /&gt;              grantee &lt;&gt; 'DBA'&lt;br /&gt;          )&lt;br /&gt;     ) and&lt;br /&gt;  grantee not in ('SYS','SYSTEM','MDSYS','CTXSYS',&lt;br /&gt;     'ORDSYS','ORDPLUGINS','AURORA$JIS$UTILITY$',&lt;br /&gt;     'HR','ODM','ODM_MTR','OE','OLAPDBA','OLAPSYS',&lt;br /&gt;     'OSE$HTTP$ADMIN','OUTLN','TRACESVR','REPADMIN',&lt;br /&gt;     'PM','QS','QS_ADM','QS_CB','QS_CBADM', 'DBSNMP',&lt;br /&gt;     'QS_CS','QS_ES','QS_OS','QS_WS','RMAN','SH','WKSYS',&lt;br /&gt;     'WMSYS','XDB','WKPROXY','LBACSYS','OLAPSVR', 'PERFSTAT');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2744470922005153130?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2744470922005153130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2744470922005153130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2744470922005153130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2744470922005153130'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-privileges-with-any.html' title='Check for privileges with &apos;ANY&apos; keywordgranted.'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8708177698493240209</id><published>2010-01-13T10:37:00.001-08:00</published><updated>2010-01-13T10:37:45.956-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for Restricted PL/SQL Packages'/><title type='text'>Check for Restricted PL/SQL Packages</title><content type='html'>select table_name from dba_tab_privs&lt;br /&gt;       where grantee='PUBLIC' &lt;br /&gt;       and privilege ='EXECUTE'&lt;br /&gt;       and table_name in&lt;br /&gt;         ('UTL_SMTP', 'UTL_TCP', 'UTL_HTTP', 'UTL_FILE', &lt;br /&gt;          'DBMS_RANDOM','DBMS_LOB', 'DBMS_SQL','DBMS_JOB', &lt;br /&gt;          'DBMS_BACKUP_RESTORE','DBMS_OBFUSCATION_TOOLKIT');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8708177698493240209?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8708177698493240209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8708177698493240209' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8708177698493240209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8708177698493240209'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-restricted-plsql-packages.html' title='Check for Restricted PL/SQL Packages'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4790967880679488349</id><published>2010-01-13T10:36:00.002-08:00</published><updated>2010-01-13T10:37:12.672-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for Role Permissions'/><title type='text'>Check for Role Permissions</title><content type='html'>select grantee,owner,table_name from dba_tab_privs&lt;br /&gt;               where privilege in ('ALTER','REFERENCES','INDEX')&lt;br /&gt;               and grantee not in ('DBA','SYSTEM','LBACSYS','XDBADMIN','XDB_ADMIN')&lt;br /&gt;               and table_name not in ('SDO_IDX_TAB_SEQUENCE','XDB$ACL')&lt;br /&gt;      and grantee not in (select grantee from dba_role_privs where granted_role='DBA')&lt;br /&gt;      and grantee not in (select owner from dba_objects);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4790967880679488349?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4790967880679488349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4790967880679488349' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4790967880679488349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4790967880679488349'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-role-permissions.html' title='Check for Role Permissions'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-569698568022749696</id><published>2010-01-13T10:36:00.001-08:00</published><updated>2010-01-13T10:36:23.701-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Prevent granting of privileges that have WITH GRANT option'/><title type='text'>Prevent granting of privileges that have WITH GRANT option</title><content type='html'>select grantee||': '||owner||'.'||table_name from dba_tab_privs &lt;br /&gt;      where grantable='YES' &lt;br /&gt;      and owner not in ('SYS','MDSYS','ORDPLUGINS',&lt;br /&gt;                        'ORDSYS','SYSTEM','WMSYS','XDB','LBACSYS')&lt;br /&gt;      and grantee not in (select grantee from dba_role_privs where granted_role='DBA')&lt;br /&gt;      order by grantee;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-569698568022749696?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/569698568022749696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=569698568022749696' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/569698568022749696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/569698568022749696'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/prevent-granting-of-privileges-that.html' title='Prevent granting of privileges that have WITH GRANT option'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-7640647051511243325</id><published>2010-01-13T10:34:00.002-08:00</published><updated>2010-01-13T10:35:06.346-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check Privileges Granted With Admin'/><title type='text'>Check Privileges Granted With Admin</title><content type='html'>select grantee,privilege from dba_sys_privs&lt;br /&gt;where grantee not in &lt;br /&gt;('SYS','SYSTEM','AQ_ADMINISTRATOR_ROLE','DBA','MDSYS','LBACSYS','SCHEDULER_ADMIN','WMSYS')&lt;br /&gt;and admin_option='YES'&lt;br /&gt;and grantee not in (select grantee from dba_role_privs where granted_role='DBA');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-7640647051511243325?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/7640647051511243325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=7640647051511243325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7640647051511243325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7640647051511243325'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-privileges-granted-with-admin.html' title='Check Privileges Granted With Admin'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4197841571789083721</id><published>2010-01-13T10:34:00.001-08:00</published><updated>2010-01-13T10:34:29.122-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SYSDBA Privilege Assignments'/><title type='text'>SYSDBA Privilege Assignments</title><content type='html'>SELECT USERNAME FROM V$PWFILE_USERS&lt;br /&gt;WHERE USERNAME NOT IN &lt;br /&gt;        (SELECT GRANTEE FROM DBA_ROLE_PRIVS WHERE GRANTED_ROLE='DBA')&lt;br /&gt;        and USERNAME !='INTERNAL' and sysdba='TRUE';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4197841571789083721?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4197841571789083721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4197841571789083721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4197841571789083721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4197841571789083721'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/sysdba-privilege-assignments.html' title='SYSDBA Privilege Assignments'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6541177577444214094</id><published>2010-01-13T10:32:00.000-08:00</published><updated>2010-01-13T10:33:18.337-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for System Privilege Assignments'/><title type='text'>Check for System Privilege Assignments</title><content type='html'>select grantee||': '||PRIVILEGE from dba_sys_privs&lt;br /&gt;                where privilege&lt;&gt;'CREATE SESSION' and&lt;br /&gt;               grantee not in ('PUBLIC','AQ_ADMINISTRATOR_ROLE',&lt;br /&gt;               'AQ_USER_ROLE','CTXSYS','DBA','DELETE_CATALOG_ROLE', &lt;br /&gt;  'EXECUTE_CATALOG_ROLE', 'EXP_FULL_DATABASE',&lt;br /&gt;  'GATHER_SYSTEM_STATISTICS','HS_ADMIN_ROLE', 'IMP_FULL_DATABASE', &lt;br /&gt;  'LOGSTDBY_ADMINISTRATOR', 'MDSYS','ODM', &lt;br /&gt;  'OEM_MONITOR','OLAPSYS','ORDSYS','OUTLN','MTSSYS',&lt;br /&gt;               'RECOVERY_CATALOG_OWNER','SELECT_CATALOG_ROLE','SNMPAGENT',&lt;br /&gt;               'SYSTEM','WKSYS','WKUSER','WMSYS','WM_ADMIN_ROLE','XDB',&lt;br /&gt;               'ANONYMOUS','CONNECT','DBSNMP','JAVADEBUGPRIV','ODM_MTR',&lt;br /&gt;               'OLAP_DBA','ORDPLUGINS','RESOURCE','RMAN','SYS','WKPROXY',&lt;br /&gt;               'AURORA$JIS$UTILITY$','AURORA$ORB$UNAUTHENTICATED',&lt;br /&gt;               'OSE$HTTP$ADMIN','TIMESERIES_DBA','TIMESERIES_DEVELOPER',&lt;br /&gt;               'OLAP_USER')&lt;br /&gt;    and grantee not in (select grantee from dba_role_privs where granted_role='DBA')&lt;br /&gt;    and grantee not in (select username from dba_users where account_status = 'LOCKED');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6541177577444214094?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6541177577444214094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6541177577444214094' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6541177577444214094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6541177577444214094'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-system-privilege-assignments.html' title='Check for System Privilege Assignments'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2161852339244939300</id><published>2010-01-13T10:29:00.001-08:00</published><updated>2010-01-13T10:29:48.371-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for Roles Assigned to PUBLIC'/><title type='text'>Check for Roles Assigned to PUBLIC</title><content type='html'>select granted_role from dba_role_privs where grantee='PUBLIC';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2161852339244939300?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2161852339244939300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2161852339244939300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2161852339244939300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2161852339244939300'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-roles-assigned-to-public.html' title='Check for Roles Assigned to PUBLIC'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8164691739506948735</id><published>2010-01-13T10:28:00.000-08:00</published><updated>2010-01-13T10:29:05.334-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for Access to System Tables/DBA Views'/><title type='text'>Check for Access to System Tables/DBA Views</title><content type='html'>select grantee,privilege,owner,table_name from dba_tab_privs&lt;br /&gt;    where (owner='SYS' or table_name like 'DBA_%') &lt;br /&gt;      and privilege &lt;&gt; 'EXECUTE'&lt;br /&gt;      and grantee not in ('PUBLIC','AQ_ADMINISTRATOR_ROLE','AQ_USER_ROLE',&lt;br /&gt;               'AURORA$JIS$UTILITY$','OSE$HTTP$ADMIN','TRACESVR',&lt;br /&gt;        'CTXSYS','DBA','DELETE_CATALOG_ROLE','EXECUTE_CATALOG_ROLE',&lt;br /&gt;               'EXP_FULL_DATABASE','GATHER_SYSTEM_STATISTICS','HS_ADMIN_ROLE',&lt;br /&gt;               'IMP_FULL_DATABASE','LOGSTDBY_ADMINISTRATOR','MDSYS','ODM',&lt;br /&gt;               'OEM_MONITOR','OLAPSYS','ORDSYS','OUTLN','RECOVERY_CATALOG_OWNER',&lt;br /&gt;               'SELECT_CATALOG_ROLE','SNMPAGENT','SYSTEM','WKSYS','WKUSER',&lt;br /&gt;               'WMSYS','WM_ADMIN_ROLE','XDB','LBACSYS','PERFSTAT','XDBADMIN')&lt;br /&gt;       and grantee not in (select grantee from dba_role_privs where granted_role='DBA')&lt;br /&gt;    order by grantee;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8164691739506948735?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8164691739506948735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8164691739506948735' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8164691739506948735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8164691739506948735'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-access-to-system-tablesdba.html' title='Check for Access to System Tables/DBA Views'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-340639310893966105</id><published>2010-01-13T10:27:00.002-08:00</published><updated>2010-01-13T10:28:18.764-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for Tablespace Quotas'/><title type='text'>Check for Tablespace Quotas</title><content type='html'>Select username,tablespace_name &lt;br /&gt;from dba_ts_quotas&lt;br /&gt;where username not in (select distinct owner from dba_objects)&lt;br /&gt;and username not in (select grantee from dba_role_privs where granted_role='DBA');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-340639310893966105?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/340639310893966105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=340639310893966105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/340639310893966105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/340639310893966105'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-tablespace-quotas.html' title='Check for Tablespace Quotas'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2546661485068865484</id><published>2010-01-13T10:27:00.001-08:00</published><updated>2010-01-13T10:27:30.735-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for Default Tablespace'/><title type='text'>Check for Default Tablespace</title><content type='html'>Select username from dba_users &lt;br /&gt;     where (default_tablespace= 'SYSTEM' or temporary_tablespace= 'SYSTEM')&lt;br /&gt;     and username not in &lt;br /&gt;         ('AURORA$JIS$UTILITY$', 'AURORA$ORB$UNAUTHENTICATED', 'DBSNMP', &lt;br /&gt;          'MDSYS', 'ORDPLUGINS', 'ORDSYS', 'OSE$HTTP$ADMIN', 'OUTLN', 'REPADMIN', &lt;br /&gt;          'SYS', 'SYSTEM','TRACESVR','MTSSYS','DIP');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2546661485068865484?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2546661485068865484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2546661485068865484' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2546661485068865484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2546661485068865484'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-default-tablespace.html' title='Check for Default Tablespace'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2376594433689578569</id><published>2010-01-13T10:26:00.001-08:00</published><updated>2010-01-13T10:26:43.871-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Replication Account Use'/><title type='text'>Replication Account Use</title><content type='html'>select 'The number of replication objects defined is: '||&lt;br /&gt;      count(*) from system.REPCAT$_REPOBJECT;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2376594433689578569?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2376594433689578569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2376594433689578569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2376594433689578569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2376594433689578569'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/replication-account-use.html' title='Replication Account Use'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2892375435294408516</id><published>2010-01-13T10:25:00.001-08:00</published><updated>2010-01-13T10:25:48.455-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Predefined Roles'/><title type='text'>Oracle Predefined Roles</title><content type='html'>select grantee||': '||granted_role from dba_role_privs &lt;br /&gt;        where grantee not in &lt;br /&gt;         ('SYS','SYSTEM','MDSYS','CTXSYS',&lt;br /&gt;         'ORDSYS','ORDPLUGINS','AURORA$JIS$UTILITY$',&lt;br /&gt;         'HR','ODM','ODM_MTR','OE','OLAPDBA','OLAPSYS',&lt;br /&gt;         'OSE$HTTP$ADMIN','OUTLN','TRACESVR','REPADMIN',&lt;br /&gt;         'PM','PUBLIC','QS','QS_ADM','QS_CB','QS_CBADM', 'DBSNMP',&lt;br /&gt;         'QS_CS','QS_ES','QS_OS','QS_WS','RMAN','SH','WKSYS',&lt;br /&gt;         'WMSYS','XDB','WKPROXY','LBACSYS','OLAPSVR', 'PERFSTAT') &lt;br /&gt;          and grantee not in (select role from dba_roles)&lt;br /&gt;          and grantee not in &lt;br /&gt;            (select grantee from dba_role_privs where granted_role='DBA')&lt;br /&gt;          and grantee not in (select distinct owner from dba_objects)&lt;br /&gt;          and granted_role in &lt;br /&gt;   ('AQ_ADMINISTRATOR_ROLE',&lt;br /&gt;    'AQ_USER_ROLE','AUTHENTICATEDUSER','CONNECT',           &lt;br /&gt;           'CTXAPP','DELETE_CATALOG_ROLE',&lt;br /&gt;           'EJBCLIENT','EXECUTE_CATALOG_ROLE',&lt;br /&gt;           'EXP_FULL_DATABASE','GATHER_SYSTEM_STATISTICS',&lt;br /&gt;           'GLOBAL_AQ_USER_ROLE','HS_ADMIN_ROLE',&lt;br /&gt;           'IMP_FULL_DATABASE','JAVADEBUGPRIV', 'JAVAIDPRIV','JAVASYSPRIV',&lt;br /&gt;           'JAVAUSERPRIV','JAVA_ADMIN','JAVA_DEPLOY',&lt;br /&gt;           'LOGSTDBY_ADMINISTRATOR','OEM_MONITOR','OLAP_DBA',&lt;br /&gt;           'RECOVERY_CATALOG_OWNER','RESOURCE','SALES_HISTORY_ROLE',&lt;br /&gt;           'SELECT_CATALOG_ROLE','WKUSER','WM_ADMIN_ROLE','XDBADMIN') &lt;br /&gt;           order by grantee;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2892375435294408516?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2892375435294408516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2892375435294408516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2892375435294408516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2892375435294408516'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/oracle-predefined-roles.html' title='Oracle Predefined Roles'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3656668865174746790</id><published>2010-01-13T10:24:00.001-08:00</published><updated>2010-01-13T10:24:39.168-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for Active Schema Owner Account'/><title type='text'>Check for Active Schema Owner Account</title><content type='html'>select distinct owner from dba_objects, dba_users &lt;br /&gt;         where owner not in &lt;br /&gt;         ('SYS','SYSTEM','MDSYS','CTXSYS',&lt;br /&gt;         'ORDSYS','ORDPLUGINS','AURORA$JIS$UTILITY$',&lt;br /&gt;         'ODM','ODM_MTR','OLAPDBA','OLAPSYS','MTSSYS',&lt;br /&gt;  'OSE$HTTP$ADMIN','OUTLN','LBACSYS',&lt;br /&gt;         'PUBLIC','DBSNMP','RMAN','WKSYS',&lt;br /&gt;  'WMSYS','XDB')  &lt;br /&gt;        and owner = username&lt;br /&gt;        and account_status not like '%LOCKED';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3656668865174746790?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3656668865174746790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3656668865174746790' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3656668865174746790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3656668865174746790'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-active-schema-owner-account.html' title='Check for Active Schema Owner Account'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3994057847937037959</id><published>2010-01-13T10:22:00.000-08:00</published><updated>2010-01-13T10:23:07.302-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check Developer Privileges on Shared Systems'/><title type='text'>Check Developer Privileges on Shared Systems</title><content type='html'>SELECT GRANTEE||': '||PRIVILEGE FROM DBA_SYS_PRIVS WHERE&lt;br /&gt;    (PRIVILEGE LIKE 'CREATE%' OR PRIVILEGE LIKE 'ALTER%'OR PRIVILEGE LIKE 'DROP%')&lt;br /&gt;    AND PRIVILEGE&lt;&gt;'CREATE SESSION'&lt;br /&gt;    AND GRANTEE NOT IN&lt;br /&gt;            ('SYS','SYSTEM','ANONYMOUS','AQ_ADMINISTRATOR_ROLE','MTSSYS',&lt;br /&gt; 'CONNECT','CTXSYS','DBA','IMP_FULL_DATABASE','MDSYS','ODM',&lt;br /&gt; 'ODM_MTR','OEM_MONITOR','OLAPSYS','OLAP_DBA','ORDPLUGINS','ORDSYS',&lt;br /&gt;  'RECOVERY_CATALOG_OWNER','RESOURCE','SYS','WKPROXY','WKSYS',&lt;br /&gt;  'WKUSER','WMSYS','XDB','TIMESERIES_DEVELOPER','TIMESERIES_DBA',&lt;br /&gt;  'LBACSYS','DBSNMP','OLAP_USER') order by grantee;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3994057847937037959?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3994057847937037959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3994057847937037959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3994057847937037959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3994057847937037959'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-developer-privileges-on-shared.html' title='Check Developer Privileges on Shared Systems'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4138847446322064235</id><published>2010-01-13T10:21:00.000-08:00</published><updated>2010-01-13T10:22:13.048-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check for Unauthorized Object Owner'/><title type='text'>Check for Unauthorized Object Owner</title><content type='html'>select distinct owner from dba_objects&lt;br /&gt;        where owner not in &lt;br /&gt;         ('SYS','SYSTEM','MDSYS','CTXSYS',&lt;br /&gt;         'ORDSYS','ORDPLUGINS','AURORA$JIS$UTILITY$',&lt;br /&gt;         'HR','ODM','ODM_MTR','OE','OLAPDBA','OLAPSYS',&lt;br /&gt;         'OSE$HTTP$ADMIN','OUTLN','LBACSYS','MTSYS',&lt;br /&gt;         'PM','PUBLIC','QS','QS_ADM','QS_CB','QS_CBADM', 'DBSNMP',&lt;br /&gt;         'QS_CS','QS_ES','QS_OS','QS_WS','RMAN','SH','WKSYS',&lt;br /&gt;         'WMSYS','XDB')&lt;br /&gt;        and owner not in (select grantee from dba_role_privs where granted_role='DBA');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4138847446322064235?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4138847446322064235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4138847446322064235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4138847446322064235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4138847446322064235'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-for-unauthorized-object-owner.html' title='Check for Unauthorized Object Owner'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8064651540107488637</id><published>2010-01-13T10:20:00.000-08:00</published><updated>2010-01-13T10:21:23.056-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check if DBA Includes Non-default Account'/><title type='text'>Check if DBA Includes Non-default Account</title><content type='html'>select grantee from dba_role_privs &lt;br /&gt;where granted_role='DBA' &lt;br /&gt;and grantee not in ('SYS','SYSTEM','CTXSYS','WKSYS','SYSMAN');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8064651540107488637?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8064651540107488637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8064651540107488637' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8064651540107488637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8064651540107488637'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-if-dba-includes-non-default.html' title='Check if DBA Includes Non-default Account'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1088899261270345415</id><published>2010-01-13T10:19:00.001-08:00</published><updated>2010-01-13T10:19:42.125-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GLOBAL_NAMES Parameter'/><title type='text'>GLOBAL_NAMES Parameter</title><content type='html'>Select value from v$parameter where name= 'global_names';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1088899261270345415?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1088899261270345415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1088899261270345415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1088899261270345415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1088899261270345415'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/globalnames-parameter.html' title='GLOBAL_NAMES Parameter'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3589547804167194300</id><published>2010-01-13T10:18:00.000-08:00</published><updated>2010-01-13T10:19:00.681-08:00</updated><title type='text'>Oracle database log mode</title><content type='html'>Select log_mode from v$database;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3589547804167194300?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3589547804167194300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3589547804167194300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3589547804167194300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3589547804167194300'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/oracle-database-log-mode.html' title='Oracle database log mode'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4564946014038984194</id><published>2010-01-13T10:16:00.001-08:00</published><updated>2010-01-13T10:17:33.174-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='&apos;user_dump_dest&apos; and &apos;background_dump_dest&apos;'/><title type='text'>'user_dump_dest' and 'background_dump_dest'</title><content type='html'>Select value from v$parameter where name='user_dump_dest';&lt;br /&gt;&lt;br /&gt;Select value from v$parameter where name='background_dump_dest';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4564946014038984194?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4564946014038984194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4564946014038984194' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4564946014038984194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4564946014038984194'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/userdumpdest-and-backgrounddumpdest_13.html' title='&apos;user_dump_dest&apos; and &apos;background_dump_dest&apos;'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8208172863828256770</id><published>2010-01-13T10:16:00.000-08:00</published><updated>2010-01-13T10:17:30.811-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='&apos;user_dump_dest&apos; and &apos;background_dump_dest&apos;'/><title type='text'>'user_dump_dest' and 'background_dump_dest'</title><content type='html'>Select value from v$parameter where name='user_dump_dest';&lt;br /&gt;&lt;br /&gt;Select value from v$parameter where name='background_dump_dest';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8208172863828256770?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8208172863828256770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8208172863828256770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8208172863828256770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8208172863828256770'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/userdumpdest-and-backgrounddumpdest.html' title='&apos;user_dump_dest&apos; and &apos;background_dump_dest&apos;'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1608033358635346831</id><published>2010-01-13T10:15:00.001-08:00</published><updated>2010-01-13T10:15:52.011-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Default Oracle System Identifier'/><title type='text'>Default Oracle System Identifier</title><content type='html'>Select value from v$parameter where name= 'instance_name';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1608033358635346831?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1608033358635346831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1608033358635346831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1608033358635346831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1608033358635346831'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/default-oracle-system-identifier.html' title='Default Oracle System Identifier'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8912639205356169374</id><published>2010-01-13T10:14:00.001-08:00</published><updated>2010-01-13T10:14:54.912-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Password Verify Function'/><title type='text'>Password Verify Function</title><content type='html'>SELECT profile, limit&lt;br /&gt;    FROM   dba_profiles,&lt;br /&gt;           (SELECT limit AS def_pwd_verify_func&lt;br /&gt;            FROM   dba_profiles&lt;br /&gt;            WHERE  resource_name = 'PASSWORD_VERIFY_FUNCTION'&lt;br /&gt;            AND    profile = 'DEFAULT')&lt;br /&gt;    WHERE   resource_name='PASSWORD_VERIFY_FUNCTION'&lt;br /&gt;    AND     REPLACE(limit,'DEFAULT',def_pwd_verify_func) in&lt;br /&gt;('UNLIMITED','NULL');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8912639205356169374?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8912639205356169374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8912639205356169374' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8912639205356169374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8912639205356169374'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/password-verify-function.html' title='Password Verify Function'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6408148991069606263</id><published>2010-01-13T10:13:00.000-08:00</published><updated>2010-01-13T10:14:04.461-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Account Lock Time'/><title type='text'>Account Lock Time</title><content type='html'>SELECT profile, limit&lt;br /&gt;    FROM   dba_profiles,&lt;br /&gt;           (SELECT limit AS def_pwd_lock_tm&lt;br /&gt;            FROM   dba_profiles &lt;br /&gt;            WHERE  profile = 'DEFAULT'&lt;br /&gt;            AND    resource_name = ' PASSWORD_LOCK_TIME ')&lt;br /&gt;    WHERE  resource_name = ' PASSWORD_LOCK_TIME '&lt;br /&gt;    AND    ((replace(limit,'DEFAULT',def_pwd_lock_tm) IN ('UNLIMITED',NULL))&lt;br /&gt;      OR    (lpad(replace(limit,'DEFAULT',def_pwd_lock_tm),40,'0') &lt;&lt;br /&gt;             lpad('.0104',40,'0')));&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6408148991069606263?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6408148991069606263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6408148991069606263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6408148991069606263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6408148991069606263'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/account-lock-time.html' title='Account Lock Time'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-7260687463734324376</id><published>2010-01-13T10:12:00.001-08:00</published><updated>2010-01-13T10:12:51.696-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Password Reuse'/><title type='text'>Password Reuse</title><content type='html'>-- Check for both reuse max and reuse time not set&lt;br /&gt;&lt;br /&gt;select profile  from DBA_PROFILES&lt;br /&gt;where (resource_name='PASSWORD_REUSE_MAX'&lt;br /&gt;       and limit in ('UNLIMITED','NULL'))&lt;br /&gt;and profile in&lt;br /&gt;       (select profile from DBA_PROFILES where&lt;br /&gt;              resource_name='PASSWORD_REUSE_TIME')&lt;br /&gt;   and limit in ('UNLIMITED','NULL'); &lt;br /&gt;&lt;br /&gt;-- Check for reuse max with value that is less than allowed minimum&lt;br /&gt;&lt;br /&gt;select profile from DBA_PROFILES&lt;br /&gt;  where resource_name='PASSWORD_REUSE_MAX'&lt;br /&gt;  and limit not in ('UNLIMITED','NULL')&lt;br /&gt;  and limit &lt; '10';&lt;br /&gt;&lt;br /&gt;-- Check for reuse time that is less than allowed minimum&lt;br /&gt;&lt;br /&gt;select profile from DBA_PROFILES&lt;br /&gt;  where resource_name='PASSWORD_REUSE_TIME'&lt;br /&gt;  and limit not in ('UNLIMITED','NULL')&lt;br /&gt;  and limit&lt; '365';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-7260687463734324376?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/7260687463734324376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=7260687463734324376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7260687463734324376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7260687463734324376'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/password-reuse.html' title='Password Reuse'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2377567372854578471</id><published>2010-01-13T10:11:00.001-08:00</published><updated>2010-01-13T10:11:43.768-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Password Life Time'/><title type='text'>Password Life Time</title><content type='html'>SELECT profile, limit&lt;br /&gt;    FROM   dba_profiles,&lt;br /&gt;           (SELECT limit AS def_pwd_life_tm&lt;br /&gt;            FROM   dba_profiles &lt;br /&gt;            WHERE  profile = 'DEFAULT'&lt;br /&gt;            AND    resource_name = 'PASSWORD_LIFE_TIME')&lt;br /&gt;    WHERE  resource_name = 'PASSWORD_LIFE_TIME'&lt;br /&gt;    AND    ((replace(limit,'DEFAULT',def_pwd_life_tm) IN ('UNLIMITED',NULL))&lt;br /&gt;      OR    (lpad(replace(limit,'DEFAULT',def_pwd_life_tm),40,'0') &gt;&lt;br /&gt;             lpad('90',40,'0')));&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2377567372854578471?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2377567372854578471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2377567372854578471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2377567372854578471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2377567372854578471'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/password-life-time.html' title='Password Life Time'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4515939240668795838</id><published>2010-01-13T10:06:00.000-08:00</published><updated>2010-01-13T10:10:54.765-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle database links'/><title type='text'>Database Links - SQL</title><content type='html'>Show all links&lt;br /&gt;&lt;br /&gt;Select db_link||': '||host from dba_db_links;&lt;br /&gt;&lt;br /&gt;-- Check links&lt;br /&gt;select owner, db_link, username from dba_db_links;&lt;br /&gt;&lt;br /&gt;select owner||': '||db_link from dba_db_links &lt;br /&gt;where (username is not NULL and username &lt;&gt; 'CURRENT_USER');&lt;br /&gt;&lt;br /&gt;select 'Number of replication objects defined = '||count(*)&lt;br /&gt;from dba_tables where table_name='REPCAT$_REPOBJECT';&lt;br /&gt;&lt;br /&gt;--Database Link Permissions&lt;br /&gt;&lt;br /&gt;select grantee||': '||privilege from dba_tab_privs&lt;br /&gt;where grantee &lt;&gt; 'DELETE_CATALOG_ROLE'&lt;br /&gt;and table_name='LINK$'&lt;br /&gt;and grantee not in (select grantee from dba_role_privs where granted_role='DBA');&lt;br /&gt;&lt;br /&gt;-- Check which links are defined in LINK$ &lt;br /&gt;&lt;br /&gt;select substr(name,1,20) Name, substr(host,1,20) Host, substr(password,1,20), &lt;br /&gt;substr(authusr,1,20), substr(authpwd,1,20), substr(passwordx,1,5)&lt;br /&gt;from sys.link$;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4515939240668795838?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4515939240668795838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4515939240668795838' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4515939240668795838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4515939240668795838'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/database-links-sql.html' title='Database Links - SQL'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2930325364052503007</id><published>2010-01-13T10:03:00.000-08:00</published><updated>2010-01-13T10:04:14.521-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='determine if pl/sql code is wrapped or not'/><title type='text'>determine if pl/sql code is wrapped or not</title><content type='html'>select owner||'.'||name from dba_source&lt;br /&gt;    where&lt;br /&gt;      line=1&lt;br /&gt;    and&lt;br /&gt;      owner not in ('SYS', 'CTXSYS', 'MDSYS', 'ODM', 'OE', 'OLAPSYS', &lt;br /&gt;         'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'PM', 'QS_ADM', &lt;br /&gt;         'RMAN', 'SYSTEM', 'WKSYS','WMSYS','XDB')&lt;br /&gt;    and&lt;br /&gt;      owner not like 'OEM%'&lt;br /&gt;    and&lt;br /&gt;      text not like '%wrapped%'&lt;br /&gt;    and&lt;br /&gt;      type in ('PACKAGE BODY','FUNCTION','PROCEDURE');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2930325364052503007?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2930325364052503007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2930325364052503007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2930325364052503007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2930325364052503007'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/determine-if-plsql-code-is-wrapped-or.html' title='determine if pl/sql code is wrapped or not'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1278648879834184308</id><published>2010-01-13T10:01:00.002-08:00</published><updated>2010-01-13T10:02:16.713-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Determine Version and options of database examined'/><title type='text'>Determine Version and options of database examined</title><content type='html'>select comp_name, version, status from dba_registry;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1278648879834184308?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1278648879834184308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1278648879834184308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1278648879834184308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1278648879834184308'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/determine-version-and-options-of.html' title='Determine Version and options of database examined'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1577158258603893856</id><published>2010-01-13T10:01:00.001-08:00</published><updated>2010-01-13T10:01:27.060-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Check the patch level'/><title type='text'>Check the patch level</title><content type='html'>select * from registry$history;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1577158258603893856?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1577158258603893856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1577158258603893856' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1577158258603893856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1577158258603893856'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/check-patch-level.html' title='Check the patch level'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6116481970530260535</id><published>2010-01-13T09:58:00.000-08:00</published><updated>2010-01-13T10:00:44.952-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Get the name of the DB'/><title type='text'>Get the name of the DB</title><content type='html'>select name from v$database;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6116481970530260535?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6116481970530260535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6116481970530260535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6116481970530260535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6116481970530260535'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/get-name-of-db.html' title='Get the name of the DB'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4846837198517893714</id><published>2010-01-13T09:54:00.000-08:00</published><updated>2010-01-13T09:55:55.482-08:00</updated><title type='text'>Oracle Critical Patch Update Advisory - October 2009</title><content type='html'>A Critical Patch Update is a collection of patches for multiple security vulnerabilities. It also includes non-security fixes that are required (because of interdependencies) by those security patches. Critical Patch Updates are cumulative, except as noted below, but each advisory describes only the security fixes added since the previous Critical Patch Update. Thus, prior Critical Patch Update Advisories should be reviewed for information regarding earlier accumulated security fixes. Please refer to:&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/deploy/security/alerts.htm"&gt;Critical Patch Updates and Security Alerts &lt;/a&gt;for information about Oracle Security Advisories.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4846837198517893714?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4846837198517893714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4846837198517893714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4846837198517893714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4846837198517893714'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/oracle-critical-patch-update-advisory.html' title='Oracle Critical Patch Update Advisory - October 2009'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2708770324838499947</id><published>2010-01-13T09:52:00.000-08:00</published><updated>2010-01-13T09:53:42.141-08:00</updated><title type='text'>OPatch lsinventory</title><content type='html'>Ensure that you are able to invoke the opatch lsinventory -detail command and are able to see the node information being printed out. A sample listing of the output of the command is as follows:&lt;br /&gt;&lt;br /&gt;Oracle interim Patch Installer version 10.2.0.4.6&lt;br /&gt;Copyright (c) 2009, Oracle Corporation.  All rights reserved..&lt;br /&gt;Oracle Home       : /home/racqa/102_twork/toii/toiir/toiir571/HOMEtoiir571&lt;br /&gt;Central Inventory : /home/racqa/102_twork/toii/toiir/toiir571/inventory&lt;br /&gt;   from           : /home/racqa/102_&lt;br /&gt;twork/toii/toiir/toiir571/HOMEtoiir571/oraInst.loc&lt;br /&gt;OPatch version    : 10.2.0.4.6&lt;br /&gt;OUI version       : 10.2.0.4.6&lt;br /&gt;OUI location      : /home/racqa/102_twork/toii/toiir/toiir571/HOMEtoiir571/oui&lt;br /&gt;Log file location : /home/racqa/102_&lt;br /&gt;twork/toii/toiir/toiir571/HOMEtoiir571/cfgtoollogs/opatch/opatch-2008_May_30_&lt;br /&gt;01-04-52-PDT_Mon.log&lt;br /&gt;Lsinventory Output file location : /home1/racqa/102_&lt;br /&gt;twork/toii/toiir/toiir571/HOMEtoiir571/cfgtoollogs/opatch/lsinv/lsinventory-2008_&lt;br /&gt;May_30_01-04-52-PDT_Mon.txt&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Installed Top-level Products (1): &lt;br /&gt;Oracle Database 10g                                                  10.2.0.4.6&lt;br /&gt;There are 1 products installed in this Oracle Home.&lt;br /&gt;Installed Products (151): &lt;br /&gt;Advanced Queueing (AQ) API                                           10.2.0.4.6&lt;br /&gt;Advanced Replication                                                 10.2.0.4.6&lt;br /&gt;Agent Required Support Files                                         10.2.0.4.6&lt;br /&gt;Assistant Common Files                                               10.2.0.4.6&lt;br /&gt;Authentication and Encryption                                        10.2.0.4.6&lt;br /&gt;Bali Share                                                           1.1.18.0.0&lt;br /&gt;Character Set Migration Utility                                      10.2.0.4.6&lt;br /&gt;CSS Single-instance Common Files                                     10.2.0.4.6&lt;br /&gt;Data Management Services Common Files                                10.2.0.4.6&lt;br /&gt;Database Configuration Assistant                                     10.2.0.4.6&lt;br /&gt;Database SQL Scripts                                                 10.2.0.4.6&lt;br /&gt;Database Upgrade Assistant                                           10.2.0.4.6&lt;br /&gt;Database Verify Utility                                              10.2.0.4.6&lt;br /&gt;Database Workspace Manager                                           10.2.0.4.6&lt;br /&gt;DBJAVA Required Support Files                                        10.2.0.4.6&lt;br /&gt;Documentation Required Support Files                                 10.2.0.4.6&lt;br /&gt;Enterprise Edition Options                                           10.2.0.4.6&lt;br /&gt;Enterprise Manager Agent                                             10.2.0.4.6&lt;br /&gt;Enterprise Manager Common Files                                      10.2.0.4.6&lt;br /&gt;Enterprise Manager Minimal Integration                               10.2.0.4.6&lt;br /&gt;Enterprise Manager plugin Common Files                               10.2.0.4.6&lt;br /&gt;Enterprise Manager Repository                                        10.2.0.4.6&lt;br /&gt;Export/Import                                                        10.2.0.4.6&lt;br /&gt;Extended Windowing Toolkit                                           3.3.18.0.0&lt;br /&gt;Generic Connectivity Common Files                                    10.2.0.4.6&lt;br /&gt;Generic Connectivity Using ODBC                                      10.2.0.4.6&lt;br /&gt;Installation Common Files                                            10.2.0.4.6&lt;br /&gt;Installer SDK Component                                              10.2.0.1.0&lt;br /&gt;iSQL*Plus                                                            10.2.0.4.6&lt;br /&gt;Java Naming and Directory Interface Libraries                        10.2.0.4.6&lt;br /&gt;Java Runtime Environment                                              1.4.2.0.0&lt;br /&gt;JDBC Common Files                                                    10.2.0.4.6&lt;br /&gt;JDBC/OCI Common Files                                                10.2.0.4.6&lt;br /&gt;JDBC/OCI Common Files for Instant Client                             10.2.0.4.6&lt;br /&gt;LDAP Required Support Files                                          10.2.0.4.6&lt;br /&gt;New Database ID                                                      10.2.0.4.6&lt;br /&gt;Object Type Translator                                               10.2.0.4.6&lt;br /&gt;Oracle Advanced Security                                             10.2.0.4.6&lt;br /&gt;Oracle C++ Call Interface                                            10.2.0.4.6&lt;br /&gt;Oracle C++ Call Interface for Instant Client                         10.2.0.4.6&lt;br /&gt;Oracle Call Interface (OCI)                                          10.2.0.4.6&lt;br /&gt;Oracle Client Required Support Files                                 10.2.0.4.6&lt;br /&gt;Oracle Code Editor                                                   1.2.1.0.0I&lt;br /&gt;Oracle Containers for Java                                           10.2.0.4.6&lt;br /&gt;Oracle Core Required Support Files                                   10.2.0.4.6&lt;br /&gt;Oracle Data Mining                                                   10.2.0.4.6&lt;br /&gt;Oracle Database 10g                                                  10.2.0.4.6&lt;br /&gt;Oracle Database 10g                                                  10.2.0.4.6&lt;br /&gt;Oracle Database User Interface                                       2.2.13.0.0&lt;br /&gt;Oracle Database Utilities                                            10.2.0.4.6&lt;br /&gt;Oracle Development Kit                                               10.2.0.4.6&lt;br /&gt;Oracle Display Fonts                                                  9.0.2.0.0&lt;br /&gt;Oracle Enterprise Manager 10g Database Control                       10.2.0.4.6&lt;br /&gt;Oracle Enterprise Manager Console DB                                 10.2.0.4.6&lt;br /&gt;Oracle Extended Windowing Toolkit                                    3.4.28.0.0&lt;br /&gt;Oracle Globalization Support                                         10.2.0.4.6&lt;br /&gt;Oracle Help For Java                                                 4.2.5.0.0a&lt;br /&gt;Oracle Help for the  Web                                             1.1.7.0.0a&lt;br /&gt;Oracle Ice Browser                                                    5.2.3.3.0&lt;br /&gt;Oracle interMedia                                                    10.2.0.4.6&lt;br /&gt;Oracle interMedia Annotator                                          10.2.0.4.6&lt;br /&gt;Oracle interMedia Audio                                              10.2.0.4.6&lt;br /&gt;Oracle interMedia Client Compatibility Files                         10.2.0.4.6&lt;br /&gt;Oracle interMedia Client Demos                                       10.2.0.4.6&lt;br /&gt;Oracle interMedia Client Option                                      10.2.0.4.6&lt;br /&gt;Oracle interMedia Common Files                                       10.2.0.4.6&lt;br /&gt;Oracle interMedia Image                                              10.2.0.4.6&lt;br /&gt;Oracle interMedia Java Advanced Imaging                              10.2.0.4.6&lt;br /&gt;Oracle interMedia Java Client                                        10.2.0.4.6&lt;br /&gt;Oracle interMedia Locator                                            10.2.0.4.6&lt;br /&gt;Oracle interMedia Video                                              10.2.0.4.6&lt;br /&gt;Oracle interMedia Web Client                                         10.2.0.4.6&lt;br /&gt;Oracle Internet Directory Client                                     10.2.0.4.6&lt;br /&gt;Oracle Internet Directory Client Common Files                        10.2.0.4.6&lt;br /&gt;Oracle Internet Directory Tools                                      10.2.0.4.6&lt;br /&gt;Oracle Java Tools                                                    10.2.0.4.6&lt;br /&gt;Oracle JDBC Thin Driver for JDK 1.2                                  10.2.0.4.6&lt;br /&gt;Oracle JDBC Thin Driver for JDK 1.4                                  10.2.0.4.6&lt;br /&gt;Oracle JDBC Thin Driver for JDK 1.4 for Instant Client               10.2.0.4.6&lt;br /&gt;Oracle JDBC/OCI Driver for JDK 1.4                                   10.2.0.4.6&lt;br /&gt;Oracle JFC Extended Windowing Toolkit                                4.2.18.0.0&lt;br /&gt;Oracle JVM                                                           10.2.0.4.6&lt;br /&gt;Oracle Locale Builder                                                10.2.0.4.6&lt;br /&gt;Oracle Message Gateway Common Files                                  10.2.0.4.6&lt;br /&gt;Oracle Net                                                           10.2.0.4.6&lt;br /&gt;Oracle Net Configuration Assistant                                   10.2.0.4.6&lt;br /&gt;Oracle Net Listener                                                  10.2.0.4.6&lt;br /&gt;Oracle Net Manager                                                   10.2.0.4.6&lt;br /&gt;Oracle Net Required Support Files                                    10.2.0.4.6&lt;br /&gt;Oracle Net Services                                                  10.2.0.4.6&lt;br /&gt;Oracle Notification Service                                           9.0.4.0.0&lt;br /&gt;Oracle OLAP                                                          10.2.0.4.6&lt;br /&gt;Oracle OLAP API                                                      10.2.0.4.6&lt;br /&gt;Oracle OLAP Catalog                                                  10.2.0.4.6&lt;br /&gt;Oracle One-Off Patch Installer                                       10.2.0.1.0&lt;br /&gt;Oracle Partitioning                                                  10.2.0.4.6&lt;br /&gt;Oracle Programmer                                                    10.2.0.4.6&lt;br /&gt;Oracle RAC Required Support Files                                    10.2.0.4.6&lt;br /&gt;Oracle RAC Required Support Files-HAS                                10.2.0.4.6&lt;br /&gt;Oracle Real Application Clusters                                     10.2.0.4.6&lt;br /&gt;Oracle Spatial                                                       10.2.0.4.6&lt;br /&gt;Oracle Starter Database                                              10.2.0.4.6&lt;br /&gt;Oracle Text                                                          10.2.0.4.6&lt;br /&gt;Oracle UIX                                                          2.1.21.0.0a&lt;br /&gt;Oracle Ultra Search Common Files                                     10.2.0.4.6&lt;br /&gt;Oracle Ultra Search Middle-Tier                                      10.2.0.4.6&lt;br /&gt;Oracle Ultra Search Server                                           10.2.0.4.6&lt;br /&gt;Oracle Universal Installer                                           10.2.0.1.0&lt;br /&gt;Oracle Wallet Manager                                                10.2.0.4.6&lt;br /&gt;Oracle XML Developer's Kit                                           10.2.0.4.6&lt;br /&gt;Oracle XML Runtime Components                                        10.2.0.4.6&lt;br /&gt;Oracle XML SQL Utility                                               10.2.0.4.6&lt;br /&gt;Oracle10g Real Application Clusters Common Files                     10.2.0.4.6&lt;br /&gt;Parser Generator Required Support Files                              10.2.0.4.6&lt;br /&gt;Perl Interpreter                                                     5.6.1.0.2d&lt;br /&gt;PL/SQL                                                               10.2.0.4.6&lt;br /&gt;PL/SQL Embedded Gateway                                              10.2.0.4.6&lt;br /&gt;PL/SQL Required Support Files                                        10.2.0.4.6&lt;br /&gt;Platform Required Support Files                                      10.2.0.4.6&lt;br /&gt;Precompiler Common Files                                             10.2.0.4.6&lt;br /&gt;Precompiler Required Support Files                                   10.2.0.4.6&lt;br /&gt;Pro*C/C++                                                            10.2.0.4.6&lt;br /&gt;RDBMS Required Support Files                                         10.2.0.4.6&lt;br /&gt;Recovery Manager                                                     10.2.0.4.6&lt;br /&gt;regexp                                                                2.1.9.0.0&lt;br /&gt;Required Support Files                                               10.2.0.4.6&lt;br /&gt;Sample Schema                                                        10.2.0.4.6&lt;br /&gt;Secure Socket Layer                                                  10.2.0.4.6&lt;br /&gt;Secure Socket Layer                                                  10.2.0.4.6&lt;br /&gt;SQL*Loader                                                           10.2.0.4.6&lt;br /&gt;SQL*Plus                                                             10.2.0.4.6&lt;br /&gt;SQL*Plus Required Support Files                                      10.2.0.4.6&lt;br /&gt;SQLJ Runtime                                                         10.2.0.4.6&lt;br /&gt;SSL Required Support Files                                           10.2.0.4.6&lt;br /&gt;SSL Required Support Files for InstantClient                         10.2.0.4.6&lt;br /&gt;Sun JDK                                                               1.4.2.0.0&lt;br /&gt;Sun JDK extensions                                                    9.0.4.0.0&lt;br /&gt;Utilities Common Files                                               10.2.0.4.6&lt;br /&gt;Visigenics ORB                                                        3.4.0.0.0&lt;br /&gt;XDK Required Support Files                                           10.2.0.4.6&lt;br /&gt;XML                                                                  10.2.0.4.6&lt;br /&gt;XML Class Generator for C++                                          10.2.0.4.6&lt;br /&gt;XML Class Generator for Java                                         10.2.0.4.6&lt;br /&gt;XML Parser for C                                                     10.2.0.4.6&lt;br /&gt;XML Parser for C++                                                   10.2.0.4.6&lt;br /&gt;XML Parser for Java                                                  10.2.0.4.6&lt;br /&gt;XML Parser for Oracle JVM                                            10.2.0.4.6&lt;br /&gt;XML Parser for PL/SQL                                                10.2.0.4.6&lt;br /&gt;XML Transviewer Beans                                                10.2.0.4.6&lt;br /&gt;XML Transx                                                           10.2.0.4.6&lt;br /&gt;XSQL Servlet                                                         10.2.0.4.6&lt;br /&gt;There are 151 products installed in this Oracle Home.&lt;br /&gt;Intermin patches (1) :&lt;br /&gt;Patch  3811942      : applied on Mon May 30 00:59:33 PDT 2008&lt;br /&gt;   Created on 31 Aug 2007, 12:06:28 hrs US/Pacific&lt;br /&gt;   Bugs fixed:&lt;br /&gt;     3811942&lt;br /&gt;   Files Touched:&lt;br /&gt;     /hosp.o --&gt; ORACLE_HOME/lib/libagent10.a&lt;br /&gt;     /pesblt.o --&gt; ORACLE_HOME/lib/libpls10.a&lt;br /&gt;     /kgl.o --&gt; ORACLE_HOME/lib/libgeneric10.a&lt;br /&gt;     /qcpi6.o --&gt; ORACLE_HOME/lib/libgeneric10.a&lt;br /&gt;     ins_rdbms.mk --&gt; ORACLE_HOME/rdbms/lib/iextjob&lt;br /&gt;     ins_rdbms.mk --&gt; ORACLE_HOME/rdbms/lib/iextjobo&lt;br /&gt;     ins_rdbms.mk --&gt; ORACLE_HOME/rdbms/lib/client_sharedlib&lt;br /&gt;     /hosp.o --&gt; ORACLE_HOME/lib/libserver10.a&lt;br /&gt;     /prse.o --&gt; ORACLE_HOME/lib/libserver10.a&lt;br /&gt;     /prsa.o --&gt; ORACLE_HOME/lib/libserver10.a&lt;br /&gt;     /prsf.o --&gt; ORACLE_HOME/lib/libserver10.a&lt;br /&gt;     /prssz.o --&gt; ORACLE_HOME/lib/libserver10.a&lt;br /&gt;     /kprc.o --&gt; ORACLE_HOME/lib/libserver10.a&lt;br /&gt;     /qmhdr.o --&gt; ORACLE_HOME/lib/libserver10.a&lt;br /&gt;     /pesblt.o --&gt; ORACLE_HOME/lib/libpls10.a&lt;br /&gt;     /qcpi6.o --&gt; ORACLE_HOME/lib/libgeneric10.a&lt;br /&gt;     prvtpexp.plb --&gt; ORACLE_HOME/rdbms/admin/prvtpexp.plb&lt;br /&gt;     sjsex.o --&gt; ORACLE_HOME/rdbms/lib/sjsex.o&lt;br /&gt;     ins_rdbms.mk --&gt; ORACLE_HOME/rdbms/lib/iextjob&lt;br /&gt;     ins_rdbms.mk --&gt; ORACLE_HOME/rdbms/lib/iextjobo&lt;br /&gt;     ins_rdbms.mk --&gt; ORACLE_HOME/rdbms/lib/ioracle&lt;br /&gt;     ins_rdbms.mk --&gt; ORACLE_HOME/rdbms/lib/client_sharedlib&lt;br /&gt;     driload.pkh --&gt; ORACLE_HOME/ctx/admin/driload.pkh&lt;br /&gt;     /oracle/sysman/assistants/util/em/EMConfigStep.class --&gt; ORACLE_&lt;br /&gt;HOME/assistants/jlib/assistantsCommon.jar&lt;br /&gt;     /oracle/sysman/assistants/util/sqlEngine/SQLEngine.class --&gt; ORACLE_&lt;br /&gt;HOME/assistants/jlib/assistantsCommon.jar&lt;br /&gt;     /oracle/sysman/assistants/dbca/backend/DBEntryStep.class --&gt; ORACLE_&lt;br /&gt;HOME/assistants/dbca/jlib/dbca.jar&lt;br /&gt;     /oracle/sysman/assistants/dbca/backend/EMConfigStep.class --&gt; ORACLE_&lt;br /&gt;HOME/assistants/dbca/jlib/dbca.jar&lt;br /&gt;     /oracle/sysman/assistants/dbca/backend/PostDBCreationStep.class --&gt; ORACLE_&lt;br /&gt;HOME/assistants/dbca/jlib/dbca.jar&lt;br /&gt;     /oracle/sysman/emcp/EMConfig.class --&gt; ORACLE_HOME/jlib/emca.jar&lt;br /&gt;     /oracle/sysman/emcp/IEMCAConstants.class --&gt; ORACLE_HOME/jlib/emca.jar&lt;br /&gt;     /oracle/sysman/emcp/EMConfig.class --&gt; ORACLE_HOME/sysman/jlib/emCORE.jar&lt;br /&gt;     /oracle/sysman/emcp/IEMCAConstants.class --&gt; ORACLE_&lt;br /&gt;HOME/sysman/jlib/emCORE.jar&lt;br /&gt;     /oracle/sysman/emSDK/conf/ConfigManager.class --&gt; ORACLE_&lt;br /&gt;HOME/sysman/jlib/emCORE.jar&lt;br /&gt;     /oracle/sysman/emSDK/eml/EmlConstants.class --&gt; ORACLE_&lt;br /&gt;HOME/sysman/jlib/emCORE.jar&lt;br /&gt;     /oracle/sysman/util/pref/PrefUtil.class --&gt; ORACLE_&lt;br /&gt;HOME/sysman/jlib/emCORE.jar&lt;br /&gt;     emctl.pl --&gt; ORACLE_HOME/emdw/bin/emctl.pl&lt;br /&gt;     /ncrfipm.o --&gt; ORACLE_HOME/lib/libnro10.a&lt;br /&gt;     libsqlplus.a --&gt; ORACLE_HOME/lib/libsqlplus.a&lt;br /&gt;     libsqlplus.so --&gt; ORACLE_HOME/lib/libsqlplus.so&lt;br /&gt;     libisqlplus.a --&gt; ORACLE_HOME/lib/libisqlplus.a&lt;br /&gt;     libisqlplus.so --&gt; ORACLE_HOME/lib/libisqlplus.so&lt;br /&gt;     mdprivs.sql --&gt; ORACLE_HOME/md/admin/mdprivs.sql&lt;br /&gt;     prvtgmd.plb --&gt; ORACLE_HOME/md/admin/prvtgmd.plb&lt;br /&gt;     sdolrsmd.sql --&gt; ORACLE_HOME/md/admin/sdolrsmd.sql&lt;br /&gt;     prvtccbk.plb --&gt; ORACLE_HOME/md/admin/prvtccbk.plb&lt;br /&gt;     wk0acl.pkh --&gt; ORACLE_HOME/ultrasearch/admin/wk0acl.pkh&lt;br /&gt;     wk0acl.plb --&gt; ORACLE_HOME/ultrasearch/admin/wk0acl.plb&lt;br /&gt;     wk0adm.pkh --&gt; ORACLE_HOME/ultrasearch/admin/wk0adm.pkh&lt;br /&gt;     wk0adm.plb --&gt; ORACLE_HOME/ultrasearch/admin/wk0adm.plb&lt;br /&gt;     wk0snapshot.plb --&gt; ORACLE_HOME/ultrasearch/admin/wk0snapshot.plb&lt;br /&gt;     wk0util.pkh --&gt; ORACLE_HOME/ultrasearch/admin/wk0util.pkh&lt;br /&gt;     wk0util.plb --&gt; ORACLE_HOME/ultrasearch/admin/wk0util.plb&lt;br /&gt;   Patch Location in Inventory:&lt;br /&gt;     /home1/racqa/102_&lt;br /&gt;twork/toii/toiir/toiir571/HOMEtoiir571/inventory/oneoffs/3811942&lt;br /&gt;   Patch Location in Storage area:&lt;br /&gt;     /home1/racqa/102_twork/toii/toiir/toiir571/HOMEtoiir571/.patch_&lt;br /&gt;storage/3811942_Aug_31_2007_12_06_28&lt;br /&gt;Rac system comprising of multiple nodes&lt;br /&gt;  Local node = stadu56&lt;br /&gt;  Remote node = stacg16&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;OPatch succeeded.&lt;br /&gt;&lt;br /&gt;If you do not find the node information correctly printed out, you need to update the node list. For more information on updating the node list, see the Oracle Universal Installer User's Guide.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2708770324838499947?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2708770324838499947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2708770324838499947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2708770324838499947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2708770324838499947'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/opatch-lsinventory.html' title='OPatch lsinventory'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8375357809918498528</id><published>2010-01-13T08:22:00.000-08:00</published><updated>2010-01-13T08:42:01.654-08:00</updated><title type='text'>How to use wrap utility to encode Oracle database source code Object</title><content type='html'>The wrap program provided by Oracle encodes the PL/SQL source code but does not encrypt it.&lt;br /&gt;&lt;br /&gt;select owner||'.'||name from dba_source&lt;br /&gt;    where&lt;br /&gt;      line=1&lt;br /&gt;    and&lt;br /&gt;      owner not in ('SYS', 'CTXSYS', 'MDSYS', 'ODM', 'OE', 'OLAPSYS', &lt;br /&gt;         'ORDPLUGINS', 'ORDSYS', 'OUTLN', 'PM', 'QS_ADM', &lt;br /&gt;         'RMAN', 'SYSTEM', 'WKSYS','WMSYS','XDB')&lt;br /&gt;    and&lt;br /&gt;      owner not like 'OEM%'&lt;br /&gt;    and&lt;br /&gt;      text not like '%wrapped%'&lt;br /&gt;    and&lt;br /&gt;      type in ('PACKAGE BODY','FUNCTION','PROCEDURE');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8375357809918498528?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8375357809918498528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8375357809918498528' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8375357809918498528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8375357809918498528'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2010/01/how-to-use-wrap-utility-to-encode.html' title='How to use wrap utility to encode Oracle database source code Object'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-7667119972190515526</id><published>2009-09-18T18:06:00.000-07:00</published><updated>2009-09-18T18:09:42.528-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Finding locked oracle database user account information'/><title type='text'>How to find locked oracle database user account details</title><content type='html'>USER_AUDIT_SESSION contains audit trail records concerning connections and disconnections of the current user.&lt;br /&gt;======================================================================================&lt;br /&gt;Select os_username, username,userhost,terminal,timestamp,action_name,logoff_time,RETURNCODE&lt;br /&gt;from DBA_AUDIT_SESSION where RETURNCODE in (1017,28000) order by timestamp.&lt;br /&gt;look for the row just before reurncode 28000 and you will get when,which os user from which terminal the account got unlocked. &lt;br /&gt;&lt;br /&gt;DBA_AUDIT_SESSION table&lt;br /&gt;======================================================================================&lt;br /&gt;Column Datatype NULL Description &lt;br /&gt;OS_USERNAME VARCHAR2(255) Operating system login username of the user whose actions were audited &lt;br /&gt;USERNAME VARCHAR2(30) Name (not ID number) of the user whose actions were audited &lt;br /&gt;USERHOST VARCHAR2(128) Client host machine name &lt;br /&gt;TERMINAL VARCHAR2(255) Identifier of the user's terminal &lt;br /&gt;TIMESTAMP DATE Date and time of the creation of the audit trail entry (date and time of user login for entries created by AUDIT SESSION) in the local database session time zone &lt;br /&gt;ACTION_NAME VARCHAR2(28) Name of the action type corresponding to the numeric code in the ACTION column in DBA_AUDIT_TRAIL &lt;br /&gt;LOGOFF_TIME DATE Date and time of user log off &lt;br /&gt;LOGOFF_LREAD NUMBER Logical reads for the session &lt;br /&gt;LOGOFF_PREAD NUMBER Physical reads for the session &lt;br /&gt;LOGOFF_LWRITE NUMBER Logical writes for the session &lt;br /&gt;LOGOFF_DLOCK VARCHAR2(40) Deadlocks detected during the session &lt;br /&gt;SESSIONID NUMBER NOT NULL Numeric ID for each Oracle session &lt;br /&gt;RETURNCODE NUMBER NOT NULL Oracle error code generated by the action. &lt;br /&gt;Some useful values: &lt;br /&gt;0 - Action succeeded&lt;br /&gt;2004 - Security violation&lt;br /&gt;28000 - user locked&lt;br /&gt;1017 -wrong combination user/pasword&lt;br /&gt;CLIENT_ID VARCHAR2(64) Client identifier in each Oracle session &lt;br /&gt;SESSION_CPU NUMBER Amount of CPU time used by each Oracle session &lt;br /&gt;EXTENDED_TIMESTAMP TIMESTAMP(6) WITH TIME ZONE Timestamp of the creation of the audit trail entry (timestamp of user login for entries created by AUDIT SESSION) in UTC (Coordinated Universal Time) time zone &lt;br /&gt;PROXY_SESSIONID NUMBER Proxy session serial number, if an enterprise user has logged in through the proxy mechanism &lt;br /&gt;GLOBAL_UID VARCHAR2(32) Global user identifier for the user, if the user has logged in as an enterprise user &lt;br /&gt;INSTANCE_NUMBER NUMBER Instance number as specified by the INSTANCE_NUMBER initialization parameter &lt;br /&gt;OS_PROCESS VARCHAR2(16) Operating System process identifier of the Oracle process&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-7667119972190515526?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/7667119972190515526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=7667119972190515526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7667119972190515526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7667119972190515526'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2009/09/how-to-find-locked-oracle-database-user.html' title='How to find locked oracle database user account details'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1097752811166246335</id><published>2009-08-19T04:54:00.000-07:00</published><updated>2009-08-19T05:01:15.607-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Get table and index DDL  using DBMS_METADATA.GET_DDL'/><title type='text'>Get table and index DDL  using DBMS_METADATA.GET_DDL</title><content type='html'>Prior to Oracle9i, getting table and index DDL was a time-consuming and tricky process.  You could run the export utility with ROWS=NO, but the output was hard to re-use because of quoted strings.  The only other option was to write complex dictionary scripts that might not work on complex objects such as IOT and nested tables.&lt;br /&gt;&lt;br /&gt;Punching DDL from the dictionary is very useful when you are migrating a system to a new platform and you want to pre-create the objects in a new tablespace so that you can import with IGNORE=Y.&lt;br /&gt;&lt;br /&gt;In Oracle9i we have the exciting new dbms_metadata utility to display DDL directly from the data dictionary.  Using this powerful utility, we can punch individual objects or an entire schema.&lt;br /&gt;&lt;br /&gt;Best of all, it is easy.  You simply execute dbms_metadata. get_ddl.&lt;br /&gt;&lt;br /&gt;capture index ddl before you drop.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;create table indxddl&lt;br /&gt;(&lt;br /&gt;tbl_name  varchar(32), &lt;br /&gt;indx_name varchar(32), &lt;br /&gt;indxddl varchar(4000)&lt;br /&gt;); &lt;br /&gt;&lt;br /&gt;create table test31(id numeric(16), name varchar2(128));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;create index test31indx1 on test31(id);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;insert into indxddl(tbl_name,indx_name,indxddl) values ('test31','test31indx1','create index test31indx1 on test31(id)');&lt;br /&gt;INSERT INTO INDXDDL(TBL_NAME,INDX_NAME,INDXDDL) VALUES ('TEST31','TEST31INDX1','CREATE INDEX TEST31INDX1 ON TEST31(ID)');&lt;br /&gt;&lt;br /&gt;set long 1000&lt;br /&gt;select * from indxddl;&lt;br /&gt;&lt;br /&gt;delete from indxddl;&lt;br /&gt;&lt;br /&gt;create index test31indx2 on test31(name);&lt;br /&gt;&lt;br /&gt;select upper(index_name) from user_indexes where upper(table_name)='TEST31'&lt;br /&gt;minus&lt;br /&gt;select upper(indx_name) from indxddl where upper(tbl_name)='TEST31';&lt;br /&gt;&lt;br /&gt;SELECT DBMS_METADATA.GET_DDL('INDEX','TEST31INDX2') FROM USER_INDEXES u;&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE procedure indexddl_proc( p_table_name   varchar2)&lt;br /&gt;      as&lt;br /&gt;      cnt number; &lt;br /&gt;     indexddl varchar(4000); &lt;br /&gt;        begin&lt;br /&gt;        select count(*) &lt;br /&gt;      into cnt&lt;br /&gt;          from&lt;br /&gt;          (select upper(index_name) from user_indexes where table_name ='TEST31'&lt;br /&gt;           minus  &lt;br /&gt;      select upper(indx_name) from INDXDDL where tbl_name = 'TEST31');&lt;br /&gt;     if cnt&gt;0 then&lt;br /&gt;     for i in &lt;br /&gt;     (select index_name  as a from user_indexes where table_name ='TEST31'&lt;br /&gt;     minus  &lt;br /&gt;     select upper(indx_name) as a from indxddl where upper(tbl_name)= 'TEST31')&lt;br /&gt;     loop&lt;br /&gt;     indexddl:=DBMS_METADATA.GET_DDL('INDEX',i.a);&lt;br /&gt;     --SELECT DBMS_METADATA.GET_DDL('INDEX',i.a) into indexddl FROM USER_INDEXES u;&lt;br /&gt;     insert into indxddl(tbl_name,indx_name,indxddl) values (upper(p_table_name),upper(i.a),upper(indexddl));&lt;br /&gt;     end loop;&lt;br /&gt;     end if;&lt;br /&gt;&lt;br /&gt; for x in (select table_name,index_name&lt;br /&gt;                 from indxddl&lt;br /&gt;              where table_name = ltrim(rtrim(p_table_name,''''), '''' ) ) loop&lt;br /&gt;       execute immediate 'drop index '||x.index_name;&lt;br /&gt;   end loop;&lt;br /&gt;   execute immediate 'truncate table '||ltrim(rtrim(p_table_name,''''), '''' );&lt;br /&gt;   exception&lt;br /&gt;        when others then&lt;br /&gt;             raise;&lt;br /&gt;  end  indexddl_proc;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;execute indexddl_proc('TEST31');&lt;br /&gt;&lt;br /&gt;To punch off all table and indexes for the EMP table, we execute dbms_metadata. get_ddl, select from DUAL, and providing all required parameters.&lt;br /&gt; &lt;br /&gt;set heading off;&lt;br /&gt;set echo off;&lt;br /&gt;Set pages 999;&lt;br /&gt;set long 90000;&lt;br /&gt; &lt;br /&gt;spool ddl_list.sql&lt;br /&gt; &lt;br /&gt;select dbms_metadata.get_ddl('TABLE','DEPT','SCOTT') from dual;&lt;br /&gt; &lt;br /&gt;select dbms_metadata.get_ddl('INDEX','DEPT_IDX','SCOTT') from dual;&lt;br /&gt; &lt;br /&gt;spool off;&lt;br /&gt;&lt;br /&gt;Here is the output.  The only thing missing is the ending semicolons after each statement.  Just for illustration, we show how a primary key can be punched as part of the table DDL or separately using the INDEX argument.&lt;br /&gt;CREATE TABLE "SCOTT"."DEPT"&lt;br /&gt;   (   "DEPTNO" NUMBER(2,0),&lt;br /&gt;       "DNAME" VARCHAR2(14),&lt;br /&gt;       "LOC" VARCHAR2(13),&lt;br /&gt;        CONSTRAINT "PK_DEPT" PRIMARY KEY ("DEPTNO")&lt;br /&gt;  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255&lt;br /&gt;  STORAGE(INITIAL 12288 NEXT 12288 MINEXTENTS 1 MAXEXTENTS 249 PCTINCREASE 50&lt;br /&gt;  FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSTEM"  ENABLE&lt;br /&gt;   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 LOGGING&lt;br /&gt;  STORAGE(INITIAL 12288 NEXT 12288 MINEXTENTS 1 MAXEXTENTS 249 PCTINCREASE 50&lt;br /&gt;  FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSTEM"&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;  CREATE UNIQUE INDEX "SCOTT"."DEPT_IDX" ON "SCOTT"."DEPT" ("DNAME")&lt;br /&gt;  FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSTEM"&lt;br /&gt;&lt;br /&gt;Now we can modify the syntax to punch a whole schema.  It us easily done by selecting dbms_metadata. get_ddl and specifying USER_TABLES and USER_INDEXES. :&lt;br /&gt;&lt;br /&gt;set pagesize 0&lt;br /&gt;set long 90000&lt;br /&gt;set feedback off&lt;br /&gt;set echo off &lt;br /&gt;&lt;br /&gt;spool scott_schema.sql &lt;br /&gt;&lt;br /&gt;connect scott/tiger;&lt;br /&gt;&lt;br /&gt;SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)&lt;br /&gt;     FROM USER_TABLES u;&lt;br /&gt;&lt;br /&gt;SELECT DBMS_METADATA.GET_DDL('INDEX',u.index_name)&lt;br /&gt;     FROM USER_INDEXES u;&lt;br /&gt;&lt;br /&gt;spool off;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1097752811166246335?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1097752811166246335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1097752811166246335' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1097752811166246335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1097752811166246335'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2009/08/get-table-and-index-ddl-using.html' title='Get table and index DDL  using DBMS_METADATA.GET_DDL'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4344973960083546189</id><published>2009-05-20T14:18:00.000-07:00</published><updated>2009-05-20T14:19:33.766-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Find the tables/indexes that have stale statistics in a database'/><title type='text'>Find the tables/indexes that have stale statistics in a database</title><content type='html'>Using the code below one can find the tables/indexes that have stale statistics in a database, when options=&gt;’GATHER AUTO’ &lt;br /&gt;is used oracle gathers statistics analyzes the tables/indexes that have stale statistics. Table monitoring is &lt;br /&gt;enabled by default in 10g to find table which is used to find table statistics, when STATISTICS_LEVEL is set &lt;br /&gt;to BASIC table monitoring is disabled. In 9i one can enable/disable table monitoring by &lt;br /&gt;calling DBMS_STATS.ALTER_SCHEMA_TABLE_MONITORING&lt;br /&gt;&lt;br /&gt;SQL&gt; SET SERVEROUTPUT ON&lt;br /&gt;&lt;br /&gt;SQL&gt; DECLARE&lt;br /&gt;ObjList dbms_stats.ObjectTab;&lt;br /&gt;BEGIN&lt;br /&gt;dbms_stats.gather_database_stats(objlist=&gt;ObjList, options=&gt;’LIST STALE’);&lt;br /&gt;FOR i in ObjList.FIRST..ObjList.LAST&lt;br /&gt;LOOP&lt;br /&gt;dbms_output.put_line(ObjList(i).ownname || ‘.’ || ObjList(i).ObjName || ‘ ‘ || ObjList(i).ObjType || ‘ ‘ || ObjList(i).partname);&lt;br /&gt;END LOOP;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;SYS.COL_USAGE$ TABLE&lt;br /&gt;SYS.DEPENDENCY$ TABLE&lt;br /&gt;SYS.HISTGRM$ TABLE&lt;br /&gt;SYS.HIST_HEAD$ TABLE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: To find schema level stats that are stale one can call &lt;br /&gt;DBMS_STATS.GATHER_SCHEMA_STATS(ownname=&gt;’SCOTT’, objlist=&gt;ObjList, options=&gt;’LIST STALE’);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4344973960083546189?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4344973960083546189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4344973960083546189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4344973960083546189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4344973960083546189'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2009/05/find-tablesindexes-that-have-stale.html' title='Find the tables/indexes that have stale statistics in a database'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6828504503636012295</id><published>2009-05-20T10:02:00.000-07:00</published><updated>2009-05-20T10:03:23.258-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Detailed report of all invalid objects in the database.'/><title type='text'>Detailed report of all invalid objects in the database.</title><content type='html'>SET LINESIZE  145&lt;br /&gt;SET PAGESIZE  9999&lt;br /&gt;&lt;br /&gt;clear columns&lt;br /&gt;clear breaks&lt;br /&gt;clear computes&lt;br /&gt;&lt;br /&gt;column owner           format a25         heading 'Owner'&lt;br /&gt;column object_name     format a30         heading 'Object Name'&lt;br /&gt;column object_type     format a20         heading 'Object Type'&lt;br /&gt;column status          format a10         heading 'Status'&lt;br /&gt;&lt;br /&gt;break on owner skip 2 on report&lt;br /&gt;compute count label ""               of object_name on owner&lt;br /&gt;compute count label "Grand Total: "  of object_name on report&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;    owner&lt;br /&gt;  , object_name&lt;br /&gt;  , object_type&lt;br /&gt;  , status&lt;br /&gt;FROM dba_objects&lt;br /&gt;WHERE status &lt;&gt; 'VALID'&lt;br /&gt;ORDER BY owner, object_name&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6828504503636012295?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6828504503636012295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6828504503636012295' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6828504503636012295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6828504503636012295'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2009/05/detailed-report-of-all-invalid-objects.html' title='Detailed report of all invalid objects in the database.'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-7293571379959339398</id><published>2009-05-20T09:57:00.000-07:00</published><updated>2009-05-20T09:58:44.697-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Truncating Listener Log File'/><title type='text'>Truncating Listener Log File</title><content type='html'>$cp $ORACLE_HOME/network/log/listener.log $ORACLE_HOME/network/log/listener.log_`date +"%Y%m%d"`&lt;br /&gt;&lt;br /&gt;$cat /dev/null &gt; $ORACLE_HOME/network/log/listener.log&lt;br /&gt;&lt;br /&gt;$nohup compress $ORACLE_HOME/network/log/listener.log_`date +"%Y%m%d"` &amp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-7293571379959339398?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/7293571379959339398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=7293571379959339398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7293571379959339398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7293571379959339398'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2009/05/truncating-listener-log-file.html' title='Truncating Listener Log File'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3520429105398327585</id><published>2009-05-20T09:50:00.000-07:00</published><updated>2009-05-20T09:51:50.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Refreshing stale statistics using the DBMS_STATS package and the GATHER AUTO option.'/><title type='text'>Refreshing stale statistics using the DBMS_STATS package and the GATHER AUTO option.</title><content type='html'>BEGIN&lt;br /&gt;  DBMS_STATS.gather_schema_stats (&lt;br /&gt;    ownname          =&gt; USER,&lt;br /&gt;    cascade          =&gt; TRUE,&lt;br /&gt;    options          =&gt; 'GATHER AUTO');&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;The results of the statistics refresh are evident in the %_TABLES views, as shown below.&lt;br /&gt;&lt;br /&gt;    SELECT table_name,&lt;br /&gt;           num_rows,&lt;br /&gt;           avg_row_len&lt;br /&gt;    FROM   user_tables;&lt;br /&gt;&lt;br /&gt;    TABLE_NAME                       NUM_ROWS AVG_ROW_LEN&lt;br /&gt;    ------------------------------ ---------- -----------&lt;br /&gt;    DEPARTMENTS                          1000          21&lt;br /&gt;&lt;br /&gt;To automate the gathering of statistics, simply schedule a job to the call the DBMS_STATS package. The example below refreshes stale statistics for for schema "TIM" at midnight every day.&lt;br /&gt;&lt;br /&gt;    SET SERVEROUTPUT ON&lt;br /&gt;    DECLARE&lt;br /&gt;      l_job  BINARY_INTEGER;&lt;br /&gt;    BEGIN&lt;br /&gt;      DBMS_JOB.submit (&lt;br /&gt;        job =&gt; l_job,&lt;br /&gt;        what =&gt; 'BEGIN DBMS_STATS.gather_schema_stats (' ||&lt;br /&gt;                'ownname =&gt; ''TIM'', cascade =&gt; TRUE, options =&gt; ''GATHER AUTO''); END;',&lt;br /&gt;        next_date =&gt; SYSDATE,&lt;br /&gt;        interval =&gt; '/* 1 Day Interval */ TRUNC(SYSDATE) + 1');&lt;br /&gt;      COMMIT;&lt;br /&gt;      DBMS_OUTPUT.put_line('Job: ' || TO_CHAR(l_job));&lt;br /&gt;    END;&lt;br /&gt;    /&lt;br /&gt;&lt;br /&gt;Alternatively we could set monitoring on for all database tables, with the exception of those in the SYS schema, and use the following procedure:&lt;br /&gt;&lt;br /&gt;    DBMS_STATS.gather_database_stats(cascade =&gt; TRUE, options =&gt; 'GATHER AUTO');&lt;br /&gt;&lt;br /&gt;Since only those tables with stale or empty stats are processed the overhead on the system is greatly reduced.&lt;br /&gt;&lt;br /&gt;Note. In Oracle 10g, gathering stale statistics for the database once a day happens by default.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3520429105398327585?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3520429105398327585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3520429105398327585' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3520429105398327585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3520429105398327585'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2009/05/refreshing-stale-statistics-using.html' title='Refreshing stale statistics using the DBMS_STATS package and the GATHER AUTO option.'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1261476881323301934</id><published>2009-05-20T09:46:00.000-07:00</published><updated>2009-05-20T09:47:13.585-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Statistics on Tables'/><category scheme='http://www.blogger.com/atom/ns#' term='Indexes and Columns'/><title type='text'>Statistics on Tables, Indexes and Columns</title><content type='html'>Statistics on tables, indexes, and columns are stored in the data dictionary. To view statistics in the data dictionary, query the appropriate data dictionary view (USER, ALL, or DBA). These DBA_* views include the following:&lt;br /&gt;&lt;br /&gt;    *      DBA_TABLES&lt;br /&gt;    *      DBA_OBJECT_TABLES&lt;br /&gt;    *      DBA_TAB_STATISTICS&lt;br /&gt;    *      DBA_TAB_COL_STATISTICS&lt;br /&gt;    *      DBA_TAB_HISTOGRAMS&lt;br /&gt;    *      DBA_INDEXES&lt;br /&gt;    *      DBA_IND_STATISTICS&lt;br /&gt;    *      DBA_CLUSTERS&lt;br /&gt;    *      DBA_TAB_PARTITIONS&lt;br /&gt;    *      DBA_TAB_SUBPARTITIONS&lt;br /&gt;    *      DBA_IND_PARTITIONS&lt;br /&gt;    *      DBA_IND_SUBPARTITIONS&lt;br /&gt;    *      DBA_PART_COL_STATISTICS&lt;br /&gt;    *      DBA_PART_HISTOGRAMS&lt;br /&gt;    *      DBA_SUBPART_COL_STATISTICS&lt;br /&gt;    *      DBA_SUBPART_HISTOGRAMS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1261476881323301934?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1261476881323301934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1261476881323301934' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1261476881323301934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1261476881323301934'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2009/05/statistics-on-tables-indexes-and.html' title='Statistics on Tables, Indexes and Columns'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1578066068272473449</id><published>2009-05-20T09:33:00.001-07:00</published><updated>2009-05-20T09:33:42.046-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 10g Data Dictionary Table Statistics'/><title type='text'>Oracle 10g Data Dictionary Table Statistics</title><content type='html'>To collect statistics on dictionary objects, execute the following statements. The collection process can be done in different formats.&lt;br /&gt;&lt;br /&gt;Format (1)&lt;br /&gt;SQL&gt; EXEC DBMS_STATS.GATHER_SCHEMA_STATS ('SYS');&lt;br /&gt;&lt;br /&gt;Format (2)&lt;br /&gt;SQL&gt; exec DBMS_STATS.GATHER_DATABASE_STATS (gather_sys=&gt;TRUE);&lt;br /&gt;&lt;br /&gt;Format (3)&lt;br /&gt;SQL&gt; EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;&lt;br /&gt;&lt;br /&gt;As seen in the above examples, the gather_schema_stats procedure accepts the sys argument to perform statistics collections. In case of the gather_database_stats procedure, there is a new argument gather_sys whose default value is FALSE. When needed, you can set it to TRUE and execute the procedure.&lt;br /&gt;&lt;br /&gt;There is another procedure, delete_dictionary_stats, which allows you to remove data dictionary stats.&lt;br /&gt;&lt;br /&gt;When you execute the gather_dictionary_stats procedure, it gathers statistics from the SYS and SYSTEM schemas, as well as any other schemas that are related, such as OUTLN or DBSNMP schemas.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1578066068272473449?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1578066068272473449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1578066068272473449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1578066068272473449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1578066068272473449'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2009/05/oracle-10g-data-dictionary-table.html' title='Oracle 10g Data Dictionary Table Statistics'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-903195393001999337</id><published>2007-08-16T06:37:00.000-07:00</published><updated>2007-08-16T06:38:48.898-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SPFILE and INIT.ORA'/><category scheme='http://www.blogger.com/atom/ns#' term='Difference between the PFILE'/><title type='text'>Difference between the PFILE, SPFILE and INIT.ORA</title><content type='html'>Difference between the PFILE, SPFILE and INIT.ORA, and what is the function of each? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the "old days," Oracle kept its parameters in a text file. By default, this parameter file's name was of the form initsid.ora where "sid" is replaced by the ORACLE_SID value. So if ORACLE_SID=ORCL, the parameter file was named "initorcl.ora." When two DBAs have a conversation about the parameter file, their SIDs may be different, so they refer to this parameter file as the "INIT.ORA" file. They just remove the SID from the file name, but it is implied.&lt;br /&gt;&lt;br /&gt;Back in the old days, many of the initialization parameters were not dynamically modifiable. If you wanted to use a different set of parameters for weekend batch processing compared to online use during the week, the DBA would have two parameter files -- two INIT.ORAs. Now the DBA could not name them the same if they were in the same directory. So the DBA might have one parameter file called "init_weekday.ora" and another called "init_weekend.ora." To change the parameter values, the DBA would shut down the database Friday evening at 6 p.m. and start it up with the weekend's parameter values. Monday morning at 5 a.m., the database was restarted with the weekday's parameter values. The PFILE parameter of the STARTUP command could instruct Oracle to start with a specific Parameter FILE (PFILE) like:&lt;br /&gt;&lt;br /&gt;STARTUP PFILE=/home/oracle/7.3/dbs/init_weekend.ora&lt;br /&gt;&lt;br /&gt;Oracle DBAs would refer to the initialization parameter file as either the INIT.ORA or the PFILE. They are the same thing. The PFILE (INIT.ORA) is a text file which can be edited with any text editor.&lt;br /&gt;&lt;br /&gt;In Oracle 9i, the binary parameter file was introduced. This is called the SPFILE (Server Parameter File). The SPFILE replaces the PFILE. For the most part, you can use the PFILE or the SPFILE, but not both. The SPFILE is a binary file and is not edited with any text editor. Instead, you modify the parameter's values with the ALTER SYSTEM SET command. For information on these parameter files, please refer to the following Oracle documentation:&lt;br /&gt;&lt;br /&gt;Initialization Parameter Files and Server Parameter Files&lt;br /&gt;&lt;br /&gt;Managing Initialization Parameters Using a Server Parameter File&lt;br /&gt;&lt;br /&gt;There are benefits to the SPFILE over the PFILE. Since the SPFILE was introduced in Oracle 9i, I do not use the old PFILE any more. Some Oracle functionality does not work as well if you are not using the SPFILE. The self-tuning SGA works best when using a SPFILE as Oracle can store some information abou the SGA components in the SPFILE. THe SPFILE can hold parameters for multiple Oracle instances, something that is very important in a Real Application Clusters (RAC) environment. Oracle's Recovery Manager (RMAN) can automatically back up the SPFILE's contents while it cannot back up the PFILE.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-903195393001999337?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/903195393001999337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=903195393001999337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/903195393001999337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/903195393001999337'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/08/difference-between-pfile-spfile-and.html' title='Difference between the PFILE, SPFILE and INIT.ORA'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2478752809782876714</id><published>2007-07-31T11:16:00.000-07:00</published><updated>2007-07-31T11:17:15.147-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Complete guide to becoming an Oracle database administrator'/><title type='text'>Complete guide to becoming an Oracle database administrator</title><content type='html'>&lt;a href="http://searchoracle.techtarget.com/tip/0,289483,sid41_gci1263890,00.html?track=NL-333&amp;ad=596913&amp;asrc=EM_NLN_1895573"&gt;Complete guide to becoming an Oracle database administrator.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2478752809782876714?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2478752809782876714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2478752809782876714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2478752809782876714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2478752809782876714'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/complete-guide-to-becoming-oracle.html' title='Complete guide to becoming an Oracle database administrator'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1786672480366861616</id><published>2007-07-12T08:14:00.000-07:00</published><updated>2007-07-12T08:17:39.162-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle  Database 11g'/><title type='text'>Oracle  Database 11g</title><content type='html'>&lt;a href="http://www.dba-oracle.com/oracle11g/oracle_11g_new_features.htm"&gt;Oracle 11g new Features&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;NEW YORK CITY   11-JUL-2007 06:30 AM    Oracle today introduced Oracle(r) Database 11g, the latest release of the world's most popular database. With more than 400 features, 15 million test hours, and 36,000 person-months of development, Oracle Database 11g is the most innovative and highest quality software product Oracle have ever announced.&lt;br /&gt;&lt;br /&gt;"Oracle Database 11g, built on 30 years of design experience, delivers the next generation of enterprise information management," said Andy Mendelsohn, senior vice president of Database Server Technologies, Oracle. "More than ever, our customers are facing the challenges of, rapid data growth, increased data integration, and data connectivity IT cost pressures. Oracle Database 10g pioneered grid computing, and more than half of Oracle customers have moved to that release. Oracle Database 11g delivers the key features our customers have asked for to accelerate broad adoption and growth of Oracle grids; representing real innovation, that addresses real challenges, as told to us by real customers."&lt;br /&gt;&lt;br /&gt;Oracle Database 11g can help organizations take control of their enterprise information, gain better business insight, and quickly and confidently adapt to an increasingly changing competitive environment. To do this, the new release extends Oracle's unique database clustering, data center automation, and workload management capabilities. With secure, highly available and scalable grids of low-cost servers and storage, Oracle customers can tackle the most demanding transaction processing, data warehousing, and content management applications.&lt;br /&gt;&lt;br /&gt;Real Application Testing Helps Reduce Time, Risk and Cost of Change&lt;br /&gt;Oracle Database 11g features advanced self-management and automation features to help organizations meet service level agreements. For example, with organizations facing regular database and operating system software upgrades, and hardware and system changes, Oracle Database 11g introduces Oracle Real Application Testing, making it the first database to help customers test and manage changes to their IT environment quickly, in a controlled, cost effective manner.&lt;br /&gt;&lt;br /&gt;Increase Return On Investment for Disaster Recovery Solutions&lt;br /&gt;In Oracle Database 11g, Oracle Data Guard enables customers to use their standby database to improve performance in their production environments as well as provide protection from system failures and site-wide disasters. Oracle Data Guard uniquely enables simultaneous read and recovery of a single standby database making it available for reporting, backup, testing and 'rolling' upgrades to production databases. By offloading workloads from production to a standby system, Oracle Data Guard helps enhance the performance of production systems and provides a more cost-effective disaster recovery solution.&lt;br /&gt;&lt;br /&gt;Enhanced Information Lifecycle Management and Storage Management&lt;br /&gt;Oracle Database 11g has significant new data partitioning and compression capabilities, for more cost-effective Information Lifecycle Management and storage management. Oracle Database 11g automates many manual data partitioning operations and extends existing range, hash and list partitioning to include interval, reference and virtual column partitioning. In addition, Oracle Database 11g provides a complete set of composite partitioning options, allowing storage management that is driven by business rules.&lt;br /&gt;&lt;br /&gt;Building on its long-standing data compression capabilities, Oracle Database 11g offers advanced data compression for both structured and unstructured (LOB) data managed in transaction processing, data warehousing, and content management environments. Compression ratios of 2x to 3x or more for all data can be achieved with the new advanced compression capabilities in Oracle Database 11g.&lt;br /&gt;&lt;br /&gt;Total Recall of Data Changes&lt;br /&gt;The new release also features "Oracle Total Recall," enabling administrators to query data in designated tables "as of" earlier times in the past. This offers an easy, practical way to add a time dimension to data for change tracking, auditing, and compliance.&lt;br /&gt;&lt;br /&gt;Maximum Availability of Information&lt;br /&gt;Oracle has consistently led the industry in protecting database applications from planned and unplanned downtime. Oracle Database 11g continues this lead by making it easier for administrators to meet their users' availability expectations. New availability features include Oracle Flashback Transaction which makes it easy to back out a transaction made in error, as well as any dependent transactions; Parallel Backup and Restore which helps improve the backup and restore performance of very large databases; and 'hot patching,' which improves system availability by allowing database patches to be applied without the need to shut databases down. In addition, a new advisor - Data Recovery Advisor - helps administrators significantly reduce recovery downtime by automating problem investigation, intelligently determining recovery plan and handling multiple failure situations.&lt;br /&gt;&lt;br /&gt;Oracle Fast Files&lt;br /&gt;The next-generation capability for storing large objects (LOBs) such as images, large text objects, or advanced data types ? including XML, medical imaging, and three-dimensional objects - within the database. Oracle Fast Files offers database applications performance fully comparable to file systems. By storing a wider range of enterprise information and retrieving it quickly and easily, enterprises can know more about their business and adapt more rapidly.&lt;br /&gt;&lt;br /&gt;Faster XML&lt;br /&gt;Oracle Database 11g includes significant performance enhancements to XML DB, a feature of Oracle database that enables customers to natively store, and manipulate XML data. Support for binary XML has been added offering customers a choice of XML storage options to match their specific application and performance requirements. XML DB also enables manipulation of XML data using industry standard interfaces with support for XQuery, Java Specification Requests (JSR)-170 and SQL/XML standards.&lt;br /&gt;&lt;br /&gt;Transparent Encryption&lt;br /&gt;Oracle Database 11g continues to build on its unmatched security capabilities through the addition of significant enhancements. The new release features improved Oracle Transparent Data Encryption capabilities beyond column level encryption. Oracle Database 11g offers tablespace encryption that can be utilized to encrypt entire tables, indexes, and other data storage. Encryption is also provided for LOBs stored in the database.&lt;br /&gt;&lt;br /&gt;Embedded OLAP Cubes&lt;br /&gt;Oracle Database 11g also provides data warehousing innovations. OLAP cubes are enhanced to behave as materialized views in the database. This allows developers to use industry standard SQL for data query, but still benefit from the high performance delivered by an OLAP cube. New Continuous Query Notification features allow applications to be immediately notified when important changes are made to database data without burdening the database with constant polling.&lt;br /&gt;&lt;br /&gt;Connection Pooling and Query Result Caches&lt;br /&gt;The performance and scalability features in Oracle Database 11g are designed to help organizations maintain a highly performant, scalable infrastructure to provide users' with the best quality of service. Oracle Database 11g further enhances Oracle's position as the industry's performance and scalability leader with new features such as Query Result Caches which improves application performance and scalability by caching and reusing the results of often called database queries and functions in database and application tiers, and Database Resident Connection Pooling which improves the scalability of web-based systems by providing connection pooling for non-multi-threaded applications.&lt;br /&gt;&lt;br /&gt;Enhanced Application Development&lt;br /&gt;Oracle Database 11g offers developers a choice of development tools, and a streamlined application development process that takes full advantage of key Oracle Database 11g features. These include new features such as Client Side Caching, Binary XML for faster application performance, XML processing, and the storing and retrieving of files. In addition, Oracle Database 11g also includes a new Java just-in-time Compiler to execute database Java procedures faster without the need for a third party compiler; native integration with Visual Studio 2005 for developing .NET applications on Oracle; Access migration tools with Oracle Application Express; and SQL Developer easy query building feature for fast coding of SQL and PL/SQL routines.&lt;br /&gt;&lt;br /&gt;Enhanced Self-Management and Automation&lt;br /&gt;The manageability features in Oracle Database 11g are designed to help organizations easily manage enterprise grids and deliver on their users' service level expectations. Oracle Database 11g introduces more self-management and automation that will help customers reduce their system management costs, while increasing performance, scalability, availability and security of their database applications. New manageability capabilities in Oracle Database 11g include Automatic SQL and memory tuning, a new Partitioning Advisor which automatically advises administrators on how to partition tables and indexes in order to improve performance, and enhanced performance diagnostics for database clusters. In addition, Oracle Database 11g includes a new Support Workbench which provides an easy-to-use interface that presents database health-related incidents to administrators along with information on how to quickly manage the resolution of incidents.&lt;br /&gt;&lt;br /&gt;Oracle is the #1 Database: Gartner 2006 Worldwide RDBMS Market Share Reports 47.1 Percent Share for Oracle&lt;br /&gt;Gartner recently published their market share numbers by operating system for 2006 based on total software revenues. According to Gartner, Oracle:&lt;br /&gt;&lt;br /&gt;* Has 47.1 percent share (up from 46.8 percent in 2005);&lt;br /&gt;&lt;br /&gt;* Has revenue growth of 14.9 percent, faster than the market average of 14.2 percent with US$7.2 Billions in revenues; and,&lt;br /&gt;&lt;br /&gt;* Continues to hold more market share than its two closest competitors combined.&lt;br /&gt;&lt;br /&gt;About Oracle Database 11g&lt;br /&gt;Oracle Database is the only database designed for grid computing. With the release of Oracle Database 11g, Oracle is making the management of enterprise information easier than ever; enabling customers to know more about their business and innovate more quickly. Oracle Database 11g delivers superior performance, scalability, availability, security and ease of management on a low-cost grid of industry standard storage and servers. Oracle Database 11g is designed to be effectively deployed on everything from small blade servers to the biggest SMP servers and clusters of all sizes. It features automated management capabilities for easy, cost-effective operation. Oracle Database 11g's unique ability to manage all data from traditional business information to XML and 3D spatial information makes it the ideal choice to power transaction processing, data warehousing, and content management applications. &lt;br /&gt;&lt;br /&gt;Database 11g, the long-awaited overhaul of Oracle's flagship database management system (DBMS), made its official debut today.&lt;br /&gt;Database 11g, the first major overhaul of Oracle's flagship database management system in about four years, is set to make its official debut tomorrow, leaving some IT industry experts and Oracle users wondering if Oracle security and patching improvements will come along with it.&lt;br /&gt;&lt;br /&gt;Oracle has caught a great deal of flack for its patching policies over the last couple of years, mainly for the time it takes to issue fixes.&lt;br /&gt;&lt;br /&gt;"I know that Oracle has to spend an inordinate amount of time testing each patch or each bug fix before they release it in a patch," said Brian Peasland, an independent Oracle consultant. "But it seems that some of these bugs have been known for two years or even longer before they get patched, and that's just quite disturbing, actually."&lt;br /&gt;&lt;br /&gt;Database 11g, which is entering the market after a nine-month beta testing period, offers a host of fully automated features, new testing-related capabilities, better overall performance, and many other new capabilities that are in line with the release's key themes of "innovation" and "change management," according to Oracle.&lt;br /&gt;&lt;br /&gt;"Oracle has invested heavily into self-tuning capabilities, including automated storage and memory management and intelligent tuning advisors," said Donald K. Burleson, a well-known independent Oracle consultant. "Now, in 11g, Oracle closes the loop and offers intelligent automation tools to create a self-healing database. The most important 11g new automation features include fully automated memory tuning and fully automated SQL tuning, a major advance in database technology."&lt;br /&gt;&lt;br /&gt;Oracle executives led by Charles Phillips, company president, were set to officially launch Database 11g at a kick-off event in New York City today. Database 11g is the company's first major DBMS revamp since it released Database 10g about four years ago. Oracle said the software will be commercially available on Linux sometime in August. Release dates for Database 11g on Microsoft Windows and other platforms have not been announced.&lt;br /&gt;&lt;br /&gt;Database 11g features and functionality&lt;br /&gt;&lt;br /&gt;Database 11g offers nearly 500 new features covering a wide range of areas, including manageability, high availability, scalability, infrastructure, content management, and business intelligence.&lt;br /&gt;&lt;br /&gt;"Probably the most important [new feature] is our Real Application Testing capability," said Robert G. Shimp, a vice president with Oracle's global technology business unit. "This allows us to dramatically shrink the time it takes for a customer to do a database upgrade."&lt;br /&gt;&lt;br /&gt;Oracle says the system offers enhanced self-management and automated features designed to help organizations manage enterprise grids and deliver on service-level agreements. Key among them are automatic SQL and memory tuning.&lt;br /&gt;&lt;br /&gt;More Database 11g info:&lt;br /&gt;&lt;br /&gt;Database 11g debut raises Oracle security questions&lt;br /&gt;&lt;br /&gt;Oracle expert looks ahead to Database 11g&lt;br /&gt;&lt;br /&gt;Oracle Database 11g to feature XML enhancements&lt;br /&gt;&lt;br /&gt;Oracle Database 11g preview&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Jeff S. Buelt, the director of information technology at Pro Staff, a Minneapolis-based temporary staffing firm that runs several versions of Oracle, says features like automatic SQL tuning will be a welcome change when the time comes to upgrade.&lt;br /&gt;&lt;br /&gt;"We have lots of users running queries and reports," Buelt said. "It would be very nice to be able to tune the system easier and faster."&lt;br /&gt;&lt;br /&gt;Andy Mendelsohn, Oracle's senior vice president of database server technologies, said other new features in Database 11g, such as enhanced partitioning and storage-related capabilities, were created to help organizations deal with the dramatic growth in data resulting from relatively new data-retention regulations like Sarbanes-Oxley.&lt;br /&gt;&lt;br /&gt;Along those lines, Database 11g offers enhanced data compression capabilities. Experts point out that compressing data could have an overhead in terms of performance. But they add that the performance cost is probably negligible compared to the storage-related savings.&lt;br /&gt;&lt;br /&gt;"The sizes of databases are growing exponentially [and] the whole cost of storage is getting out of control," Mendelsohn said. "By using a combination of our partitioning technologies -- what we call Information Lifecycle Management -- and our compression technologies, you can go from in the order of a million-dollar storage system down to $50,000, or something of that sort."&lt;br /&gt;&lt;br /&gt;Database 11g also offers Database Replay and SQL Replay capabilities, which give users a better understanding of how database changes affect SQL performance.&lt;br /&gt;&lt;br /&gt;"The Database Replay basically provides the ability to replay the workload from production onto test environments," said Noel Yuhanna, a database analyst with Cambridge, Mass.-based Forrester Research. "It really minimizes some of these challenges and issues which customers are having around application deployments. We believe that around 20% of applications typically fail because [proper] testing is not there, and the Database Replay mitigates this risk."&lt;br /&gt;&lt;br /&gt;Database 11g's newly included Oracle Data Guard technology lets companies use their standby systems to improve performance in production environments while providing protection from system failures and disasters, according to Oracle. The technology enables users to take snapshots of database systems for testing, reporting, backups and rolling upgrades.&lt;br /&gt;&lt;br /&gt;Oracle Database 11g will also offer significant new XML-related features and enhancements. Oracle says the main XML features focus on XML DB, the company's XML storage and retrieval technology, and they include a new binary XML data type, a new XML index, and enhanced support for XQuery and other emerging standards. Oracle expert Donald Burleson wrote that Database 11g provides support for schema-based Document Type Definitions, which let users describe the structure of XML documents.&lt;br /&gt;&lt;br /&gt;Some other new Database 11g features include Quick Fault Resolution, the ability to automatically retain all the diagnostics related to a fault; online table and index redefinition; Database Repair Advisor, a wizard that helps DBAs deal with the fault diagnosis and resolution process; a new high-performance Large Objects infrastructure; native Java and PL/SQL compilers; and a re-engineered driver for PHP.&lt;br /&gt;&lt;br /&gt;An Oracle and Microsoft role reversal?&lt;br /&gt;&lt;br /&gt;Oracle is big with large companies, but hopes the fully automated features of Database 11g will help it achieve greater mindshare among smaller organizations, a market dominated by Microsoft SQL Server, according to industry experts. Meanwhile, they say, Microsoft is hoping to push SQL Server further into the high end of the market.&lt;br /&gt;&lt;br /&gt;"SQL Server is driving up, Oracle is driving down," Burleson said. "And part of that drive-down that Oracle is doing in 11g is putting artificial intelligence in the database. That's where I think that Oracle is going to beat the daylights out of SQL Server."&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is a comprehensive list of &lt;a href="http://www.dba-oracle.com/oracle11g/oracle_11g_new_features.htm"&gt;Oracle 11g new Features&lt;/a&gt; from dba-oracle.com.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1786672480366861616?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1786672480366861616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1786672480366861616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1786672480366861616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1786672480366861616'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/oracle-database-11g.html' title='Oracle  Database 11g'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6227940473668566165</id><published>2007-07-12T06:56:00.001-07:00</published><updated>2007-07-12T06:56:20.072-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='table_dep.sql'/><title type='text'>table_dep.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : table_dep.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays a list dependencies for the specified table.&lt;br /&gt;-- Requirements : Access to the ALL views.&lt;br /&gt;-- Call Syntax  : @table_dep (table-name) (schema-name)&lt;br /&gt;-- Last Modified: 15/07/2000&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;PROMPT&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET LINESIZE 255&lt;br /&gt;SET PAGESIZE 1000&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT ad.referenced_name "Object",&lt;br /&gt;       ad.name "Ref Object",&lt;br /&gt;       ad.type "Type",&lt;br /&gt;       Substr(ad.referenced_owner,1,10) "Ref Owner",&lt;br /&gt;       Substr(ad.referenced_link_name,1,20) "Ref Link Name"&lt;br /&gt;FROM   all_dependencies ad&lt;br /&gt;WHERE  ad.referenced_name = Upper('&amp;&amp;1')&lt;br /&gt;AND    ad.owner           = Upper('&amp;&amp;2')&lt;br /&gt;ORDER BY 1,2,3;&lt;br /&gt;&lt;br /&gt;SET VERIFY ON&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;PROMPT&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6227940473668566165?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6227940473668566165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6227940473668566165' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6227940473668566165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6227940473668566165'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/tabledepsql.html' title='table_dep.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-7617249332559857237</id><published>2007-07-12T06:55:00.001-07:00</published><updated>2007-07-12T06:55:37.332-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='user_hit_ratio.sql'/><title type='text'>user_hit_ratio.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : user_hit_ratio.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays the Cache Hit Ratio per user.&lt;br /&gt;-- Requirements : Access to the V$ views.&lt;br /&gt;-- Call Syntax  : @user_hit_ratio&lt;br /&gt;-- Last Modified: 15/07/2000&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET LINESIZE 500&lt;br /&gt;COLUMN "Hit Ratio %" FORMAT 999.99&lt;br /&gt;&lt;br /&gt;SELECT a.username "Username",&lt;br /&gt;       b.consistent_gets "Consistent Gets",&lt;br /&gt;       b.block_gets "DB Block Gets",&lt;br /&gt;       b.physical_reads "Physical Reads",&lt;br /&gt;       Round(100* (b.consistent_gets + b.block_gets - b.physical_reads) /&lt;br /&gt;       (b.consistent_gets + b.block_gets),2) "Hit Ratio %"&lt;br /&gt;FROM   v$session a,&lt;br /&gt;       v$sess_io b&lt;br /&gt;WHERE  a.sid = b.sid&lt;br /&gt;AND    (b.consistent_gets + b.block_gets) &gt; 0&lt;br /&gt;AND    a.username IS NOT NULL;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-7617249332559857237?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/7617249332559857237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=7617249332559857237' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7617249332559857237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7617249332559857237'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/userhitratiosql.html' title='user_hit_ratio.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6517273923972788650</id><published>2007-07-12T06:54:00.000-07:00</published><updated>2007-07-12T06:55:07.297-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unusable_indexes.sql'/><title type='text'>unusable_indexes.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : unusable_indexes.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays unusable indexes for the specified schema or all schemas.&lt;br /&gt;-- Requirements : Access to the DBA views.&lt;br /&gt;-- Call Syntax  : @unusable_indexes (schema-name or all)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SELECT owner,&lt;br /&gt;       index_name&lt;br /&gt;FROM   dba_indexes&lt;br /&gt;WHERE  owner = DECODE(UPPER('&amp;1'), 'ALL', owner, UPPER('&amp;1'))&lt;br /&gt;AND    status NOT IN ('VALID', 'N/A')&lt;br /&gt;ORDER BY owner, index_name;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6517273923972788650?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6517273923972788650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6517273923972788650' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6517273923972788650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6517273923972788650'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/unusableindexessql.html' title='unusable_indexes.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1518075179340912127</id><published>2007-07-11T10:38:00.002-07:00</published><updated>2007-07-11T10:39:16.000-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='top_sql.sql'/><title type='text'>top_sql.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : top_sql.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays a list of SQL statements that are using the most resources.&lt;br /&gt;-- Comments     : The address column can be use as a parameter with SQL_Text.sql to &lt;br /&gt;--                display the full statement.&lt;br /&gt;-- Requirements : Access to the V$ views.&lt;br /&gt;-- Call Syntax  : @top_sql (number)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET LINESIZE 500&lt;br /&gt;SET PAGESIZE 1000&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM   (SELECT Substr(a.sql_text,1,50) sql_text,&lt;br /&gt;               Trunc(a.disk_reads/Decode(a.executions,0,1,a.executions)) reads_per_execution, &lt;br /&gt;               a.buffer_gets, &lt;br /&gt;               a.disk_reads, &lt;br /&gt;               a.executions, &lt;br /&gt;               a.sorts,&lt;br /&gt;               a.address&lt;br /&gt;        FROM   v$sqlarea a&lt;br /&gt;        ORDER BY 2 DESC)&lt;br /&gt;WHERE  rownum &lt;= &amp;&amp;1;&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1518075179340912127?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1518075179340912127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1518075179340912127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1518075179340912127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1518075179340912127'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/topsqlsql.html' title='top_sql.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2242783165939148136</id><published>2007-07-11T10:38:00.001-07:00</published><updated>2007-07-11T10:38:36.531-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='top_sessions.sql'/><title type='text'>top_sessions.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : top_sessions.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays information on all database sessions ordered by executions.&lt;br /&gt;-- Requirements : Access to the V$ views.&lt;br /&gt;-- Call Syntax  : @top_sessions.sql (reads, execs or cpu)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET LINESIZE 500&lt;br /&gt;SET PAGESIZE 1000&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;COLUMN username FORMAT A15&lt;br /&gt;COLUMN machine FORMAT A25&lt;br /&gt;COLUMN logon_time FORMAT A20&lt;br /&gt;&lt;br /&gt;SELECT NVL(a.username, '(oracle)') AS username,&lt;br /&gt;       a.osuser,&lt;br /&gt;       a.sid,&lt;br /&gt;       a.serial#,&lt;br /&gt;       c.value AS &amp;1,&lt;br /&gt;       a.lockwait,&lt;br /&gt;       a.status,&lt;br /&gt;       a.module,&lt;br /&gt;       a.machine,&lt;br /&gt;       a.program,&lt;br /&gt;       TO_CHAR(a.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time&lt;br /&gt;FROM   v$session a,&lt;br /&gt;       v$sesstat c,&lt;br /&gt;       v$statname d&lt;br /&gt;WHERE  a.sid        = c.sid&lt;br /&gt;AND    c.statistic# = d.statistic#&lt;br /&gt;AND    d.name       = DECODE(UPPER('&amp;1'), 'READS', 'session logical reads',&lt;br /&gt;                                          'EXECS', 'execute count',&lt;br /&gt;                                          'CPU',   'CPU used by this session',&lt;br /&gt;                                                   'CPU used by this session')&lt;br /&gt;ORDER BY c.value DESC;&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2242783165939148136?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2242783165939148136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2242783165939148136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2242783165939148136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2242783165939148136'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/topsessionssql.html' title='top_sessions.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6908414872119751081</id><published>2007-07-11T10:37:00.001-07:00</published><updated>2007-07-11T10:37:37.826-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='session_io.sql'/><title type='text'>session_io.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : session_io.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays I/O information on all database sessions.&lt;br /&gt;-- Requirements : Access to the V$ views.&lt;br /&gt;-- Call Syntax  : @session_io&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET LINESIZE 500&lt;br /&gt;SET PAGESIZE 1000&lt;br /&gt;&lt;br /&gt;COLUMN username FORMAT A15&lt;br /&gt;&lt;br /&gt;SELECT NVL(s.username, '(oracle)') AS username,&lt;br /&gt;       s.osuser,&lt;br /&gt;       s.sid,&lt;br /&gt;       s.serial#,&lt;br /&gt;       si.block_gets,&lt;br /&gt;       si.consistent_gets,&lt;br /&gt;       si.physical_reads,&lt;br /&gt;       si.block_changes,&lt;br /&gt;       si.consistent_changes&lt;br /&gt;FROM   v$session s,&lt;br /&gt;       v$sess_io si&lt;br /&gt;WHERE  s.sid = si.sid&lt;br /&gt;ORDER BY s.username, s.osuser;&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6908414872119751081?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6908414872119751081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6908414872119751081' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6908414872119751081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6908414872119751081'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/sessioniosql.html' title='session_io.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8874474525524186364</id><published>2007-07-11T10:36:00.001-07:00</published><updated>2007-07-11T10:36:54.822-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open_cursors.sql'/><title type='text'>open_cursors.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : open_cursors.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays a list of all cursors currently open.&lt;br /&gt;-- Requirements : Access to the V$ views.&lt;br /&gt;-- Call Syntax  : @open_cursors&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SELECT a.user_name,&lt;br /&gt;       a.sid,&lt;br /&gt;       a.sql_text&lt;br /&gt;FROM   v$open_cursor a&lt;br /&gt;ORDER BY 1,2&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8874474525524186364?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8874474525524186364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8874474525524186364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8874474525524186364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8874474525524186364'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/opencursorssql.html' title='open_cursors.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-345248942250615786</id><published>2007-07-11T10:35:00.001-07:00</published><updated>2007-07-11T10:35:59.094-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='locked_objects.sql'/><title type='text'>locked_objects.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : locked_objects.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Lists all locked objects.&lt;br /&gt;-- Requirements : Access to the V$ views.&lt;br /&gt;-- Call Syntax  : @locked_objects&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET LINESIZE 500&lt;br /&gt;SET PAGESIZE 1000&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SELECT a.object_name,&lt;br /&gt;       a.owner object_owner,&lt;br /&gt;       Decode(b.locked_mode, 0, 'None',&lt;br /&gt;                             1, 'Null (NULL)',&lt;br /&gt;                             2, 'Row-S (SS)',&lt;br /&gt;                             3, 'Row-X (SX)',&lt;br /&gt;                             4, 'Share (S)',&lt;br /&gt;                             5, 'S/Row-X (SSX)',&lt;br /&gt;                             6, 'Exclusive (X)',&lt;br /&gt;                             b.locked_mode) locked_mode,&lt;br /&gt;       b.session_id sid,&lt;br /&gt;       b.oracle_username,&lt;br /&gt;       b.os_user_name&lt;br /&gt;FROM   all_objects a,&lt;br /&gt;       v$locked_object b&lt;br /&gt;WHERE  a.object_id = b.object_id&lt;br /&gt;ORDER BY 1;&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-345248942250615786?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/345248942250615786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=345248942250615786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/345248942250615786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/345248942250615786'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/lockedobjectssql.html' title='locked_objects.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2613863239200716399</id><published>2007-07-11T10:33:00.001-07:00</published><updated>2007-07-11T10:33:59.018-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='high_water_mark.sql'/><title type='text'>high_water_mark.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : high_water_mark.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays the High Water Mark for the specified table, or all tables.&lt;br /&gt;-- Requirements : Access to the Dbms_Space.&lt;br /&gt;-- Call Syntax  : @high_water_mark (table_name or all) (schema-name)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET SERVEROUTPUT ON&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;DECLARE&lt;br /&gt;  CURSOR cu_tables IS&lt;br /&gt;    SELECT a.owner,&lt;br /&gt;           a.table_name&lt;br /&gt;    FROM   all_tables a&lt;br /&gt;    WHERE  a.table_name = Decode(Upper('&amp;&amp;1'),'ALL',a.table_name,Upper('&amp;&amp;1'))&lt;br /&gt;    AND    a.owner      = Upper('&amp;&amp;2');&lt;br /&gt;&lt;br /&gt;  op1  NUMBER;&lt;br /&gt;  op2  NUMBER;&lt;br /&gt;  op3  NUMBER;&lt;br /&gt;  op4  NUMBER;&lt;br /&gt;  op5  NUMBER;&lt;br /&gt;  op6  NUMBER;&lt;br /&gt;  op7  NUMBER;&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;  Dbms_Output.Disable;&lt;br /&gt;  Dbms_Output.Enable(1000000);&lt;br /&gt;  Dbms_Output.Put_Line('TABLE                             UNUSED BLOCKS     TOTAL BLOCKS  HIGH WATER MARK');&lt;br /&gt;  Dbms_Output.Put_Line('------------------------------  ---------------  ---------------  ---------------');&lt;br /&gt;  FOR cur_rec IN cu_tables LOOP&lt;br /&gt;    Dbms_Space.Unused_Space(cur_rec.owner,cur_rec.table_name,'TABLE',op1,op2,op3,op4,op5,op6,op7);&lt;br /&gt;    Dbms_Output.Put_Line(RPad(cur_rec.table_name,30,' ') ||&lt;br /&gt;                         LPad(op3,15,' ')                ||&lt;br /&gt;                         LPad(op1,15,' ')                ||&lt;br /&gt;                         LPad(Trunc(op1-op3-1),15,' ')); &lt;br /&gt;  END LOOP;&lt;br /&gt;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2613863239200716399?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2613863239200716399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2613863239200716399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2613863239200716399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2613863239200716399'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/highwatermarksql.html' title='high_water_mark.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3968821894789832847</id><published>2007-07-11T10:32:00.003-07:00</published><updated>2007-07-11T10:32:52.523-07:00</updated><title type='text'>grant_update.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : grant_update.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Grants update on current schemas tables to the specified user/role.&lt;br /&gt;-- Call Syntax  : @grant_update (schema-name)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'GRANT UPDATE ON "' || u.table_name || '" TO &amp;1;'&lt;br /&gt;FROM   user_tables u&lt;br /&gt;WHERE  NOT EXISTS (SELECT '1'&lt;br /&gt;                   FROM   all_tab_privs a&lt;br /&gt;                   WHERE  a.grantee    = UPPER('&amp;1')&lt;br /&gt;                   AND    a.privilege  = 'UPDATE'&lt;br /&gt;                   AND    a.table_name = u.table_name);&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3968821894789832847?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3968821894789832847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3968821894789832847' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3968821894789832847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3968821894789832847'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/grantupdatesql.html' title='grant_update.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-7741191834087191382</id><published>2007-07-11T10:32:00.001-07:00</published><updated>2007-07-11T10:32:18.944-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grant_select.sql'/><title type='text'>grant_select.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : grant_select.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Grants select on current schemas tables, views &amp; sequences &lt;br /&gt;--                to the specified user/role.&lt;br /&gt;-- Call Syntax  : @grant_select (schema-name)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'GRANT SELECT ON "' || u.object_name || '" TO &amp;1;'&lt;br /&gt;FROM   user_objects u&lt;br /&gt;WHERE  u.object_type IN ('TABLE','VIEW','SEQUENCE')&lt;br /&gt;AND    NOT EXISTS (SELECT '1'&lt;br /&gt;                   FROM   all_tab_privs a&lt;br /&gt;                   WHERE  a.grantee    = UPPER('&amp;1')&lt;br /&gt;                   AND    a.privilege  = 'SELECT'&lt;br /&gt;                   AND    a.table_name = u.object_name);&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-7741191834087191382?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/7741191834087191382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=7741191834087191382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7741191834087191382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7741191834087191382'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/grantselectsql.html' title='grant_select.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-857882404113196208</id><published>2007-07-11T10:31:00.001-07:00</published><updated>2007-07-11T10:31:42.186-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grant_insert.sql'/><title type='text'>grant_insert.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : grant_insert.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Grants insert on current schemas tables to &lt;br /&gt;--                the specified user/role.&lt;br /&gt;-- Call Syntax  : @grant_insert (schema-name)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'GRANT INSERT ON "' || u.table_name || '" TO &amp;1;'&lt;br /&gt;FROM   user_tables u&lt;br /&gt;WHERE  NOT EXISTS (SELECT '1'&lt;br /&gt;                   FROM   all_tab_privs a&lt;br /&gt;                   WHERE  a.grantee    = UPPER('&amp;1')&lt;br /&gt;                   AND    a.privilege  = 'INSERT'&lt;br /&gt;                   AND    a.table_name = u.table_name);&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-857882404113196208?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/857882404113196208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=857882404113196208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/857882404113196208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/857882404113196208'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/grantinsertsql.html' title='grant_insert.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-46746958230227717</id><published>2007-07-11T10:30:00.002-07:00</published><updated>2007-07-11T10:31:02.337-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grant_execute.sql'/><title type='text'>grant_execute.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : grant_execute.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Grants execute on current schemas code objects &lt;br /&gt;--                to the specified user/role.&lt;br /&gt;-- Call Syntax  : @grant_execute (schema-name)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'GRANT EXECUTE ON "' || u.object_name || '" TO &amp;1;'&lt;br /&gt;FROM   user_objects u&lt;br /&gt;WHERE  u.object_type IN ('PACKAGE','PROCEDURE','FUNCTION')&lt;br /&gt;AND    NOT EXISTS (SELECT '1'&lt;br /&gt;                   FROM   all_tab_privs a&lt;br /&gt;                   WHERE  a.grantee    = UPPER('&amp;1')&lt;br /&gt;                   AND    a.privilege  = 'EXECUTE'&lt;br /&gt;                   AND    a.table_name = u.object_name);&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-46746958230227717?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/46746958230227717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=46746958230227717' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/46746958230227717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/46746958230227717'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/grantexecutesql.html' title='grant_execute.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2541777839944656053</id><published>2007-07-11T10:30:00.001-07:00</published><updated>2007-07-11T10:30:21.000-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grant_delete.sql'/><title type='text'>grant_delete.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : grant_delete.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Grants delete on current schemas tables to the &lt;br /&gt;--                 specified user/role.&lt;br /&gt;-- Call Syntax  : @grant_delete (schema-name)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'GRANT DELETE ON "' || u.table_name || '" TO &amp;1;'&lt;br /&gt;FROM   user_tables u&lt;br /&gt;WHERE  NOT EXISTS (SELECT '1'&lt;br /&gt;                   FROM   all_tab_privs a&lt;br /&gt;                   WHERE  a.grantee    = UPPER('&amp;1')&lt;br /&gt;                   AND    a.privilege  = 'DELETE'&lt;br /&gt;                   AND    a.table_name = u.table_name);&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2541777839944656053?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2541777839944656053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2541777839944656053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2541777839944656053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2541777839944656053'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/grantdeletesql.html' title='grant_delete.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-7508333514809629267</id><published>2007-07-11T10:28:00.002-07:00</published><updated>2007-07-11T10:29:19.770-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='enable_fkeys.sql'/><title type='text'>enable_fkeys.sql</title><content type='html'>SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'ALTER TABLE "' || a.table_name || '" ENABLE CONSTRAINT "' || a.constraint_name || '";'&lt;br /&gt;FROM   all_constraints a&lt;br /&gt;WHERE  a.constraint_type = 'R'&lt;br /&gt;AND    a.owner           = Upper('emsowner');&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-7508333514809629267?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/7508333514809629267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=7508333514809629267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7508333514809629267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7508333514809629267'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/enablefkeyssql.html' title='enable_fkeys.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1761616365821022648</id><published>2007-07-11T10:28:00.001-07:00</published><updated>2007-07-11T10:28:31.743-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='disable_fkeys.sql'/><title type='text'>disable_fkeys.sql</title><content type='html'>SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET LINESIZE 150&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'ALTER TABLE "' || a.table_name || '" DISABLE CONSTRAINT "' || a.constraint_name || '";'&lt;br /&gt;FROM   all_constraints a&lt;br /&gt;WHERE  a.constraint_type = 'R'&lt;br /&gt;AND    a.owner           = Upper('emsowner');&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;@temp.sql&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1761616365821022648?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1761616365821022648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1761616365821022648' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1761616365821022648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1761616365821022648'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/disablefkeyssql.html' title='disable_fkeys.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-5531867867045682394</id><published>2007-07-11T10:27:00.001-07:00</published><updated>2007-07-11T10:27:28.090-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='db_info.sql'/><title type='text'>db_info.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : db_info.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays general information about the database.&lt;br /&gt;-- Requirements : Access to the v$ views.&lt;br /&gt;-- Call Syntax  : @db_info&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 1000&lt;br /&gt;SET LINESIZE 100&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM   v$database;&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM   v$instance;&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM   v$version;&lt;br /&gt;&lt;br /&gt;SELECT a.name,&lt;br /&gt;       a.value&lt;br /&gt;FROM   v$sga a;&lt;br /&gt;&lt;br /&gt;SELECT Substr(c.name,1,60) "Controlfile",&lt;br /&gt;       NVL(c.status,'UNKNOWN') "Status"&lt;br /&gt;FROM   v$controlfile c&lt;br /&gt;ORDER BY 1;&lt;br /&gt;&lt;br /&gt;SELECT Substr(d.name,1,60) "Datafile",&lt;br /&gt;       NVL(d.status,'UNKNOWN') "Status",&lt;br /&gt;       d.enabled "Enabled",&lt;br /&gt;       LPad(To_Char(Round(d.bytes/1024000,2),'9999990.00'),10,' ') "Size (M)"&lt;br /&gt;FROM   v$datafile d&lt;br /&gt;ORDER BY 1;&lt;br /&gt;&lt;br /&gt;SELECT l.group# "Group",&lt;br /&gt;       Substr(l.member,1,60) "Logfile",&lt;br /&gt;       NVL(l.status,'UNKNOWN') "Status"&lt;br /&gt;FROM   v$logfile l&lt;br /&gt;ORDER BY 1,2;&lt;br /&gt;&lt;br /&gt;PROMPT&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-5531867867045682394?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/5531867867045682394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=5531867867045682394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5531867867045682394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5531867867045682394'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/dbinfosql.html' title='db_info.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6991522884623652913</id><published>2007-07-11T10:26:00.001-07:00</published><updated>2007-07-11T10:26:20.692-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='create_data.sql'/><title type='text'>create_data.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : create_data.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Creates the DDL to repopulate the specified table.&lt;br /&gt;-- Call Syntax  : @create_data (table-name) (schema)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET LINESIZE 1000&lt;br /&gt;SET SERVEROUTPUT ON&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;SET TRIMSPOOL ON&lt;br /&gt;SET TRIMOUT ON&lt;br /&gt;&lt;br /&gt;ALTER SESSION SET nls_date_format = 'DD-MON-YYYY HH24:MI:SS';&lt;br /&gt; &lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;DECLARE&lt;br /&gt;&lt;br /&gt;  CURSOR c_columns (p_table_name  IN  VARCHAR2,&lt;br /&gt;                    p_owner       IN  VARCHAR2) IS&lt;br /&gt;    SELECT Lower(a.column_name) column_name,&lt;br /&gt;           a.data_type&lt;br /&gt;    FROM   all_tab_columns a&lt;br /&gt;    WHERE  a.table_name = p_table_name&lt;br /&gt;    AND    a.owner      = p_owner&lt;br /&gt;    AND    a.data_type  IN ('CHAR','VARCHAR2','DATE','NUMBER','INTEGER');&lt;br /&gt;    &lt;br /&gt;  v_table_name  VARCHAR2(30) := Upper('&amp;&amp;1');&lt;br /&gt;  v_owner       VARCHAR2(30) := Upper('&amp;&amp;2');&lt;br /&gt;  &lt;br /&gt;  &lt;br /&gt;  FUNCTION Format_Col(p_column    IN  VARCHAR2,&lt;br /&gt;                      p_datatype  IN  VARCHAR2) &lt;br /&gt;    RETURN VARCHAR2 IS&lt;br /&gt;  BEGIN&lt;br /&gt;    IF p_datatype IN ('CHAR','VARCHAR2','DATE') THEN&lt;br /&gt;      RETURN ''' || Decode(' || p_column || ',NULL,''NULL'','''''''' || ' || p_column || ' || '''''''') || ''';&lt;br /&gt;    ELSE &lt;br /&gt;      RETURN ''' || Decode(' || p_column || ',NULL,''NULL'',' || p_column || ') || ''';&lt;br /&gt;    END IF;&lt;br /&gt;  END;&lt;br /&gt;    &lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;  Dbms_Output.Disable;&lt;br /&gt;  Dbms_Output.Enable(1000000);&lt;br /&gt;  &lt;br /&gt;  Dbms_Output.Put_Line('SELECT ''INSERT INTO ' || Lower(v_owner) || '.' || Lower(v_table_name));&lt;br /&gt;  Dbms_Output.Put_Line('(');&lt;br /&gt;  &lt;&lt; Columns_Loop &gt;&gt;&lt;br /&gt;  FOR cur_rec IN c_columns (v_table_name, v_owner) LOOP&lt;br /&gt;    IF c_columns%ROWCOUNT != 1 THEN&lt;br /&gt;      Dbms_Output.Put_Line(',');&lt;br /&gt;    END IF;&lt;br /&gt;    Dbms_Output.Put(cur_rec.column_name);&lt;br /&gt;  END LOOP Columns_Loop;&lt;br /&gt;  Dbms_Output.New_Line;&lt;br /&gt;  Dbms_Output.Put_Line(')');&lt;br /&gt;  Dbms_Output.Put_Line('VALUES');&lt;br /&gt;  Dbms_Output.Put_Line('(');&lt;br /&gt;  &lt;br /&gt;  &lt;&lt; Data_Loop &gt;&gt;&lt;br /&gt;  FOR cur_rec IN c_columns (v_table_name, v_owner) LOOP&lt;br /&gt;    IF c_columns%ROWCOUNT != 1 THEN&lt;br /&gt;      Dbms_Output.Put_Line(',');&lt;br /&gt;    END IF;&lt;br /&gt;    Dbms_Output.Put(Format_Col(cur_rec.column_name, cur_rec.data_type));&lt;br /&gt;  END LOOP Data_Loop;&lt;br /&gt;  Dbms_Output.New_Line;&lt;br /&gt;  Dbms_Output.Put_Line(');''');&lt;br /&gt;  Dbms_Output.Put_Line('FROM ' || Lower(v_owner) || '.' || Lower(v_table_name) );&lt;br /&gt;  Dbms_Output.Put_Line('/');&lt;br /&gt;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;SET LINESIZE 1000&lt;br /&gt;SPOOL table_data.sql&lt;br /&gt;&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6991522884623652913?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6991522884623652913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6991522884623652913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6991522884623652913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6991522884623652913'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/createdatasql.html' title='create_data.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2464509148130311063</id><published>2007-07-11T10:25:00.001-07:00</published><updated>2007-07-11T10:25:30.342-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compile_invalid_objects.sql'/><title type='text'>compile_invalid_objects.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : compile_invalid_objects.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Compiles all invalid objects for user schema&lt;br /&gt;-- Call Syntax  : @compile_invalid_objects.sql &lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;spool cinv.sql&lt;br /&gt;select 'alter '||decode(object_type,'PACKAGE BODY','PACKAGE',object_type)&lt;br /&gt;|| ' '||'.'|| object_name ||' compile' ||&lt;br /&gt;decode(object_type, 'PACKAGE BODY', ' body;', ';')&lt;br /&gt;from user_objects&lt;br /&gt;where status = 'INVALID'&lt;br /&gt;/&lt;br /&gt;spool off&lt;br /&gt;set termout on feedback on echo on&lt;br /&gt;spool cinvobj.lis&lt;br /&gt;@cinv.sql&lt;br /&gt;&lt;br /&gt;column object_name format A30&lt;br /&gt;column object_type format A20&lt;br /&gt;select object_name, object_type, status&lt;br /&gt;from user_objects&lt;br /&gt;where status = 'INVALID'&lt;br /&gt;/&lt;br /&gt;spool off&lt;br /&gt;set lines 80 &lt;br /&gt;prompt Spool file saved at cinvobj.lis&lt;br /&gt;prompt Script file saved at cinv.sql&lt;br /&gt;prompt&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2464509148130311063?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2464509148130311063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2464509148130311063' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2464509148130311063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2464509148130311063'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/compileinvalidobjectssql.html' title='compile_invalid_objects.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-2343995177323767609</id><published>2007-07-11T10:24:00.001-07:00</published><updated>2007-07-11T10:24:47.052-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compile_all.sql'/><title type='text'>compile_all.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : compile_all.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Compiles all invalid objects for specified schema, or all schema.&lt;br /&gt;-- Requirements : Requires all other "Compile_All" scripts.&lt;br /&gt;-- Call Syntax  : @compile_all (schema-name or all)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;@Compile_All_Specs &amp;&amp;1&lt;br /&gt;@Compile_All_Bodies &amp;&amp;1&lt;br /&gt;@Compile_All_Procs &amp;&amp;1&lt;br /&gt;@Compile_All_Funcs &amp;&amp;1&lt;br /&gt;@Compile_All_Views &amp;&amp;1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-2343995177323767609?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/2343995177323767609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=2343995177323767609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2343995177323767609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/2343995177323767609'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/compileallsql.html' title='compile_all.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-6530111389903442117</id><published>2007-07-11T10:23:00.002-07:00</published><updated>2007-07-11T10:24:08.786-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compile_all_views.sql'/><title type='text'>compile_all_views.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : compile_all_views.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Compiles all invalid views for specified schema, or all schema.&lt;br /&gt;-- Call Syntax  : @compile_all_views (schema-name or all)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'ALTER VIEW ' || a.owner || '.' || a.object_name || ' COMPILE;'&lt;br /&gt;FROM    all_objects a&lt;br /&gt;WHERE   a.object_type = 'VIEW'&lt;br /&gt;AND     a.status      = 'INVALID'&lt;br /&gt;AND     a.owner       = Decode(Upper('&amp;&amp;1'), 'ALL',a.owner, Upper('&amp;&amp;1'));&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-6530111389903442117?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/6530111389903442117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=6530111389903442117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6530111389903442117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/6530111389903442117'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/compileallviewssql.html' title='compile_all_views.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-3562433260558676267</id><published>2007-07-11T10:23:00.001-07:00</published><updated>2007-07-11T10:23:26.399-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compile_all_trigs.sql'/><title type='text'>compile_all_trigs.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : compile_all_trigs.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Compiles all invalid triggers for specified schema, or all schema.&lt;br /&gt;-- Call Syntax  : @compile_all_trigs (schema-name or all)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'ALTER TRIGGER ' || a.owner || '.' || a.object_name || ' COMPILE;'&lt;br /&gt;FROM    all_objects a&lt;br /&gt;WHERE   a.object_type = 'TRIGGER'&lt;br /&gt;AND     a.status      = 'INVALID'&lt;br /&gt;AND     a.owner       = Decode(Upper('&amp;&amp;1'), 'ALL',a.owner, Upper('&amp;&amp;1'));&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-3562433260558676267?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/3562433260558676267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=3562433260558676267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3562433260558676267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/3562433260558676267'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/compilealltrigssql.html' title='compile_all_trigs.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-5929396148726374831</id><published>2007-07-11T10:22:00.001-07:00</published><updated>2007-07-11T10:22:50.494-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compile_all_specs.sql'/><title type='text'>compile_all_specs.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : compile_all_specs.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Compiles all invalid package specifications for specified schema,&lt;br /&gt;--                or all schema.&lt;br /&gt;-- Call Syntax  : @compile_all_specs (schema-name or all)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'ALTER PACKAGE ' || a.owner || '.' || a.object_name || ' COMPILE;'&lt;br /&gt;FROM    all_objects a&lt;br /&gt;WHERE   a.object_type = 'PACKAGE'&lt;br /&gt;AND     a.status      = 'INVALID'&lt;br /&gt;AND     a.owner       = Decode(Upper('&amp;&amp;1'), 'ALL',a.owner, Upper('&amp;&amp;1'));&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-5929396148726374831?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/5929396148726374831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=5929396148726374831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5929396148726374831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/5929396148726374831'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/compileallspecssql.html' title='compile_all_specs.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-132376872188389808</id><published>2007-07-11T10:21:00.002-07:00</published><updated>2007-07-11T10:22:02.229-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compile_all_procs.sql'/><title type='text'>compile_all_procs.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : compile_all_procs.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Compiles all invalid procedures for specified schema, or all schema.&lt;br /&gt;-- Call Syntax  : @compile_all_procs (schema-name or all)&lt;br /&gt;-- Last Modified: 02/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'ALTER PROCEDURE ' || a.owner || '.' || a.object_name || ' COMPILE;'&lt;br /&gt;FROM    all_objects a&lt;br /&gt;WHERE   a.object_type = 'PROCEDURE'&lt;br /&gt;AND     a.status      = 'INVALID'&lt;br /&gt;AND     a.owner       = Decode(Upper('&amp;&amp;1'), 'ALL',a.owner, Upper('&amp;&amp;1'));&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-132376872188389808?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/132376872188389808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=132376872188389808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/132376872188389808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/132376872188389808'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/compileallprocssql.html' title='compile_all_procs.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1676208536927305784</id><published>2007-07-11T10:21:00.001-07:00</published><updated>2007-07-11T10:21:18.396-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compile_all_funcs.sql'/><title type='text'>compile_all_funcs.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : compile_all_funcs.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Compiles all invalid functions for specified schema, or all schema.&lt;br /&gt;-- Call Syntax  : @compile_all_funcs (schema-name or all)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'ALTER FUNCTION ' || a.owner || '.' || a.object_name || ' COMPILE;'&lt;br /&gt;FROM    all_objects a&lt;br /&gt;WHERE   a.object_type = 'FUNCTION'&lt;br /&gt;AND     a.status      = 'INVALID'&lt;br /&gt;AND     a.owner       = Decode(Upper('&amp;&amp;1'), 'ALL',a.owner, Upper('&amp;&amp;1'));&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1676208536927305784?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1676208536927305784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1676208536927305784' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1676208536927305784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1676208536927305784'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/compileallfuncssql.html' title='compile_all_funcs.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8433474421600361609</id><published>2007-07-11T10:12:00.001-07:00</published><updated>2007-07-11T10:12:37.662-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='compile_all_bodies.sql'/><title type='text'>compile_all_bodies.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : compile_all_bodies.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Compiles all invalid package bodies for specified schema, or all schema.&lt;br /&gt;-- Call Syntax  : @compile_all_bodies (schema-name or all)&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET PAGESIZE 0&lt;br /&gt;SET FEEDBACK OFF&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SPOOL temp.sql&lt;br /&gt;&lt;br /&gt;SELECT 'ALTER PACKAGE ' || a.owner || '.' || a.object_name || ' COMPILE BODY;'&lt;br /&gt;FROM    all_objects a&lt;br /&gt;WHERE   a.object_type = 'PACKAGE BODY'&lt;br /&gt;AND     a.status      = 'INVALID'&lt;br /&gt;AND     a.owner       = Decode(Upper('&amp;&amp;1'), 'ALL',a.owner, Upper('&amp;&amp;1'));&lt;br /&gt;&lt;br /&gt;SPOOL OFF&lt;br /&gt;&lt;br /&gt;-- Comment out following line to prevent immediate run&lt;br /&gt;@temp.sql&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;br /&gt;SET FEEDBACK ON&lt;br /&gt;SET VERIFY ON&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8433474421600361609?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8433474421600361609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8433474421600361609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8433474421600361609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8433474421600361609'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/compileallbodiessql.html' title='compile_all_bodies.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-8893369017629637312</id><published>2007-07-11T10:11:00.001-07:00</published><updated>2007-07-11T10:11:48.514-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='access.sql'/><title type='text'>access.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : access.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Lists all objects being accessed in the schema.&lt;br /&gt;-- Call Syntax  : @access (schema-name)&lt;br /&gt;-- Requirements : Access to the v$views.&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET SERVEROUTPUT ON&lt;br /&gt;SET PAGESIZE 1000&lt;br /&gt;SET LINESIZE 255&lt;br /&gt;SET VERIFY OFF&lt;br /&gt;&lt;br /&gt;SELECT Substr(a.object,1,30) object,&lt;br /&gt;       a.type,&lt;br /&gt;       a.sid,&lt;br /&gt;       b.username,&lt;br /&gt;       b.osuser,&lt;br /&gt;       b.program&lt;br /&gt;FROM   v$access a,&lt;br /&gt;       v$session b&lt;br /&gt;WHERE  a.sid   = b.sid&lt;br /&gt;AND    a.owner = Upper('&amp;1');&lt;br /&gt;&lt;br /&gt;PROMPT&lt;br /&gt;SET PAGESIZE 18&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-8893369017629637312?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/8893369017629637312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=8893369017629637312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8893369017629637312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/8893369017629637312'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/accesssql.html' title='access.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4847332831421515140</id><published>2007-07-11T10:10:00.000-07:00</published><updated>2007-07-11T10:11:07.891-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='active_sessions.sql'/><title type='text'>active_sessions.sql</title><content type='html'>-- -----------------------------------------------------------------------------------&lt;br /&gt;-- File Name    : active_sessions.sql&lt;br /&gt;-- Author       : Sachchida Ojha&lt;br /&gt;-- Description  : Displays information on all active database sessions.&lt;br /&gt;-- Requirements : Access to the V$ views.&lt;br /&gt;-- Call Syntax  : @active_sessions&lt;br /&gt;-- Last Modified: 04/28/2005&lt;br /&gt;-- -----------------------------------------------------------------------------------&lt;br /&gt;SET LINESIZE 500&lt;br /&gt;SET PAGESIZE 1000&lt;br /&gt;&lt;br /&gt;COLUMN username FORMAT A15&lt;br /&gt;COLUMN machine FORMAT A25&lt;br /&gt;COLUMN logon_time FORMAT A20&lt;br /&gt;&lt;br /&gt;SELECT NVL(s.username, '(oracle)') AS username,&lt;br /&gt;       s.osuser,&lt;br /&gt;       s.sid,&lt;br /&gt;       s.serial#,&lt;br /&gt;       p.spid,&lt;br /&gt;       s.lockwait,&lt;br /&gt;       s.status,&lt;br /&gt;       s.module,&lt;br /&gt;       s.machine,&lt;br /&gt;       s.program,&lt;br /&gt;       TO_CHAR(s.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time&lt;br /&gt;FROM   v$session s,&lt;br /&gt;       v$process p&lt;br /&gt;WHERE  s.paddr  = p.addr&lt;br /&gt;AND    s.status = 'ACTIVE'&lt;br /&gt;ORDER BY s.username, s.osuser;&lt;br /&gt;&lt;br /&gt;SET PAGESIZE 14&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4847332831421515140?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4847332831421515140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4847332831421515140' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4847332831421515140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4847332831421515140'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/activesessionssql.html' title='active_sessions.sql'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-4182491647819249419</id><published>2007-07-11T09:04:00.001-07:00</published><updated>2007-07-11T09:04:59.655-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hot Backup Script'/><title type='text'>Hot Backup Script</title><content type='html'>#!/bin/ksh&lt;br /&gt;############################################################################&lt;br /&gt;####&lt;br /&gt;#&lt;br /&gt;# Hot Backup Script&lt;br /&gt;# Sachchida Ojha&lt;br /&gt;############################################################################&lt;br /&gt;###&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;#DBA=sojha@dbceo.com; export DBA&lt;br /&gt;ORACLE_HOME=/export/home/oracle/OraHome1; export ORACLE_HOME&lt;br /&gt;&lt;br /&gt;#ARCH_DEST=/u05/arch/hsphtpr; export ARCH_DEST&lt;br /&gt;ORACLE_SID=arsystem; export ORACLE_SID&lt;br /&gt;&lt;br /&gt;LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib; export LD_LIBRARY_PATH&lt;br /&gt;LOG_DIR=$HOME/scripts/log;export LOG_DIR&lt;br /&gt;&lt;br /&gt;LOG_FILE=$LOG_DIR/do_hot_back_$ORACLE_SID.log ; export LOG_FILE&lt;br /&gt;ALERT_LOG=$ORACLE_HOME/admin/$ORACLE_SID/bdump/alert_${ORACLE_SID}.log;&lt;br /&gt;export ALERT_LOG&lt;br /&gt;UDUMP=$ORACLE_HOME/admin/$ORACLE_SID/udump ;export UDUMP&lt;br /&gt;&lt;br /&gt;BACKUP_BASE=/u01/oracle_backup/hotbackup/$ORACLE_SID; export &lt;br /&gt;BACKUP_BASE&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Check if DB shutdown normally don't check the rest&lt;br /&gt;#&lt;br /&gt;ENUM=`tail -35 $ALERT_LOG | egrep -c 'CLOSE'`&lt;br /&gt;if [ $ENUM -ne 0 ]; then&lt;br /&gt;    echo "`uname -n`:$ORACLE_SID instance was down." &gt; $LOG_FILE&lt;br /&gt;    exit&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;# Creating backup directory and purge directory&lt;br /&gt;#&lt;br /&gt;A=`date | awk '{print $2}'`; export A&lt;br /&gt;B=`date | awk '{print $3}'`; export B&lt;br /&gt;C=`date | awk '{print $6}'`; export C&lt;br /&gt;&lt;br /&gt;BACKUP_DIR=$BACKUP_BASE/$A'_'$B'_'$C; export BACKUP_DIR&lt;br /&gt;&lt;br /&gt;echo "Starting hot backup of $ORACLE_SID at" $(date) &gt; $LOG_FILE&lt;br /&gt;echo " " &gt;&gt; $LOGFILE&lt;br /&gt;echo "Creating backup directory $BACKUP_DIR...\c" &gt;&gt; $LOG_FILE&lt;br /&gt;echo " " &gt;&gt; $LOGFILE&lt;br /&gt;mkdir $BACKUP_DIR || exit 1&lt;br /&gt;echo "Done" &gt;&gt; $LOG_FILE&lt;br /&gt;df -k $BACKUP_BASE &gt;&gt; $LOG_FILE&lt;br /&gt;&lt;br /&gt;# Creating list of tablespaces&lt;br /&gt;TSP=$HOME/scripts/tmp/hot_tsp.lis&lt;br /&gt;export TSP&lt;br /&gt;&lt;br /&gt;$ORACLE_HOME/bin/sqlplus -s internal  &lt;&lt;EOF &gt; $TSP&lt;br /&gt;        set head off pages 0&lt;br /&gt;        set lines 150&lt;br /&gt;        set echo off verify off feedback off&lt;br /&gt;        select name from sys.ts$ where online$ !=3 and name != 'TEMP' &lt;br /&gt;order&lt;br /&gt;by ts# desc;&lt;br /&gt;exit;&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;# Declaring variables for log file and shell script names to be used in &lt;br /&gt;the&lt;br /&gt;following loop&lt;br /&gt;&lt;br /&gt;cat $TSP | while read LINE&lt;br /&gt;do&lt;br /&gt;        TSPNAME=$LINE; export TSPNAME&lt;br /&gt;        COPY_FILE_NAME=$HOME/scripts/tmp/$TSPNAME.ksh; export &lt;br /&gt;COPY_FILE_NAME&lt;br /&gt;        BEGIN_TBS_LOG=$HOME/scripts/tmp/$TSPNAME.begin; export &lt;br /&gt;BEGIN_TBS_LOG&lt;br /&gt;        END_TBS_LOG=$HOME/scripts/tmp/$TSPNAME.end; export END_TBS_LOG&lt;br /&gt;&lt;br /&gt;        # Altering the tablespace to Begin backup mode&lt;br /&gt;&lt;br /&gt;        $ORACLE_HOME/bin/sqlplus -s internal  &lt;&lt;EOF &gt; $BEGIN_TBS_LOG&lt;br /&gt;        set head off pages 0&lt;br /&gt;        set lines 150&lt;br /&gt;        alter tablespace  $TSPNAME  begin backup;&lt;br /&gt;        exit;&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;# Check for error in the begin backup execution and email error&lt;br /&gt;&lt;br /&gt;NUM=`egrep -ci 'ORA-|error' $BEGIN_TBS_LOG`&lt;br /&gt;if [ $NUM -gt 0 ]&lt;br /&gt;then&lt;br /&gt;        echo "Failed $ORACLE_SID begin backup at "`date ' %m/%d/%y,%T'` &lt;br /&gt;&gt;&gt;&lt;br /&gt;$LOG_FILE&lt;br /&gt;        echo "" &gt;&gt; $LOG_FILE&lt;br /&gt;        SUBJ="ERROR: `uname -n`:$ORACLE_SID $TSPNAME failed begin &lt;br /&gt;backup."&lt;br /&gt;        echo $SUBJ | mailx -s "$SUBJ" $DBA &gt;&gt; $LOG_FILE&lt;br /&gt;        exit 1&lt;br /&gt;fi&lt;br /&gt;rm -f $BEGIN_TBS_LOG&lt;br /&gt;&lt;br /&gt;#Generate shell scripts to compress and copy different tablespaces and &lt;br /&gt;run&lt;br /&gt;them&lt;br /&gt;&lt;br /&gt;        $ORACLE_HOME/bin/sqlplus -s internal  &lt;&lt;EOF &gt; $COPY_FILE_NAME&lt;br /&gt;        set head off pages 0&lt;br /&gt;        set lines 150&lt;br /&gt;        set echo off verify off feedback off&lt;br /&gt;&lt;br /&gt; select '#!/bin/ksh' from dual;&lt;br /&gt;        select 'cp ' || file_name || ' $BACKUP_DIR' || &lt;br /&gt;substr(file_name,&lt;br /&gt;instr(file_name,'/',-1)) from dba_data_files&lt;br /&gt;        where tablespace_name='$TSPNAME';&lt;br /&gt;        select 'wait;' from dual;&lt;br /&gt;        exit;&lt;br /&gt;EOF&lt;br /&gt;# Run the compress and copy and email if any errors&lt;br /&gt;&lt;br /&gt;chmod 744 $COPY_FILE_NAME&lt;br /&gt;if $COPY_FILE_NAME&lt;br /&gt;then&lt;br /&gt;        echo "Finished copy and compress Datafiles of" $TSPNAME " at"&lt;br /&gt;$(date) &gt;&gt; $LOG_FILE&lt;br /&gt;        else&lt;br /&gt;        echo "Copy and Compress Failed for tablespace " $TSPNAME " at"&lt;br /&gt;$(date) &gt;&gt; $LOG_FILE&lt;br /&gt;        SUBJ="ERROR: `uname -n`:$ORACLE_SID $COPY_FILE_NAME failed to &lt;br /&gt;copy."&lt;br /&gt;        echo $SUBJ | mailx -s "$SUBJ" $DBA &gt;&gt; $LOG_FILE&lt;br /&gt;fi&lt;br /&gt;        rm $COPY_FILE_NAME&lt;br /&gt;&lt;br /&gt;        # Put the tablespace back in end backup mode&lt;br /&gt;&lt;br /&gt;        $ORACLE_HOME/bin/sqlplus -s internal &lt;&lt;EOF &gt; $END_TBS_LOG&lt;br /&gt;        alter tablespace  $TSPNAME  end backup;&lt;br /&gt;        exit;&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;# Check the end backup log for any errors and email if any&lt;br /&gt;&lt;br /&gt;NUM=`egrep -ci 'ORA-|error' $END_TBS_LOG`&lt;br /&gt;if [ $NUM -gt 0 ]&lt;br /&gt;then&lt;br /&gt;echo "Failed $ORACLE_SID end backup at "`date ' %m/%d/%y,%T'` &gt;&gt; &lt;br /&gt;$LOG_FILE&lt;br /&gt;        echo "" &gt;&gt; $LOG_FILE&lt;br /&gt;        SUBJ="ERROR: `uname -n`:$ORACLE_SID $TSPNAME failed to end &lt;br /&gt;backup"&lt;br /&gt;        echo $SUBJ | mailx -s "$SUBJ" $DBA &gt;&gt; $LOG_FILE&lt;br /&gt;        exit 1&lt;br /&gt;fi&lt;br /&gt;        rm $END_TBS_LOG&lt;br /&gt;done&lt;br /&gt;&lt;br /&gt;echo "Backing up the latest 7 archive files generated today" &gt;&gt; &lt;br /&gt;$LOG_FILE&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;$ORACLE_HOME/bin/sqlplus -s internal &lt;&lt;EOF&lt;br /&gt;alter system archive log current;&lt;br /&gt;exit;&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;#cd $ARCH_DEST || exit 1&lt;br /&gt;#ls -ltr *.arc | tail -7 | awk '{print $9}' &gt; &lt;br /&gt;$HOME/scripts/tmp/ARCHLIST&lt;br /&gt;#cat $HOME/scripts/tmp/ARCHLIST | while read EACHLINE&lt;br /&gt;#do&lt;br /&gt;#/usr/local/bin/gzip -cv &lt; $ARCH_DEST/$EACHLINE &gt; &lt;br /&gt;$BACKUP_DIR/$EACHLINE.gz &amp;&lt;br /&gt;#done&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo "Taking a binary backup of the latest controlfile " &gt;&gt; $LOG_FILE&lt;br /&gt;        $ORACLE_HOME/bin/sqlplus -s internal &lt;&lt;EOF&lt;br /&gt;        alter database backup controlfile to&lt;br /&gt;'$BACKUP_DIR/ctrl_file_binary_copy';&lt;br /&gt;        alter database backup controlfile to trace;&lt;br /&gt;        exit;&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;cd $ORACLE_HOME/admin/$ORACLE_SID/udump&lt;br /&gt;echo " " &gt;&gt; $LOGFILE&lt;br /&gt;echo " Taking an ascii copy of control file " &gt;&gt; $LOGFILE&lt;br /&gt;cp `ls -ltr $ORACLE_HOME/admin/$ORACLE_SID/udump/*.trc|tail -1| awk &lt;br /&gt;'{print&lt;br /&gt;$9}'` $BACKUP_DIR&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;echo " Backup Done" &gt;&gt; $LOG_FILE&lt;br /&gt;df -k $BACKUP_BASE &gt;&gt; $LOG_FILE&lt;br /&gt;&lt;br /&gt;if [ -e $BACKUP_DIR/ctrl_file_binary_copy ]&lt;br /&gt;then&lt;br /&gt;        cd $BACKUP_BASE&lt;br /&gt;        echo " " &gt;&gt; $LOGFILE&lt;br /&gt;        echo "Seems like today's backup completed Okay" &gt;&gt; $LOGFILE&lt;br /&gt;        echo " " &gt;&gt; $LOGFILE&lt;br /&gt;        echo "Following older backup directories will be purged" &gt;&gt;&lt;br /&gt;$LOG_FILE&lt;br /&gt;        echo " " &gt;&gt; $LOGFILE&lt;br /&gt;        /usr/bin/find . -mtime  1 -type d &gt;&gt; $LOG_FILE&lt;br /&gt;        /usr/bin/find . -mtime  1 -type d -exec /usr/bin/rm -rf {} \;&lt;br /&gt;&lt;br /&gt;sqlplus internal &lt;&lt; EOF &gt; /tmp/verbackup.lis&lt;br /&gt;    set pages 1000 lines 400 feedback off echo off verify off trimspool &lt;br /&gt;off;&lt;br /&gt;    column recover heading "Requires|Recovery?" format a10;&lt;br /&gt;    column time heading "Date Of|Last Backup" format a15;&lt;br /&gt;    column Name format a40;&lt;br /&gt;    column Mode format a20;&lt;br /&gt;&lt;br /&gt;    select substr(tablespace_name,1,20) "Tablespace &lt;br /&gt;Name",substr(name,1,45)&lt;br /&gt;"Name",&lt;br /&gt;       a.status "Status", decode(fuzzy,'YES','BACKUP','NORMAL') "Mode" &lt;br /&gt;,&lt;br /&gt;recover, time&lt;br /&gt;    from v\$datafile_header a, v\$backup b&lt;br /&gt;    where a.file#=b.file# order by tablespace_name,name;&lt;br /&gt;exit&lt;br /&gt;EOF&lt;br /&gt;cat /tmp/verbackup.lis  &gt;&gt; $LOG_FILE&lt;br /&gt;else&lt;br /&gt;        echo "$BACKUP_DIR does not exist" &gt;&gt; $LOGFILE&lt;br /&gt;fi&lt;br /&gt;NUM=`egrep -ci 'ORA-|error' $LOG_FILE`&lt;br /&gt;if [ $NUM -gt 0 ]&lt;br /&gt;then&lt;br /&gt;        echo "Failed $ORACLE_SID online Hot backup at "`date &lt;br /&gt;' %m/%d/%y,%T'`&lt;br /&gt;&gt;&gt; $LOG_FILE&lt;br /&gt;        echo "" &gt;&gt; $LOG_FILE&lt;br /&gt;        SUBJ="ERROR: `uname -n`:$ORACLE_SID `basename $0` failed"&lt;br /&gt;        echo $SUBJ | mailx -s "$SUBJ" $DBA &gt;&gt; $LOG_FILE&lt;br /&gt;&lt;br /&gt;else&lt;br /&gt;&lt;br /&gt;        echo "Completed $ORACLE_SID Hot backup at "`date &lt;br /&gt;' %m/%d/%y,%T'` &gt;&gt;&lt;br /&gt;$LOG_FILE&lt;br /&gt;        SUBJ="SUCCESS: `uname -n`:$ORACLE_SID `basename $0` completed."&lt;br /&gt;        cat $LOG_FILE | mailx -s "$SUBJ" $DBA &gt;&gt; $LOG_FILE&lt;br /&gt;fi&lt;br /&gt;exit&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-4182491647819249419?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/4182491647819249419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=4182491647819249419' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4182491647819249419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/4182491647819249419'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/hot-backup-script.html' title='Hot Backup Script'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-7712719638209706011</id><published>2007-07-11T09:01:00.000-07:00</published><updated>2007-07-11T09:02:14.110-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle&apos;s history'/><title type='text'>Oracle's history</title><content type='html'>Oracle&lt;br /&gt;&lt;br /&gt;Oracle Corporation was founded in 1977 in Redwood, California. They introduced the first Relational Database Management System based on the IBM System/R model and the first database management system utilizing IBM's Structured Query Language (SQL) technology.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;What is Oracle's history?&lt;br /&gt;&lt;br /&gt;1977&lt;br /&gt;    Relational Software Inc. (RSI - currently Oracle Corporation) established &lt;br /&gt;1978&lt;br /&gt;    Oracle V1 ran on PDP-11 under RSX, 128 KB max memory. Written in assembly language. Implementation separated Oracle code and user code. Oracle V1 was never officially released. &lt;br /&gt;1980&lt;br /&gt;    Oracle V2 released - the first commercially available relational database to use SQL. Oracle runs on on DEC PDP-11 machines. Coide is still written in PDP-11 assembly language, but now ran under Vax/VMS. &lt;br /&gt;1982&lt;br /&gt;    Oracle V3 released, Oracle became the first DBMS to run on mainframes, minicomputers, and PC's (portable codebase). First release to employ transactional processing. Oracle V3's server code was written in C. &lt;br /&gt;1983&lt;br /&gt;    Relational Software Inc. changed its name to Oracle Corporation. &lt;br /&gt;1984&lt;br /&gt;    Oracle V4 released, introduced read consistency, was ported to multiple platforms, first interoperability between PC and server. &lt;br /&gt;1986&lt;br /&gt;    Oracle V5 released. Featured true client/server, VAX-cluster support, and distributed queries. (first DBMS with distributed capabilities). &lt;br /&gt;1987&lt;br /&gt;    CASE and 4GL toolset &lt;br /&gt;1988&lt;br /&gt;    Oracle V6 released - PL/SQL introduced.&lt;br /&gt;    Oracle Financial Applications built on relational database. &lt;br /&gt;1989&lt;br /&gt;    Released Oracle 6.2 with Symmetric cluster access using the Oracle Parallel Server &lt;br /&gt;1991&lt;br /&gt;    Reached power of 1,000 TPS on a parallel computing machine.&lt;br /&gt;    First database to run on a massively parallel computer (Oracle Parallel Server). &lt;br /&gt;1992&lt;br /&gt;    Released Oracle7 for Unix &lt;br /&gt;1993&lt;br /&gt;    Rollout of Oracle's Cooperative Development Environment (CDE).&lt;br /&gt;    Introduction of Oracle Industries and the Oracle Media Server. &lt;br /&gt;1994&lt;br /&gt;    Oracle's headquarters moved to present location.&lt;br /&gt;    Released Oracle 7.1 and Oracle7 for the PC. &lt;br /&gt;1995&lt;br /&gt;    Reported gross revenues of almost $3 billion. &lt;br /&gt;1995&lt;br /&gt;    OraFAQ.com website launched. &lt;br /&gt;1997&lt;br /&gt;    Oracle8 released (supports more users, more data, higher availability, and object-relational features) &lt;br /&gt;1998&lt;br /&gt;    Oracle announces support for the Intel Linux operating system &lt;br /&gt;1999&lt;br /&gt;    Oracle8i (the "i" is for internet) or Oracle 8.1.5 with Java integration (JVM in the database) &lt;br /&gt;2000&lt;br /&gt;    Oracle8i Release 2 released&lt;br /&gt;    Oracle now not only the number one in Databases but also in ERP Applications&lt;br /&gt;    Oracle9i Application Server generally available: Oracle tools integrated in middle tier &lt;br /&gt;2001&lt;br /&gt;    Oracle9i Release 1 (with RAC and Advanced Analytic Service) &lt;br /&gt;2002&lt;br /&gt;    Oracle9i Release 2 &lt;br /&gt;2004&lt;br /&gt;    Oracle10g Release 1 (10.1.0) available ("g" is for grid, the latest buzzword) &lt;br /&gt;2005&lt;br /&gt;    The Oracle FAQ (this site) is 10 years old! &lt;br /&gt;2005&lt;br /&gt;    Oracle10g Release 2 (10.2.0) available&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-7712719638209706011?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/7712719638209706011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=7712719638209706011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7712719638209706011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/7712719638209706011'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/oracles-history.html' title='Oracle&apos;s history'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3064691157026501809.post-1488888832079516852</id><published>2007-07-11T08:25:00.000-07:00</published><updated>2007-07-11T08:27:38.565-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Welcome to Oracle DBA Scripts Blog'/><title type='text'>Welcome to Oracle DBA Scripts Blog</title><content type='html'>Welcome to Oracle DBA Scripts Blog. Here you will find useful oracle database scripts to do your routine jobs. If you have any useful scripts then you can add it into this blog.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3064691157026501809-1488888832079516852?l=oracledbascripts.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbascripts.blogspot.com/feeds/1488888832079516852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3064691157026501809&amp;postID=1488888832079516852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1488888832079516852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3064691157026501809/posts/default/1488888832079516852'/><link rel='alternate' type='text/html' href='http://oracledbascripts.blogspot.com/2007/07/welcome-to-oracle-dba-scripts-blog.html' title='Welcome to Oracle DBA Scripts Blog'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
