因host命令导致无法正常SHUTDOWN的实验

SHUTDOWN有几个參数能够使用:

SHUTDOWN NORMAL:NORMAL也是默认的子句,运行的条件是

No new connections are allowed after the statement is issued.

Before the database is shut down, the database waits for all currently connectedusers to disconnect from
the database.

下次启动时不须要不论什么实例恢复过程。

SHUTDOWN IMMEDIATE:运行的场景是

To initiate an automated and unattended backup.

When a power shutdown is going to occur soon.

When the database or one of its applications is functioning irregularly and youcannot contact users to ask
them to log off or they are unable to log off.

运行的条件是

No new connections are allowed, nor are new transactions
allowed to be started,after the statement is issued.

Any uncommitted transactions are rolled back. (If long
uncommitted transactionsexist, this method of shutdown might not complete quickly, despite its name.)

Oracle Database does not wait for users currently connected
to the database todisconnect. The database implicitly rolls back active transactions and disconnectsall connected users.

相同地,下次启动时不须要不论什么实例恢复过程。

SHUTDOWN
TRANSACTIONAL
:运行的场景是须要进行例行的实例停止,但首先同意全部活动的交易完毕,运行的条件是

No new connections are allowed, nor are new transactions
allowed to be started,after the statement is issued.

After all transactions have completed, any client still
connected to the instance isdisconnected.

At this point, the instance shuts down just as it would
when a SHUTDOWNIMMEDIATE statement is submitted.

下次启动时不须要不论什么实例恢复过程。

这样的关闭操作不会让client丢失任务,同一时候不要求全部用户退出。

SHUTDOWN
ABORT
:运行的场景是

You need to shut down the database instantaneously (for
example, if you know apower shutdown is going to occur in one minute).

You experience problems when starting a database instance.

运行的条件是

No new connections are allowed, nor are new transactions
allowed to be started,after the statement is issued.

Current client SQL statements being processed by Oracle Database areimmediately terminated.

Uncommitted transactions are not rolled back.

Oracle Database does not wait for users currently connected to the database todisconnect. The database implicitly
disconnects all connected users.

下次启动时将须要实例恢复过程。

能够看出ABORT是一种暴力的关闭,不会隐式地回滚交易,因为仍存在脏块,所下面次启动时须要进行实例恢复。

实验:

1. 运行shutdown normal命令关闭数据库

SQL> shutdown normal

发现提示SHUTDOWN: waiting for logins to complete.

从上面的介绍看,使用shutdown normal的方式关闭数据库,不同意新连接接入,同一时候须要全部已连接的client断开后,才干继续正常关闭。怀疑此处可能存在仍未断开的连接。

使用kill -9 7255仍不起作用。

2. 运行shutdown immediate命令关闭数据库

于是直接CTRL+C中断shutdown
normal,然后使用shutdown immediate命令关闭数据库

SQL>shutdown
immediate

此时提示SHUTDOWN:
Active processes prevent shutdown operation

MOS上有篇文章(416658.1)专门介绍了immediate出现这样的报错的问题,给出的原因是:

“If
the DB Control repository is running on the database target against which shutdown immediate was attempted then an incorrect order of events seems used.You should stop DB Control first to get rid of all connections
between DB Control and the repository database and then shutdown the database with ‘shutdown immediate‘.”

意思是说可能DB
Control库正在运行一些事件,须要停止DB Control避免全部DB Control和库之间的连接,然后才干运行shutdown immediate关闭,但这里我没有这样可能的操作,应该是没有普通用户未运行exit的场景,想一想,原来之前使用SYS登录后用过host切换到OS下,但并未切回退出,因此可能因为这种问题,导致shutdown immediate出现hang的情况

3.
运行shutdown abort命令关闭数据库

依照MOS的说法,使用

SQL>
shutdown abort   直接关闭

SQL>
startup restrict     同意具有restrict session权限的用户才干登陆,换句话,避免用户再登陆导致无法正常关闭

SQL>
shutdown normal 运行normal正常关闭

此时一切都安静了。

总结

1.
非到万不得已尽量不要使用ABORT,谁知道会出现什么诡异的事情。

2.
运行关闭前,建议断开全部使用SYS连接的会话,特别是使用host切换OS的连接,可能会不注意,这点是教训。

时间: 2024-07-29 07:13:27

因host命令导致无法正常SHUTDOWN的实验的相关文章

Linux命令(38):host命令-域名查询工具

