Categories
Installing in the Cloud Oracle Certification and Database

Stopping and Starting the Database- Creating a Database

After clarifying the terms database versus instance, it makes sense to talk about starting and stopping databases. In a 24/7 environment this is not something that DBAs do often, but there are steps when configuring and setting up the databases in the beginning, along with some maintenance that might be necessary.

We discussed enough the importance of setting the environment variables for the OS user to perform these steps. You also need access to either a privileged OS account in the correct OS group or a privileged database user account. Connecting as a privileged user allows you to perform administrative tasks, such as starting, stopping, and creating databases. You can use either OS authentication or a password file to connect to your database as a privileged user.

Understanding OS Authentication

OS authentication means that if you can log in to a database server via an authorized OS account, you’re allowed to connect to your database without the requirement of an additional password. A simple example demonstrates this concept. First, the id command is used to display the OS groups to which the oracle user belongs:

Next, a connection to the database is made with SYSDBA privileges, purposely using a bad (invalid) username and password:

I can now verify that the connection as SYS was established:

How is it possible to connect to the database with an incorrect username and password? Actually, it is not a bad thing (as you might initially think). The prior connection works because Oracle ignores the username/password provided, as the user was first verified via OS authentication. In that example, the oracle OS user belongs to the dba OS group and is therefore allowed to make a local connection to the database with SYSDBA privileges without having to provide a correct username and password.

See Table 1-1, in Chapter 1, for a complete description of OS groups and the mapping to corresponding database privileges. Typical groups include dba and oper; these groups correspond to sysdba and sysoper database privileges, respectively. The sysdba and sysoper privileges allow you to perform administrative tasks, such as starting and stopping your database.