Home Database Mysql Tutorial 因host命令导致无法正常SHUTDOWN的实验

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

Jun 07, 2016 pm 04:09 PM
host s shutdown Order experiment lead to normal

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 discon

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 connected users 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 you cannot 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 transactions exist, this method of shutdown might not complete quickly, despite its name.)

Oracle Database does not wait for users currently connected to the database to disconnect. The database implicitly rolls back active transactions and disconnects all 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 is disconnected.

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

下次启动时不需要任何实例恢复过程。

这种关闭操作不会让客户端丢失任务,同时不要求所有用户退出。

SHUTDOWN ABORT:执行的场景是

You need to shut down the database instantaneously (for example, if you know a power 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 are immediately terminated.

Uncommitted transactions are not rolled back.

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

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

可以看出ABORT是一种暴力的关闭,不会隐式地回滚交易,由于仍存在脏块,所以下次启动时需要进行实例恢复。

实验:

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

SQL> shutdown normal

\

发现提示SHUTDOWN: waiting for logins to complete喎?http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vc3Ryb25nPi48L3A+CjxwPrTTyc/D5rXEvenJ3L+0o6zKudPDc2h1dGRvd24gbm9ybWFstcS3vcq9udix1cr9vt2/4qOssrvUytDt0MLBrL3TvdPI66OszazKsdDo0qrL+dPQ0tHBrL3TtcS/zbuntsu2z7+quvOjrLLFxNy8zND41f2zo7nYsdWho7uz0sm0y7Smv8nE3LTm1NrI1M60ts+/qrXEway906GjPC9wPgo8cD7KudPDa2lsbCAtOSA3MjU1yNSyu8bw1/fTw6GjPGJyPgo8L3A+Cgo8cD48c3Ryb25nPjIuINa00NBzaHV0ZG93biBpbW1lZGlhdGXD/MHuudix1cr9vt2/4jwvc3Ryb25nPjxicj4KPC9wPgo8cD7T2srH1rG900NUUkwmIzQzO0PW0LbPc2h1dGRvd24gbm9ybWFso6zIu7rzyrnTw3NodXRkb3duCiBpbW1lZGlhdGXD/MHuudix1cr9vt2/4jwvcD4KPHA+U1FMJmd0OwpzaHV0ZG93biBpbW1lZGlhdGU8L3A+CjxwPjxpbWcgc3JjPQ=="http://www.2cto.com/uploadfile/Collfiles/20141113/201411130916122.png" alt="\">

此时提示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的连接,可能会不注意,这点是教训。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Windows 11 shutdown prompts task host window task host is executing the shutdown task solution Windows 11 shutdown prompts task host window task host is executing the shutdown task solution Feb 12, 2024 pm 12:40 PM

Recently, many Win11 users have reported that when shutting down, they are prompted that the taskhostwindow task host is executing the shutdown task. So what is going on? Users can enter the Desktop folder under the local registry editor, and then select AutoEndTasks in the right window to set it. Let this site carefully introduce to users the solution to this problem when shutting down. Windows 11 shutdown prompts that the taskhostwindow task host is executing the shutdown task. Solution 1. Use the key combination win key + r key, enter "regedit" and press Enter, as shown in the figure below. 2. Search for [HKEY

How to run SUDO commands in Windows 11/10 How to run SUDO commands in Windows 11/10 Mar 09, 2024 am 09:50 AM

The sudo command allows users to run commands in elevated privilege mode without switching to superuser mode. This article will introduce how to simulate functions similar to sudo commands in Windows systems. What is the Shudao Command? Sudo (short for "superuser do") is a command-line tool that allows users of Unix-based operating systems such as Linux and MacOS to execute commands with elevated privileges typically held by administrators. Running SUDO commands in Windows 11/10 However, with the launch of the latest Windows 11 Insider preview version, Windows users can now experience this feature. This new feature enables users to

How to check the MAC address of the network card in Win11? How to use the command to obtain the MAC address of the network card in Win11 How to check the MAC address of the network card in Win11? How to use the command to obtain the MAC address of the network card in Win11 Feb 29, 2024 pm 04:34 PM

This article will introduce readers to how to use the command prompt (CommandPrompt) to find the physical address (MAC address) of the network adapter in Win11 system. A MAC address is a unique identifier for a network interface card (NIC), which plays an important role in network communications. Through the command prompt, users can easily obtain the MAC address information of all network adapters on the current computer, which is very helpful for network troubleshooting, configuring network settings and other tasks. Method 1: Use "Command Prompt" 1. Press the [Win+X] key combination, or [right-click] click the [Windows logo] on the taskbar, and in the menu item that opens, select [Run]; 2. Run the window , enter the [cmd] command, and then

Super practical! Sar commands that will make you a Linux master Super practical! Sar commands that will make you a Linux master Mar 01, 2024 am 08:01 AM

1. Overview The sar command displays system usage reports through data collected from system activities. These reports are made up of different sections, each containing the type of data and when the data was collected. The default mode of the sar command displays the CPU usage at different time increments for various resources accessing the CPU (such as users, systems, I/O schedulers, etc.). Additionally, it displays the percentage of idle CPU for a given time period. The average value for each data point is listed at the bottom of the report. sar reports collected data every 10 minutes by default, but you can use various options to filter and adjust these reports. Similar to the uptime command, the sar command can also help you monitor the CPU load. Through sar, you can understand the occurrence of excessive load

cmdtelnet command is not recognized as an internal or external command cmdtelnet command is not recognized as an internal or external command Jan 03, 2024 am 08:05 AM

The cmd window prompts that telnet is not an internal or external command. This problem must have deeply troubled you. This problem does not appear because there is anything wrong with the user's operation. Users do not need to worry too much. All it takes is a few small steps. Operation settings can solve the problem of cmd window prompting telnet is not an internal or external command. Let’s take a look at the solution to the cmd window prompting telnet is not an internal or external command brought by the editor today. The cmd window prompts that telnet is not an internal or external command. Solution: 1. Open the computer's control panel. 2. Find programs and functions. 3. Find Turn Windows features on or off on the left. 4. Find “telnet client

Where is hyperv enhanced session mode? Tips for enabling or disabling Hyper-V enhanced session mode using commands in Win11 Where is hyperv enhanced session mode? Tips for enabling or disabling Hyper-V enhanced session mode using commands in Win11 Feb 29, 2024 pm 05:52 PM

In Win11 system, you can enable or disable Hyper-V enhanced session mode through commands. This article will introduce how to use commands to operate and help users better manage and control Hyper-V functions in the system. Hyper-V is a virtualization technology provided by Microsoft. It is built into Windows Server and Windows 10 and 11 (except Home Edition), allowing users to run virtual operating systems in Windows systems. Although virtual machines are isolated from the host operating system, they can still use the host's resources, such as sound cards and storage devices, through settings. One of the key settings is to enable Enhanced Session Mode. Enhanced session mode is Hyper

What is the normal computer CPU operating temperature? What is the normal computer CPU operating temperature? Feb 18, 2024 pm 05:00 PM

What is the normal temperature of computer CPU? With the continuous development of technology, computers have become an indispensable tool in people's lives. Whether it is for office, study or entertainment, computers play an important role. As one of the core components of the computer, the temperature of the CPU plays a vital role in the performance and stability of the computer. So, how should we judge whether the temperature of the computer CPU is normal? First of all, we need to make it clear that different CPU models and brands have different upper operating temperature limits. Generally speaking, most CPUs

How to delete win11 widgets? One command to uninstall Windows 11 widgets function tips How to delete win11 widgets? One command to uninstall Windows 11 widgets function tips Apr 11, 2024 pm 05:19 PM

Widgets are a new feature of the Win11 system. They are turned on by default. However, it is inevitable that some users do not use widgets very much and want to disable them because they take up space. So how should they do this? The editor below will teach you how to operate it, and you can try it out. What are widgets? Widgets are small cards that display dynamic content from your favorite apps and services on your Windows desktop. They appear on the widget board, where you can discover, pin, unpin, arrange, resize, and customize widgets to reflect your interests. The widget board is optimized to display relevant widgets and personalized content based on usage. Open the widget panel from the left corner of the taskbar, where you can see live weather

See all articles