Wednesday, May 03, 2006

Closing trace file with ORADEBUG

Was playing with ORADEBUG today and figured out a cool feature - you can actually close trace file using ORADEBUG CLOSE_TRACE. The only way I knew before was to shrink the file. So now after 10046 trace you don't need to restart the process to close trace file.

If your SMON, PMON, etc. Oracle process is dumping like crazy (kind of abnormal but who needs a DBA anyway if SMON is not dumping regularly?) - you can close this file and actually delete it without bouncing the instance. Never really dealt with Windoracle on that matter but I suspect that removing SMON's trace file, for instance, is not possible (it's locked) without stopping Oracle instance UNLESS one uses ORADEBUG CLOSE_TRACE.

How many times you got into situation when dump destination got full and someone (perhaps, you) cleaned it up using something trivial like 'rm *trc'? Out of those cases how often you noticed that several GB filesystem with single 100 KB alert.log file is still 99% full after "clean up" because SMON and/or whatever other backgroung processes keep inodes open? My bet is - at least 50%.

Now you need simple:
SQL> oradebug setospid
Statement processed.
SQL> oradebug close_trace
Statement processed.

Isn't that amazing? Just checked - it's available at least in 9iR2, 10gR1 and 10gR2.


At Tue May 09, 12:32:00 PM GMT+2, Blogger Laurent Schneider said...

Where did you dig that one? I thought I knew the commands to use in sqlplus ;-)

At Tue May 09, 01:04:00 PM GMT+2, Blogger Alex Gorbachev said...

Laurent, I will answer you question with my another favorit ORADEBUG option, which is.... ORADEBUG HELP ;-)


Post a Comment

Links to this post:

Create a Link

<< Home