Log into the database via sqlplus with sysdba priv’s with a single command. This can be setup with an alias, if you’d like.
#. Log into the server as the oracle user and ensure you have the effective group of the appropriate DBA group. Typical unix installations have the OS user as ‘oracle’ and the dba group as 'dba' (not to be confused with the ‘oinstall’ group).
#. Check your account with the unix
‘id’ command. Make sure your environment variables are set to the appropriate
database:
$ id uid=510(oracle) gid=500(dba)
$ env | grep ORA
ORACLE_SID=TESTDB
ORACLE_HOME=/opt/app/oracle/product/10.0.1.0
$ env | grep ORA
ORACLE_SID=TESTDB
ORACLE_HOME=/opt/app/oracle/product/10.0.1.0
#. connect to the database
1.
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.
- At the SQL Command Line prompt, enter the following command:
Sql > 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.
b) Connecting as SYSDBA with 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.
- At the SQL Command Line prompt, enter the following command:
Sql> 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).