Home >Database >Oracle >Understand the opening and closing of oracle database in ten minutes

Understand the opening and closing of oracle database in ten minutes

WBOY
WBOYforward
2021-12-30 18:05:533274browse

This article brings you relevant knowledge about opening and closing the Oracle database. I hope it will be helpful to everyone.

Understand the opening and closing of oracle database in ten minutes

#I have always felt a little confused about the various startup and shutdown commands of the database. Let me sort them out now.

1. Database startup:

Oracle startup is divided into three steps: starting the instance, loading the database, and opening the database. You can open the database according to your actual needs

The syntax is startup

1, nomount mode

SQL> startup nomount
ORACLE instance started.

Total System Global Area  830930944 bytes
Fixed Size                  2257800 bytes
Variable Size             536874104 bytes
Database Buffers          285212672 bytes
Redo Buffers                6586368 bytes

This startup method only creates instances (that is, various methods for creating Oracle instances) memory structures and service processes), does not load the database or open data files.

This mode is generally suitable for creating databases and control files.

2. mount mode

SQL> startup mount
ORACLE instance started.

Total System Global Area  830930944 bytes
Fixed Size                  2257800 bytes
Variable Size             536874104 bytes
Database Buffers          285212672 bytes
Redo Buffers                6586368 bytes
Database mounted.

This mode will start the instance, load the database and save the database shutdown mode

Generally used for database maintenance, such as: performing database complete Recovery operations, changing the archive mode of the database, etc.

3. Open mode

SQL> startup
ORACLE instance started.

Total System Global Area  830930944 bytes
Fixed Size                  2257800 bytes
Variable Size             536874104 bytes
Database Buffers          285212672 bytes
Redo Buffers                6586368 bytes
Database mounted.
Database opened.

This mode will start the instance, load and open the database. This is the conventional way to open a database. As long as the user wants to perform multiple operations on the database, it must be opened in this way. (Open the database in open mode) No parameters are required after startup.

4. Force mode

SQL> startup force
ORACLE instance started.

Total System Global Area  830930944 bytes
Fixed Size                  2257800 bytes
Variable Size             536874104 bytes
Database Buffers          285212672 bytes
Redo Buffers                6586368 bytes
Database mounted.
Database opened.

This mode will terminate the instance and restart the database (open). This mode has certain mandatory requirements (for example, you can try it when other startup modes fail. This mode)

2. Database shutdown:

Close is also divided into three steps, including: closing the database, unloading the database, closing Oracle instance

The syntax is shutdown

1, normal

SQL> shutdown normal
Database closed.
Database dismounted.
ORACLE instance shut down.

This is a normal shutdown mode (provided there is no time limit, this method is usually chosen to shut down the database)

2. Immediate

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

This method is to close the database immediately and close the database in the shortest possible time.

In this shutdown method, Oracle will not only immediately interrupt the current user's connection, but also forcibly terminate the user's current active transactions, roll back unfinished transactions, and close the database in immediate shutdown mode.

3. transactional

SQL> shutdown transactional
Database closed.
Database dismounted.
ORACLE instance shut down.

This method is called the transaction closing method. Its primary task is to ensure that all currently active transactions can be submitted and the database is closed in the shortest possible time. .

4, abort

SQL> shutdown abort
ORACLE instance shut down.


慎重!慎重!慎重!(重要的事情说三遍)

This method is called the ultimate shutdown method. The ultimate shutdown method is mandatory and destructive. Using this method will forcefully interrupt any database operation, so Some data information may be lost, affecting the integrity of the database.

(Use this method if the other three methods cannot be closed. Use with caution!)

Recommended tutorial: "Oracle Tutorial"

The above is the detailed content of Understand the opening and closing of oracle database in ten minutes. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete