How to setup SQL*Plus prompt
top of page
  • Admin

How to setup SQL*Plus prompt

For this, it is most convenient to use the glogin.sql file, since the specified script is executed when sqlplus is started.The script is located in the directory .\sqlplus\admin\ (Windows) or ./sqlplus/admin/ (Linux)

Changing the prompt is done by executing the command


set sqlprompt ''

Examples:

How to display instance name instead of sqlplus

column instance_name new_value iname

select instance_name from v$instance;
set sqlprompt '&iname> '

How to display the instance name and the username under which the connection was made instead of sqlplus



column instance_name new_value iname

select instance_name || ':' || user  instance_name from v$instance;
set sqlprompt 'TEST: &iname> '


Changing the SQLPLUS prompt is useful as an additional mechanism to alert administrators about the role of the database, i.e.adding hints "TEST", "PROM" clearly indicates the need to work with the database more attentively

21 views0 comments
bottom of page