Sqlplus Common Commands

Source: Internet
Author: User
Tags sqlplus

1. Program runs-----Sqlplus

Landing ordinary users: scott/brant;
General Administrator user login: system/brant;
Advanced Admin User login:
1> switch to other users:sql> Conn sys/brant as SYSDBA; (Switch to advanced Admin user)
2> re-landing: Sqlplus sys/brant as SYSDBA;

Switch back to the normal account again:
Conn Scott/brant;
Conn System/brant;
Conn Sys/brant as SYSDBA;

View current users: Show user;

Test:
1>conn scott/brant;
2> Set line display maximum value: Set Linesize 300;
3> set maximum number of pages: set pagesize 30;
4>select * from EMP;

If query under Administrator account, then: SELECT * from Scott.emp;

2. Use the commands in Notepad:
1> Ed A; (This will pop up a window that creates Notepad, a notepad name, and a Notepad entry: SELECT * from EMP)
2> Ed A; (You can call out Notepad again to modify it)
3> @a; (Execute the command in Notepad)

4> executes a local TXT file, such as a file D:\demo content: SELECT * from EMP;

@d:\demo.txt or @d:demo.txt

5> Execute local D-disk SQL file (demo.sql)

@d:demo.sql or @d:demo

6> Querying All tables: select * from Tab;

7> View table structure: DESC EMP;

8> command "/": Represents the command to continue the previous step.

9> Data type:

Number (4): digit, length 4;

VARCHAR2 (10): A string representing a length of 10

Date: Represents the day.

VARCHAR2 (7,2) represents a number: a string of 7 bits, an integer 5 bits, and a decimal 2 bits.

Sqlplus Common Commands

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.