Infolinks

Friday 29 June 2012

Instance startup and shutdown

Instance startup and shutdown

Every running Oracle database is associated with an Oracle instance.
An Oracle instance is a combination of the System Global Area (SGA) and other Oracle processes running in memory.
After starting an instance, Oracle associates the instance with the specified database.
This is called mounting the database. The database is then ready to be opened, which makes it accessible to authorized users.

Startup

The steps to start an Oracle database and make it available for system-wide use are:
1. Start an instance.
2. Mount the database.
3. Open the database.

This can be done using the SQL*Plus STARTUP command or via Enterprise Manager. An administrator level Oracle logon (sysdba) is required to startup or shutdown the database instance.
To start an instance, Oracle must read the init.ora file, this contains a list of configuration parameters for the instance and database, Oracle then allocates memory and creates background processes. Until it is mounted, no database is associated with these memory structures and processes.
Changes made by editing the init.ora file will take effect when the instance is next started. Some init.ora parameters can be changed dynamically by using the ALTER SESSION or ALTER SYSTEM statement while the instance is running.
You can start an instance in restricted mode (or later alter an existing instance to be in restricted mode). This restricts connections to only those users who have been granted the RESTRICTED SESSION system privilege.
In addition to init.ora, every Oracle database has a control file this lists the datafiles and redo log files.
The control file must be available for the open database operation to succeed.
Restricted Session Mode
You can start an instance in restricted mode (or later alter an existing instance to be in restricted mode). This restricts connections to only those users who have been granted the RESTRICTED SESSION system privilege.
Read-Only Mode
You can open any database in read-only mode to prevent its data contents from being modified by user transactions.
Datafiles and temporary tablespaces (but not permanent tablespaces) can be taken offline and online.
Recovery of offline datafiles and tablespaces can be performed
The control file remains available for updates about the state of the database
One useful application of read-only mode occurs when standby databases function as temporary reporting databases.
Shutdown
The steps to shutting down a database and its associated instance are:
1. Close the database.
2. Unmount the database.
3. Shut down the instance.
This can be done with the SHUTDOWN command or via Enterprise Manager. Oracle automatically performs all three steps when an instance is shut down.
In unusual circumstances, shutdown of an instance might not occur cleanly, e.g. all memory structures might not be removed from memory. In this case, subsequent instance startup may fail.
In such situations, the DBA can force the new instance to start up by manually terminating the old processes and then starting a new instance, or by issuing a SHUTDOWN ABORT statement.
Database Quiesce
You can prevent new database activity, but allow running commands to complete with the ALTER SYSTEM QUIESCE RESTRICTED command.
Issuing this statement will have the following effect:
- All inactive sessions (other than SYS and SYSTEM) will be prevented from becoming active.
- No user other than SYS and SYSTEM can start a new transaction, a new query, a new fetch, or a new PL/SQL operation.

- Oracle will then wait for existing transactions to finish (either commit or abort).
- For shared server mode instances only, Oracle will block logins (other than SYS or SYSTEM)
- Oracle does not wait for multiple successive OCI fetches to finish, but will wait for all sessions (other than those of SYS or SYSTEM) that hold any shared resource (such as enqueues) to release the resource. After all such operations finish, Oracle finishes executing the QUIESCE RESTRICTED statement.

The ALTER SYSTEM UNQUIESCE command puts all running instances back into normal mode, so that all blocked actions can proceed.
"We actually had the engine running until touchdown. Not that that was intended, necessarily. It was a very gentle touchdown. It was hard to tell when we were on" - Neil Armstrong
Every running Oracle database is associated with an Oracle instance.
An Oracle instance is a combination of the System Global Area (SGA) and other Oracle processes running in memory.
After starting an instance, Oracle associates the instance with the specified database.
This is called mounting the database. The database is then ready to be opened, which makes it accessible to authorized users.

Startup

The steps to start an Oracle database and make it available for system-wide use are:
1. Start an instance.
2. Mount the database.
3. Open the database.

This can be done using the SQL*Plus STARTUP command or via Enterprise Manager. An administrator level Oracle logon (sysdba) is required to startup or shutdown the database instance.
To start an instance, Oracle must read the init.ora file, this contains a list of configuration parameters for the instance and database, Oracle then allocates memory and creates background processes. Until it is mounted, no database is associated with these memory structures and processes.
Changes made by editing the init.ora file will take effect when the instance is next started. Some init.ora parameters can be changed dynamically by using the ALTER SESSION or ALTER SYSTEM statement while the instance is running.
You can start an instance in restricted mode (or later alter an existing instance to be in restricted mode). This restricts connections to only those users who have been granted the RESTRICTED SESSION system privilege.
In addition to init.ora, every Oracle database has a control file this lists the datafiles and redo log files.
The control file must be available for the open database operation to succeed.
Restricted Session Mode
You can start an instance in restricted mode (or later alter an existing instance to be in restricted mode). This restricts connections to only those users who have been granted the RESTRICTED SESSION system privilege.
Read-Only Mode
You can open any database in read-only mode to prevent its data contents from being modified by user transactions.
Datafiles and temporary tablespaces (but not permanent tablespaces) can be taken offline and online.
Recovery of offline datafiles and tablespaces can be performed
The control file remains available for updates about the state of the database
One useful application of read-only mode occurs when standby databases function as temporary reporting databases.
Shutdown
The steps to shutting down a database and its associated instance are:
1. Close the database.
2. Unmount the database.
3. Shut down the instance.
This can be done with the SHUTDOWN command or via Enterprise Manager. Oracle automatically performs all three steps when an instance is shut down.
In unusual circumstances, shutdown of an instance might not occur cleanly, e.g. all memory structures might not be removed from memory. In this case, subsequent instance startup may fail.
In such situations, the DBA can force the new instance to start up by manually terminating the old processes and then starting a new instance, or by issuing a SHUTDOWN ABORT statement.
Database Quiesce
You can prevent new database activity, but allow running commands to complete with the ALTER SYSTEM QUIESCE RESTRICTED command.
Issuing this statement will have the following effect:
- All inactive sessions (other than SYS and SYSTEM) will be prevented from becoming active.
- No user other than SYS and SYSTEM can start a new transaction, a new query, a new fetch, or a new PL/SQL operation.

- Oracle will then wait for existing transactions to finish (either commit or abort).
- For shared server mode instances only, Oracle will block logins (other than SYS or SYSTEM)
- Oracle does not wait for multiple successive OCI fetches to finish, but will wait for all sessions (other than those of SYS or SYSTEM) that hold any shared resource (such as enqueues) to release the resource. After all such operations finish, Oracle finishes executing the QUIESCE RESTRICTED statement.

The ALTER SYSTEM UNQUIESCE command puts all running instances back into normal mode, so that all blocked actions can proceed.
"We actually had the engine running until touchdown. Not that that was intended, necessarily. It was a very gentle touchdown. It was hard to tell when we were on" - Neil Armstrong

No comments:

Post a Comment