定制sql*plus的几条命令

sql*plus每次启动前会执行$ORACLE_HOME/sqlplus/admin/login.sql (glogin.sql)文件,修改该文件内容可以在每次进入sql*plus是进入自己定制的模式中。[@more@]

一个glogin.sql文件例子:

set serveroutput on size 100000

set trimspool on
set long 5000
set linesize 100
set pagesize 9999
column plan_plus_exp format a80

column global_name new_value gname
set termout off
select lower(user)||'@'||decode(global_name,'ORCL.US.ORACLE.COM','ORCL',global_name) global_name from global_name;
set sqlprompt '&gname>'
set termout on

进入sql*plus时,界面如下(各set/column命令不逐条解释):

U:>sqlplus scott/tiger

SQL*Plus: Release 9.2.0.1.0 - Production on 星期二 2月 1 20:56:01 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


连接到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

scott@ORCL>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/207/viewspace-789148/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/207/viewspace-789148/

你可能感兴趣的:(定制sql*plus的几条命令)