High Availbility

OS & Virtualization

Wednesday, October 25, 2006

DBMS_APPLICATION_INFO package

I often see requests to investigate why a particular job is taking longer than expected, or to kill a session running a particular job. The problem is identifying the session, and they trying to identify what the session is doing, or what part of the batch process is running.

If developers used the DBMS_APPLICATION_INFO package to instrument their code it would make mine that their life much easy. The package allows you to specify a Module and Action for the current position in the code. This can be monitored externally using V$SESSION and also appears in V$SQLAREA to allow you to match SQL to a module.

You can also use the package to put your own progress information in V$SESSION_LONGOPS. If you haven't come across this view before Oracle itself populates it when doing "long operations", so you can monitor the progress of an index rebuild, or how far a FTS has got. With the DBMS_APPLICATION_INFO package you can show the progress of you own batch processing, eg. You have processes 300 contracts out of 2000 etc.

- at start
DBMS_APPLICATION_INFO.SET_MODULE( 'TEST MODULE','AT START' );
- when complete
DBMS_APPLICATION_INFO.SET_MODULE( NULL,NULL );

The first monitors what the progress in v$SESSION ...
SELECT sid , module ,action
FROM v$session
WHERE module IS NOT NULL

The second monitors V$SESSION_LONGSOPS through the long ops section

SELECT sid ,opname,sofar,totalwork,units,elapsed_seconds ,time_remaining FROM v$session_longops WHERE sofar != totalwork;

VMware for Oracle

You want to run Oracle on multiple platforms? You want to be able to install once and then go ahead and play with the database after having set it up once and not need to reinstall the software . You are very curious to learn these newer technologies, you want to watch and learn how RAC works but unfortunately you just have one computer at home. Even at work it's not just that easy to get a couple of machines , if not servers, to hook them up, build clusters and have them all shared Cooked or RAW via a SCSI let alone JBOD, SAN or NAS.

Good VMware with links with Oracle
http://www.dbasupport.com/oracle/ora10g/RACingAhead0101.shtml
http://www.oracle.com/technology/tech/linux/vmware/cookbook/index.html
http://oracle-base.com/articles/10g/OracleDB10gR2RACInstallationOnWindows2003UsingVMware.php

Saturday, October 21, 2006

Performance monitoring on Windows

Oracle Performance Monitoring on Windows

The Oracle Counters for Windows Performance Monitor package is not installed by default. In order to install them when you install Oracle, select the custom install option. You can also install this option later via the Oracle installer. Once Oracle Counters for Windows Performance Monitor has been installed, you must perform one more piece of setup. The Oracle performance counters are set up to monitor one Oracle instance. Information about this instance must be configured in the registry. In order to do this, from a command prompt run orafcfg.exe with a username, password and Oracle net service name as follows:

operfcfg –U system –P password –D sid

This will update the registry. You should now be able to monitor Oracle via perfmon. Some of the things that you can monitor are:

  • The Oracle Buffer Cache. Here you can see the cache miss ratio.
  • Shared Pool Stats. This collection includes the data dictionary cache, and the library
    cache.
  • Log Buffer. Provides information on log space requests.
  • Database Data Files. This object provides physical read and write per second counters.
  • DBWR stats. Provides information on the DB Writer processes.

Miscellaneous. Other statistics include dynamic space management, free lists and dynamic sorts.
By taking advantage of Oracle Counters for Windows Performance Monitor you can easily and efficiently monitor Oracle along with monitoring the OS. Some of the most important and first counters that I look at when performance monitoring a system are:

  • Processor: %Processor Time. This gives me a quick look at how busy the system is.
  • Physical Disk: Avg. Disk sec/Read, Avg. Disk sec/Write. This provides me with an overview of how well the I/O subsystem is doing.

When first looking at a system I am actually more interested in disk latencies than throughput. The Avg. Disk sec/Read and Avg. Disk sec/Write should be in the range of 5-15 ms (0.005 – 0.015). Anything higher than this indicates a problem.

Performance monitoring on Linux

There are some built in command in Linux to check the performance of linux eg
  • top : Provide information (frequently refreshed) about the most CPU-intensive processes currently running. you can sort by CPU% or MEM% by typing 'F'
  • ps -aux : all the processes in the system. use "grep "to filter which processes
  • free : Display statistics about memory usage: total free, used, physical, swap, shared, and buffers used by the kernel.Easy monitoring with "SAR"

