DBA_Oracle Startup/Shutdown (concept) (various maintenance operations on the database), dba_oracleshutdown

Source: Internet
Author: User

DBA_Oracle Startup/Shutdown (concept) (various maintenance operations on the database), dba_oracleshutdown

I. Summary

The Complete Oracle Database startup process is completed in three steps:

Start instance --> load database --> Open Database

Because different maintenance operations can be performed on the database at different stages in the Oracle database startup process, which corresponds to our different needs, we need to start the database in different modes.

1. Oracle startup requires four statuses: SHUTDOWN, NOMOUNT, MOUNT, and OPEN.

2. Four ways to disable Oracle: Normal, Immediate, Transactional, Abort

3. Detailed description of the startup and shutdown processes


 
Ii. Database Startup Process

1. NoMount mode (no database is loaded when the instance is started)

(1). Command: startup nomount

(2). Explanation: This startup mode only creates instances and does not load databases. Oracle only creates various Memory Structures and service processes for instances and does not open any data files.

In NoMount mode, you can only access the data dictionary views related to the SGA area, including VPARAMETER, VSGA, VPROCESS, and VSESSION. The information in these views is obtained from the SGA area, it has nothing to do with the database.

(3). usage of the Mode:

Create a new database;
Rebuild the control file;
2. Mount mode (load the database but do not open the database)

(1). Command: startup mount

(2). Explanation: This startup mode will load the database for the instance, but keep the database closed. When loading a database, you must open the Database Control file, but neither the data file nor the redo log file can be read or written. Therefore, you cannot perform operations on the database.

In Mount mode, you can only access data dictionary views related to control files, including VTHREAD, VCONTROLFILE, VDATABASE, VDATAFILE, and V $ LOGFILE, these views are obtained from the control file.

(3). usage of the Mode:

Rename a data file;
Add, delete, or rename the redo log file;
Perform full database recovery;
Change the database archiving mode;
3. Open Mode (Open the database normally)

(1). Command: startup [open]

(2). Explanation: Follow the three steps to start the database normally.

(3). usage of the Mode:

Do not perform any maintenance on the database at ordinary times. For example, simply do application development and use this mode;
4. Force start Mode

(1). Command: startup force

(2). Purpose & explanation:

In some cases, if you cannot start the database successfully in the previous modes, you can try to force the start mode.
5. Others

You can also switch between startup modes by using the Alter Database statement. In addition, you can set different statuses for different operations on the database, such as restricted/unrestricted pumping status and read-only.

Iii. Database Shutdown Process

1. Nomal (normal close Mode)

(1). Command: shutdown nomal

(2). Explanation: when data is disabled normally, Oracle performs the following operations:

Blocks any user from establishing new connections.
Wait for all currently connected users to take the initiative to disconnect (In this mode, Oracle will not immediately disconnect the current user, and these users will still perform related operations)
Once all users are disconnected, the database is immediately closed, detached, And the instance is terminated. (Therefore, when you close the database normally, you should notify all online users to disconnect the database as soon as possible)
2. Immediate (close now)

(1). Command: shutdown immediate

(2). Explanation:

Stops any user from establishing new connections and stops the current connected user from starting any new transactions.
Oracle does not wait for online users to actively disconnect, forcibly terminate the current transaction of the user, and rolls back any uncommitted transactions. (If there are too many uncommitted transactions, this method will take a long time to terminate and roll back the transaction)
Shut down, unmount the database, and terminate the instance.
3. Transactional (transaction close Mode)

(1). Command: shutdown transactional

(2). Explanation: This method is between the normal closing mode and the immediate closing mode. The response time will be faster and the processing will be more appropriate. The execution process is as follows:

Stops any user from establishing new connections and stops the current connected user from starting any new transactions.
Wait until all uncommitted active transactions are committed, and immediately disconnect the user.
Shut down, unmount the database, and terminate the instance.
4. Abort (Termination close method)

(1). Command: shutdown abort

(2). Explanation: This is a rough method to close the database. If none of the three methods can be closed, you can use the termination method to close the database. However, disabling the database in this way will lose a part of the data. When the instance is restarted and the database is opened, the background process SMON will resume the instance. In general, we should avoid using this method to close the database. The execution process is as follows:

Stops any user from establishing new connections and stops the current connected user from starting any new transactions.
Terminate the SQL statement that is being executed immediately.
No uncommitted transactions are returned.
Directly disconnect all users, close or detach the database, and terminate the instance.
 
Iv. Case Database Startup Process

