die Seilerwerks

Chronicling Life, Love, Linux and Oracle database administration.

Posts Tagged ‘sqlplus

TWO_TASK is actually still used.

without comments

You’ll have to forgive my obtuseness. I only ever log into my Oracle servers as “oracle” and am able to login locally with

$ sqlplus / as sysdba
or
$ sqlplus dts

So today I was a little scared when I couldn’t do this from an OS user other than oracle. The $ORACLE_SID variable was indeed set correctly. After quite a bit of hot Google action it turns out that sqlplus still uses the TWO_TASK environment variable. For some reason I had assumed it was deprecated and/or obsolete since I had never had to use it.

Sometimes it helps to step down from the mountaintop for a clearer view.

Written by Don Seiler

July 6, 2007 at 2:43 pm

Posted in Uncategorized

Tagged with ,

sqlplus commit-on-exit?

with 2 comments

ACHTUNG: Did you know that SQL*Plus issues a COMMIT when you exit? This has nothing to do with the AUTOCOMMIT setting, which will automatically commit after every statement in sqlplus.

If you issue a graceful exit (via the “exit” or “quit” command), sqlplus will always issue a commit. However, if you were to be ungracefully disconnected, for example by closing your terminal window, then PMON will issue a rollback like it does with any other disconnected session.

Here’s a small oracle-l thread about it as well. Google also turns up an Eddie Awad post on it. Of course it turns out that this is a documented “feature”:

“Regardless of the AUTOCOMMIT setting, changes are committed when you exit SQL*Plus successfully.”

Written by Don Seiler

January 9, 2007 at 9:42 pm

Posted in Uncategorized

Tagged with ,

set autotrace traceonly

without comments

For those few of you out there more newb than even me, this can make a huge difference. Easy explanation of the power of AUTOTRACE in SQL*Plus, via Tom Kyte. Basically quick and easy way to get query plan and statistical data.

This is usually a sign that you need a better index:

880637 consistent gets189017 physical reads

Written by Don Seiler

November 14, 2006 at 10:28 am

Posted in Uncategorized

Tagged with , , ,