Oracle primary users and some common commands

Source: Internet
Author: User

Oracle The main users:

L Super admin: Sys

L General Administrator: System

L General Users: Scott

SQLPLUSW Some of the common commands :

L Set line Display quantity: Set linesize length

L settings also show quantity: Set pagesize length

L Ed and @ instructions

L Connection: Conn username/password as SYSDBA

If you forget the user password:

Win+r run cmd;

Run Sqlplus/nolog

Sql>connect/as SYSDBA

Sql>alter user Scott identified by Oracle123 (Modify password Oracle123 for Scott users)

Sql>alter user Scott account unlock (Scott users unlocked)

Query instructions:

SELECT * from EMP;

Set the length of each line display:

Set Linesize ;

Set the number of rows to display per page:

Set pagesize 100;

Connecting Users:

Conn username/password [as Sysdba|sysoper]

For example, if you are connecting to a Super Administrator (SYS), you must write as SYSDBA at the end of the connection:

Conn Sys/change_on_install as Sysdba

SYS user accesses the EMP table under the Scott User:

SELECT * FROM ScottEMP;

To query the currently connected User:

Show user;

Get all the table names in a database:

SELECT * from tab;

To view the EMP table structure:

DESC EMP;

There are several main types of columns in the type:

Number (4): Represents the digit, the length is 4;

Number (7,2): represents numbers, where decimals account for 2 bits, integers are 5 bits, and total length is 7;

VARCHAR2 (10): Represents a string that can hold only 10 lengths;

Date: Represents the day;

You can enter a "/" in SQLPLUSW to represent the operation of repeating the previous statement.

Sql> Ed DB

Click "Yes".

Fill in the command in Notepad, save as *.sql

Commands can be executed by means of the @ file name, or by the @ path.

Sql> @db

Note: If you do not enter the suffix name when executing the *.sql file, if it is txt you need to enter the suffix. txt.

Oracle primary users and some 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.