Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: instance name in SQL Plus prompt?
Hi Dan,
try this :
SET FEEDBACK OFF
SET TERMOUT OFF
SET HEADING OFF
COL user_name NEW_VALUE mc_user_name
COL db_name NEW_VALUE mc_db_name
SELECT LOWER ( user ) user_name,
LOWER ( SUBSTR( global_name,1,(INSTR(global_name,'.',1,1)-1)))
db_name
FROM global_name;
SET SQLPROMPT '< &mc_user_name:&mc_db_name > '
SET TERMOUT ON
SET FEEDBACK ON
SET HEADING ON
Put in your login.sql or write to another script which is called by the
login.sql.
Every time you the SQL*Plus the login is running.
But the login.sql is not called if do 'connect scott/tiger' or others
connect in a SQL*Plus session. The login.sql is NOT called
and the prompt is not changed, so after a connect you have to call the
script above or you write a little script that do the connect
and then calls the login.sql
HTH
Kay
Daniel A. Morgan <dmorgan_at_exesolutions.com> schrieb in im Newsbeitrag: 3B0DFC51.615A694F_at_exesolutions.com...