自定义sqlplus登录过后的sqlprompt

在任意一个目录下新建一个一个login.sql

比如:

E:\oracle-study

输入内容:

define _editor=sublime_text
set serveroutput on size 1000000
set trimspool on
set long 5000
set linesize 100
set pagesize 9999
column plan_plus_exp format a80




set time on


set termout off  
column propmt_q new_value propmt_q
select upper(user)||'@'|| instance_name||'('||host_name||')' as propmt_q from v$instance;
set sqlprompt '&propmt_q> '


保存过后新建一个环境变量:SQLPATH= E:\oracle-study

然后通过sqlplus登录

失败:ora-12560

google之:

再添加一个环境变量:ORACLE_SID=ORCL

重新登录:效果是

D:\app\wujiahua\product\11.2.0\dbhome_1\RDBMS\ADMIN>sqlplus


SQL*Plus: Release 11.2.0.1.0 Production on 星期三 1月 16 22:22:21 2013


Copyright (c) 1982, 2010, Oracle.  All rights reserved.


请输入用户名:  system
输入口令:


连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


22:22:40 SYSTEM@orcl(WJH-PC)>
22:22:44 SYSTEM@orcl(WJH-PC)>
22:22:51 SYSTEM@orcl(WJH-PC)>
22:22:51 SYSTEM@orcl(WJH-PC)>


标红部分表示定制成功:


你可能感兴趣的:(oracle,定制sqlprompt)