Introduction to oracle SQL * PLUS 1: sqlplusSQL * PLUS is an interactive and batch query tool. It is the most basic oracle database utility and uses a basic command line interface, it is usually used by users, administrators, and program developers. Use sqlplus to send commands to the oracle server for execution. 2: Command type 1: SQL statement 2: PL/SQL Block 3: SQL * Plus internal commands, for example, the parameter control command set, environment Monitoring command show4: comments Note 5: External command, prefix is! A script can contain the preceding content. If SQL commands are sent, use SQL Engine in the background to process PL/SQL commands, use the PL/SQL Engine ORACLE_HOME of the oracle object to define the location where the oracle software is installed and suitable for storing SQLPLUS files. ORACLE_SID is required by oracle server and not required by SQL/PLUS. PATH: In the oracle_home/bin PATH, TNS_ADMIN is the tnsnames that sqlPlus needs to connect to the remote server. ora is used to specify the path of the file. SQLPATH defines the path where the SQL script is located. If no path is specified, find the corresponding script in the current path. If not, run the script in SQLPATH. 3: sqlplus command parameter: option parameter:-H display help,-V display sqlplus version-SILENT used in script, not display sqlplus help information: [SQL] C: \ Windows \ system32> sqlplus-h; SQL * Plus: Release 11.1.0.6.0-Production Copyright (c) 1982,200 7, Oracle. all rights reserved. use SQL * Plus to execute SQL, PL/SQL, and SQL * Plus statements. Usage 1: sqlplus-H |-V-H displays the SQL * Plus version and usage help. -V displays the SQL * Plus version. Usage 2: sqlplus [[<option>] [<logon>] [<start>] [SQL] C: \ Windows \ system32> sqlplus-v SQL * Plus: release 11.1.0.6.0-Production logon parameter Syntax: [plain] {username [/password] [@ connect_identifier] |/} [AS {SYSOPER | SYSDBA | SYSASM}] |/NOLOG start parameter Syntax: [plain] @ {url | file_name [. ext]} [arg...] there is a security risk for direct connection: for example, sqlplus hr/hr @ orcl. If someone else remotely connects, the user name and password of the logon will be displayed through the process. Enter only the user name. When prompted, enter the password to prevent password theft. For windows systems, it is generally a single user with multiple tasks. for unix and linux systems, generally, it is a multi-tasking user, so other users can see the login username and password information. Sqlplus/is an operating system authentication, applicable to clients and servers on the same machine as for system-level user logon ex: sqlplus/as sysdba; sqlplus/nolog is not connected to the database. If you want to connect to the database, you can use conn/as sysdba. At this time, you can connect to MySQL 4: SQL Buffer is the memory cache zone, the last executed SQL/plsql command list is placed to list the last executed SQL [SQL] SQL> select * from test; id name ------------------------------------------------------------------ 101 topwqp 102 topwqp SQL> list 1 * select * from test SQL> how to run the commands in the buffer: run the command, or/the difference between running the previous command and/: run displays the current command/sqlplus does not save the SQL * plus command, the sqlplus cache only contains SQL and PL/SQL statements. ex:/[SQL] SQL>/ID NAME -------------------------------------------------------------- 101 topwqp 102 topwqp ex: run [SQL] SQL> run 1 * select * from test ID NAME -------------------------------------------------- -------------------- 101 topwqp 102 topwqp