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