How to customize your SQL * plus Environment

Source: Internet
Author: User
How to customize your SQL * plus environment. SQL * plus is simple, powerful, and ubiquitous. What does SQL * plus mainly do? SQL * plus automatically runs glogin. SQL

How to customize your SQL * plus environment. SQL * plus is simple, powerful, and ubiquitous. What does SQL * plus mainly do? SQL * plus automatically runs glogin. SQL

SQL * plus is simple, powerful, and ubiquitous. What does SQL * plus mainly do?

1) autotrace

2) Programming

SQL * plus automatically runs glogin. SQL, which contains the global default settings. You can customize your SQL * plus environment as needed.

1) First, define an environment variable sqlpath in the system environment settings, and set your own environment scripts login. SQL and connect. SQL.
Put them in the SQLPATH directory.

2) define a login. SQL script, which is automatically executed when SQL * PLUS is enabled.

3) define a script connect. SQL, which is called during identity switching.

To implement this login. SQL script, we need to master some basic SQL * plus knowledge first.

Reminder: you do not have to remember too many commands.
A] help index
B] help command
When these two steps are combined, the friendly SQL * plus will tell you.
1) execute an SQL script
@
@: Execute the nested script. It indicates that the nested script and the host are in the same directory.
Exercise:
Scripts think. SQL and sub_think. SQL are available under $ Oracle_HOME/dbs.
Think. The content of SQL is: @ sub_think. SQL
Then we can execute:
@ $ ORACLE_HOME/dbs/think. SQL
2) edit the current input.
Edit
Generally, the DML, DDL, and DCL statements are SQL * plus statements. After execution, they are saved in the memory area of the SQL buffer, and only one recently executed SQL statement can be saved.
3) re-run the statement in SQL buffer
/
4) output the displayed content to the specified file
Spool filename
/* Anything you do in SQL * plus */
Spool off
Then you can view it in the file path.
5) col command
A] Change the default Column Title
COL default Column Title HEADING Custom column title

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.