Oracle command line custom editor vi

Source: Internet
Author: User

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

 
 
  1. SQL> define_editor='vi' 
  2. SQL> col FILE_NAME for a45  
  3. SQL> col TABLESPACE_NAME for a10  
  4. SQL> col CURRENT_SCN for 999999999999  
  5. SQL> col TABLESPACE_NAME heading 'TBS_NAME'  
  6. SQL> select a.FILE_NAME,a.TABLESPACE_NAME,b.CURRENT_SCN from DBA_DATA_FILES a, v$database b where a.TABLESPACE_NAME='USERS';  
  7.  
  8. FILE_NAME                                     TBS_NAME     CURRENT_SCN  
  9. --------------------------------------------- ---------- -------------  
  10. +DATAGRP/db/datafile/users.259.686941969      USERS        73497665778  

-- Save the last SQL statement to the specified file me.

 
 
  1. sqlSQL> save me.sql  
  2. Created file me.sql  
  3. SQL>        
  4. SQL> host cat me.sql  
  5. select a.FILE_NAME,a.TABLESPACE_NAME,b.CURRENT_SCN from DBA_DATA_FILES a ,v$database b where a.TABLESPACE_NAME='USERS' 
  6. /  
  7. SQL>  

-- Enter the vi editor to modify the file me.

 
 
  1. sqlSQL> edit me.sql  
  2.  
  3. select a.FILE_NAME,a.TABLESPACE_NAME,b.CURRENT_SCN from DBA_DATA_FILES a ,v$database b where a.TABLESPACE_NAME='USERS' 
  4. /  
  5. ~  
  6. ~   

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.