Oracle startup and close

xiaoxiao2021-03-06  16

/ * Concept of instance * /

The instance is an entity used to manage the database, which consists of a memory structure located in the server. An instance can only access a database, and a database can be accessed simultaneously by multiple instances. Instances in users and databases There is a role of a middleware. The database follows instances are two things, and the database is mainly a series of physical storage structures for Oracle Save Data.

/ * Database start * /

The complete startup process of the Oracle database is divided into the following 3:

1.SQL> Startup Nomount creates and starts an instance corresponding to the database,

At the time of the instance, a series of daemon is created for an instance and a memory structure such as the SGA area is created in memory. The initialization parameter file will only be used during the instance startup. If the initialization parameter file has an error, the instance will not be able to start. (Generally only using this mode when creating a database, rebuilding control files)

Specify initialization parameter file: If the PFILE parameter is not specified when executing the startup statement, Oracle first reads the server-side initialization parameter (spfile . OA), if the default server-side initialization parameters are not found, Oracle will continue to read Take the text initialization parameter file (INIT . OR). The default initialization parameter file is located in the / Database / Directory Starting instance SQL> Startup Pfile = i: / Oracle / Ora91/Database/temp/init01.ora

2. SQL> Startup Mount is loaded with the instance.

When the database is loaded, the instance will open the database's control file, get physical structure information such as the database name, the location and name of the database, and the instance will not be able to load the database. If the control file is corrupted, the instance will not be loaded. In the loading phase, the instance will open Data file and redo log files (can be used for the following maintenance: * Rename data file * Add, delete, or rename redo log file * Execute Database Full Recovery Operation * Change the archive mode of the database)

3. SQL> Startup Open Database

The database will open all the data files and redo log files. If there is any data file or the redo log file that cannot be opened normally, the database will return an error message. Normal start is divided into a limited state (only DBA can access the database) and non- Two kinds in limited states.

/ * Switch start mode * /

SQL> ALTER DATABASE MOUNT; SQL> ALTER DATABASE OPEN;

Enter the restricted state SQL> Startup Restrict;

When performing the following database maintenance operations, the database must be placed in a limited state: * Execute data import and export operation * Use SQL * Loader to extract external data * Temporary user access database * Database Database Transplantation and Upgrade

Switch SQL> ALTER SYSTEM DISABLE RESSION; SQL> ALTER SYSTEM Enable Restricted session;

Switch SQL> ALTABASE OPEN read Only; SQL> ALTER DATABASE OPEN Read Write;

Force start database SQL> Startup force;

/ * Database Close * /

1. Turn off the database

When you turn off the database, Oracle will redo the content written in the log cache to write the data file in the database cache, then close all data files and redo log files.

2. Uninstall the database to turn off the database control file

3. The background process and service process owned by the abortd instance instance is aborted, and the SGA area in the memory is reclaimed.

Normally closed, do not need to make any recovery operations when starting the database next time, SQL> Shutdown Normal;

Stick Now, when you start the database next time, you don't need any recovery operation sql> shutdown immediate; transaction shutdown mode, you do not need to make any recovery operations when you start the database. SQL> Shutdown Transactonal;

Terminate the closing method, you need to perform database recovery SQL> Shutdown Abort when starting the database next time;

转载请注明原文地址:https://www.9cbs.com/read-41753.html

New Post(0)