Step1. SQLPLUS /'as sysdba'SQL*Plus: Release 10.2.0.1.0 - Production on Sat Mar 3 22:48:27 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to an idle instance.Step2. Startup nomountORACLE instance started.-->Total System Global Area 167772160 bytesFixed Size         1218316 bytesVariable Size       104859892 bytesDatabase Buffers      58720256 bytesRedo Buffers        2973696 bytesoracle@db1:~> ps -ef | grep ora_oracle 3626 1 0 22:48 ? 00:00:00 ora_pmon_orcl1oracle 3628 1 0 22:48 ? 00:00:00 ora_psp0_orcl1oracle 3630 1 0 22:48 ? 00:00:00 ora_mman_orcl1oracle 3632 1 0 22:48 ? 00:00:00 ora_dbw0_orcl1oracle 3634 1 0 22:48 ? 00:00:00 ora_lgwr_orcl1oracle 3636 1 0 22:48 ? 00:00:00 ora_ckpt_orcl1oracle 3638 1 0 22:48 ? 00:00:00 ora_smon_orcl1oracle 3640 1 0 22:48 ? 00:00:00 ora_reco_orcl1oracle 3642 1 0 22:48 ? 00:00:00 ora_cjq0_orcl1oracle 3644 1 0 22:48 ? 00:00:00 ora_mmon_orcl1oracle 3646 1 0 22:48 ? 00:00:00 ora_mmnl_orcl1oracle 3648 1 0 22:48 ? 00:00:00 ora_d000_orcl1oracle 3650 1 0 22:48 ? 00:00:00 ora_s000_orcl1Step3. Startup mountOracle instance started.-->Total System Global Area 167772160 bytesFixed Size 1218316 bytesVariable Size 104859892 bytesDatabase Buffers 58720256 bytesRedo Buffers 2973696 bytesDatabase mounted.Step4. StartupORACLE instance started.-->Total System Global Area 167772160 bytesFixed Size 1218316 bytesVariable Size 104859892 bytesDatabase Buffers 58720256 bytesRedo Buffers 2973696 bytesDatabase mounted.Database opened.


What can I do if oracle cannot be started after shutdown is disabled?

When you start an oracle database, a database instance is created and the database startup status can be selected. Generally, you can start an instance by loading and opening the database, so that any valid user can link to the instance and perform typical database access operations. The following describes the content.

I. How to start a database

There are many ways to start a database instance:

1. Use SQL * PLUS to use SQL * PLUS to connect to an Oracle database with administrator permissions, and then release the startup command to start the database.
2. Use Recovery Manager to execute the startup and shutdown commands to start and close database instances. This method is preferred in the RMAN environment, rather than calling the SQL * PLUS method.
3. Oracle Enterprise Manager allows you to use Oracle Enterprise Manager to manage oracle databases, including starting and disabling databases. Oracle Enterprise Manager is an independent oracle database product, together with the graphic console, proxies, public services, and various tools, it provides an integrated and complex system management platform for managing oracle products.

Procedure for starting a database instance: start SQL * PLUS: sqlplus/nolog without connecting to the database, and connect to oracle: connect username/password as SYSDBA as sysdba as SYSDBA, connect to the oralce database and prepare to start the database instance. Then run the startup command to start the database instance. oracle must read the instance configuration file from the server parameter file or the traditional text initialization parameter file. When the startup command without the pfile clause is used, oracle reads the initialization parameters from the server parameter file (spfile) in the default location specified by the platform. You can also specify the location of the initialization parameter, for example, startup pfile =/u01/oracle/dbs/init. ora.

You can start a database instance in different modes:

1. Start but not load the database instance. This mode does not allow access to the database, and is generally only applicable to database creation or re-creation of control files. To enable this database mode, run the startup nomount command to start the database instance.
2. Start the instance and load the database, but keep the database closed. This mode is applicable to some dba actions, such as renaming a data file, adding a cancel or renaming a redo log file, and performing a complete database restoration operation, but does not allow general access to the database. To enable this database mode, run the startup mount command to start the database instance.
3. Start the instance, load and open the database. This mode can be used in unrestricted ways to allow access by all legal users. To enable this database mode, run the startup command to start the database instance.
4. force the database to start and start up force. In some special cases, you may encounter some problems when starting the database instance. Generally, do not force the database to start unless you use the shutdown normal, shutdown immediate, and shutdown transactional commands to close the current instance.

In Oracle, how does one execute the command in the overall process of shutdown after startup in cmd ,?

Simplest:
Click Start Menu -- run -- Enter cmd
In this way, enter the cmd
Input sqlplus
Enter your system username and password
Input shutdown immediate.
Input startup to start the database.

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.