Oracle Related Useful Information No - 1

·         To start up or shut down appropriate privileges are needed.
·         Two special connection accounts / authorizations are available for startup and shutdown: SYSDBA or SYSOPER.
Ø  SYSDBA : The SYSDBA authorization allows to perform any database task. When a database is initially installed, only the SYS schema can connect to the database with the SYSDBA authorization. You can grant this authorization and the SYSOPER authorization to give others the ability to perform these tasks without connecting as the SYS user.
Ø  SYSOPER : The SYSOPER authorization is a less powerful authorization that allows startup and shutdown abilities but restricts other administrative tasks, such as access to non-administrative schema objects.
# These authorizations are managed either through a passwords file or via operating-system control.
·                  Oracle 10g Database Startup: When it starts up, a database passes through three modes:             i) NOMOUNT, ii) MOUNT, and iii) OPEN.
              # The Oracle instance is composed of a set of logical memory structures and background processes. When Oracle is started, these memory structures and background processes are initialized and started so that users can communicate with the Oracle database. Whenever an Oracle database is started, it goes through a series of steps to ensure database consistency.
Ø  1) STARTUP NOMOUNT:  STARTUP NOMOUNT starts the instance without mounting the database. When a database is started in this mode, the parameter file is read and the background processes and memory structures are initiated, but they are not attached or communicating with the disk structures of the database. When the instance is in this state, the database is not available for use. If a database is started in NOMOUNT mode, you can perform certain tasks. One of the most common is to run a script that creates the underlying database. At times, a database may not be able to go to the next mode (called MOUNT mode) and remains in NOMOUNT mode. For example, this can occur if Oracle has a problem accessing the control file structures, which contain important information to continue with the startup process. If these structures are damaged or not available, the database startup process cannot continue until the problem is resolved.
Ø  2)  STARTUP MOUNT: The STARTUP MOUNT option performs all the work of the STARTUP NOMOUNT option but also attaches and interacts with the database structures. At this point, Oracle obtains information from the control files that it uses to locate and attach to the main database structures. Certain administrative tasks can be performed while the database is in this mode, for example, recovery. You can also physically change file locations or place the database in archive log mode.

Ø  3)  STARTUP OPEN: The STARTUP OPEN option is the default startup mode if no mode is specified on the STARTUP command line. STARTUP OPEN performs all the steps of the STARTUP NOMOUNT and STARTUP MOUNT options. This option makes the database available to all users. Although you typically use the STARTUP NOMOUNT, STARTUP MOUNT, and STARTUP OPEN options, a few other startup options are available that you can use in certain situations: STARTUP FORCE and STARTUP RESTRICT. These are discussed next.

Ø   4)  STARTUP OPEN: The STARTUP OPEN option is the default startup mode if no mode is specified on the STARTUP command line. STARTUP OPEN performs all the steps of the STARTUP NOMOUNT and STARTUP MOUNT options. This option makes the database available to all users. Although you typically use the STARTUP NOMOUNT, STARTUP MOUNT, and STARTUP OPEN options, a few other startup options are available that you can use in certain situations: STARTUP FORCE and STARTUP RESTRICT. These are discussed next.

Ø  5)   STARTUP FORCE: You can use the STARTUP FORCE startup option if you are experiencing difficulty starting the database in a normal fashion. For example, if a database server lost power and the database stopped abruptly, it can leave the database in a state in which a STARTUP FORCE startup is necessary. This type of startup should not normally be required but can be used if a normal startup does not work. What is also different about STARTUP FORCE is that it can issued no matter what mode the database is in. STARTUP FORCE does a shutdown abort and then restarts the database.

Ø  6)  STARTUP RESTRICT : The STARTUP RESTRICT option starts up the database and places it in OPEN mode, but gives access only to users who have the RESTRICTED SESSION privilege. You might want to open a database using the RESTRICTED option when you want to perform maintenance on the database while it is open but ensure that users cannot connect and perform work on the database. You might also want to open the database using the RESTRICTED option to perform database exports or imports and guarantee that no users are accessing the system during these activities. After you are done with your work, you can disable the restricted session, ALTER SYSTEM DISABLE RESTRICTED SESSION, so everyone can connect to the database.

·         Shutting Down an Oracle 10g Database :
Ø  1) SHUTDOWN NORMAL
Ø  2) SHUTDOWN TRANSACTIONAL
Ø  3) SHUTDOWN IMMEDIATE
Ø  4) SHUTDOWN ABORT
1)      SHUTDOWN NORMAL :
v  This is the default type of shutdown that Oracle performs if no shutdown option is specified.
v  No new Oracle connections are allowed from the time the SHUTDOWN NORMAL command is issued.
v  The database will wait until all users are disconnected to proceed with the shutdown process.
v  This type of shutdown is also known as a "clean" shutdown because when Oracle is started again, no recovery is necessary.
2)      SHUTDOWN TRANSACTIONAL :
v  No new connections or new transactions are allowed from the time the SHUTDOWN TRANSACTIONAL command is issued.
v  A transactional shutdown does allow User processes to complete prior to the disconnection. This can prevent a User from losing work. Useful when long running transactions that need to be completed prior to shutdown.
v  This type of shutdown is also a clean shutdown and does not require any recovery on a subsequent startup.
3)      SHUTDOWN IMMEDIATE :
v  No new Oracle connections are allowed.
v  Any uncommitted transactions are rolled back. Thus, a user in the middle of a transaction will lose all the uncommitted work. Oracle does not wait for clients to disconnect. Any unfinished transactions are rolled back, and their database connections are terminated.
4)      SHUTDOWN ABORT :
v  Oracle disconnects all client connections immediately upon the issuance of the SHUTDOWN ABORT command.
v  No new Oracle connections are allowed.
v  Any SQL statements currently in progress are terminated, regardless of their state. Uncommitted work is not rolled back.
### Do not use SHUTDOWN ABORT regularly unless other options for database shutdown fail or if you are experiencing some type of database problem that is preventing Oracle from performing a clean shutdown.