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