John’s Oracle Experiences

My everyday experiences with Oracle products

Archive for March, 2009

Autostartup Management Agents (10.2.0.5) using gcstartup

Posted by John Paul van Helvoort on March 30, 2009

When installing the new Enterprise Manager Grid Control (Agents) version 10.2.0.5. You might find yourself searching why agents automatically start on ever reboot. First you take out the oracle script under /etc/init.d or its symbolic links under rc?.d. But still it will startup automatically. Some research shows that the script “gcstartup” is called upon startup while running in runlevel 3 and 5. This script was already there in previous releases but never used automatically by refering to it from the runlevel rc3.d or rc5.d.
In 10.2.0.5 this is corrected by creating softlinks to the gcstartup script upon installing the agent while running root.sh.

If you take out these (symbolic) softlinks you are again in control of when and how the agents startup.

Background information on it

BUG 7414737
ROOT.SH SHOULD SOFTLINK RC3.D AND RC5.D FILES FOR AUTOSTART

Many other bugs are solved, here is the link.

Posted in Grid Control | 2 Comments »

Easy backup command using cpio

Posted by John Paul van Helvoort on March 25, 2009

This is definately not new, but so good to keep in mind. Sometimes its just handy to quickly make an easy file or directory backup before making any changes to them.This is what i mostly use to do so

For creating an archive i use


cd /u00/oracle/
find admin | cpio -oc > /u00/oracle/admin.cpio

for restore an archive i use


cd /u00/oracle/
cpio -idmv < admin.cpio

When you want to also backup the directory structure before the admin folder you must use the full path to be included in the find like this.


find /u00/oracle/admin | cpio -oc > /u00/oracle/admin.cpio

When restored , it will restore the admin directory where it was backupped so the following command will be enough to restore.


cpio -idmv < admin.cpio

Posted in Linux | Leave a Comment »

Increasing a root filesystem in a XEN image

Posted by John Paul van Helvoort on March 16, 2009

First of all shutdown the xen image you want to increase the filesystem off.
Then create a empty 10gb tempfile by executing the following command as root user on the XEN host ;

dd if=/dev/zero of=tempfile bs=1024 count=10000000

Now say your root filesystem image is called disk0 and is 4.5 Gb in size. You now need to expand your disk0 image with the newly create tempfile. Todo so , you can “cat” the empty file behind the disk0 by using this command;

cat tempfile >> disk0

After this action the “disk size” is increased up to 4.5 gb + 10gb = 14.5 Gb but not yet the partition which is created on this disk itself. For that to be increase aswell we need to follow these steps ; Also note that i am not using a disk with more than 1 ” real” partition and that the end partition is the one we need to expand ! Other senario’s need to be followed when dealing with more complex disk setups. In a nutshell, we are deleting the existing partition from the partition table and recreating a new one starting from the same blockpointer as where the old one started. By doing this the data on the partition we are deleting is not lost but again available in the newly created partition !

You can now start the image again, once started login as root and start fdisk.

xxx:/home/oracle # fdisk /dev/xvda
The number of cylinders for this disk is set to 1767.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)


Command (m for help): p

Disk /dev/xvda: 14.5 GB, 14534967296 bytes
255 heads, 63 sectors/track, 1767 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/xvda1 1 66 530113+ 82 Linux swap / Solaris
/dev/xvda2 67 522 3662820 83 Linux


Command (m for help): d
Partition number (1-4): 2
Command (m for help): p

Disk /dev/xvda: 14.5 GB, 14534967296 bytes
255 heads, 63 sectors/track, 1767 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/xvda1 1 66 530113+ 82 Linux swap / Solaris


Command (m for help): n
Command action
e extended
p primary partition (1-4) p

Partition number (1-4): 2
First cylinder (67-1767, default 67): 67
Last cylinder or +size or +sizeM or +sizeK (67-1767, default 1767): 1767

Command (m for help): w

The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

Before we shutdown the XEN Guest again, we must determine the filesystem type with the command “mount”

