The importance of Oracle command line for Oracle databases is self-evident. The following describes the Oracle command line custom editor vi, which is helpful for you to learn about Oracle command line.
Oracle command line custom editor vi:
For example, let's take the definition editor vi in sqlplus as an example to edit and save the file as follows:
-- Oracle command line definition editor is vi
- SQL> define_editor='vi'
- SQL> col FILE_NAME for a45
- SQL> col TABLESPACE_NAME for a10
- SQL> col CURRENT_SCN for 999999999999
- SQL> col TABLESPACE_NAME heading 'TBS_NAME'
- SQL> select a.FILE_NAME,a.TABLESPACE_NAME,b.CURRENT_SCN from DBA_DATA_FILES a, v$database b where a.TABLESPACE_NAME='USERS';
-
- FILE_NAME TBS_NAME CURRENT_SCN
- --------------------------------------------- ---------- -------------
- +DATAGRP/db/datafile/users.259.686941969 USERS 73497665778
-- Save the last SQL statement to the specified file me.
- sqlSQL> save me.sql
- Created file me.sql
- SQL>
- SQL> host cat me.sql
- select a.FILE_NAME,a.TABLESPACE_NAME,b.CURRENT_SCN from DBA_DATA_FILES a ,v$database b where a.TABLESPACE_NAME='USERS'
- /
- SQL>
-- Enter the vi editor to modify the file me.
- sqlSQL> edit me.sql
-
- select a.FILE_NAME,a.TABLESPACE_NAME,b.CURRENT_SCN from DBA_DATA_FILES a ,v$database b where a.TABLESPACE_NAME='USERS'
- /
- ~
- ~
Implementation of oracle command line Logon
How to add tablespaces in ORACLE
Syntax for creating views in Oracle
Create tables and indexes in Oracle
Implementation of oracle re-Indexing