Various enabling and disabling methods in Oracle

Source: Internet
Author: User
The shutdown command has four parameters: NORMAL, TRANSACTIONAL, IMMEDIATE, and ABORT. If no parameter is specified by default, the value is NORMAL. Shutdown normal: do not allow new connections, wait for the session to end, wait for the transaction to end, make a checkpoint, and close the data file. No instance recovery is required at startup. Shutdown transactional: do not allow new connections, do not wait for the session to end, wait for the transaction to end, make a checkpoint, and close the data file. No instance recovery is required at startup. Shutdown immediate: do not allow new connections, do not wait for the session to end, do not wait for the transaction to end, make a checkpoint and close the data file. Transactions that are not finished are automatically rolled back. No instance recovery is required at startup. Shutdown abort: does not allow new connections, does not wait for the session to end, does not wait for the transaction to end, does not do the checkpoint and does not close the data file. The instance is automatically restored at startup. Startup command startup open: the default parameter of STARTUP is OPEN. OPEN the database and allow access to the database. All files described in the control file of the current instance have been opened. Startup mount: MOUNT the database. only DBA is allowed to manage the database. Only the control file of the current instance is opened and the data file is not opened. Startup nomount: only through the initialization file, allocate the SGA area, start the database background process, did not open the control file and data file. You cannot access any database. Startup pfile = filename: Start the database with filename as the initialization file, instead of using the default initialization file. Startup force: Stop the running of the current database and restart the database. Startup restrict: only users with restricted session permission can access the database. Startup recover: starts the database and starts media recovery. ============================================================ Oracle the database provides several different methods for starting and disabling databases, this article will detail the differences between these startup and shutdown methods, along with their respective features. 1. For most Oracle DBAs, the most common method to start and close Oracle databases is Server Manager in command line mode. After Oracle 8i, the system has concentrated all the functions of Server Manager into SQL * Plus. That is to say, SQL * Plus can be used to start and close the database after 8 I, server Manager is no longer required, but the system retains the Server Manager tool to maintain backward compatibility. In addition, you can use Oracle Enterprise Manager of the image user tool (GUI) to start and close the system. The image user interface Instance Manager is very simple and will not be detailed here. To start and close a database, you must log on to the database as a user with the Oracle administrator privilege. Generally, you must log on to the database as a user with the SYSDBA privilege. Generally, INTERNAL users are often used to start and close databases (INTERNAL users are actually synonymous with SYSDBA users ). The new version of Oracle Database will gradually eliminate the INTERNAL users of INTERNAL, so we 'd better configure DBA users to have SYSDBA permissions. 2. Database STARTUP (STARTUP) three steps are required to start a database: 1. Create an Oracle instance (not in the installation phase) 2. Install the database by the instance (in the installation phase) 3. Open the database (open stage) in the Startup command, different options can be used to control different database Startup steps. 1. the startup nomountnonount option only creates an Oracle instance. Read the init. ora initialization parameter documentation, start the background process, and initialize the system global zone (SGA ). The Init. ora document defines instance configurations, including the size of the memory structure and the number and type of background processes. The instance name is configured 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 routine started. Total System Global Area 35431692 bytesFixed Size 70924 bytesVariable Size 18505728 bytesDatabase Buffers 16777216 bytesRedo Buffers 77824 bytes2, startup mount this command creates an instance and installs the database, but does not open the database. This document does not open the data document and rebuild log document in the Oracle read control document. This method is often used in database maintenance operations, such as renaming data documents, changing duplicate logs, and opening and archiving methods. In this way, in addition to the SGA system list, the system will also prompt "database load is complete. 3. STARTUP the command to create an instance, install an instance, and open a database. At this time, the database makes the data document and the re-log document online, and usually requests one or more rollback segments. In this case, the system will not only see any prompts in the Startup Mount mode, but also give a prompt "the database has been opened. 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. The following two commands must be run 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. Other open methods include the three open methods described earlier, and some other options. (1) In the 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. (2) startup force this command is actually a combination of the two commands, shutdown abort and startup. 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. Iii. Database SHUTDOWN there are four different options for database SHUTDOWN. 1. shutdown normal: This is a saving option for the database to close the SHUTDOWN command. That is to say, if you issue a command like SHUTDOWN, it means shutdown nornal. 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 any user connected to the database exits. 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 for shutting down a database. This method is often used to quickly shut down a 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, it may take some time (the transaction rollback time) to close the database in this way ). The system does not wait for any user connected to the database to exit the system, forcibly roll back any active transactions, and then disconnect any connected users. 3. shutdown transactional: This option is only available after Oracle 8i. This command is often used to plan to shut down the database. It completes the execution of active transactions that are currently connected to the system. After running this command, any new connections and transactions are not allowed. After any active transaction is 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 a problem when starting the database instance; any running SQL statement will be aborted immediately. No uncommitted transactions will be rolled back. Oracle does not wait for the user 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.

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.