2 Day DBA > Managing Users and Security > Logging In as an Administrator > Logging In and Connecting t...
Logging In and Connecting to the Database as SYSDBA |
Previous |
Next |
You can log in and connect as SYSDBA
only with SQL Command Line (SQL*Plus). You can do so either by supplying the SYS
user name and password, or by using operating system (OS) authentication.
Note: The following instructions establish a local connection to the database. Do not attempt to connectAS SYSDBA remotely. See "About Local and Remote Connections" for more information.
|
Connecting as SYSDBA with the SYS User Name and Password
To connect as SYSDBA
supplying the SYS
user name and password:
Log in to the Oracle Database XE host computer with any user account.
Do one of the following:
On Windows: Click Start, point to Programs (or All Programs), point to Oracle Database 10g Express Edition, and then select Run SQL Command Line.
On Linux with Gnome: In the Applications menu, point to Oracle Database 10g Express Edition, and then select Run SQL Command Line.
On Linux with KDE: Click the icon for the K Menu, point to Oracle Database 10g Express Edition, and then select Run SQL Command Line.
A SQL Command Line command window opens.
Note: You can also start SQL Command Line from a terminal session (Linux) or command window (Windows). See "Connecting Locally with SQL Command Line" for instructions. |
At the SQL Command Line prompt, enter the following command:
CONNECT SYS/password AS SYSDBA
where password
is the password for the SYS
user account. You set the SYS
account password upon installation (Windows) or configuration (Linux).
Connecting as SYSDBA with OS Authentication
To connect as SYSDBA
using OS authentication:
Do one of the following:
On Windows: Log in to the Oracle Database XE host computer as a user who is a member of the ORA_DBA
user group. This is typically the user that installed Oracle Database XE.
On Linux: Log in to the Oracle Database XE host computer as a user who is a member of the dba
user group. This is typically the oracle
user.
Do one of the following:
On Windows: Click Start, point to Programs (or All Programs), point to Oracle Database 10g Express Edition, and then select Run SQL Command Line.
On Linux with Gnome: In the Applications menu, point to Oracle Database 10g Express Edition, and then select Run SQL Command Line.
On Linux with KDE: Click the icon for the K Menu, point to Oracle Database 10g Express Edition, and then select Run SQL Command Line.
A SQL Command Line command window opens.
Note: You can also start SQL Command Line from a terminal session (Linux) or command window (Windows). See "Connecting Locally with SQL Command Line" for instructions. |
At the SQL Command Line prompt, enter the following command:
CONNECT / AS SYSDBA
The slash (/) indicates that the database should authenticate you with operating system (OS) authentication. Remember that when you connect with OS authentication, you are effectively logging in to the database as user SYS
.