RE: Fw: OT - Getting fired for database oops

  • From: "Bobak, Mark" <Mark.Bobak@xxxxxxxxxxxx>
  • To: "jkstill@xxxxxxxxx" <jkstill@xxxxxxxxx>, Thomas Day <tomdaytwo@xxxxxxxxx>
  • Date: Thu, 21 May 2009 11:24:56 -0400

Jared,

Starting in 10g, you can do:
Set sqlprompt "_user'@'_connect_identifier> "

And it will stay up to date across multiple 'connect' operations.

Example:

pqrac201:[pqpep1]:(/home/oracle):$sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Thu May 21 11:22:25 2009

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters and Data Mining options


Session altered.

SYS@pqpep1> conn adds@prd1
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.
@> conn adds@prd1
Enter password:
Connected.

Session altered.

ADDS@prd1> conn mbobak@pep1
Enter password:
Connected.

Session altered.

MBOBAK@pep1>

Hope that helps,

-Mark
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Jared Still
Sent: Thursday, May 21, 2009 10:49 AM
To: Thomas Day
Cc: Joel.Patterson@xxxxxxxxxxx; gmei@xxxxxxxxxxxxxx; oracle-l@xxxxxxxxxxxxx
Subject: Re: Fw: OT - Getting fired for database oops

On Thu, May 21, 2009 at 6:57 AM, Thomas Day 
<tomdaytwo@xxxxxxxxx<mailto:tomdaytwo@xxxxxxxxx>> wrote:
...

SET SQLprompt "&db_name..&user_name> "
It doesn't reset the sqlprompt when I go to a new database.  What technique do 
you use?

As of 10.2.something I believe, login.sql is called automatically by
sqlplus when new connections are made.  Just tested on 10.2.0.4

When making a connection to a new database however, I always
logout.  Logging onto a database is handled by a shell script, so
it's just a matter of 'olog <dbname>'

There's different ways to handle this, but I long ago got into the habit
of exiting sqlplus and restarting it for new database connections.

Jared

Other related posts: