Overview Database Instance Startup Flashcards
Ways to start an Instance (3 Ways)
+ sqlplus - STARTUP NOMOUNT command
+ Oracle Enterprise Manager
+ SVRCTL utility
3 Startup Stages
1) Instance started without mounting
2) Database mounted
3) Database open
Users that can access the database when not open
SYSDBA SYSOPER SYSBACKUP SYSDG SYSKM
How an Instance is Started (5 Steps)
1) Searches parameter file (spfile or pfile). If not found, initialization parameter file (init.ora).
2) Reads the parameter file to determine the initialization parameters
3) Allocates the SGA based on the initialization parameters
4) Starts the Oracle background processes
5) Opens the alert log and trace files and writes all explicit parameter settings to the alert log in valid parameter syntax
At this stage no database is associated with the instance. Scenarios that require a NOMOUNT include db creation and certain backup and recovery operations.
How a Database is Mounted (2 Steps)
The instance mounts a database to associate the database with this instance.
1) The instance obtains the names of the db control files specified in the CONTROL_FILES initialization parameter and opens the files.
2) Oracle Database reads the control files to find the names of the data files and online redo log files.
In a mounted db, the db is closed and accessible only to db administrators. The db is not available for normal operation.
CLUSTER_DATABASE parameter
This allows multiple instances to mount the same db concurrently.
If CLUSTER_DATABASE = False (Default):
Only one instance can mount the db
If CLUSTER_DATABASE = True:
Then multiple instances can mount to the db if all their CLUSTER_DATABSE parameter settings are set to True.
The number of instances that can mount the db is subject to a predeterminted maximum specified when creating the database.
How a Database is Opened (3 Steps)
Opening a mounted db makes it avaialble for normal operation.
Any valid user can connect to an open database and access its information.
When you open a db the following takes place:
1) Opens the online data files in the tablespace other than undo tablspaces
If the tablespace was offline when the database was shutdown, then the tablespace and coresponding data files will be offline when the db opens.
2) Acquires an undo tablespace
If multiple undo tablespaces exists, then the UNDOTABLESPACE initialization parameter designates the undo tablespace to use. If this is not set, then the first available undo tablespace is chosen.
3) Opens the online redo log files
If any of the data files or redo log files are not present when the instance attempts to open the database, or if the files are present but fail consistency tests, the the database returns an error. Media recovery may be required.
Read-Only Mode
By default the db opens in read/write mode. In read-only mode user transactions cannot modify data (No writing to data files or online redo log files).
However the db can perform recovery or operations that change the db state without generating redo.
+ Data files can be taken offline and online, but you cannot take permanent tablespaces offline.
+ Offline datafiles and tablespaces can be recovered.
+ The control files remains available for updates about the state of the db.
+ Temp tablespaces created with CREATE TEMPORARY TABLESPACE statement are read/write
+ Writes to OS audit trails, trace files and alert logs
Startup command options
+ STARTUP NOMOUNT - Only starts instance
+ STARTUP MOUNT - Starts db but only accessible to admins. The db is not available for normal operation.
+ STARTUP - Starts db in open mode
+ STARTUP FORCE - If instance is running it shuts down with SHUTDOWN ABORT command and then restarts the instance.