Windows
安装完以后,默认输入SQL> ed 则调出记事本,原因如下_EDITOR = "Notepad"
SQL> define
DEFINE _DATE = "23-11月-10" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "win" (CHAR)
DEFINE _USER = "SYS" (CHAR)
DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1002000100" (CHAR)
DEFINE _EDITOR = "Notepad" (CHAR)
DEFINE _O_VERSION = " Oracle Database 10g Enterprise Edition Release 10.2.0.
1.0 - Production
With the Partitioning, OLAP and Data Mining options" (CHAR)
DEFINE _O_RELEASE = "1002000100" (CHAR)
DEFINE _RC = "1" (CHAR)
DEFINE _DATE = "23-11月-10" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "win" (CHAR)
DEFINE _USER = "SYS" (CHAR)
DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1002000100" (CHAR)
DEFINE _EDITOR = "Notepad" (CHAR)
DEFINE _O_VERSION = " Oracle Database 10g Enterprise Edition Release 10.2.0.
1.0 - Production
With the Partitioning, OLAP and Data Mining options" (CHAR)
DEFINE _O_RELEASE = "1002000100" (CHAR)
DEFINE _RC = "1" (CHAR)
而在Linux下默认则为 _EDITOR = "ed" (CHAR),下面我们把默认的
编辑器设置为vi或vim
[oracle@rhel5 admin]$ vi $ORACLE_HOME/sqlplus/admin/glogin.sql
在文件的末尾添加
DEFINE _EDITOR = "vi"
或
DEFINE _EDITOR = "vim"
在文件的末尾添加
DEFINE _EDITOR = "vi"
或
DEFINE _EDITOR = "vim"
例如:
[oracle@linux ~]$ cat $ORACLE_HOME/sqlplus/admin/glogin.sql
--
-- Copyright (c) 1988, 2005, Oracle. All Rights Reserved.
--
-- NAME
-- glogin.sql
--
-- DESCRIPTION
-- SQL*Plus global login "site profile" file
--
-- Add any SQL*Plus commands here that are to be executed when a
-- user starts SQL*Plus, or uses the SQL*Plus CONNECT command.
--
-- USAGE
-- This script is automatically run
--
DEFINE _EDITOR = "vim"
[oracle@linux ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on 星期二 6月 26 01:21:48 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> conn u1/u1
已连接。
SQL> define
DEFINE _DATE = "26-6月 -12" (CHAR)
DEFINE _CONNECT_IDENTIFIER = "orcl" (CHAR)
DEFINE _USER = "U1" (CHAR)
DEFINE _PRIVILEGE = "" (CHAR)
DEFINE _SQLPLUS_RELEASE = "1102000100" (CHAR)
DEFINE _EDITOR = "vim" (CHAR)
DEFINE _O_VERSION = "Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options" (CHAR)
DEFINE _O_RELEASE = "1102000100" (CHAR)
SQL> ed
SP2-0107: 无须保存。
SQL> select * from dual;
D
-
X
SQL> ed
已写入 file afiedt.buf
select * from dual
/
~
~
~
1* select * from dual
SQL> /
D
-
X