RE: A Question Of SQLPLUS

RE: A Question Of SQLPLUS

 

  

You could have a "glogin.sql" in "%ORACLE_HOME%\sqlplus\admin" or
"$ORACLE_HOME/sqlplus/admin", plus have a "login.sql" in a directory defined
in your personal "%SQLPATH%" or "$SQLPATH" environment variable. That way
users can have a default for a given machine, and individuals can create a
personal version (i.e. in case they want their own NLS_DATE_FORMAT).

-----Original Message-----
From: Patterson Joel
[mailto:oracledba-ezmlmshield-x85016367.[Email address protected]
Sent: Friday, April 29, 2005 11:51 AM
To: LazyDBA Discussion
Subject: RE: A Question Of SQLPLUS


$ORACLE_HOME\sqlplus\admin

-----Original Message-----
From: henry Wollman
[mailto:oracledba-ezmlmshield-x82780188.[Email address protected]
Sent: Friday, April 29, 2005 11:46 AM
To: LazyDBA Discussion
Subject: RE: A Question Of SQLPLUS


Where is the glogin.sql file defined? I would like to set one up to
cover
initial login but have never heard of it before.

| Henry A.L. Wollman Rejoice and be glad!
|_____________________________________________________
| Moody Bible Institute, Database Administrator, [Email address
protected]| 820 N. LaSalle Blvd, Chicago, IL 60610 312-329-2291
|_____________________________________________________
-----Original Message-----
From: Pepling Todd C.
[mailto:oracledba-ezmlmshield-x95599432.[Email address protected]
Sent: Thursday, April 28, 2005 11:55 AM
To: LazyDBA Discussion
Subject: RE: A Question Of SQLPLUS

Could put this in a script called "set_prompt.sql" or cut and paste.

DEFINE v_DBNAME="?"
DEFINE v_USER="?"
DEFINE v_SID="?"
DEFINE v_HOST="?"
COLUMN v_DBNAME NEW_VALUE v_DBNAME NOPRINT
COLUMN v_USER NEW_VALUE v_USER NOPRINT
COLUMN v_SID NEW_VALUE v_SID NOPRINT
COLUMN v_HOST NEW_VALUE v_HOST NOPRINT

SELECT
SYS_CONTEXT('USERENV','DB_NAME') V_DBNAME
,USER V_USER
,SYS_CONTEXT('USERENV','SESSIONID') v_SID
,UTL_INADDR.GET_HOST_NAME v_HOST
FROM
DUAL
;

SELECT
LTRIM(SID) v_SID
FROM
V$SESSION
WHERE
AUDSID=SYS_CONTEXT('USERENV','SESSIONID')
AND
STATUS='ACTIVE'
;

SET SQLPROMPT "&v_HOST:&v_DBNAME:&v_USER(&v_SID)> "

UNDEFINE v_DBNAME
UNDEFINE v_USER
UNDEFINE v_SID
UNDEFINE v_HOST

-----Original Message-----
From: Poole David
[mailto:oracledba-ezmlmshield-x90891824.[Email address protected]
Sent: Thursday, April 28, 2005 12:42 PM
To: LazyDBA Discussion
Subject: A Question Of SQLPLUS


Hi

Anyone know if its possible to change the sqlplus prompt to reflect my
new
database connection? For example below you can see that I logged into
sqlplus as user 'user1' on database 'db1' on box 'box1', however if I
use
the connect command to change to 'user2' to database 'db2' the sqlplus
prompt does not change. I know the connection settings are picked up
whenever I log into sqlplus via the glogin.sql file however I do not
want to
keep logging in and out of sqlplus just to pick up the new connection
settings.

Thanks in advance

David

------------------------------------------------------------------
SQL*Plus: Release 9.2.0.1.0 - Production on Thu Apr 28 16:36:11 2005

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

[Email address protected] connect user2/[Email Address Removed] address protected]
----------------------------------------------------------------

Systems Operations, Thus Plc.
.
. . _
www.thus.net www.demon.net
email. david.[Email address protected]
internal. 740 4156
external. 0141 566 4156
mobile. 07880 502093


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
This email and any files transmitted with it are confidential and
intended
solely for the use of the individual or entity to whom they are
addressed.
If you have received this email in error please notify the system
manager.
This message contains confidential information and is intended only for
the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html



--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html



--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

Oracle LazyDBA home page