Hi
You have already seen many post with the answer to this, but if you use
connect glogin.sql will not be run again.
I created a very basic script with a very short name and put it in the
directory where my SQL_PATH registry key points to. This script
does the connect (after prompting for the
Title: RE: SID on sqlplus prompt?
I use this as well but it only works going through Sqlplus. If you want to change connections while you are in sqlplus by entering sql Connect username@dbname, then the sid/username will not change on the sql prompt. To make the connection change show, add
If the db_name will do just as well you can use
sys_context('USERENV', 'DB_NAME') to obtain the database name and not have to
grant access to any of the v$ tables. There's also ora_database_name which is a
function that takes no arguments and returns db_name.domain_name Both of these
to:
Sent by: Subject: RE: SID on sqlplus prompt?
root@fatcity
I use this: glogin.sql file found in $OH/sqlplus/admin on the db server. hth.
gene
--
-- $Header: /plus/v3/spam/precious/files/ACTIVE/glogin.sql,v 1.6 1995/07/25 02:33:26
cjones Exp $
-- Copyright (c) Oracle Corporation 1988, 1994, 1995. All Rights Reserved.
--
-- SQL*Plus Global Login
How about something like this? Of course, it requires that the user have
select access to v$instance -- maybe there's another place to find this.
You could do some sort of batch to reference the $ORACLE_SID instead, but
the advantage of this is you can put it into glogin.sql or login.sql -- or