How to change or modify the SQLPlus prompt?

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?
  1. Prompt with Username, Connect String/dbname and date
SQL> SET SQLPROMPT "_USER'@'_CONNECT_IDENTIFIER _DATE> "
SYS@prod10 22-JUN-11>
  1. Prompt with username only
SET SQLPROMPT "_USER>"
SYS>
  1. Prompt with Connection identifier/database name
SYS>SET SQLPROMPT "_CONNECT_IDENTIFIER>"
prod10>
  1. Prompt with critical identifications
SET SQLPROMPT "Producion Critical>"
Producion Critical>
DBA Tips Data Pump Reference

0 comments:

Post a Comment

 

dba topics. Copyright 2011-16 All Rights Reserved | Site Map | Contact | Disclaimer | Google