I often use sqlplus to perform my daily administrative tasks and i work on multiple servers that contain multiple databases, each database contains multiple accounts.
When connected to a database, i need to know my username and my database connection to reassure me that I point to the correct database in order to avoid errors that could be catastrophic.
To customize your sqlplus prompt
- Navigate to the directory $ORACLE_HOME/sqlplus/admin
- Create a file login.sql (or edit the file if it already exists) using vi on unix / Linux or notepad on windows
- SET SQLPROMPT '&_USER.@&_CONNECT_IDENTIFIER.> '
The next time you will login your sqlplus prompt will look like this : user@alias