xx:~ # mount
/dev/xvda2 on / type ext3 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
securityfs on /sys/kernel/security type securityfs (rw)
/dev/mapper/oracle-u01 on /u01 type ext3 (rw)
xxx:~ #

Now that we know the filesystem type is ext3 we can continue the following steps after we shutdown the XEN guest.

In order to expand the size in the partition we need to execute one more command.
Depending on what filesystem we are dealing with, you can use either resize_reiserfs or resize2fs ( ext3)

First we need to add this disk to another XEN guest so that you have a non mounted filesystem disk available. You cannot execute these commands from within the XEN guest you are trying to expand ! Therefor you need to add the disk to another XEN guest in order to have full access to the disk.

When added to another XEN Guest , you don’t need to restart this guest ! Just type
“fdisk -l” and locate the disk you just added. Mostly this is the last disk displayed. Check this by comparing the disk size.

example :

x:/u01 # fdisk -l


..

Disk /dev/xvdd: 14.5 GB, 14534967296 bytes
255 heads, 63 sectors/track, 3855 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/xvdd1 1 66 530113+ 82 Linux swap / Solaris
/dev/xvdd2 67 1767 13663282+ 83 Linux

Now we have 2 chooses, for reiserfs execute the following ( this might also be done ONLINE ! ) :

x:~ # resize_reiserfs /dev/xvdd2

resize_reiserfs 3.6.19 (2003 www.namesys.com)

resize_reiserfs: On-line resizing finished successfully.

For Ext3 execute chkdisk when needed and then resize2fs;

x:~ # e2fsck -f /dev/xvdd2

e2fsck 1.38 (30-Jun-2005)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/xvdd2: 133866/525888 files (0.7% non-contiguous), 782580/1050249 blocks

x:~ # resize2fs /dev/xvdd2

resize2fs 1.38 (30-Jun-2005)
Resizing the filesystem on /dev/xvdd2 to 3415820 (4k) blocks.
The filesystem on /dev/xvdd2 is now 3415820 blocks long.

After a reboot your root filesystem is increased !

Posted in Linux | Leave a Comment »

Monitoring the Integration Profile Status in Enterprise Grid Control

Posted by John Paul van Helvoort on March 11, 2009

By default the monitoring facillity by oracle does not provide us with a threshold to monitor the synchronization profiles created in Oracle Identity Management.
Several enhancement requests are logged on metalink but still no solution is provided. Know that this option requires the installation of the plugin for identity management on both OMS and Agent ( info )

Here is a quick hack to implement such a feature in your monitoring tool so that a email is sent whenever the status of the syncing profile returns “Agent Execution Successful, Mapping/IMPORT operation Failure”.

We need to change the following files and update the changes so that the agent is now aware of these new monitoring rules.

First we alter this file $AGENT_HOME/sysman/admin/default_collection/oracle_eps_server.xml and add the following to the file :

...
&amp;lt;CollectionItem NAME="ODIIntegrationProfileStatus"&amp;gt;
    &amp;lt;Schedule&amp;gt;
      &amp;lt;IntervalSchedule INTERVAL="2" TIME_UNIT="Min"/&amp;gt;
    &amp;lt;/Schedule&amp;gt;
    &amp;lt;Condition COLUMN_NAME="Status"
               CRITICAL="Agent Execution Successful, Mapping/IMPORT operation Failure"
               WARNING="N/A"
               OPERATOR="EQ"
               MESSAGE="The DIP Sync Profile is in broken state"
               CLEAR_MESSAGE="The DIP Sync Profile is up"
               CLEAR_MESSAGE_NLSID="eps_server_dip_broken_cond_clear"
               MESSAGE_NLSID="eps_server_dip_broken_cond"/&amp;gt;
    &amp;lt;Condition COLUMN_NAME="ProfileErrors"
               CRITICAL="Error"
               WARNING="N/A"
               OPERATOR="EQ"
               MESSAGE="The DIP Sync Profile is in broken state"
               CLEAR_MESSAGE="The DIP Sync Profile is up"
               CLEAR_MESSAGE_NLSID="eps_server_dip_broken_cond_clear"
               MESSAGE_NLSID="eps_server_dip_broken_cond"/&amp;gt;
