When using Sqlplus, we can set the default behavior of Sqlplus by two profiles: Glogin.sql and Login.sql.
Glogin.sql called Global SITE Profile, located in the $oracle_home/sqlplus/admin directory, Login.sql called user profile, is located in the current path of the users, or under the path specified by the SQLPATH environment variable.
When the user starts Sqlplus or executes the conn command under Sqlplus, Sqlplus first calls the Glogin.sql file, then looks for the Login.sql file under the current path, and if Login.sql is not found, looks for the SQLPath file under the path and subpath specified by Login.sql.
For example, you can use the Login.sql file to configure Sqlprompt values.
[Oracle@oadata ~]$ ls-l | grep login.sql
-rw-r--r--1 Oracle oinstall 134 09-17 14:16 login.sql
[oracle@oadata ~]$ cat Login.sql
Set Termout off
column user_name new_value username
Select lower (user) user_name from dual;
Set sqlprompt ' &username> '
set termout on
[oracle@oadata ~]$ sqlplus easy/easy
sql*plus:release 11.2.0.3.0 Production on Tue Sep 14:18:53 2013
Copyright (c) 1982, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition release 11.2.0.3.0-64bit Production with the
partitioning , OLAP, Data Mining and real application testing options
Easy>select user from dual;
USER
------------------------------
Easy
easy>
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/