Two sqlplus common commands-Basic version

Source: Internet
Author: User
Tags sqlplus

1. Connecting Conn

1.1 Login to the system with Oracle user, enter Sqlplus environment, log in Administrator mode

1Oracle@yas:~>Sqlplus/Nolog2Sql*Plus:release11.2.0.1.0Production onTue Feb2  -: -: +  .3Copyright (c)1982, the, Oracle. Allrights reserved.4Sql>ShowUser;5 USER  is ""6Sql>Conn/  asSYSDBA7 Connected.8Sql>ShowUser;9 USER  is"SYS"

1.2 Normal USER Login conn User/password

1 SQL> conn T1/T12Connected. 3 SQL>user; 4 USER  is "T1"

2. Disconnect Disc

1 SQL>  disc2fromDatabase11.2. 0.1. 0 - 3bit  Productionwith andReal Application Testing Options

3. Change Password PASSW

1 SQL>  passw2 for T13oldpassword:                                  #输入原密码  4new password:                                  #新密码 5Retype New password:                           #再输入一次新密码      6 Password changed   

4. Show the current user show users;

1 SQL> conn T1/T12Connected. 3 SQL>user; 4 USER  is "T1"

5. Exit the exit port connection to the current database and exit Sqlplus

1 SQL>exit2fromDatabase11.2. 0.1. 0 - 3bit  Productionwith andReal Application Testing Options

6. View the database version

1Sql> Select *  fromv$version;2 3 BANNER4 --------------------------------------------------------------------------------5OracleDatabase11g Enterprise Edition Release11.2.0.1.0 -64bitProduction6Pl/SQL Release11.2.0.1.0 -Production7CORE11.2.0.1.0Production8Tns forLinux:version11.2.0.1.0 -Production9Nlsrtl Version11.2.0.1.0 -Production

7. Start/Close instance, open is startup, shut down why is shutdown immediate? The normal shutdown time is longer.

Shutdown--normal shutdown (waits for all users to disconnect before shutting down)

Shutdown immediate--Recommended (force the user to disconnect immediately after executing the current SQL)

Sql> shutdownImmediateDatabaseclosed.Databasedismounted. ORACLE instance shut down. SQL>Startuporacle instance started. Total System Global Area576221184bytesfixed Size2215464bytesvariable Size432013784bytesDatabaseBuffers138412032Bytesredo Buffers3579904bytesDatabasemounted.DatabaseOpened.

8. View executed commands list\l Here is the only one because the database has just been restarted.

1 SQL>  l2   1*Select from V$session

Two sqlplus common commands-Basic version

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.