Common commands for Sql*plus
Connection command
1.conn[ect]
USAGE: Conn username/password @ NETWORK SERVICE name [as Sysdba/sysoper] when connecting with a privileged user, you must bring as SYSDBA or as Sysoper
2.disc[onnect]
Description: This command is used to disconnect from the current database
3.psssw[ord]
Note: This command is used to modify the user's password, and if you want to modify another user's password, you need to log in with Sys/system.
4.show User
Description: Displays the current user name
5.exit
Description: The command disconnects from the database and exits the Sql*plus
File Operations Command
1.start and @
Description: Run SQL script
Case: sql>@ d:\a.sql or Sql>start d:\a.sql
2.edit
Description: The command can edit the specified SQL script
Case: Sql>edit D:\a.sql, this will open the D:\a.sql file.
3.spool
Note: This command can output the contents of the Sql*plus screen to the specified file.
Case: Sql>spool d:\b.sql and input sql>spool off
Interactive commands
1.&
Note: You can override a variable, which needs to be entered by the user when it executes.
SELECT * from emp where job= ' &job ';
2.edit
Description: The command can edit the specified SQL script
Case: Sql>edit D:\a.sql
3.spool
Note: This command can output the contents of the Sql*plus screen to the specified file.
Spool D:\b.sql and enter spool off
Displaying and setting environment variables
Overview: Can be used to control the output of various formats, set show if you want to permanently save the relevant settings, you can go to modify the Glogin.sql script
1.linesize
Description: Sets the width of the display line, which is 80 characters by default
Show Linesize
Set Linesize 90
2.pagesize Description: Sets the number of rows displayed per page, default is 14
Usage is the same as linesize.
The use of other environmental parameters is similar
Basic use of Oracle-basic commands