sqlplus environment $SQLPATH login.sql
常用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
目前这篇文章有4条评论(Rss)评论关闭。