[Architecture] Detailed explanation of Oracle 11g instance and database startup process

Instance and database startup overview

Typically, you can use SQL*Plus commands, OEM, or SRVCTL to manually start the instance, then mount and open the database, making it available to users. The following diagram shows the startup sequence of instances and databases:

illustrate:
  • Start the instance without loading the database: the instance is started, but not yet associated with the database;
  • Loading the database: The instance has been started and is associated with the database by reading the control file. At this time, the database is closed to the user;
  • Open database: The instance has been started and is associated with an open database, the data contained in the data files can be accessed by authorized users.
How to start an instance?

When Oracle Database starts an instance, it performs the following steps:
1. Search for the server parameter file in the platform-specific default location, and if not found, look for the initialization parameter file. The default startup behavior can be overridden by the startup command with the spfile or pfile parameter;
2. Read the parameter file to determine the value of the initialization parameter;
3. Allocate SGA according to initialization parameter settings;
4. Start the Oracle background process;
5. Open the alert log and trace files, and write all explicit parameter settings to the alert log in the form of valid parameter syntax;
At this stage, the database is not associated with the instance, and scenarios that require the database to be in the Nomount state include database creation and certain backup and restore operations.

How to load the database?

The instance mounts the database to associate the database with the instance. To load a database, the instance obtains the names of the database control files specified in the CONTROL_FILES initialization parameter and opens these files. The database reads the control file to find the names of the data files and online redo log files.
When the database is in the mounted state, the database is closed. At this time, only the database administrator can access it and can complete some specific maintenance operations. However, the database is unavailable for normal operations.
If the database allows multiple instances to mount the same database at the same time, the CLUSTER_DATABASE parameter setting can make the database available to multiple instances. The behavior of the database depends on the following settings:
1. If the CLUSTER_DATABASE of the first instance of the mount database is false (the default value), then only this instance can mount the database;
2. If the CLUSTER_DATABASE of the first instance is true, then other instances can mount the database if their CLUSTER_DATABASE parameter is set to true. The number of instances to mount the database depends on the maximum value specified when the database was created.

How to open the database?

Open the loaded database, you can perform some general database operations, any valid user can connect and access an open database. When you open a database, the database does the following:
1. Open the online data file in the tablespace: if the tablespace is offline, the data file is also offline;
2. Get undo tablespace: If there are multiple undo tablespaces, the UNDO_TABLESPACE initialization parameter specifies the undo tablespace to be used. If this parameter is not set, the first available undo tablespace is selected;
3. Open the online redo log file (online redo log).



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324859394&siteId=291194637
Recommended