The SAR suite of utilities is bundled with your system (in fact, it is installed on most flavors of UNIX®), but probably not enabled. To enable SAR, you must run some utilities at periodic intervals through the cron facility. Use the crontab -e command while running as the root user

  • mpstat : average CPU statistic
  • iostat : flow of data to and from disk drive
  • vmstat : memory, like "free"

Useful link

http://www-128.ibm.com/developerworks/aix/library/au-unix-perfmonsar.html

Thursday, October 12, 2006

Oracle Memory Configuration on Windows Server

Configuring Large Memory for Oracle on 32-bit and 64-bit Windows

There is an inherent maximum of 4 GB of addressable memory for the 32 bit architecture. This is a maximum per process. one 4 GB memory segment is shared by all user threads. By default, if you run multiple Oracle instances on the same server, or run other applications on the same server, they will share the same 4 GB of memory.

By default, on Windows 2000 and Server 2003, 2 GB of the available 4 GB of memory is reserved for the 32-bit OS and 2 GB is shared for User Threads (i.e. the Oracle SGA). It is possible to allow Oracle to use more memory. To expand the total memory used by Oracle above 2 GB, the /3GB flag may be set in the boot.ini file. With the /3GB flag set, only 1 GB is used for the OS, and 3 GB is available for all user threads, including the Oracle SGA.

Workarounds are available for using memory above the 4 GB limit. Intel 32-bit processors such as the Xeon processor support Paging Address Extensions for large memory support. PAE allocates additional memory in a separate memory segment that is also assigned to the process. MS Windows 2000 and 2003 support PAE through Address Windowing Extensions (AWE). PAE/AWE may be enabled by setting the /PAE flag in the boot.ini file. The “USE_INDIRECT_BUFFERS=TRUE” parameter must also be set in the Oracle initialization file. In addition, the DB_BLOCK_BUFFERS parameter must be used instead of the DB_CACHE parameter in the Oracle initialization file.

With this method, Windows 2000 Server and Windows Server 2003 versions can support up to 8 GB of total memory.Windows Advanced Server and Data Center versions support up to 64 GB of addressable memory with PAE/AWE.

Recommanded changes for Windows x86 system Boot.ini SWITCH

  • < 4GB None (or /NOPAE)
  • = 4GB /3GB (or /3GB /NOPAE)
  • > 4GB to <= 16GB /3GB /PAE
  • >16GB /PAE only

    Support for /3GB and /PAE – 32-bit


  • Windows 2000 Advanced Server
  • Windows 2000 Datacenter Server
  • Windows 2003 Enterprise Edition
  • Windows 2003 Datacenter Edition

32-bit Max Memory Support on x86 based computers

  • Windows 2003 Enterprise = 32GB max
  • Windows 2003 Datacenter = 64GB max

Some good links for oracle on windows
http://www.siebelonmicrosoft.com/technical_content/oracle/workshops.aspx

Tuesday, October 03, 2006

How to setup Oracle IAS (Application Server) to run Oracle forms/report?

Make sure you have a list of files (xxxx.conf, jinit.exe, icons.jar, icons.cab, xxxx.sig, xxxx.env html files) before you start.

Step 1. Installation of CD (3 in totals)
Install Oracle 10g IAS Core (9.0.4) on Oracle_home1 eg D:\OAS10g
Install Forms Server and Report Server eg D:\Orant
Install forms patchset 13

Step 2. The Configuration files in 10g IAS
Copy 6iserver.conf to %oracle_home%\Apache\Apache\conf;
Modify the parameters to point to forms6i home
Change the oracle_apache.conf to include 6iserver.conf

For Servlet mode only
Modify the files at %oracle_home\Apache\Jserv\Servlets\zone.properities
Modify the httpd.conf, uncomment #
# Include the configuration for Apache JServ 1.1
# include "D:\OAS10g\Apache\Jserv\conf\jserv.conf"


