ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 设置sqlplus环境

设置sqlplus环境

原创 Linux操作系统 作者:cc59 时间:2006-09-07 00:00:00 0 删除 编辑


一些初学者对于sqlplus的使用很是不方便,其实用得好,这个工具当然是首选.下面帖出一段login.sql的脚本以方便参照:

以下是我机器上的glogin.sql

[oracle@rac1 admin]$ vi glogin.sql

COLUMN ROWLABEL FORMAT A15

-- Used for the SHOW ERRORS command
COLUMN LINE/COL FORMAT A8
COLUMN ERROR FORMAT A65 WORD_WRAPPED

-- Used for the SHOW SGA command
COLUMN name_col_plus_show_sga FORMAT a24
COLUMN units_col_plus_show_sga FORMAT a15
-- Defaults for SHOW PARAMETERS
COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE

-- Defaults for SHOW RECYCLEBIN
COLUMN origname_plus_show_recyc FORMAT a16 HEADING 'ORIGINAL NAME'
COLUMN objectname_plus_show_recyc FORMAT a30 HEADING 'RECYCLEBIN NAME'
COLUMN objtype_plus_show_recyc FORMAT a12 HEADING 'OBJECT TYPE'
COLUMN droptime_plus_show_recyc FORMAT a19 HEADING 'DROP TIME'

-- Defaults for SET AUTOTRACE EXPLAIN report
-- These column definitions are only used when SQL*Plus
-- is connected to Oracle 9.2 or earlier.
COLUMN id_plus_exp FORMAT 990 HEADING i
COLUMN parent_id_plus_exp FORMAT 990 HEADING p
COLUMN plan_plus_exp FORMAT a60
COLUMN object_node_plus_exp FORMAT a8
COLUMN other_tag_plus_exp FORMAT a29
COLUMN other_plus_exp FORMAT a44

-- Default for XQUERY
COLUMN result_plus_xquery HEADING 'Result Sequence'
define_editor=vi
set serveroutput on size 1000000
set trimspool on
set long 5000
set linesize 200
set pagesize 9999
column plan_plus_exp format a30
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

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

上一篇: 设置安装autotrace
请登录后发表评论 登录
全部评论

注册时间:2007-12-21

  • 博文量
    132
  • 访问量
    286499