3 Ways to Invoke / Open Vi Editor by ed Command in SQLPLUS

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Generally, SQLPLUS takes the default editor by the OS. You can bypass the OS default editor using following settings. There are 3 option to set vi as the editor for the sqlplus command. 

Option 1: 

define_editor=’vi’ - Temporary for each sqlplus session

 
SQL> define_editor='vi'
SQL> ed
Wrote file afiedt.buf

  1* select name from v$database

Option 2: 

Make above setting permanent for the sqlplus utility by adding settings in $ORACLE_HOME/sqlplus/ admin/glogin.sql file. Once you add this entry in glogin.sql file it will be affective for all the sessions.

 
vi $ORACLE_HOME/sqlplus/admin/glogin.sql
define _editor='vi'
advertisements
 
Option 3: 

Set the default edit as vi in the unix environment.

$ export EDITOR="vi"
$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Wed Feb 22 05:02:28 2017

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select name from v$database;

NAME
---------
ORCLTEST

SQL> ed
Wrote file afiedt.buf

  1* select name from v$database

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (578) General (60) Unix (47) Script (41) Blog (23) OCI (3) SQL* Loader (3) Datapump (2) Software (1)
DBA Tips
 

acehints.com Copyright 2011-21 All Rights Reserved | Site Map | Contact | Disclaimer