Amazon Partner

Thursday, 19 November 2009

Setup ntpd for 11g RAC / Clusterware

Linux  :
------
Edit the followin file :/etc/sysconfig/ntpd

Add -x to the current option as follows:

# Drop root to id 'ntp:ntp' by default.
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

# Set to 'yes' to sync hw clock after successful ntpdate
SYNC_HWCLOCK=no

# Additional options for ntpdate
NTPDATE_OPTIONS=""

-------------------------
HP-UX :

Add export XNTPD_ARGS="-x" to /etc/rc.config.d/netdaemons


Restart:
/sbin/init.d/xntpd stop


--------------------------

Sun Solaris :
/sbin/init.d/xntpd start

Setup ISCSI Client (Linux) for 11g RAC

Follow the following Steps to setup iscsi-initiater on linux server as client of openfier.

[root@oracluster03 /]# cd /media/*/Server
[root@oracluster03 Server]# rpm -i iscsi-init*
warning: iscsi-initiator-utils-6.2.0.868-0.18.el5.x86_64.rpm: Header V3 DSA sign ature: NOKEY, key ID 1e5e0159


[root@oracluster03 ~]# service iscsid start
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
[root@oracluster03 ~]# chkconfig iscsid on
[root@oracluster03 ~]# chkconfig iscsi on
[root@oracluster03 ~]# service iscsid status
iscsid (pid 22651 22650) is running...

[root@oracluster03 ~]#
[root@oracluster03 ~]#

--- cut here start -------


iscsiadm -m discovery -t sendtargets -p $STORAGE|awk '{print "iscsiadm -m node -T "$2"  -p $STORAGE -l"}'

----- cut here end ----------

Test your command and make sure you can see the expected storage.

# export STORAGE=192.168.1.200
# iscsiadm -m discovery -t sendtargets -p $STORAGE


To manually log in to an iSCSI target, use the following command
iscsiadm -m node -T proper_target_name -p target_IP -l

As you need to do this each disk, it can be achieved by using simple AWK command to generate for all disks.

iscsiadm -m discovery -t sendtargets -p $STORAGE|awk '{print "iscsiadm -m node -T "$2"  -p $STORAGE -l"}'

Now use the output to test your login to each disk.

iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.ocrdisk3  -p $STORAGE -l
iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.ocrdisk2  -p $STORAGE -l

iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.ocrdisk1  -p $STORAGE -l

As We setting this up for Oracle RAC, so ideally we need automatic login on startup ( default behaviour ), As a safe side we setup the disk to auto login on startup by using "--op update -n node.startup -v automatic" option.

# iscsiadm -m discovery -t sendtargets -p $STORAGE|awk '{print "iscsiadm -m node -T "$2"  -p $STORAGE --op update -n node.startup -v automatic"}'  

iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.ocrdisk3  -p $STORAGE --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.ocrdisk2  -p $STORAGE --op update -n node.startup -v automatic
iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.ocrdisk1  -p $STORAGE --op update -n node.startup -v automatic

# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.ocrdisk3  -p $STORAGE --op update -n node.startup -v automatic
# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.ocrdisk2  -p $STORAGE --op update -n node.startup -v automatic
# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.ocrdisk1  -p $STORAGE --op update -n node.startup -v automatic


Now create UDEV rules so all the disk have uniform name on startup.

Create openscsi Rules file

[root@oracluster03 ~]# vi /etc/udev/rules.d/55-openiscsi.rules
----------------------File start here ---------------------
KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"

-------------------------------------------------------------------------------------------
[root@oracluster03 ~]# mkdir -p /etc/udev/scripts

[root@oracluster03 ~]# vi /etc/udev/scripts/iscsidev.sh

-------------------------------file start here --------------------


#!/bin/sh

# FILE: /etc/udev/scripts/iscsidev.sh

BUS=${1}
HOST=${BUS%%:*}

[ -e /sys/class/iscsi_host ] || exit 1

file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"

target_name=$(cat ${file})

# This is not an open-scsi drive
if [ -z "${target_name}" ]; then
exit 1
fi

echo "${target_name##*.}"

---------file ends here -------------------------

[root@oracluster03 ~]# chmod 755 /etc/udev/scripts/iscsidev.sh

[root@oracluster03 ~]# service iscsi stop

Logging out of session [sid: 1, target: iqn.2006-01.com.openfiler:cluster03.gridcontrol01, portal: 192.168.2.5,3260]
Logout of [sid: 1, target: iqn.2006-01.com.openfiler:cluster03.gridcontrol01, portal: 192.168.2.5,3260]: successful
Stopping iSCSI daemon: [ OK ]

[root@oracluster03 ~]# service iscsi start
iscsid dead but pid file exists
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2006-01.com.openfiler:cluster03.gridcontrol01, portal: 192.168.2.5,3260]
Login to [iface: default, target: iqn.2006-01.com.openfiler:cluster03.gridcontrol01, portal: 192.168.2.5,3260]: successful

[ OK ]

Verify that, Disk are linked for logical link with local name.

[root@oracluster03 ~]# ls -lrt /dev/iscsi/*/


####Only on First node ##########


fdisk /dev/iscsi/disk01/part

fdisk /dev/iscsi/disk02/part


######### on all other nodes ########
partprobe


fdisk -l

Sunday, 30 August 2009

Oracle Database Security

Oracle provides the following way of managing database security.
  • Alerts
  • System Privileges
  • Object Privileges
  • Users and Roles
  • User and Tablespace Quotas
  • Profiles and Resource Limits
  • Password Management
  • Connect Internal and Password Files
  • O/S Authentication
  • Auditing
  • Event Triggers
  • Fine Grained Access Control
  • Oracle Label Security
  • Database Vault
  • Audit Vault
  • Data Encryption
  • Security Server

Thursday, 27 August 2009

ORA-16069: Archive Log standby database activation identifier mismatch

I was Testing "Using a standby database for Read/Write for testing and Convert back to standby mode using Flasback"

Step followed :
Standby database :
1) alter database recover managed standby database finish ;
2) create restore point Before_DR_Test;
3) alter database commit to switchover to primary;
4) Startup force;
5) Create table , select data, etc
6) Complete any testing for read/write operation

Convert back to Standby :

7) startup mount force;
8) flashback database to restore point Before_DR_Test;
9) alter database convert to physical standby;
10) startup mount force;
11) alter database recover managed standby database disconnect;

All succeed and managed to convert the database in standby mode, but its failing to accept any new archive log generated at primary database. I am getting following error in standby database alert.log

RFS[10]: Activation ID mismatch: found 0x99d06db8 expected 0x99d0b54

ORA-16069: Archive Log standby database activation identifier mismatch

Wednesday, 11 March 2009

Monday, 2 March 2009

Oracle DBA Questions

1. Database size is 500GB, what will be best possible backup solution/stratagy and why ?
2. CRS and ASM is 10.2.0.4 and DB is 10.1.0.4. Do you think there will any issues , If yes/No , why
3. At What stage you think RMAN Backup stratagy won't be enough? why

Regards
Krishan