Common commands in Oracle

Source: Internet
Author: User

Sqlplus is a common development tool for Oracle databases. Common commands in sqlplus are as follows.

1. Connection command

(1). Conn [ect]

Usage: conn username/password @ network service name [as sysdba/sysoper]. When connecting with a privileged user identity, you must include as sysdba or as sysoper.

(2). Disc [onnect]

Note: This command is used to disconnect from the current database.

(3). psssw [ord]
Note: This command is used to modify the password of a user. If you want to change the password of another user, You need to log on to the system using sys/system.

(4). Show user

Description: displays the current user name.

(5). Exit

Note: This command will disconnect the database and exit SQL * Plus.

 

2. File Operation commands

(1). Start and @

Run the SQL script.
Case: SQL> @ D:/a. SQL or SQL> Start D:/a. SQL.

(2). Edit

Note: You can edit the specified SQL script.
Case: SQL> edit D:/a. SQL. This will open the file D:/a. SQL.

(3). Spool
Note: This command can output the content on the SQL * Plus screen to a specified file.
Case: SQL> spool D:/B. SQL and enter SQL> spool off.

3. Interactive commands
(1 ).&
Note: This variable can be used as an alternative, and must be input during execution.
Select * from EMP where job = '& job ';

4. Display and set Environment Variables
Overview: Set show can be used to control various output formats. If you want to permanently save related settings, you can modify the glogin. SQL script.
(1). linesize
Description: sets the display line width. The default value is 80 characters.
Show linesize
Set linesize 90
(2). pagesize

Note: set the number of rows displayed on each page. The default value is 14.
The usage is the same as linesize.
The usage of other environment parameters is similar.

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.