暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

ORACLE之nomount、mount与open

原创 何权林 2020-07-10
2239

一、startup nomount
Starting the Instance (NOMOUNT)
An instance would be started in the NOMOUNT stage only during database creation or the re-creation of control files.
Starting an instance includes the following tasks:
• Reading the initialization file from $ORACLE_HOME/dbs in the following order:
- First spfileSID.ora
- If not found then, spfile.ora
- If not found then, initSID.ora
Specifying the PFILE parameter with STARTUP overrides the default behavior.
• Allocating the SGA
• Starting the background processes
• Opening the alertSID.log file and the trace files
The database must be named with the DB_NAME parameter either in the initialization parameter file or in the STARTUP command.
首先,查看参数文件;
其次,开启实例,分配内存;
然后,开启后台进程;
最后,打开log。

二、startup mount
To perform specific maintenance operations, you start an instance and mount a database but do not open the database.
For example, the database must be mounted but not open during the following tasks:
• Renaming data files
• Enabling and disabling online redo log file archiving options
• Performing full database recovery
Mounting a database includes the following tasks:
• Associating a database with a previously started instance
• Locating and opening the control files specified in the parameter file
• Reading the control files to obtain the names and status of the data files and online redo log files. However, no checks are performed to verify the existence of the data files and online redo log files at this time.
首先,关联数据库与开启的实例;
然后,根据参数文件找到控制文件并打开;
最后,读取控制文件获得数据文件及redo log文件。

三、startup open
Normal database operation means that an instance is started and the database is mounted and open. With normal database operation, any valid user can connect to the database and perform typical data access operations.
Opening the database includes the following tasks:
• Opening the online data files
• Opening the online redo log files
If any of the data files or online redo log files are not present when you attempt to open the database, the Oracle server returns an error.
During this final stage, the Oracle server verifies that all the data files and online redo log files can be opened and checks the consistency of the database. If necessary, the SMON background process initiates instance recovery.
首先,根据控制文件中获得的信息,打开数据文件;
然后,打开redo log;
最后,检查数据一致性,如有必要,进行前滚回滚恢复。

四、其他
SHUTDOWN:
shutdown normal: 不断开现有连接用户,但阻止任何用户建立新的连接。已连接的用户能够继续他们的工作,直到用户自行断开连接。数据库再次启动时不需要实例恢复。(关机时间长)

shutdown transactional: 与normal方式区别在于,上面是需要用户执行完所有操作后自行关闭连接,而transactional方式是当用户执行完当前事务后,数据库强制关闭用户连接。数据库再次启动时不需要实例恢复。

shutdown immediate: 阻止任何用户新的连接,当前连接用户未递交的事务强制回退,断开用户连接,关闭数据库。数据库再次启动时不需要实例恢复。

shutdown abort: 阻止任何用户新的连接,未递交的事务都不被回退,强制断开任何连接,关闭数据库。数据库再次启动时自动进行实例恢复。

STARTUP:
startup nomount: 根据参数文件,分配内存实例,启动后台进程,不打开控制文件和数据文件,不能访问数据库。

startup mount: 不允许数据库用户访问。仅当前实例的控制文件被打开,数据文件未打开。
当前模式下可操作:重命名数据文件、添加取消或重命名重做日志文件、设置归档模式、设置闪回、执行完整的数据库恢复操作等。

startup open: startup的默认参数就是open,打允许数据库的访问,当前实例控制文件中所描述的所有文件都已经打开。

startup pfile=filename: 以filename为初始化文件启动数据库,不使用默认初始化文件。

startup force: 中止当前数据库的运行,开始重新正常的启动数据库。

startup restrict: 只允许具有restricted session权限的用户访问数据库。

startup recover: 数据库启动,并开始介质恢复。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论