Pages
Categories
Apex Audit Book review Bugs Character sets Database links Dataguard Email General musings Grid control Installs Linux Materialized views Old Oracle forms Performance tuning PL/SQL RAC Rman Scripts Security Sharepoint Space Spfile SQL*Net SQL Developer SQL server Stats Uncategorized Windows WordpressCategories
- Apex (1)
- Audit (1)
- Book review (2)
- Bugs (6)
- Character sets (6)
- Database links (2)
- Dataguard (1)
- Email (3)
- General musings (6)
- Grid control (2)
- Installs (10)
- Linux (16)
- Materialized views (2)
- Old (1)
- Oracle forms (4)
- Performance tuning (17)
- PL/SQL (4)
- RAC (6)
- Rman (10)
- Scripts (30)
- Security (3)
- Sharepoint (1)
- Space (6)
- Spfile (2)
- SQL Developer (1)
- SQL server (5)
- SQL*Net (4)
- Stats (4)
- Uncategorized (7)
- Windows (7)
- Wordpress (3)
Archives
- April 2012
- March 2012
- February 2012
- December 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- April 2009
- March 2009
- November 2008
- January 2008
- November 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
Recent Comments
- Shaikh Mujahid on Oracle Developer Suite 10g 9.0.4.0.1 windows software download media
- Ranjith on ORA-38029 Object Statistics Are Locked – due to import with rows=n
- Shaikh Mujahid on Oracle Developer Suite 10g 9.0.4.0.1 windows software download media
- Tom on Fix for TOAD error ORA-02404: specified plan table not found
- fayaz on Oracle Forms popup dialog alert box
Category Archives: Scripts
Clone a database
The below SQL generates a SQL script that can be used to clone a database, putting tablespaces into hot backup mode one at a time. Run it on the source database, and edit the output to specify new target file … Continue reading
Posted in Rman, Scripts
Leave a comment
Slow SQL report
Lists slow SQL in library cache for tuning investigations: set pages 9999 spool c.lst select elapsed_time/1000000 secs, executions, elapsed_time/1000000/greatest(executions,1) secs_per_exec, sql_text from v$sql where executions > 50 and elapsed_time/1000000/greatest(executions,1) > 1 order by 3 desc / spool off ed c.lst … Continue reading
Posted in Performance tuning, Scripts
Leave a comment
Using 10g datapump and scheduler to copy schemas
Update 13-Feb-07: Setting the datapump table_exists_action to replace does not overwrite views, sequences, plsql objects. They have to be dropped separately before datapump is called, see gotchas and code below. Update 02-Mar-07: dba_ views rather than all_ views have to … Continue reading
Posted in RAC, Scripts
7 Comments
Identify what auditing is on
Suspect too much auditing is on on a database? This script will show you what auditing is on: set pages 9999 select * from DBA_STMT_AUDIT_OPTS ; select * from DBA_PRIV_AUDIT_OPTS ; set termout off lines 192 spool 1.tmp select * … Continue reading
Posted in Audit, Scripts
Leave a comment
Pre 9202/9014: Advanced queuing runs away with server memory.
Using the below memory listing script, I found two databases with large PGAs. That was strange since pga_aggregate_target was unset, sort_area_size was just 64k, and there were very few sessions. Checking PGA at session level showed the QMN sessions had … Continue reading
Posted in Bugs, Scripts
Leave a comment
Tablespace space with sm$ views + database level space
The sm$ views are an easy way of seeing tablespace space usage. There is also an sm$ts_free view. set pages 9999 col tot_mb form 999,999 col use_mb form 999,999 col pct_used form 999 select t.tablespace_name, t.bytes/1024/1024 tot_mb, u.bytes/1024/1024 use_mb, 100*u.bytes/t.bytes … Continue reading
Posted in Scripts, Space
Leave a comment
rman crosscheck archivelog all
If archived redo logs are (wrongly) deleted/moved/compressed from disk without being backed up, the rman catalog will not know this has happened, and will keep attempting to backup the missing archived redo logs. That will cause rman archived redo log … Continue reading
Posted in Rman, Scripts
4 Comments
Is database using pfile (init.ora), or spfile?
Very useful SQL, from Tom Kyte: select decode(count(*), 1, ‘spfile’, ‘pfile’ ) from v$spparameter where rownum=1 and isspecified=’TRUE’ ; If it it using an spfile, an easy way to see the parameters is to generate an init.ora copy: SQL> conn … Continue reading
9i unix startup / shutdown with listener password
Thanks to Laurent Schneider for tips on how to handle listener passwords in scripts. [Update 12-Jan-2007 - ammended script following Laurent's comment, and update 09-Feb-2007 - ammended script following Kevin's comment] A system startup/shutdown shell script I just used that … Continue reading
Posted in Installs, Scripts, SQL*Net
6 Comments
Script run against every running database, listing total oracle memory (sga+pga)
This shell script runs against every database that is up and running (has an entry in the ps list). Which I think is better than searching through oratab (since not all of those may be up and running, esp. on … Continue reading
Posted in Performance tuning, Scripts
1 Comment