常用sqlplus 每次可能都要set pagesize \\set linesize \\set serveroutput很麻烦,sqlplus 允许每次启动都是会查找一个login.sql的文件自动格式化这些变量,从当前目录查找,也可以指定SQLPATH变量批定login.sql存放路径,这样从哪个目录进sqlplus都可以找到。
SQLPATH [SQL*Plus]
When an SQL script file (a file containing SQL statements) is executed with start, the file is searched in the current directory and the directory specified with the environment variable SQLPATH. (On Windows, it's also possible to specify these directory via the registry.
Starting SQL*PLUS
Whenever SQL*Plus is started, it looks for a file named login.sql in the directory specified with $SQLPATH and, if existant, executes it.
On Windows...
On Windows, there is also the possibility to set the SQLPATH in the registry:
HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\{oracle_home}\\SQLPATH
on linux
export SQLPATH=/xxxx
分享tom的设置,当然可以根据自己的使用习惯定义
---------login.sql--------------
define _editor=vi
set serveroutput on size 1000000
set trimspool on
set long 5000
set linesize 150
set pagesize 9999
column plan_plus_exp format a80
column global_name new_value gname
set termout off
define gname=idle
column global_name new_value gname
select lower(user) || '@' || substr( global_name, 1,
decode( dot, 0, length(global_name), dot-1) ) global_name
from (select global_name, instr(global_name,'.') dot from global_name );
set sqlprompt '&gname> '
set termout on
SQLPATH [SQL*Plus]
When an SQL script file (a file containing SQL statements) is executed with start, the file is searched in the current directory and the directory specified with the environment variable SQLPATH. (On Windows, it's also possible to specify these directory via the registry.
Starting SQL*PLUS
Whenever SQL*Plus is started, it looks for a file named login.sql in the directory specified with $SQLPATH and, if existant, executes it.
On Windows...
On Windows, there is also the possibility to set the SQLPATH in the registry:
HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\{oracle_home}\\SQLPATH
on linux
export SQLPATH=/xxxx
分享tom的设置,当然可以根据自己的使用习惯定义
---------login.sql--------------
define _editor=vi
set serveroutput on size 1000000
set trimspool on
set long 5000
set linesize 150
set pagesize 9999
column plan_plus_exp format a80
column global_name new_value gname
set termout off
define gname=idle
column global_name new_value gname
select lower(user) || '@' || substr( global_name, 1,
decode( dot, 0, length(global_name), dot-1) ) global_name
from (select global_name, instr(global_name,'.') dot from global_name );
set sqlprompt '&gname> '
set termout on
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




