Thursday, 21 July 2011

Kill OPMN Process and restart the Instance


You have previously started the opmn process as an incorrect user (such as root) but are now logged in as the unix user that owns the Application Server installation. The AS unix owner then experiences permission related errors communicating with the root initiated OPMN process.

It can be confirmed that this has taken place by listing the ownership of the running "opmn -d" processes:
$ ps -ef|grep 'opmn -d'|grep -v 'grep'
root 31011 1 0 09:08 ? 00:00:00 /as1013/app/oracle/product/mid101300a/opmn/bin/opmn -d
root 31012 31011 0 09:08 ? 00:00:00 /as1013/app/oracle/product/mid101300a/opmn/bin/opmn -d

To implement the solution, please execute the following steps:

1. Capture output from "ps -ef|grep 'opmn -d'|grep -v 'grep'" to identify current opmn daemon processes to be terminated.
2. Capture output from "opmnctl status -l" for future reference
- it may be necessary to manually kill processes that the current "opmn -d" processes have started
3. Log in to the UNIX account that owns the current "opmn -d" processes (this may require root privileges).
4. Use "opmnctl stopall" to stop the opmn daemon and all processes
5. Use "ps -ef|grep 'opmn -d'|grep -v 'grep'" to confirm the two "opmn -d" processes have been terminated
- use "kill -9 " on each PID to force this if necessary (again, this may need root privileges)
6. Review the PID column from the "opmnctl status -l" and confirm that each process has been stopped.
- again use "kill -9 " on each PID to force this if necessary (again, this may need root privileges)
7. For the directory of each OC4J instance that exists below $ORACLE_HOME/j2ee,
rename the "persistence" directory to "persistence.old"
8. Confirm if any files under the $ORACLE_HOME have been created under the incorrect unix account:

$ find $ORACLE_HOME -user root -print
With the exception of files below the $ORACLE_HOME/Apache/Apache/bin directory, use "chown" to reset the owner and group of each files that has changed.

For example:

$ cd $ORACLE_HOME/opmn/conf
$ ls -ld1 .*
drwx------ 3 mid101300a oinstall 4096 Sep 7 09:08 .
drwx------ 8 mid101300a oinstall 4096 May 30 09:00 ..
-r-------- 1 root root 21 Sep 7 09:08 .formfactor
Use the ownership of the directory guide the "chown" command needed:

$ chown mid101300a:oinstall .formfactor
9. Log out from the incorrect UNIX account and log back in as the UNIX user owning the AS installation.
10. Start opmn and desired managed processes:

$ opmnctl start

$ opmnctl startproc process-type=HTTP_Server
opmnctl: starting opmn managed processes...

$ opmnctl startproc process-type=home
opmnctl: starting opmn managed processes...
11. Confirm via "ps -ef|grep 'opmn -d'|grep -v 'grep' " that opmn daemon processes are owned by the expected user
12. Use "opmnctl status -l" to confirm all processes have started correctly.



Friday, 15 July 2011

Solaris 10 – Change IP Address without reboot

Adding or editing the IP address on a Solaris 10 server is different from the previous versions of the OS (Solaris 9, Solaris 8 etc).

In the previous versions of the Solaris Operating System, you need to edit the /etc/hosts file and add/edit the entry for the IP address and the hostname.

Example: sun1

However, in Solaris 10, you should edit the /etc/hosts file (a symlink to /etc/inet/hosts file) and the /etc/inet/ipnodes file and add an entry for IP address and hostname.

Once done, restart the Network service using

# svcadm restart network/physical

or reboot the server for the changes to take effect.

Although, the /etc/inet/ipnodes files is primarily for IPv6 only, without adding an entry to the file, the IP address (IPv4) doesn’t become active. This seems to be a known problem but the good news is this is now fixed in the Solaris 10 U4 (08/07 build).

Also, ensure that the /etc/netmasks file with the network ID and the netmask.

Monday, 11 July 2011


[oracle@testbox ~]$ RESTORE_TIME=`TZ=GMT date +%d-%m-%Y`

[oracle@testbox ~]$ echo $RESTORE_TIME


[oracle@testbox ~]$ RESTORE_TIME=`TZ=GMT+24 date +%d-%m-%Y`

[oracle@testbox ~]$ echo $RESTORE_TIME


[oracle@testbox ~]$ RESTORE_TIME=`TZ=GMT+48 date +%d-%m-%Y`

[oracle@testbox ~]$ echo $RESTORE_TIME


[oracle@testbox ~]$ RESTORE_TIME=`TZ=GMT-48 date +%d-%m-%Y`

[oracle@testbox ~]$ echo $RESTORE_TIME


[oracle@testbox ~]$ RESTORE_TIME=`date "+%d-%m-%Y"`

[oracle@testbox ~]$ echo $RESTORE_TIME


[oracle@testbox ~]$ RESTORE_TIME=`date -d yesterday "+%d-%m-%Y"`

[oracle@testbox ~]$ echo $RESTORE_TIME


[oracle@testbox ~]$

RESTORE_TIME=`date -d yesterday "+%d-%m-%Y"`

echo Beginning copy of $SOURCE to $DEST. Press Ctrl+C to abort within 10 secs...

sleep 10

# Delete old logs and create an automatic log for this operation

find /tmp -name /tmp/$LOGFILE* -mtime +14 -exec rm {} \; 2>/dev/null

exec > >(tee -a /tmp/$LOGFILE.$TIMESTAMP)

echo Generating RMAN script ..

cat <<EOF >> /tmp/rman-duplicate.$$

run {

set until time "to_date('$RESTORE_TIME 23:00:00','DD-MM-YYYY HH24:MI:SS')";

allocate auxiliary channel aux_01 device type disk;

duplicate target database to $DEST;



Friday, 1 July 2011