设置SQL PLUS环境

参考Oracle Database 9i/10g/11g编程艺术一书:

login.sql代码如下:

define _editor=vi
set serveroutput on size 1000000
set trimspool on
set long 5000
set linesize 700
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

win7  oracle环境变量 SQLPATH 在注册表中:

HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb11g_home1\SQLPATH

"SQLPATH"="E:\\MyOracle\\oracle\\product\\11.2.0\\dbhome_1\\dbs"

将login.sql 放在SQLPATH指定目录下,然后重新执行sql plus即可:

C:\>sqlplus / as sysdba

sql plus提示符变为:

sys@orcl> 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。