In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. The difference between Oracle and Dameng kill session. 1. One of the methods of Kill Session in Oracle database:
The basic syntax of the Oracle-ALTER SYSTEM KILL SESSION kill session is as follows.
SQL > ALTER SYSTEM KILL SESSION 'sid,serial#'
In the RAC environment, you can optionally specify the INST_ID, which is displayed when querying the GV$SESSION view. This allows you to terminate sessions on different RAC nodes.
SQL > ALTER SYSTEM KILL SESSION 'sid,serial#,@inst_id'
The KILL SESSION command does not actually terminate the session. It just asks for conversational suicide. In some cases, such as waiting for a reply from a remote database or rolling back a transaction, the session does not immediately terminate itself and wait for the current operation to complete. In these cases, the session will have a "marked as kill" state. And then it will be killed as soon as possible. In addition to the syntax described above, you can also add an IMMEDIATE clause.
SQL > ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE
This does not affect the work of command execution, but immediately returns control to the current session rather than waiting for confirmation of the kill.
2. DM Kill session
The DM database uses a threaded architecture, so instead of directly kill processes like Oracle, you can only call sp_close_session () to kill the thread to kill the session.
SQL > select sess_id,curr_sch, sql_text,user_name,trx_id, clnt_host,clnt_ip,osname, vpooladdr from sys.v$sessions where sql_text''
LINEID SESS_ID CURR_SCH SQL_TEXT
-
USER_NAME TRX_ID CLNT_HOST CLNT_IP OSNAME VPOOLADDR
--
1 140615618728712 SYSDBA select COMMENT$ from SYS.SYSCOLUMNCOMMENTS where SCHNAME='SYS' and TVNAME='SYSOBJECTS' and COLNAME='SUBTYPE$'
SYSDBA 1871 ahzhixin:: ffff:192.168.20.45 Windows 8 140615618661112
2 140615954273032 SYSDBA select sess_id,curr_sch, sql_text,user_name,trx_id, clnt_host,clnt_ip,osname, vpooladdr from sys.v$sessions where sql_text''
SYSDBA 1874 dm2:: ffff:127.0.0.1 Linux 140615954205432
Used time: 1.935 (ms). Execute id is 57.
Then use the system procedure SP_CLOSE_SESSION (SESSION_ID) to kill the session according to SESSION_ID:
SQL > SP_CLOSE_SESSION (140615618728712)
DMSQL executed successfully
Used time: 1.099 (ms). Execute id is 58.
SQL >
Second, the concept of threads:
In the Oracle database, there are many processes, each of which is responsible for different functions. On the other hand, DM database uses the single-process and multi-thread structure of "symmetric server architecture". This symmetric server architecture not only makes effective use of system resources, but also provides high scalability performance. The thread referred to here is the thread of the operating system.
[root@dm1 dm] # ps-ef | grep dmserver
Dmdba 21285 1 0 18:02? 00:00:04 / dm/dmdbms/bin/dmserver / dm/dmdbms/data/cndba/dm.ini-noconsole
Root 21638 21435 0 23:52 pts/1 00:00:00 grep dmserver
[root@dm1 dm] #
At run time, the server is composed of a variety of memory data structures and a series of threads, which are divided into many types, and different types of threads complete different tasks. Threads access and process the data structure concurrently through a certain synchronization mechanism to complete all kinds of tasks submitted by customers. The DM database server is a shared server that allows multiple users to connect to the same server. The server process is called the shared server process.
The DM process mainly includes listening thread, IO thread, worker thread, scheduling thread, log thread and so on. You can view the relevant information of the thread through the dynamic performance view of DM. The main related threads are as follows:
V$LATCHES records the current waiting thread information V$THREADS records the information of active threads in the current system V$WTHRD_HISTORY records the relevant historical information of all active threads since the system was started. V$PROCESS records server process information
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.