Profound Understanding of Oracle Database startup and Shutdown

Source: Internet
Author: User
Profound Understanding of Oracle Database startup and Shutdown

Profound Understanding of Oracle Database startup and Shutdown

The ORACLE tutorial is: a deep understanding of Oracle Database startup and shutdown.

The Oracle database provides several different methods for starting and disabling databases. This article describes the differences between these methods and their respective functions.

1. Start and close the Oracle database

For most Oracle DBAs, the most common method to start and close Oracle databases is Server Manager in the 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 graphical user tool (GUI) to start and close the system. The graphic user interface Instance Manager is very simple and will not be detailed here.

To start and shut down a database, you must log on to the database as a user with the Oracle administrator privilege. Generally, you must log on 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 set 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. Database Installation By instance (installation phase)

3. Open the database (open stage)

In the Startup command, you can use different options to control different database Startup steps.

1. STARTUP NOMOUNT

The 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:


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 rewrites log files from the control file, but does not open the file. This method is often used in database maintenance operations, such as renaming data files, 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

This command completes three steps: Creating an instance, installing an instance, and opening a database. In this case, the database makes the data file and the duplicate log file online, and usually requests one or more rollback segments. In this case, in addition to all the prompts in the Startup Mount mode, a prompt "the database has been opened" is displayed. 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.


If you start the database in the startup mount mode, you can open the database by running the following command:

   
4. Other open methods

In addition to the three methods of opening a database, there are also some other options.

(1) STARTUP RESTRICT

In this way, 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 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.

[NextPage]

Iii. Database SHUTDOWN)

There are four different options for shutting down a database. We will introduce them one by one.

1. SHUTDOWN NORMAL

This is indeed a saving option for shutting down the SHUTDOWN command of the database. 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 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 to close a database. This method is often used to close the database quickly 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 way to shut down the database. It is also the method that has to be used when there is no way to shut down the database. 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 and cannot be shut down using commands such as shutdown normal or shutdown immediate;

2. immediately shut down the database;

3. problems encountered 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.

Table 1 clearly shows the differences and connections between the above four closed databases.

Table 1 Comparison of different Shutdown database Methods


Where: A-Abort I-Immediate T-Transaction N-Nornal

Previous Page

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.