Tuesday, June 28, 2011

How to Verify if OID services are Completely Down

Dear All,

We had a situation where in we were asked to rebuild indexes of OID using "bulkload".Within OID all attributes needs to be indexed or attributes which are indexed needs to be rebuild.

Before we start rebuilding activity the OID should be either in 'read-only' mode or 'shutdown'.I have issued 'opmnctl stopall' and all services were shutdown cleanly,but when we ran bulkload we got the message that OID services are still running ,pelase shutdown.

So below are simple steps to check if OID services are shutdown cleanly.

1. First step is to use the normal 'OS command'

ps -ef | grep -i oid ( or ) ps -ef | grep -i <username>

<username> - is the user which you start/stop OID services

2. The next step is to use the 'oidctl' utility

$ oidctl connect=<servicename> status

<service name> - is the name of the DB service.

Eg
===
$ oidctl connect=OIDB status (in my case 'OIDB' is the database name)
NLS_LANG not set in environment
Setting NLS_LANG to AMERICAN_AMERICA.AL32UTF8
oidctl:Checking Oracle Internet Directory Processes ...
Process oidmon is not running ------------------> if any OID process is running,it would give you the PID
Checking OIDLDAPD instance 1 ...
Instance is shutdown ------------------> if any OIDLDAPD process is running,it would give you the PID and ports of dispatcher and server
OIDREPLD instance is not configured
ODISRV instance is not configured



3. The third step is to check the table 'ODS.ODS_PROCESS'

Normally after OID is shutdown there are no entries on these tables.Sometimes if the shutdown is not clear or due to any bugs
there are normally some entries on the table.Use the below query to check

set lines 200
col HOSTNAME format a30
col FLAGS format a20

select instance,PID,SERVERID,FLAGS,HOSTNAME,STATE,RETRYCOUNT,LASTWAKETIME from ods.ods_process;


If the above query returns any values after stopping OID,then it is not a clean shutdown. After ensuring the OID services are down ,truncate the table ODS.ODS_PROCESS.

truncate table ODS.ODS_PROCESS;

So now we have gone through the different ways/methods of how to check if OID services are down before starting any maintenance activities.

Tuesday, June 14, 2011

More about Cron

Hello ,

All of you would be aware that cron is a time based scheduler used in Unix based operarting systems.We used cron to schedule and execute shell scripts or commands periodically or during any date / time.

There was a requirement within our system to run a job at specific time intervals,no better option than cron.

When I logged in and issued "crontab -l" I received the following message

crontab: you are not authorized to use cron. Sorry.


On further researching found that there are two important control files which control the permissions and access to cron.They are

"cron.allow and cron.deny",both these files are ascii text and owned by root.

These files are generally found under directory /etc/cron.d/ .

If the cron.allow file does not exist and your username is not there in entry cron.deny you will be able to use cron.

If the file exists and your username does not exist in the cron.allow file then you will not be able to use cron.

The cron.deny will contain all users who are denied access to cron.

My case I just requested Unix sysadmin to add my username in file - cron.allow.