Oracle database instance startup and Shutdown

Source: Internet
Author: User

To start and close a database, Must have Oracle Log on as an administratorGenerally SysdbaPermission user login. Generally, sys users use sysdba to start and close databases. The following describes the differences between the startup and shutdown modes of several Oracle databases and their respective functions. 1. Database startup (startup)In the startup command, you can use different options to control different database startup steps. 1. the startup nomount nonount option only creates an oracle instance. Read the init. ora initialization parameter file, start the background process, and initialize the system global zone (SGA ). The init. ora file defines the instance configuration, including the size of the memory structure and the number and type of background processes. The instance name is set according to oracle_sid and does not have to be the same as the name of the opened database. When the instance is turned on, the system displays a list of SGA Memory Structures and sizes, as shown below: SQL> startup nomountoracle instance started. total system global area 35431692 bytesfixed size 70924 bytesvariable size 18505728 bytesdatabase buffers 16777216 bytesredo buffers 77824 bytes 2. startup mount this command creates an instance and installs the database, but does not open the database. The Oracle System reads data files and redo log files from control files, but does not open these files. This method is often used in database maintenance operations, such as renaming data files, changing redo logs, opening archiving methods, and executing full database recovery of databases. In this way, in addition to the SGA system list, the system will also prompt "database mounted. 3. startup the command to create an instance, install an instance, and open a database. In this case, the database makes the data file and redo log file online, and usually requests one or more rollback segments. In this case, the system will display a prompt "database opened." In addition to all the prompts in the startup Mount mode. In this case, the database system is in normal operation and can accept user requests. If you use startup nomount or startup mount to open a database, you must use the alter database command to open the database. For example, if you use startup nomount to open a database, that is, the instance has been created but the database has not been installed or opened. In this case, you must run the following two commands to start the database correctly. Alter database Mount; Alter database open; if you start the database in startup Mount mode, you only need to run the following command to open the database: Alter database open; 4. In addition to the three methods described earlier, other methods include the following. (1) In startup restrict mode, the database is successfully opened, but only privileged users (users with DBA roles) are allowed to use the database. This method is often used to maintain the database. For example, you do not want other users to connect to the database for data import/export operations, data loading, or specific migration or upgrade operations. (2) Startup force this command is actually forced to close the database ( Shutdown abort) And start the database ( Startup) A combination of the two commands. This command is used only when the database is shut down and cannot be shut down. (3) alter database open read only; this command opens the database in read-only mode after creating an instance and installing the database. This method can be used to open product databases that only provide the query function. 2. Shutdown a database)There are four different options for disabling a database. 1. Shutdown normal: This is a saving option for the database to close the shutdown command. That is to say, if you enter a command such as shutdown, that is, to execute the shutdown nornal command. After this command is issued, no new connections are allowed to connect to the database. Before the database is closed, Oracle will close the database only after all currently connected users exit from the database. Close the database in this way, and no instance recovery is required at the next startup. However, it may take several days or longer to close a database. 2. Shutdown immediate this is a common method of shutting down the database. This method is often used to quickly shut down the database but to make it clean. SQL statements currently being processed by Oracle are immediately interrupted, and all uncommitted transactions in the system are rolled back. If a long uncommitted transaction exists in the system, closing the database in this way also takes some time (the transaction rollback time ). The system does not wait for all users connected to the database to exit the system, forcibly roll back all active transactions, and then disconnect all connected users. 3. Shutdown transactional. This option is only available after Oracle 8i. This command is often used to plan to close the database. It completes the execution of the active transaction that is currently connected to the system. After running this command, any new connections and transactions are not allowed. After all the active transactions are completed, the database will be shut down in the same way as shutdown immediate. 4. Shutdown ABORT: This is the last move to shut down the database. It is also the method that has to be used only when there is no way to shut down the database. It is generally not recommended. If the following situations occur, you can consider using this method to shut down the database. 1. The database is in an abnormal working state. You cannot use commands such as shutdown normal or shutdown immediate to close the database. 2. You need to close the database immediately. 3. You have encountered problems when starting the database instance; all running SQL statements will be aborted immediately. All uncommitted transactions will not be rolled back. Oracle does not wait for the user currently connected to the database to exit the system. The instance must be restored when the database is started next time. Therefore, the next start may take more time than usual. The following table lists the differences and links between the four types of database closures.
Closing Method Abort Immediate Transaction Nornal
Allow new connections × × × ×
Wait until the current session is stopped × × ×
Wait until the current transaction is aborted × ×
Force checkpoint to close all files ×
 

 

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.