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 (1)
- 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 (28)
- Security (2)
- Sharepoint (1)
- Space (6)
- Spfile (1)
- SQL Developer (1)
- SQL server (5)
- SQL*Net (4)
- Stats (4)
- Uncategorized (6)
- Windows (7)
- Wordpress (3)
Archives
- 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
- xnnc on Oracle Forms Dropdown List Item values populated from database table
- kelloggsville on ORA-38029 Object Statistics Are Locked – due to import with rows=n
- pawan on Cron fix for ulimit: max user processes: cannot modify limit:operation not permitted
- Adex on Fix for Oracle XE 1608: unable to create InstallDriver instance, return code -2147221164
- Shivaswamy on Oracle Data Guard Overview
Category Archives: Scripts
shell script to clean old oracle trace and log files
This code cleans up old trace files, log files, core dumps, etc. It is designed to be run from cron. It takes a somewhat brutal approach by deleting files after just 7 days – good for e.g. dev/test servers, but … Continue reading
Posted in Scripts
3 Comments
schema moves by the magic of partition exchange
Here’s an example of how to use partition exchange to move partitions or even entire unpartitioned tables from one schema to another. Is mean to be very fast and generate very little redo. Even more so if the partitions and … Continue reading
Posted in Performance tuning, Scripts, Space
1 Comment
Move script for ORA-03297: file contains used data beyond requested RESIZE value
Attempting to shrink files which have a lot of empty space can fail with this error: SQL> alter database datafile ‘/ora1data/TEST/TEST_ts_data1_f1.dbf’ resize 2g ; ORA-03297: file contains used data beyond requested RESIZE value Provided you can get an outage, one … Continue reading
Posted in Scripts
Leave a comment
Using tar with compress or gzip
1) To tar files up into a tarball: tar cvfp – file1 file2 file3 > tarfile.tar And to untar: tar xvfp tarfile.tar 2) Now, same thing but with compress added in: tar cvfp – file1 file2 file3 | compress > … Continue reading
Posted in Scripts
Leave a comment
Installing dbms_profiler
I used the following to install dbms_profiler, using a central set of system owned tables rather than each user having its own tables: conn / as sysdba @?/rdbms/admin/profload.sql conn system/password alter user system default tablespace users ; — [or any … Continue reading
Posted in Performance tuning, Scripts
Leave a comment
What SQL and sessions are running?
GUIs like TOAD and Enterprise Manager can show this better, but they’re not always to hand. Every session active now or within the last minute is shown. set pages 9999 lines 132 col username form a20 col osuser form a20 … Continue reading
Posted in Performance tuning, Scripts
3 Comments
Bug? with wrong results from all_objects in stored plsql procedures
Wouldn’t it be nice if sql code produced the same result, regardless of whether it is inside a stored procedure or is a standalone plsql block? But that’s not what happens when the all_ views are used. Run this code … Continue reading
Posted in Bugs, Scripts
3 Comments
10046 tracing in another session
To switch 10046 tracing on in another session (first setting on timed statistics and making max_dump_file_size very large): set pages 9999 verify off col serial new_value serial noprint select serial# serial from v$session where sid = &1 ; exec sys.dbms_system.set_bool_param_in_session(&1,&serial,’timed_statistics’,true) … Continue reading
Posted in Performance tuning, Scripts
Leave a comment
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