host命令 功能说明 host命令是常用的域名查询工具,和nslookup.dig功能基本相同,用法如下: host [参数] [选项] 常用参数 选项 说明 -a 查询DNS详细信息相当于-v -t -c(type) 指定查询类型,默认为IN -r 禁用递归处理 -t(type) 指定查询类型 包括a.all.mx.ns  示例                     查询jd.com信息 [[email protected] ~]# host jd.com jd.com has addre

Linux命令学习总结:shutdown

命令简介: 该命令可以安全关闭或者重新启动系统.你没有看错,shutdown命令不仅可以关闭系统.也可以重启Linux系统. 命令语法: /sbin/shutdown [-t sec] [-arkhncfFHP] time [warning-message] 命令参数: 参数 长参数 描叙 -a   Use /etc/shutdown.allow. -c   中断关机:当执行"shutdown -h 12:00"指令时,只要按+键就可以中断关机的指令 -f   重新启动时不进行磁盘检测

host命令--Linux命令应用大词典729个命令解读

内容来源于人民邮电出版社<Linux命令应用大词典> 讲述729个命令,1935个例子 学习Linux系统的参考书.案头书,遇到不懂的命令或命令选项一查即可 争取每天都发布内容  host命令 使用host命令可以执行DNS查找,进行域名解析. 命令语法: host [选项][名称][服务器] 命令中各选项的含义如表所示. 表                              host命令选项含义 选项 含义 -a 相当于-v -t ANY -C 比较权威域名服务器上的SOA记录 -l

Linux host命令

一.host命令 host命令是常用的分析域名查询工具,可以用来测试域名系统工作是否正常. 1.1 语法 host(选项)(参数) 1.2 选项 -a 显示详细的DNS信息: -c<类型> 指定查询类型,默认值为“IN“: -C 查询指定主机的完整的SOA记录: -r 在查询域名时,不使用递归的查询方式: -t<类型> 指定查询的域名信息类型: -v 显示指令执行的详细信息: -w 如果域名服务器没有给出应答信息,则总是等待,直到域名服务器给出应答: -W<时间> 指定

windows环境常用网络命令测试和分析(51cto实验01)

结果分析 1,ipconfig显示本机ip地址配置情况. 2,ipconfig/all显示本机IP地址配置等情况的详细信息. 3,ping指令测试网络的连通性,发送4个ICMP的类型8报文给对方,对方回应4个ICMP类型的报文给本机. 4,ping –t不停发送ICPM的类型8报文给对方,只要对方存活,就会一直发. 5,arp –a显示本机arp缓存的内容,对方IP地址和对方MAC地址的对应关系. 6,arp –d删除本机的arp缓存区,清除IP地址与MAC地址的对应关系. 7,arp –s绑定

电脑关机命令,方便使用 shutdown -s -t ***

shutdown -s -t 120 120秒后关机,还可以设置更高的时间,1小时60*60即可 3600shutdown -s -t 3600 想要定点关机,就如12点关机,命令如下: at 12:00 shutdown -s 想取消自动关机,在运行中输入: shutdown -a

每天一个Linux命令(64)shutdown命令

    shutdown以一种安全的方式关闭系统.     (1)用法:     用法:  shutdown [参数] [时间]     (2)功能:     功能:  系统关机命令,shutdown指令可以关闭所有程序,并依用户的需要,进行重新开机或关机的动作,所有登陆用户都可以看到关机信息提示. 原理:  shutdown通过通知init进程,要求它改换运行级别来实现.运行级别0用来关闭系统,运行级别6用来重启系统,运行级别1用来使系统进入执行系统管理任务状态,如果没有给出 -h 或 -r

关于运行mysql_install_db命令导致sudo systemctl start /restart mariadb.service启动失败问题

运行环境:centos 7 数据库:mariadb 问题描述:在yum安装mariadb数据库运行后运行了/var/lib/mysql_install_db命令,从而导致mariadb数据库启动或重启都失败. 故障解决: [[email protected] mysql]$ sudo systemctl start mariadb.service  Job for mariadb.service failed because the control process exited with err

host命令详解

基础命令学习目录首页 原文链接:https://blog.csdn.net/xin_y/article/details/53924763 分析域名查询工具,测试域名系统工作是否正常 语法: host (选项) (参数) 选项: -a : 显示详细的DNS信息 -c<类型> : 指定查询类型,默认值为"IN" -C : 查询指定主机的完整的SOA记录 -r : 在查询域名时,不使用递归的查询方式 -t<类型> : 指定查询的域名信息类型 -v : 显示指令执行的详