Thursday, September 17, 2015

Error: OSWatcher uses the OS utility Logman to gather its data

Starting Operating System Watcher for Windows (OSWatcher) may return following error message.
c:\oswfw_2_5.1\oswfw_2_5.1>oswatcher 20 120

Error:
OSWatcher uses the OS utility Logman to gather its data.
Logman can only write its output to a local drive.
fOSWatcher therefore can only be run from a local drive.


To solve this issue; open command prompt, where you will initiate OSwatcher, by using “Run as Administrator” option after right clicking on command prompt icon form the start menu – as you see bellow





































After that, OSWatcher should run successfully
c:\oswfw_2_5.1\oswfw_2_5.1>oswatcher 20 120

Start of Operating System Watcher for Windows

           Processing: OSWThread OSWSystem OSWServer_Work_Queue OSWProcessor OSWProcess OSWLogicalDisk OSWPhysicalDisk OSWPagingFile OSWNetstat OSWMemory OSWCache
           Config Dir: c:\oswfw_2_5.1\oswfw_2_5.1
Output File Directory: c$\oswfw_2_5.1\oswfw_2_5.1
     Output File Type: csv
    Snapshot Interval: 00:00:20 seconds
     Runtime Interval: 0120:00:00 (/du 0120:00) hours
            Node List: SGPVPSTUNMGR

OSWatcher for Windows written by:
  Kevin Reardon, Center of Expertise, Oracle Corporation

Starting OSWatcher for Windows V2.5.1 on Thu 08/27/2015

Creating Archive Directories:

Node SGPVPSTUNMGR created Archive
Node SGPVPSTUNMGR created Archive\OSWThread
Node SGPVPSTUNMGR created Archive\OSWSystem
Node SGPVPSTUNMGR created Archive\OSWServer_Work_Queue
Node SGPVPSTUNMGR created Archive\OSWProcessor
Node SGPVPSTUNMGR created Archive\OSWProcess
Node SGPVPSTUNMGR created Archive\OSWLogicalDisk
Node SGPVPSTUNMGR created Archive\OSWPhysicalDisk
Node SGPVPSTUNMGR created Archive\OSWPagingFile
Node SGPVPSTUNMGR created Archive\OSWNetstat
Node SGPVPSTUNMGR created Archive\OSWMemory
Node SGPVPSTUNMGR created Archive\OSWCache

Creating OSWatcher Counters
Create Counter: OSWThread
 Start Counter: OSWThread
Create Counter: OSWSystem
 Start Counter: OSWSystem
Create Counter: OSWServer_Work_Queue
 Start Counter: OSWServer_Work_Queue
Create Counter: OSWProcessor
 Start Counter: OSWProcessor
Create Counter: OSWProcess
 Start Counter: OSWProcess
Create Counter: OSWLogicalDisk
 Start Counter: OSWLogicalDisk
Create Counter: OSWPhysicalDisk
 Start Counter: OSWPhysicalDisk
Create Counter: OSWPagingFile
 Start Counter: OSWPagingFile
Create Counter: OSWNetstat
 Start Counter: OSWNetstat
Create Counter: OSWMemory
 Start Counter: OSWMemory
Create Counter: OSWCache
 Start Counter: OSWCache
Create OSWCleanup

Data Collector Set                      Type                          Status
-------------------------------------------------------------------------------
OSWCache                                Counter                       Running
OSWLogicalDisk                          Counter                       Running
OSWMemory                               Counter                       Running
OSWNetstat                              Counter                       Running
OSWPagingFile                           Counter                       Running
OSWPhysicalDisk                         Counter                       Running
OSWProcess                              Counter                       Running
OSWProcessor                            Counter                       Running
OSWServer_Work_Queue                    Counter                       Running
OSWSystem                               Counter                       Running
OSWThread                               Counter                       Running

The command completed successfully.

The status of OSWClenanup on SGPVPSTUNMGR is: SGPVPSTUNMGR


c:\oswfw_2_5.1\oswfw_2_5.1>



Monday, September 14, 2015

TNS-12531: TNS:cannot allocate memory

I found this message in my listener.ora file while investigating a ORA-00600 error which was causing the database to slow down very much.
24-FEB-2015 11:55:00 * 12531
TNS-12531: TNS:cannot allocate memory
24-FEB-2015 11:55:02 * 12531
TNS-12531: TNS:cannot allocate memory
24-FEB-2015 11:55:04 * 12531
TNS-12531: TNS:cannot allocate memory

The reason which I found was that this database server was a 32-Bit Windows machine where maximum 4G RAM can be utilized. Once all RAM is consumed, listener would not be able to spawn a new server process because of memory shortage. In shortage of resources (especially on 32-bit platform), you may also face ORA-04030. Solution for this problem is to move to 64-bit platform. As a workaround, you can try to reduce SGA memory allocation to free up some memory and/or stop any unnecessary process or application.

Tuesday, September 1, 2015

TNS-12560: TNS:protocol adapter error

This is one of the most common and generic errors you may face while trying to connect with the database. There could be a lot of reasons for this. To troubleshoot this, you may want to go through following checklist
Check your TNS entry in TNSNAMES.ORA file, if it is set correctly and there is no syntax error and it is pointing to correct server and instance.
Use “tnsping” command to check the TNS service. This will also show the path of sqlnet.ora file to confirm where your TNS_ADMIN is pointing to. If you see anything wrong, set your TNS_ADMIN correctly to point to correct $ORACLE_HOME/network/admin location.

C:\Users\00140^OperaSupport>tnsping test

TNS Ping Utility for 32-bit Windows: Version 10.1.0.4.2 - Production on 19-AUG-2015 01:45:19

Copyright (c) 1997, 2003, Oracle.  All rights reserved.

Used parameter files:
D:\oracle\12.1.0.2\database\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST= (ADDRESS = (PROTOCOL = TCP)(host = 192.168.10.2)(Port = 1521))) (CONNECT_DATA = (SERVICE_NAME = PRODDB))
TNS-12560: TNS:protocol adapter error

There could be a possibility that listener port (1521 is default) is blocked for security reasons. Use telnet command from client to connect with port 1521 of the server to check if 1521 port is open and accessible. Error as shown below would mean that port is not accessible. If telnet succeeds, it would just show a blank screen without any error message.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\salmqure>telnet MYSERVER 1521
Connecting To MYSERVER...Could not open connection to the host, on port 1521: Connect failed

Make sure there are enough resources available on both client side and database server side. If not enough resources (CPU, RAM, pagefile/swapspace) available, you might be facing TNS-12560 error. Open task manager (or use “top” command on Linux) to check current resources utilization.
Check if network connectivity from client to database server (and vice versa) working fine. Even if “ping” command is working fine, still there could be some network connectivity issue which might be the reason of TNS-12560. 
Once I faced this error message, and to check client server network connectivity I tried to access database server “d:” drive by typing \\<host_IP>\d$ in run command box; and it returned me error “The name limit for the local computer network adapter card was exceeded” as you can see bellow.









Microsoft provides instructions here to troubleshoot this problem. In my case, IT team helped to resolve this problem and after that TNS-12560 was gone