"Turn" Oralce basic-sqlplus tools using the rites eight 2017-12-20 20:22:45

Source: Internet
Author: User
Tags sqlplus

Original address: https://www.toutiao.com/i6501603661565657614/

One, database connection:

Sqlplus [user_name[/password][@ host_string]]

. user_name the user name of the specified database

. Password the password for the specified data user name

. host_string specify the database to connect to

#登录方式:

1.sqlplus/nologging

Connect Sys/oracle as Sysdba

2.windows Login: Sqlplus "/as sysdba"

Linux login: Sqlplus '/as sysdba '

Login to Oracle's Sqlplus

Second, view the database status

Select Name,open_mode from V$database;

Select Instance_name,status from V$instance;

Third, database startup:

Startup archive Start

Startup Mount non-archive start

Startup Nomount control file is missing, use this command

Startup start Database order: Launch the instance, open the control file, open the data file.

Iv. Database shutdown:

Normal shutdown: shutdown immediate;

In case of natural disaster or fire, emergency shut down database: Shutdown abort;

To view Oracle database version information:

SELECT * from V$version;

The command information that is built into the sqlplus is called:

Help Index

Help information for the SET command

? SET

Once the session is closed, the Sqlplus retention command is released.

#list View the historical SQL command:

1. Set the input format

SET Sqlblanklines on

SET PAGESIZE 100

SET WRAP OFF

SET Linesize 200

SELECT ' DROP talbe ' | | ' ' | | table_name| | ' ' | | '; '

From User_tables;

Bulk generate delete data table syntax

2. Change the command in the buffer

c/n/m

List

/

3. Save Buffer Command

Linux:save/backup/text. Txt

Windows:save E:backuptext. Txt

4. View the saved commands

GET E:backuptext. Txt

5. Load and run the command

/or START E:backuptext. TXT OR @ e:backuptext. Sql

"Turn" Oralce basic-sqlplus tools using the rites eight 2017-12-20 20:22:45

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.