oracle数据库启动及关闭

数据库关闭与启动: scn == system change number



数据库启动步骤

nomount----> mount---->open

(1)第一阶段

sql> startup nomount

ORACLE instance started.


Total System Global Area 7148580864 bytes

Fixed Size 2214216 bytes

Variable Size 3825206968 bytes

Database Buffers 3288334336 bytes

Redo Buffers 32825344 bytes

sql>


sql> select status from v$instance;


STATUS

------------

STARTED


sql> show parameter spfile;


NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

spfile string +DATA/orcl/spfileorcl.ora



nomount这一步,数据库做了什么?

读取参数文件+启动数据库实例



(2)第二阶段

sql> alter database mount;


Database altered.


sql>


sql> show parameter control


NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

control_file_record_keep_time integer 7

control_files string +DATA/orcl/controlfile/current

.260.943301383,+FRA/orcl/cont

rolfile/current.256.943301385

control_management_pack_access string DIAGNOSTIC+TUNING

sql> select status from v$instance;


STATUS

------------

MOUNTED


sql> select name from v$datafile;


NAME

--------------------------------------------------------------------------------

+DATA/orcl/datafile/system.256.943301251

+DATA/orcl/datafile/sysaux.257.943301251

+DATA/orcl/datafile/undotbs1.258.943301251

+DATA/orcl/datafile/users.259.943301251

+DATA/orcl/datafile/example.265.943301433


sql> select member from v$logfile;


MEMBER

--------------------------------------------------------------------------------

+DATA/orcl/onlinelog/group_3.263.943301403

+FRA/orcl/onlinelog/group_3.259.943301407

+DATA/orcl/onlinelog/group_2.262.943301397

+FRA/orcl/onlinelog/group_2.258.943301401

+DATA/orcl/onlinelog/group_1.261.943301389

+FRA/orcl/onlinelog/group_1.257.943301395


select name from v$tablespace;

select name from v$database;

sql> select name from v$database;


NAME

---------

ORCL


sql> show parameter name


NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

db_file_name_convert string

db_name string orcl

db_unique_name string orcl

global_names boolean FALSE

instance_name string orcl

lock_name_space string

log_file_name_convert string

service_names string orcl

sql>


mount这一步,数据库做了什么?

读取控制文件,验证控制文件的一致性及db_name的一致性



(3)第三阶段


sql> alter database open;

Database altered.


sql> select open_mode from v$database;


OPEN_MODE

--------------------

READ WRITE


sql> select status from v$instance;


STATUS

------------

OPEN



open这一步,数据库做了什么?

验证数据文件和联机重做日志是否存在及控制文件、数据文件的一致性



sql> startup

ORACLE instance started.


Total System Global Area 7148580864 bytes

Fixed Size 2214216 bytes

Variable Size 3825206968 bytes

Database Buffers 3288334336 bytes

Redo Buffers 32825344 bytes

Database mounted.

Database opened.



###############

使用oracle Restart组件中的 SRVCTL 工具来启动数据库

srvctl start database -d orcl -o mount

srvctl start database -d orcl -o start

srvctl start database -d orcl -o open


不加 -o 默认是open

srvctl start database -d orcl 等价于

srvctl start database -d orcl -o open


[oracle@oel ~]$ crs_stat -t

Name Type Target State Host

------------------------------------------------------------

ora.DATA.dg ora....up.type ONLINE ONLINE oel

ora.FRA.dg ora....up.type ONLINE ONLINE oel

ora....ER.lsnr ora....er.type ONLINE ONLINE oel

ora.asm ora.asm.type ONLINE ONLINE oel

ora.cssd ora.cssd.type ONLINE ONLINE oel

ora.diskmon ora....on.type ONLINE ONLINE oel

ora.orcl.db ora....se.type ONLINE ONLINE oel



#############

数据库关闭



其他:

查看oracle内存段:

ipcs -m | grep ora

[root@oel ~]# ipcs -m | grep ora

0xfa55c7d8 163841 oracle 660 4096 0

0x00000000 1736706 oracle 660 4096 0

0x00000000 1769475 oracle 660 4096 0

0xd3ac6c80 1802244 oracle 660 4096 0


ps - ef | grep ora

相关文章

数据库版本:11.2.0.4 RAC(1)问题现象从EM里面可以看到,在23号早上8:45~8:55时,数据库等待会话暴增...
(一)问题背景最近在对一个大约200万行数据的表查看执行计划时,发现存在异常,理论上应该返回100多万...
(一)删除备份--DELETE命令用于删除RMAN备份记录及相应的物理文件。当使用RMAN执行备份操作时,会在RM...
(1)DRA介绍 数据恢复顾问(Data Recovery Advise)是一个诊断和修复数据库的工具,DRA能够修复数据文...
RMAN(Recovery Manager)是Oracle恢复管理器的简称,是集数据库备份(backup)、修复(restore)和恢复...
(1)备份对象 可以使用RMAN进行的备份对象如下: --整个数据库:备份所有的数据文件和控制文件; --数...