注解:sqlplus是oracle自带的客户端字符管理工具,使用方便快速.但是经常需要对该工具的一些环境进行设置,不错,我们可以在使用的时候临时设置,可是我总觉得这很麻烦!所以就谷歌了一下,知道如何对环境,如linesize、pagesize、serveroutput等进行长久设置。
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Oct 19 11:19:29
2011
Copyright (c) 1982, 2005, Oracle. All rights
reserved.
Connected to an idle instance.
SQL> startup open;
ORACLE instance started.
Total System Global Area 734003200 bytes
Fixed
Size 1221564 bytes
Variable
Size 197135428 bytes
Database
Buffers 532676608 bytes
Redo
Buffers 2969600 bytes
Database mounted.
Database opened.
SQL> set linesize 100;
SQL> set pagesize 200;
SQL> set serveroutput on;
SQL> set autotrace on statistics
SQL> exit
SP2-0620: Error while disconnecting
Disconnected from Oracle Database 10g Enterprise Edition Release
10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Oct 19 11:29:00
2011
Copyright (c) 1982, 2005, Oracle. All rights
reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 -
Production
With the Partitioning, OLAP and Data Mining options
SQL> SQL>
SQL>
SQL> show linesize;
linesize 80
SQL> show pagesize;
pagesize 14
SQL> show serveroutput;
serveroutput OFF
SQL> show autotrace;
autotrace
OFF 设置完了后,退出sqlplus的话,刚才的设置显然失效!!!!
[root@oracle ~]# vim
/myoracle/product/10.2.0/db_1/sqlplus/admin/glogin.sql 修改该文件,永久生效。注意:glogin.sql是在你的安装目录。。。。。省略。。。。
set linesize 100
set pagesize 100
set serveroutput on
set autotrace on statistics
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Oct 19 11:30:56
2011
Copyright (c) 1982, 2005, Oracle. All rights
reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 -
Production
With the Partitioning, OLAP and Data Mining options
SQL> show linesize
linesize 100
SQL> show serveroutput;
serveroutput ON SIZE UNLIMITED FORMAT WORD_WRAPPED
SQL> show autotrace;
autotrace ON STATISTICS