In-depth Oracle Database Parsing

Source: Internet
Author: User

Database startup:

Nomount: Oracle first looks for the parameter file, and then creates an instance, allocates memory, and starts background processes based on the settings in the parameter file.

  1. SQL> startup nomount
  2. The ORACLE routine has been started.
  3. Total SystemGlobalArea 167772160 bytes
  4. FixedSize1266392 bytes
  5. VariableSize113249576 bytes
  6. DatabaseBuffers 50331648 bytes
  7. Redo Buffers 2924544 bytes
  8. SQL>SelectInstance_name, statusFromV $ instance;
  9. INSTANCE_NAME STATUS
  10. --------------------------------------------------------
  11. Orcl STARTED

Mount: oracle can obtain the location information of the control file from the parameter file, find the control file, and determine the existence of the data file based on the location of the data file recorded in the control file.

  1. SQL>Alter DatabaseMount;
  2. The database has been changed.
  3. SQL>SelectInstance_name, statusFromV $ instance;
  4. INSTANCE_NAME STATUS
  5. ----------------------------
  6. Orcl MOUNTED

Open: oracle will find the location of the data file and log file based on the information recorded in the control file, and then carry out the checkpoint and integrity check. If there is no problem, you can start the database. If there is inconsistency or file loss, you need to recover the database. Oracle performs the following checks:

For the first time, check whether the checkpoint cnt in the data file header is consistent with the checkpoint cnt in the control file.

The second time, check whether the system change number scn of the data file is consistent with the system change number scn recorded in the control file.

  1. SQL>Alter Database Open;
  2. The database has been changed.
  3. SQL>SelectInstance_name, statusFromV $ instance;
  4. INSTANCE_NAME STATUS
  5. ----------------------------
  6. OrclOPEN

Database closure:

Close: note that the close database can only be performed without connection; otherwise, a ORA-01093 error may occur.

  1. SQL>Alter Database Close;
  2. The database has been changed.
  3. SQL>SelectInstance_name, statusFromV $ instance;
  4. INSTANCE_NAME STATUS
  5. ----------------------------
  6. Orcl MOUNTED

Dismount:

  1. SQL>Alter DatabaseDismount;
  2. The database has been changed.
  3. SQL>SelectInstance_name, statusFromV $ instance;
  4. INSTANCE_NAME STATUS
  5. ----------------------------
  6. Orcl STARTED

Shutdown:

  1. SQL> shutdown;
  2. ORA-01507:Database NotMount
  3. The ORACLE routine has been disabled.
Comparison of several close methods:

Shutdown normal: any new connection will no longer be allowed to connect to the database, but before the database is closed, oracle needs to wait until all users of the current connection exit from the database. In this way, the database is closed, and no instance recovery is required at the next startup.

Shutdown immediate: the transaction being processed by oracle is immediately interrupted, and uncommitted transactions are rolled back. The system does not wait until the user connected to the database exits and forcibly disconnects all connected users. Then run the Check Point to write all the changed data back to the data file and close the database. To close a database in this way, you do not need to restore the instance when you start the database the next time. This is a safe way to close the database.

Shutdown transactional: the database no longer allows new connections and prohibits new transactions, but allows the current active transactions to be executed completely. After all the active transactions are executed, the database will be shut down in the same way as shutdown immediate.

Shutdown abort: the database will immediately terminate all user connections, interrupt all transactions, immediately close the database, not roll back unfinished transactions, and the database will not execute checkpoints. At the next startup, the database must restore the instance.

  • 1
  • 2
  • Next Page
[Content navigation]
Page 1: Database startup and Shutdown Page 7: control file and database Initialization

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.