Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Fixing a little problem in the login.sql script found in Tom Kyte's book

Re: Fixing a little problem in the login.sql script found in Tom Kyte's book

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Wed, 15 Jan 2003 09:10:08 -0000
Message-ID: <3e252572$0$227$ed9e5944@reading.news.pipex.net>


"FC" <flavio_at_tin.it> wrote in message
news:Ls_U9.40554$AA2.1857705_at_news2.tin.it...
>
> "Sybrand Bakker" <gooiditweg_at_sybrandb.demon.nl> wrote in message
> news:v4k82vci2t3jb2jn7qsf5op82dqoe7gble_at_4ax.com...
> > On Tue, 14 Jan 2003 14:19:41 GMT, "FC" <flavio_at_tin.it> wrote:
> >
> > >
> > >When you start SQL*Plus with /NOLOG,
> >
> >
> > you are expected to have a connect statement in your script.
> >
> >
> > Sybrand Bakker, Senior Oracle DBA
> >
>
> Sybrand,
> I am not sure to understand the objection.
> What if you are about to start the DB ?

The objection is that the script as provided by Tom is designed to set the prompt to the connected user, You are not so much fixing it as adding functionality to it. Bear in mind that the script was around before the days of using sqlplus to start the db. Incidentally your version is very similar to the one on the co-operative FAQ at www.jlcomp.demon.co.uk

Apologies to all who have seen this rant from me before. Consider the following sqlplus session. initially the prompt is correct.

niall_at_NL9IWK.US.ORACLE.COM>
niall_at_NL9IWK.US.ORACLE.COM> conn system_at_dev -- now connect to a dev instance Enter password:
Connected.
niall_at_NL9IWK.US.ORACLE.COM> -- prompt shows wrong global name niall_at_NL9IWK.US.ORACLE.COM> conn system/password_at_badname ERROR:
ORA-12154: TNS:could not resolve service name

Warning: You are no longer connected to ORACLE. niall_at_NL9IWK.US.ORACLE.COM> -- now the prompt shows both the wrong username and wrong global name.

In my view a prompt that shows incorrect information is more dangerous than one that shows you none. There are work arounds (like never type connect and/or write a sql script to allow db connections from within sqlplus) but none that give me a guarantee that I won't one day be sitting at a prompt that says

system_at_dev> drop user application_user cascade; user dropped.

when actually what happened was
system_at_live> drop user application_user cascade; Oops.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
Received on Wed Jan 15 2003 - 03:10:08 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US