This section describes how to use Oracle command line interface, SQL*Plus.
Oracle 11g XE server not only offers a Web interface, but it also offers a command line interface called SQL*Plus.
The program file of SQL*Plus is located at
Here is what I did in a command window with "sqlplus", to obtain a list of all users and
checking privileges of user "Herong":
SQL*Plus: Release 22.214.171.124.0 Production on Tue Aug 11 16:39:24 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> connect SYS/HerongY@ng AS SYSDBA
ORA-12154: TNS:could not resolve the connect identifier specified
SQL> connect SYS/anything AS SYSDBA
SQL> SELECT * FROM ALL_USERS;
USERNAME USER_ID CREATED
------------------------------ ---------- ---------
XS$NULL 2147483638 27-AUG-11
APEX_040000 47 27-AUG-11
APEX_PUBLIC_USER 45 27-AUG-11
FLOWS_FILES 44 27-AUG-11
HR 43 27-AUG-11
MDSYS 42 27-AUG-11
ANONYMOUS 35 27-AUG-11
XDB 34 27-AUG-11
CTXSYS 32 27-AUG-11
OUTLN 9 27-AUG-11
SYSTEM 5 27-AUG-11
SYS 0 27-AUG-11
12 rows selected.
This tutorial shows a number of interesting behaviors of Oracle 11.2:
Use the "/nolog" option with the "sqlplus" command so it will be started without login,
which give you a chance to run the "CONNECT" or other commands.
"SYS" is a very special built-in user account in Oracle server.
It has the password set to the value provided during the installation process.
When correct user name and password "SYS/HerongY@ng" is provided,
Oracle 11.2 server returns with the "ORA-12154: TNS" error,
which could be related to some settings I missed during the installation.
However, when incorrect user name and password "SYS/anything" is provided,
Oracle 11.2 server provides me the connect. This is very funny.
After some searching on the Internet, I think Oracle has a logic to default
incorrect user name and password combination to use Windows user group
authentication to establish the connection if "AS SYSDBA" is specified.
Application Express users are not included in the "ALL_USERS" table in Oracle 11.2.
But in Oracle 10.2, the user added in Application Express is listed in the "ALL_USERS" table.