&amp;lt;/CollectionItem&amp;gt;
...

Now update the $AGENT_HOME/sysman/admin/metadata/oracle_eps_server.xml file and increase the release nummer so that the metarepository identifies this change.

&amp;lt;TargetMetadata META_VER="6.7" TYPE="oracle_eps_server" CATEGORY_PROPERTIES="VersionCategory"
                RESOURCE_BUNDLE_PACKAGE="oracle.oimcontrol.eps.rsc"&amp;gt;

to

&amp;lt;TargetMetadata META_VER="6.8" TYPE="oracle_eps_server" CATEGORY_PROPERTIES="VersionCategory"
                RESOURCE_BUNDLE_PACKAGE="oracle.oimcontrol.eps.rsc"&amp;gt;

After these changes we need to let the agent know we made the changed by reloading the settings.

$ORACLE_HOME_AGENT\bin\emctl reload

Oracle Enterprise Manager 10g Release 4 Grid Control 10.2.0.4.0.
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD reload completed successfully

After this you can define the Metric Threshold on the monitoring page of the Directory Integration Platform.

Posted in Grid Control, Identity Manager | Leave a Comment »

Oracle Enterprise Manager 10g Grid Control Release 5 (10.2.0.5) is out for Linux x86 and Windows 32 bits

Posted by John Paul van Helvoort on March 10, 2009

In February Oracle released there new patchset 10.2.0.5 for the Oracle Enterprise Grid Control server together with a new version Intelligent Agent.
This new patch is now available for linux x86 and Windows 32 bits now.

This release now supports Management Support for Oracle Database 11g Release 1 ! And tons of other new features which can be found
here

You can download this new release here ;

Oracle Enterprise Manager 10g Grid Control Release 5 (10.2.0.5)

Posted in Grid Control | Leave a Comment »

Creating a standby database using Enterprise Grid Control fails with Initialization Error

Posted by John Paul van Helvoort on March 10, 2009

While creating a standby database with a OMS 10.2.0.4 and agents 10.2.0.3 on the source and target database server , i ran into some strange behavior.
As it seems , when datafiles are larger then 4 gb and you use the HTTP transfer protocol , you might run into the following error :

“Initialization Error” with Error Log “File does not exist or not accessible.”

After some research i found that datafiles larger then 4 Gb transferred with the HTTP protocol with agent 10.2.0.3,
could cause this error and therefor need ;

Patch 5372553
Description EMDCLIENT API SUPPORTS ONLY JAVA INT FOR OUTPUT SIZE LIMIT
Product Intelligent Agent

After applying this patch on the Intelligent Agents using opatch, the database clone(creation) works perfectly using Enterprise Grid Control.
Note that you need to apply this patch on the source – and target agent for this clone to succeed.

Posted in Database, Grid Control | 2 Comments »

How to manually resolve a gap in the stand-by archived redo logs

Posted by John Paul van Helvoort on March 10, 2009

When dealing with an STANDBY database in some cases the auto recovery funtion is not working as smooth as you might wish.
After checking the connections and availability of the primary database and standby database the GAP resolving returns the following error :

FAL[client]: Failed to request gap sequence
 GAP - thread 1 sequence 23143-23143
 DBID 3656317626 branch 606569825
FAL[client]: All defined FAL servers have been attempted.

This error indicates a problem on the standby database which requests a redolog file what the primary database is not supplying.
So if the redolog is available in the archive directory on the primary site, you might consider to solve this problem manually by following these steps.

Transfer the missing redolog file from your primary site to you standby site in the correct archive log shipping directory.
After doing so the archive is available on the standby site for recovering the standby database.
You can now issue a logfile register so that the standby database is aware of the archivelog being available by using this command :

ALTER DATABASE REGISTER LOGFILE '/u03/oradata/STBY/arch/1_23143_606569825.arc'

Now the standby database should recover its state to the last logfile switch made on the primairy site.

Posted in Application Server | Leave a Comment »