Thursday, November 5, 2015

SQL Plus || Changing the Prompt to show connected user and database

Amend your $ORACLE_HOME\sqlplus\admin\glogin.sql script - add:
set sqlprompt "_user '@' _connect_identifier > "
to the end of the file.
In Oracle 10g this will change correctly each time you issue a "conn". For clients before 10g it won't change when you do a "conn" but will remain as the username/db you first connected to.
You can also use _date for the current date and _privilege for the privilege (eg SYSDBA) of the connected user.

No comments: