Source: http://www.adp-gmbh.ch/ora/sqlplus/login.html
Storing settings for SQL*PLUS (login.sql and glogin.sql) |
glogin.sqlWhenever SQL*PLUS starts up, it looks for a file named glogin.sql
under the directory $ORACLE_HOME/sqlplus/admin.
If such a file is found, it is read and the containing statements executed. This
allows to store settings (such as linesize
) accross
SQL*PLUS sessions.
New in Oracle
10g
: Oracle also reads glogin.sql and login.sql at a connect
in sql*plus.
login.sqlAdditionally, after reading glogin.sql, sql*plus also looks for a
file named login.sql
in the directory from where
SQL*PLUS was and in the directory that the environment variable SQLPATH
points to and reads it and executes it. Settings
from the login.sql take precedence over settings from glogin.sql
If the restriction level
is set to 3, the login.sql is not read.
A common login.sql fileset pagesize 0 set linesize 190 define _editor = gvim 10gSince Oracle 10g, the login.sql is executed after a connect
This allows to have a prompt that displays the username. For
that, the following line must be in the login.sql
:
set sqlprompt "&_user > " Related linksSee also the set store
command.
|
本文详细介绍了SQL*PLUS的初始化脚本glogin.sql和login.sql的使用方式,包括它们的作用、读取顺序及如何存储设置,特别强调了从Oracle 10g开始的读取顺序变化及新特性。

被折叠的 条评论
为什么被折叠?



