There are two ways that Oracle can interact: Sqlplus (command line) SQLPLUSW (graphical interface)
Enter Sqlplus mode: cmd input sqlplus
Enter SQLPLUSW mode: cmd input SQLPLUSW
More convenient way: Winkey + R Open the Run window--Enter Sqlplus or SQLPLUSW enter.
Or add a shortcut to the desktop.
Commands that may be used frequently:
Set Linesize number (sets the character displayed for each line, no effect in sqlplus)
Set pagesize number (sets the number of rows displayed per page)
conn username/password [as SYSDBA | as Sysoper]; toggle the current user. As SYSDBA and as Sysoper optional, this option is required when logging in with the SYS super Administrator.
However, the password is shown in clear text, it is best not to add "/password": Conn user name [as SYSDBA | as Sysoper] Enter, will prompt for a password, the input password is not echoed.
Show user; Show Current user name
SELECT * from tab; Displays all table information for the current user.
DESC table name; View information for this table.
Because you cannot use the arrow keys to modify errors in SQLPLUSW, you can enter SQL statements into a text file and execute the SQL statements in the file with the @ command in SQLPLUSW.
such as: SQL statements are stored in D:\mysql.txt
The corresponding command is: @d:\mysql.txt
If the extension is. sql, you can omit the extension.
Ed file name: You can call Notepad to create or modify a file directly
For example: Ed a returns, enter the SQL statement you want to execute in Notepad, save and close Notepad. Enter @a to execute the SQL statement you just entered in Notepad.
About the location of new files created by the ED command: The path that is saved by default when you open Sqlplus
Specific Description:
1. If you open Sqlplus[w by opening the Run window and enter sqlplus[w] directly through Winkey+r, the file is saved in the directory where Sqlplus[w].exe is located:%oracle_home%\bin,oracle_ Home is the installation path for Oracle as I installed the path to D:\oracle\product\10.2.0\db_1
2. If you enter sqlplus[w] in cmd, the file is saved in the path before the command prompt ">" at Input:
such as: cmd: c:\users\administrator>sqlplus, the file is saved in the C:\Users\Administrator directory.
Oracle Learning Note 2: Several common commands for getting Started