Thursday, February 25, 2010

Auditing database on Oracle 9i

Information that can be audited:
- Operating system login user name
- User name
- Session identifier
- Terminal identifier
- Name of the schema object accessed
- Operation performed or attempted
- Completion code of the operation
- Date and time stamp

Step for activating auditing:
1. Activate auditing in initialization paramaters (DB or OS)
audit_trail = DB
2. Activate auditing option
AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE BY user_id BY ACCESS;

Here is VIEW to view audit data on database:
- DBA_AUDIT_EXISTS
- DBA_AUDIT_OBJECT
- DBA_AUDIT_SESSION
- DBA_AUDIT_STATEMENT
- DBA_AUDIT_TRAIL
- DBA_OBJ_AUDIT_OPTS
- DBA_PRIV_AUDIT_OPTS
- DBA_STMT_AUDIT_OPTS

reff:http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/audit.htm#1108

Monday, February 8, 2010

How to add new hard drive to existing LVM volume

Sometimes your server running out of space, but if your server configured using LVM Volume, it will not be a problem anymore. Plug your new hard drive and let's configure

1. Creat an LVM partition
[root@oracledev ~]# fdisk /dev/sda
press n for creating new partition
press t for partition type and choose 8e for LVM
press w to write any changes


2. Create LVM physical volume
[root@oracledev ~]# lvm
lvm> pvcreate /dev/sda1
Physical volume "/dev/sda1" successfully created

3. Extend physical volume to existing logical volume group
lvm> vgextend VolGroup00 /dev/sda1
Volume group "VolGroup00" successfully extended

4. Extend the volume to 100%
lvm> lvextend -l +100%FREE /dev/VolGroup00/LogVol02
Extending logical volume LogVol02 to 323.47 GB
Logical volume LogVol02 successfully resized

5. Resize the partition size, but unmount it firstly
[root@oracledev ~]# resize2fs /dev/VolGroup00/LogVol02

reff:http://www.redhat.com/docs/manuals/csgfs/browse/4.6/Cluster_Logical_Volume_Manager/