Step 3. The Configuration files in Forms6i
Copy the XXXX.env files to %oracle_home2%\forms60\server
Copy icons.jar, icons.cab, *.jar, *.sig to %oracle_home2%\java
Change the %oracle_home2%\Net80\admin\tnsnames.ora to point to database server
Replace the file jinit.exe at %oracle_home2%\jinit
Modify the file at “%oracle_home%\forms60\server\formsweb.cfg. Change the jinit_classid = clsid….. if the jinit is different

Step 4. The Registry setup
Add the fmx source to the registry key FORMS60_PATH ….;D:\V420
Add the rep source to the registry key REPORTS60_PATH ….;D:\V420

These are just basic steps for setting up IAS. Visit metalink if you need a detail information of how to setup.

These are my sample conf files
6iserver.conf

Alias /forms60java/ "D:\ORANT\forms60\java/"
Alias /jinitiator/ "D:\ORANT\jinit/"
Alias /dev60temp/ "D:\ORANT\tools\web60\temp/"
Alias /dev60html/ "D:\ORANT\tools\web60\html/"
Alias /jinitiator/ "D:\ORANT\jinit/"
Alias /asp/ "D:\OAS10g\Apache\Apache\hotdocs/"
ScriptAlias /dev60cgi/ "D:\ORANT\bin/"SetEnvIf Request_URL "ifcgi60" ORACLE_HOME=D:\ORANT
SetEnv FORMS60_WEB_CONFIG_FILE D:\ORANT\FORMS60\SERVER\formsweb.cfg
AddType video/avi avi
AddType application/x-orarrp rrpa rrpp rrpt rrpr


xxxx.env

PATH=D:\ORANT\bin
ORACLE_HOME=D:\ORANT
FORMS60_PATH=D:\ORANT\forms60;D:\v420
REPORTS60_PATH=D:\ORANT\forms60;D:\v420
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 # FORMS60_REPFORMAT=pdf


zone.properities

#New version v420 Release GeO env settingservlet.v420.code=oracle.forms.servlet.ListenerServlet servlet.v420.initArgs=EnvFile=D:\ORANT\forms60\server\v420.env servlet.v420.initArgs=configFileName=D:\ORANT\forms60\server\formsweb.cfg

Monday, October 02, 2006

Some issues in Oracle report printing

Oracle reports 6i seem to have more problems with windows XP than windows 2000. Here are some of the tips you can try

  1. Check out what report patch you have. I have use patchset 18 and it manage to resolve most of the problem, including print to email issues. You can check which version by clicking help -> about report runtime
  2. Check report background engine for any errors messages
  3. Check software firewall. Some workstation comes bundle with firewall and sometimes they don't pop up a window, telling you they have block the report background engine from running.
  4. Back to basic. Can you print on other applications software beside oracle report?

Sunday, October 01, 2006

Automating Installation

During my day-to-day work, there are many times I need to do re-installation again and again to simulate and to practice. I have found there are actually a couples of ways to automate installation easily. In Oracle there is a response file which you can edit the default parameters, similar Linux kickstart process.

In Oracle, this is how I start
  1. Start record the default parameters by typing
    setup.exe -record -destinationFile C:\OraInst\rec.rsp.
    The installation will run normally and a summary page will be presented. You can opt to cancel or continue.
  2. To use a response file during an installation on Windows,
    setup.exe [-silent] -responseFile C:\OraInst\custom.rsp.
    Use -silent if you want full unattended installation. If you want the system to fill in default values, omit the -silent.

By default, the sys password will not be recorded, you will have to manually entered the values in the text file.

Automating Windows 2000/XP installation

Windows has a setupmgr which allows you to do unattended installation.

  1. Insert the Windows CD
  2. Browse /Support/Tools/Deploy.cab, extract the files
  3. run the setupmgr.exe to answer a list of questions
  4. After you answer all the required parameters, save the files as winnt.sif. you can view this text file.
  5. Save these files on a floppy disk. (It is also possible t integrate it with Windows CD)
  6. During installation, insert the floppy disk and the Windows CD. The windows will look for answer in the floppy disk for the parameters.
  7. Ext

Unattended Installation links
http://support.microsoft.com/?kbid=308662
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=258

Creating USB thumb drive boot disk
http://www.weethet.nl/english/hardware_bootfromusbstick.php
http://www.bootdisk.com