In order to connect to the COIN database as SYSTEM and make use of the SYSDBA role, you need to use a special form of the CONNECT command. The following SlideShow shows this and explains each part of the command.
AS SYSDBA Clause
This CONNECT command is similar to what you have seen so far, the major addition is the SYSDBA clause at the end.
CONNECT system/manager@coin AS SYSDBA
The username is system
CONNECT system/manager@coin AS SYSDBA
The password is manager
CONNECT system/manager@coin AS SYSDBA
The password is manager
CONNECT system/manager@coin AS SYSDBA
The AS SYSDBA Clause lets the system user connect in its role as a SYSDBA
CONNECT system/manager@coin
The system user could connect like this, but then would not have access to any privileges confered by the SYSDBA role.
CONNECT system/manager@coin AS SYSOPER
To connect using the SYSOPER role, assuming that you have been granted that role, use AS SYSOPER instead of SYSDBA.
How to Grant System Privileges
As with object privileges, you use the GRANT statement to confer system privileges on either
a user or a role. Unlike object privileges, the optional keywords WITH ADMIN OPTION are required to additionally allow the grantee to confer these privileges on other users and roles. For example, to give the CREATE USER, ALTER USER, and DROP USER privileges to the role APPL_DBA, you execute the following statement:
GRANT create user, alter user,
drop user TO appl_dba;
System and role privileges require the wording WITH ADMIN OPTION;
object privileges require the wording WITH GRANT OPTION.
Because the function is so similar but the syntax is different, be sure you know
when to use ADMIN and when to use GRANT, a question involving this subtle difference may appear on the exam.
SYSDB versus SYSOPER Role
If you are a user who has been granted the SYSDBA role, or SYSOPER for that matter,
your password will be stored in two different places. One copy will be in the database password file. Another copy will be stored within the database itself. When you connect using AS SYSDBA or AS SYSOPER, Oracle compares the password that you supply with the CONNECT command to that stored in the password file. Otherwise, Oracle compares the password that you supply with that stored in the database. Oracle is supposed to ensure that the password in the password file matches that stored in the database. On a very few occasions, I have seen things get out of sync. If that ever happens, one way to fix the problem is to recreate the password file. Since you have already granted the SYSDBA role to yourself, the SYSTEM user, now you should try to log into the database as SYSDBA.
Administrative Privileges
Administrative privileges that are required for an administrator to perform basic database operations are granted through two special system privileges, 1) SYSDBA and 2) SYSOPER. You must have one of these privileges granted to you, depending upon the level of authorization you require.
Note: The SYSDBA and SYSOPER system privileges allow access to a database instance even when the database is not open. Control of these privileges is totally outside of the database itself. The SYSDBA and SYSOPER privileges can also be thought of as types of connections that enable you to perform certain database operations for which privileges cannot be granted in any other fashion.
For example, you if you have the SYSDBA privilege, you can connect to the database by specifying CONNECT AS SYSDBA.
SYSDBA and SYSOPER
The following operations are authorized by the SYSDBA and SYSOPER system privileges:
System Privilege and Operations Authorized
SYSDBA
Perform STARTUP and SHUTDOWN operations
ALTER DATABASE: open, mount, back up, or change character set
CREATE DATABASE
DROP DATABASE
CREATE SPFILE
ALTER DATABASE ARCHIVELOG
ALTER DATABASE RECOVER
includes the RESTRICTED SESSION privilege
Effectively, this system privilege allows a user to connect as user SYS.
SYSOPER
Perform STARTUP and SHUTDOWN operations
CREATE SPFILE
ALTER DATABASE OPEN/MOUNT/BACKUP
ALTER DATABASE ARCHIVELOG
ALTER DATABASE RECOVER (Complete recovery only. Any form of incomplete recovery, such as UNTIL TIME|CHANGE|CANCEL|CONTROLFILE requires connecting as SYSDBA.)
Includes the RESTRICTED SESSION privilege
This privilege allows a user to perform basic operational tasks, but without the ability to look at user data.
The manner in which you are authorized to use these privileges depends upon the method of authentication that you use.
When you connect with SYSDBA or SYSOPER privileges, you connect with a default schema, not with the schema that is generally associated with your username. For SYSDBA this schema is SYS; for SYSOPER the schema is PUBLIC.
Before Oracle 12c an Oracle Instance could only have one Database. With Oracle 12c, Oracle added the ability for a single Instance to manage multiple Databases.
SysDBA - Quiz
Click the Quiz link below to take a short quiz on Sysdba in Oracle. SysDBA - Quiz