Three methods for SQL plus to respond in Linux

Source: Internet
Author: User

OracleDatabaseSqlplusNo response is pending. The online query results show that the oracle bug is caused. In fact, this bug may occur as long as the Linux x86 host runs for a multiple of 24.8 days, because time () if the function value is null, an infinite endless loop is generated, consuming the cpu. Next we will introduce the solution.

Three solutions:

1) restart the host;

2) patch set, for example, update to 10.2.0.4;

3) apply a temporary patch 4612267 to the bug.

The first method does not completely solve the problem and will remain the same later. The second method requires a long upgrade time and a long database suspension. The current production environment is not suitable for the time being;

Reference:

Doc ID: 338461.1 SQL * Plus 10.2.0.1 Hangs, When System Uptime Is Long Period of Time

Doc ID: 4612267.8 Bug 4612267-OCI client spins when machine uptime> = 249 days

The third method is patching. According to oracle official documentation, oracle11 has fixed the problem.

The following describes how to install and verify the pache 4612267 patch package:

Stop listening, dbconsole, and database first

 
 
  1. $ lsnrctl stop  
  2.  
  3. $ emctl stop dbconsole  
  4.  
  5. $ sqlplus / as sysdba  
  6.  
  7. SQL> shutdown immediate 

Note: dbconsole is stopped when Oracle EM is installed. If it is not installed, no interference is required.

Install patch

 
 
  1. $ Mkdir $ ORACLE_BASE/patches
  2.  
  3. $ Cd $ ORACLE_BASE/patches
  4.  
  5. $ Rz (upload the p4612267_10201_LINUX.zip file in SecureCRT. Other upload methods are also supported)
  6.  
  7. $ Unzip p4612267_10201_LINUX.zip
  8.  
  9. $ Cd 4612267/
  10.  
  11. $ ORACLE_HOME/OPatch/opatch apply
  12.  
  13. Invoking OPatch 10.2.0.1.0
  14.  
  15. ...
  16.  
  17. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
  18.  
  19. (Oracle Home = '/u01/app/oracle/product/10.2.0/db_1 ')
  20.  
  21. Is the local system ready for patching?
  22.  
  23. Do you want to proceed? [Y | n]
  24.  
  25. Y (enter y here)
  26.  
  27. User Responded with: Y
  28.  
  29. ...
  30.  
  31. ApplySession adding interim patch '000000' to inventory
  32.  
  33. The local system has been patched and can be restarted.
  34.  
  35. OPatch succeeded.

Verify patch

 
 
  1. $ $ORACLE_HOME/OPatch/opatch lsinventory  
  2.  
  3. Invoking OPatch 10.2.0.1.0  
  4.  
  5. Oracle interim Patch Installer version 10.2.0.1.0  
  6.  
  7. Copyright (c) 2005, Oracle Corporation. All rights reserved..  
  8.  
  9. Oracle Home       : /u01/app/oracle/product/10.2.0/db_1  
  10.  
  11. Central Inventory : /u01/app/oracle/oraInventory  
  12.  
  13. from           : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc  
  14.  
  15. OPatch version    : 10.2.0.1.0  
  16.  
  17. OUI version       : 10.2.0.1.0  
  18.  
  19. OUI location      : /u01/app/oracle/product/10.2.0/db_1/oui  
  20.  
  21. Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2009_Jan_13_11-06-27-HKT_Tue.log  
  22.  
  23. Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory-2009_Jan_13_11-06-27-HKT_Tue.txt  
  24.  
  25. --------------------------------------------------------------------------------  
  26.  
  27. Installed Top-level Products (2):  
  28.  
  29. Oracle Database  
  30.  
  31. 10g                                                  10.2.0.1.0  
  32.  
  33. Oracle Database 10g Products                                         10.2.0.1.0  
  34.  
  35. There are 2 products installed in this Oracle Home.  
  36.  
  37. Interim patches (1) :  
  38.  
  39. Patch 4612267      : applied on Tue Jan 13 11:05:10 HKT 2009  
  40.  
  41.    Created on 5 Oct 2005, 13:48:00 hrs US/Pacific  
  42.  
  43.    Bugs fixed:  
  44.  
  45.      4612267  
  46.  
  47. --------------------------------------------------------------------------------  
  48.  
  49. OPatch succeeded. 

Start the database, listener, and dbconsole

 
 
  1. $ sqlplus / as sysdba  
  2.  
  3. SQL> startup  
  4.  
  5. $ lsnrctl start  
  6.  
  7. $ emctl start dbconsole 

If necessary, you can delete the patch and stop the database before deleting it.

 
 
  1. $ Cd $ ORACLE_BASE/patches/4612267
  2.  
  3. $ ORACLE_HOME/OPatch/opatch rollback-id 4612267
  4.  
  5. Invoking OPatch 10.2.0.1.0
  6.  
  7. ...
  8.  
  9. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
  10.  
  11. (Oracle Home = '/u01/app/oracle/product/10.2.0/db_1 ')
  12.  
  13. Is the local system ready for patching?
  14.  
  15. Do you want to proceed? [Y | n]
  16.  
  17. Y (enter y here)
  18.  
  19. User Responded with: Y
  20.  
  21. ...
  22.  
  23. RollbackSession removing interim patch '000000' from inventory
  24.  
  25. The local system has been patched and can be restarted.
  26.  
  27. OPatch succeeded.

Execute the above patch command and you will find that the patch has been deleted.

Note:

 
 
  1. Running STRACE tool shows:
  2.  
  3. $ Strace/oracle/home/bin/sqlplus-V 2> & 1 | less
  4.  
  5. ......
  6.  
  7. Old_mmap (NULL, 385024, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS,-1, 0) = 0x41794000
  8.  
  9. Gettimeofday ({1122996561,411 035}, NULL) = 0
  10.  
  11. Access ("/usr/local/UD/conf/sqlnet. ora", F_ OK) =-1 ENOENT (No such file or directory)
  12.  
  13. Access ("/usr/local/UD/lib/oracle/network/admin/sqlnet. ora", F_ OK) =-1 ENOENT (No such file or directory)
  14.  
  15. Access ("/usr/local/UD/conf/sqlnet. ora", F_ OK) =-1 ENOENT (No such file or directory)
  16.  
  17. Access ("/usr/local/UD/lib/oracle/network/admin/sqlnet. ora", F_ OK) =-1 ENOENT (No such file or directory)
  18.  
  19. Fcntl64 (-1218313656, F_SETFD, FD_CLOEXEC) =-1 EBADF (Bad file descriptor)
  20.  
  21. It is looping on the times () function. -- in an endless loop
  22.  
  23. Times (NULL) =-1825782405
  24.  
  25. Times (NULL) =-1825782405
  26.  
  27. Times (NULL) =-1825782405
  28.  
  29. Times (NULL) =-1825782405
  30.  
  31. Times (NULL) =-1825782405
  32.  
  33. Times (NULL) =-1825782405
  34.  
  35. Times (NULL) =-1825782405

I will introduce the problem that sqlplus does not respond in Linux. I hope this introduction will bring you some gains!

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.