Suppose if are working on multiple environments at a time, there are chances of command execution mistakes like executing the development database commands to production sqlplus prompt. To avoid such kind of confusions, it is better to set the sqlplus command prompts in different.
Where you need to modify?
There is one file glogin.sql in $ORACLE_HOME/sqlplus/admin/directory. This file executes when you connect to the sqlplus. Modifing the glogin.sql file is the permanent way to make change for prompt. You can use below mentioned formats also to modify the prompt for temporarily.
What are the different formats?
- Prompt with Username, Connect String/dbname and date
SQL> SET SQLPROMPT "_USER'@'_CONNECT_IDENTIFIER _DATE> "
- Prompt with username only
SET SQLPROMPT "_USER>"
- Prompt with Connection identifier/database name
SYS>SET SQLPROMPT "_CONNECT_IDENTIFIER>"
- Prompt with critical identifications
SET SQLPROMPT "Producion Critical>"