1. Program runs-----Sqlplus
Landing ordinary users: scott/brant;
General Administrator user login: system/brant;
Advanced Admin User login:
1> switch to other users:sql> Conn sys/brant as SYSDBA; (Switch to advanced Admin user)
2> re-landing: Sqlplus sys/brant as SYSDBA;
Switch back to the normal account again:
Conn Scott/brant;
Conn System/brant;
Conn Sys/brant as SYSDBA;
View current users: Show user;
Test:
1>conn scott/brant;
2> Set line display maximum value: Set Linesize 300;
3> set maximum number of pages: set pagesize 30;
4>select * from EMP;
If query under Administrator account, then: SELECT * from Scott.emp;
2. Use the commands in Notepad:
1> Ed A; (This will pop up a window that creates Notepad, a notepad name, and a Notepad entry: SELECT * from EMP)
2> Ed A; (You can call out Notepad again to modify it)
3> @a; (Execute the command in Notepad)
4> executes a local TXT file, such as a file D:\demo content: SELECT * from EMP;
@d:\demo.txt or @d:demo.txt
5> Execute local D-disk SQL file (demo.sql)
@d:demo.sql or @d:demo
6> Querying All tables: select * from Tab;
7> View table structure: DESC EMP;
8> command "/": Represents the command to continue the previous step.
9> Data type:
Number (4): digit, length 4;
VARCHAR2 (10): A string representing a length of 10
Date: Represents the day.
VARCHAR2 (7,2) represents a number: a string of 7 bits, an integer 5 bits, and a decimal 2 bits.
Sqlplus Common Commands