Local=no and Local=yes____oracle in the Oracle process

Source: Internet
Author: User
Tags sqlplus
Local=no and Local=yes in the Oracle process

Reprinted to Http://www.cnblogs.com/wjoyxt/p/3780860.html

We connect the database with Sqlplus on the server, and when we view the process, we have one more record:

Oracle 16007 16006 0 10:27? 00:00:00

Oraclenewccs (description= (Local=yes) (address= (PROTOCOL=BEQ))

Local=no: Not a local connection, that is, a network connection. It is connected to the server through listener. The client's application listens to the server through the listener to send the request, after the server listens receives, in with the database connection, carries on the related operation, returns the result to the client. This is through the listening process. So the client needs to configure listening, that is, configure Tnsnames.ora.

Local=yes: Local connection. Local connection does not go to listen, so in the case of service monitoring is not started, through the local sqlplus can still connect to the database.

Now there's a problem, if we die in the execution of SQL after the client connects to the server via Pl/sql Developer or Toad tool, we can only end the program, or we kill the Toad process directly, Then the listening process established between the servers will not be released. Related processes that are not released or continue to occupy system resources. So for these dead processes, we can kill these processes: Kill-9 PID. However, in the production base to be cautious, to confirm that the process is dead can kill.

$ ps-ef|grep ORACLEORCL

Oracle 2321 1 0 20:56? 00:00:00 ORACLEORCL (Local=no)

Oracle 2391 1 0 21:02? 00:00:00 ORACLEORCL (Local=no)

Oracle 2442 1 0 21:06? 00:00:00 ORACLEORCL (Local=no)

Oracle 2534 2416 0 21:09 pts/1 00:00:00 grep ORACLEORCL

-bash-3.2$ kill-9 2321

-bash-3.2$ Ps-ef|grep ORACLEORCL

Oracle 2391 1 0 21:02? 00:00:00 ORACLEORCL (Local=no)

Oracle 2544 2416 0 21:10 pts/1 00:00:00 grep ORACLEORCL

The following script is the process of killing a network connection that has more than 30 minutes of connection time. Put the script in the crontab and execute it regularly.


kill.sh: 
ps-e-o pid-o etime-o args|grep local=no>/tmp/tmpfile 
Cat/tmp/tmpfile|while Read LINE&NBSP
do 
time= ' echo $LINE |awk ' {print $} '  
Time= ' echo $TIME |awk-f: ' {print $} ' &NBSP
If [$TIME-gt] 
then 
Echo $LINE >>/tmp/tmpfile2 
fi 
done 
cut-c 1-5/tmp/tmpfile2 |xargs-t-n1 kill-9 
rm-f/tmp/tmpfile 
rm-f/tmp/tmpfile2 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.