oracle--database Startup and shutdown

Source: Internet
Author: User

Content of this article
    • Server environment
    • Client environment
    • Overview
    • Start the database
    • Close the database
    • Add
    • Resources

This article describes the start-up and shutdown of Oracle databases, although the content is basic, but is needed in many operations of the database, and therefore, fundamental and important, must be understood in depth. For example, what kind of database load mode should be used, and the database file open mode.

Server environment
    • Windows 2003 R2
    • ORACLE11G 32-bit

Client environment
    • Windows 2008R2
    • Oracle 11g 32-bit client

Overview

If you start the database with the startup command, the operation goes through three different stages:

    • Instance startup (instance startup)
    • Database load (db mount)
    • Database Open

Instance startup (instance startup), at this stage, the Oracle parses the database parameter file and determines that the instance is not running by trying to obtain an instance lock. Oracle then launches a number of different database processes, such as the DBWN and LGWR processes. Oracle will also allocate the memory required for the SGA. Once the instance is started, Oracle reports to the user who launched the instance that the background process has started the instance.

Database load (load start), during the load phase, Oracle opens the database control file. When the control file is successfully opened, Oracle takes the database data file name from the control file and prepares it for opening the database files. It is important to note that at this time, Oracle does not check for the existence of these data files, but only identifies the location of the data files from the control file. After completing this step, Oracle reports to the user that the database has been loaded.

The database opens, and Oracle continues to start the process and tries to open the database. During the database open phase, Oracle verifies that the database file exists and opens the files. When Oracle opens the data file, it examines the data file header and compares the SCN information in these header and the SCN stored in the control file (the SCN is the Oracle method that tracks the state of the database).

When Oracle tries to open a database, it examines the SCN in each data file and in the database control file. If the SCN is the same, and the bit mapping flag is set correctly, the database is considered consistent and can be opened and used. If the SCN is not the same, Oracle automatically performs disaster or instance recovery. Disaster or instance recovery can occur if the redo required to generate a consistent image exists in the online redo log file. If a disaster or instance recovery cannot be performed because of a corrupted data file or because the redo required for recovery is not in the online redo log, Oracle requires the DBA to perform the media recovery. Media recovery requires recovering one or more database data files from one database backup, and unlike instance recovery, media recovery is a manually executed process.

The corresponding start-up is to close the shutdown command, close the Unload database, and perform the opposite operation as startup.

In this example, starting or shutting down the database is done on the server.

Start the database

Figure 1 Starting the database

Close the database

Figure 2 Closing the database

Close the database before booting.

Add

There are several different variants of Startup, including:

    • Startup: Enable Oracle to undergo three start-up phases.
    • Startup restrict: Enables Oracle to go through three startup phases and has restricted mode to open the database. Only users with restricted permissions can access the database.
    • Startup Nomount: After successfully starting the DB instance, stop the START process. You typically use this command to start a DB instance before you create the database. It is also convenient to use this command if you need to recreate the control file. It is important to note that in order to use Rman in a given database, you must be able to successfully launch the instance using the Startup Nomount command.
    • Startup mount: After successfully starting the DB instance and loading the database, stop the START process. This command is useful if you need to restore the system table space.
    • Startup Read only: Enables the Oracle database (or standby database) to be opened in read Only mode. In this way, DML operations are not supported, but the database can be queried. This command is useful if you are performing a point-in-time recovery operation and want to ensure that the database is restored to the current point in time before the DB instance is submitted with the Resetlogs command.
    • Startup force: Close the database together with the Shutdown Abort command (explained next). The Startup Force command can be followed by the open mode of the database. Examples are as follows:

Startup Force Restrict

Startup Force Mount

Startup Force Nomount

In other words, the Startup command can be followed by the database load Mode command, followed by the load Mode command, plus the database open mode.

The shutdown command has the following form:

    • Shutdown (and Shutdown Normal): Causes Oracle to wait until all user processes are disconnected from the database. After all processes are disconnected, the database will be completely closed. This command prevents instance recovery. After execution, no new user processes can connect to the database.
    • Shutdown immediate: Clears all existing user reports and rolls back all uncommitted transactions. This command prevents instance recovery. After execution, no new user processes can connect to the database.
    • Shutdown Abort: It usually crashes the database. This command requires instance recovery (not media recovery). After execution, no new user processes can connect to the database.
    • Shutdown Transactional: Causes Oracle to wait for all user processes to commit the current transaction, then disconnect those user processes and close the database. No new users can connect to the database while they are waiting to complete these transactions.

Shutdown immediate generally more commonly used, and Shutdown often close the database very slowly ~

Resources
    • Database and Instance Startup and Shutdown
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.