Archive

Archive for the ‘windows’ Category

Cannot apply BP10 to Oracle Database 11.2.0.2 on Windows Server 2008 R2

November 9th, 2011 2 comments

This happened to be when I tryed to apply Bundle Patch 10 of Oracle Database 11.2.0.2 on Windows 2008, but I guess it could happen to any 11.x database version. I decided to apply this patch after I stepped the bug in which the heap memory is exhausted because of an CVU health checks (I described it here).

After running opatch apply I got that the following files are still active:
d:\app\11.2.0\grid\bin\oraclient11.dll
d:\app\11.2.0\grid\bin\orageneric11.dll
d:\app\11.2.0\grid\bin\orapls11.dll
d:\app\11.2.0\grid\bin\oracommon11.dll
d:\app\11.2.0\grid\bin\oci.dll
d:\app\11.2.0\grid\bin\orahasgen11.dll
d:\app\11.2.0\grid\bin\oraocr11.dll
d:\app\11.2.0\grid\bin\oraocrb11.dll
d:\app\11.2.0\grid\bin\oraocrutl11.dll
d:\app\11.2.0\grid\bin\mDNSResponder.exe
d:\app\11.2.0\grid\bin\ocssd.exe
d:\app\11.2.0\grid\bin\cssdagent.exe
d:\app\11.2.0\grid\bin\cssdmonitor.exe
d:\app\11.2.0\grid\bin\evmd.exe
d:\app\11.2.0\grid\bin\evmlogger.exe
d:\app\11.2.0\grid\bin\gipcd.exe
d:\app\11.2.0\grid\bin\gpnpd.exe
d:\app\11.2.0\grid\bin\octssd.exe

It’s unlikely to have something running, because I have stopped all GI processes. Again to find out which is the process holding the dll’s I’ve used ProcessExplorer. It seemed that process WmiPrvSE.exe had the dlls open:

Description of WMI:
The wmiprvse.exe file is otherwise known as Windows Management Instrumentation. It is a Microsoft Windows-based component that provides control and information about management in an enterprise environment. Developers use the wmiprvse.exe file in order to develop applications used for monitoring purposes.

For some reason WMI is holding the CRS dlls. Stop the WMI service or kill the process and this should release the lock on the drivers and allow the opatch to proceed.

Regards,
Sve

Categories: oracle, windows Tags: , ,

Exhaust of Windows 2008 heap memory with Oracle Database 11.2.0.2

September 29th, 2011 4 comments

Recently I had an interesting setup for one of our customers. Because they got Oracle Standard Edition and Windows 2008 Server R2 Standard Edition licenses I was asked to create HA database installation. After looking around I found few docs about installing Standard Edition with Clusterware and I had some ideas. Finally I installed Grid Infrastructure on both servers and Oracle Database binaries. Then created single instance database on the second server and replicated the configuration to the first one. Currently the relocation of the database is done manually, but one could create a start/stop/monitor scripts and integrate these with GI. Once the database starts it’s registering at the scan listener so in theory it’s running in HA (just the relocation is manual) 🙂

So during the weekend I received mail from my colleagues above error messages they received from the database: connect error, Socket read timed out. It wasn’t a rush as the database is not yet in production, but it’s ahead and this was the first task for the Monday. Next day I looked around and everything was up and running, except that I wasn’t able to login through the listener and I also wasn’t able to stop or relocate it. Looking at the logs I found at some point the following message: TNS-12531: TNS:cannot allocate memory which explains the previous message.

That was weird, the server on which error appeared was the first one and had only GI running and SCAN LISTENER. This really looked like a memory leak, it’s a Windows so maybe that was obvious. I decided to look around the processes using the Resource Monitor when I found a lot of many cmd.exe processes. To confirm the problem I used Process Explorer which is a very nice tool for Windows. As could be seen below I’ve got plenty of cmd processes which were spawned, but not (obviously) closed after completion:

It turned out that this is a bug for 11.2.0.2 and Windows (64 bit). The Oracle CVU resource (ora.cvu), which by default is started on the first node in the cluster (this makes sense now) it’s doing checks on every six hours (CHECK_INTERVAL=21600) and leaves process open. Because of this the heap memory is exhausted and that’s the reason why the SCAN LISTENER is failing and giving the error message TNS-12531: TNS:cannot allocate memory

 

The following errors could be seen in Windows Eventlog, once the patch is applied the errors disappeared:
Faulting application lsnrctl.exe, version 11.2.0.2, time stamp 0x4cea8f55, faulting module kernel32.dll, version 6.0.6001.18538, time stamp 0x4cb73957, exception code 0xc0000142, fault offset 0x00000000000b1b48, process id 0x1eac, application start time 0x01cc6ab588f992c0.

Faulting application cmd.exe, version 6.0.6001.18000, time stamp 0x47918bde, faulting module kernel32.dll, version 6.0.6001.18538, time stamp 0x4cb733e1, exception code 0xc0000142, fault offset 0x0006f1e7, process id 0x1004, application start time 0x01cc6af0fa982500.

Faulting application sclsspawn.exe, version 0.0.0.0, time stamp 0x4ce622a7, faulting module kernel32.dll, version 6.0.6001.18538, time stamp 0x4cb73957, exception code 0xc0000142, fault offset 0x00000000000b1b48, process id 0x1ca0, application start time 0x01cc6c0e5efd5380.

This is the bug at MOS:
Bug 12529945: CVU HEALTH CHECKS EXHAUST WINDOWS HEAP MEMORY

The bug should have been fixed in BP8, but I applied the latest one BP10:
Patch 12849789: ORACLE 11G 11.2.0.2 PATCH 10 BUG FOR WINDOWS (64-BIT AMD64 AND INTEL EM64)

 

Regards,
Sve

Categories: oracle, windows Tags: , , ,

Running PHP 5.3.6 with Oracle support on Windows Server 2008 (64bit)

June 20th, 2011 1 comment

I was involved in a project for running a media portal with Apache/PHP and Oracle database and was asked to build the environment. As the title says it’s a Windows Server 2008 Standard edition (no enterprise, no failsafe) what’s more the licenses for Oracle Database were for Standard Editon for one server. I managed to create a HA environment for both Apache and Oracle Database, but this is another topic which I hope to describe later.

The problems which took me most time and efforts were user equivalence during Grid Infrastructure installation and running Apache/PHP with Oracle support.

In case you have installed PHP with Oracle support (enabled extension=php_oci8_11g.dll at php.ini) and does not see any OCI8 support in phpinfo(); or run in following errors during Apache startup:

The requested operation has failed!

OR

httpd.exe:
The application has failed to start because OCI.dll was not found.
Re-installing the application may fix the problem.

 

Then most probably you’re trying to run PHP (which is 32bit) with Oracle OCI library (which is 64bit). I had installed database binaries already on both machines and that’s why I had oci.dll in the PATH variable. Now PHP is trying to load my 64bit oci.dll library and fails, this could easily be determined with file command:
sve@angmar:/tmp$ file oci.dll
oci.dll: PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly
sve@angmar:/tmp$ file php.exe
php.exe: PE32 executable for MS Windows (console) Intel 80386 32-bit

The solution was to download Oracle instant client 11.2 (32bit!) and put it for example in PHP home directory. Then the path has to be added to the environment variable PATH at first place. Now OCI8 support is enabled and Apache server is starting normally, also running file against new oci.dll shows following:

sve@angmar:/tmp$ file oci.dll
oci.dll: PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit

 

Regards,
Sve

Categories: oracle, windows Tags: ,