oracle

Returning Error Codes from SQLPLUS

There may come a time when you need to return an error code from SQLPlus, either to a calling batch file, shell script, or Perl script.

SQLPlus has a WHENEVER directive available for handling errors it encounters. This command controls the behavior of SQLPlus when an OS or SQL error occurs. There are many options for this behavior.

More after the jump…

SQL errors include errors thrown by a single command entered into SQLPlus or an error raised by a PL/SQL block:

Make your own Long Running Operation

Did you know you can make your own Long Running Operation that is available to the V$SESSION_LONGOPS system view?

At the bottom of the Oracle documentation for DBMS_APPLICATION_INFO is some example code: http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_appinf.htm#i999254

In a previous post I posted Perl source code for a script that monitors V$SESSION_LONGOPS and reports progress of all current long operations: TODO

– Dave

1ZO-031 down, two to go…

So I'm 60% of the way to my 9i OCP now. I passed 1ZO-031 today. I already had the 1ZO-007 test and a hands-on class under my belt.

So far I've been using the Certification Candidate Guide, Oracle Press books and of course the Oracle documentation. For my next two exams I got some Sybex books cheap off of Amazon.com that I'll be checking out.

Tags: 

Like the v$session_longops progress bar in OEM? You'll love this…

One of the redeeming qualities of the Java Oracle Enterprise Manager client is the progress bar that comes up when you are viewing the long operations of a session. I wanted this functionality but didn’t want to wake up the big lug to get this info (it takes a long time to start up the OEM client and navigate to the screen to see the long operations progress bar).

So I decided to write a short script to emulate that functionality but take it one step further and show me info about _all_ the longops currently running on an instance.

otop , a 'top' utility for Oracle

I recently discovered that someone else is publishing some Perl utilities to monitor Oracle!

I've been using Perl to get things done with Oracle for a while and have found it extremely helpful. The current environment that I work in has a mixture of OSes so sometimes its easier to install Perl and DBI everywhere and write a simple Perl Script than to try to do something in DOS Batch for one client and then do it again in a bash shell script for another.

Sean Hull published a video of his talk about otop, the PowerPoint slides, and the downloadable source on his company's site:

Oracle imp utility COMMIT parameter and LOBS…

If you have a lot of LOB data to move around with Oracle import/export utilities this might help you out. The default for the COMMIT parameter is No.

COMMIT=N : For tables that have a LOB column, commit is performed after loading each table
This is much faster but be aware that you will use more Rollback space since each table will be committed in one large transaction.

COMMIT=Y : For tables that have a LOB column, commit is performed after each row (slow!, much overhead added because so many transactions are used to import the data)

Using SQLPLUS to generate scripts…

Tired of updating scripts by searching and replacing until your fingers fall off? Have a SQL statement you have to run against every table in your schema?

Next to Regular Expressions, this is one of the most useful tools in my arsenal.

Common uses for this are to write SQL statements that can work from a list of objects in the database:

Pages

Subscribe to oracle