Oracle下启动与关闭详解

Oracle下启动与关闭大致都是由3个步骤完成,在启动时分别是:启动实例、加载数据库、打开数据库;关闭时分别是:关闭数据库、卸载数据库、关闭Oracle实例。所以在Oracle因为这种严谨的风格下,使得在平时可以根据不同的情况根据需要,以不同的模式启动和关闭数据库。在这里就简要的说一说Oracle下的启动与关闭,在Oracle下启动与关闭部分需要使用sysdba的身份来执行,最好是服务器上通过系统身份验证的方式操作,如下Unix环境中:

[oracle@localhost ~]$ sqlplus / as sysdba

首先,先来说一下Oracle中的启动,启动时所使用的参数如下:

STARTUP [nomount|mount|open|force|resetrict] [prife=filename]

Oracle在默认是会读取运行用户的家目录下的初始化文件,所以如果使用prfile参数就是指定Oracle默认读取的初始化文件,这个在以前有提过,在这里就不做过多的说明,需要可以参看:

在启动中有以下几种模式启动:

NOMOUNT 模式:表示启动实例并不加载数据库。在这种模式下表示启动Oracle的内存结构和服务进程,期间并不加载数据库也不打开数据文件,注意该模式需要有sysdba身份权限,该模式通常用于创建新数据库或重建控制文件时使用

SQL> startup nomount

ORACLE instance started.

 

Total System Global Area 4275781632 bytes

Fixed Size                  2260088 bytes

Variable Size             905970568 bytes

Database Buffers         3355443200 bytes

Redo Buffers               12107776 bytes

MOUNT 模式:表示启动实例、加载数据库并保持数据库的关闭状态。在这种模式常常在进行数据维护时使用,如数据的恢复、更改数据库的归档、数据库的系统配置修改等等

SQL> startup mount

ORACLE instance started.

 

Total System Global Area 4275781632 bytes

Fixed Size                  2260088 bytes

Variable Size             905970568 bytes

Database Buffers         3355443200 bytes

Redo Buffers               12107776 bytes

Database mounted.

OPEN 模式:启动实例、加载并打开数据库。平时最常用的模式,要让Oracle所有用户正常使用而必须使用的模式,缺省使用startup不带任何参数就是使用该模式,也可以使用open在其他模式下启动相应的功能

SQL> startup

ORACLE instance started.

 

Total System Global Area 4275781632 bytes

Fixed Size                  2260088 bytes

Variable Size             905970568 bytes

Database Buffers         3355443200 bytes

Redo Buffers               12107776 bytes

Database mounted.

Database opened.

FORCE 模式:表示强制重启数据库,改模式具有一定的强制性,一般在其他模式已失效的情况下启动

SQL> startup

ORACLE instance started.

 

Total System Global Area 4275781632 bytes

Fixed Size                  2260088 bytes

Variable Size             905970568 bytes

Database Buffers         3355443200 bytes

Redo Buffers               12107776 bytes

Database mounted.

Database opened.

SQL> startup force

ORACLE instance started.

 

Total System Global Area 4275781632 bytes

Fixed Size                  2260088 bytes

Variable Size             905970568 bytes

Database Buffers         3355443200 bytes

Redo Buffers               12107776 bytes

Database mounted.

Database opened.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/919e5bd0dd113dc24d51d5b3e7d34757.html