Tuesday, September 20, 2011

Disk IO rate on Oracle Database Sever


From Unix Server

iostat -d -m
iostat -d /dev/sdc -m -x 2
   where
         /dev/sdc is the name of the disk  ( refer my earlier post on how to map ASM device to physical disks)
         await is disk response time
         svctm is time to process i/o request by disk

hostname : tiger

From OEM:
Targets / tiger / performance / under the Disk I/O utilization click ‘Total I/Os per second’ / change view data to last 31 days. See statistics on the left side of the page.

In OEM:
Targets / +ASM_tiger / Performance / Bottom of the page – Disk Group I/O Cumulative Statistics

OEM is Targets / Hosts. Click the Total IO/sec header to sort the list to see what other hosts are similar to tiger. Scroll down to find tiger . This is the same variable as noted above but for the last 24 hours (instead of last 31 days).

Hope this help! Rupam

Unable to start database - ORA-09925: Unable to create audit trail file

Error
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 28: No space left on device
Symptom
Unable to start database
Cause
----snip---
Could not open audit file: /ora01/grid/11.2.0.2/grid/rdbms/audit/+asm2_ora_25189_b.aud
Retry Iteration No: 1 OS Error: 28
Retry Iteration No: 2 OS Error: 28
Retry Iteration No: 3 OS Error: 28
Retry Iteration No: 4 OS Error: 28
Retry Iteration No: 5 OS Error: 28
OS Audit file could not be created; failing after 5 retries
Solution :
oracle@tiger /ora01/grid/11.2.0.2/grid/rdbms > du -ks audit
355614 audit
oracle@tiger /ora01/grid/11.2.0.2/grid/rdbms > cd audit
oracle@tiger /ora01/grid/11.2.0.2/grid/rdbms/audit > find . -name "*.aud" |wc -l
340729
oracle@tiger /ora01/grid/11.2.0.2/grid/rdbms/audit > find . -name "*.aud" \( -mtime +3 -o -atime +3 \) | xargs rm
oracle@tiger /ora01/grid/11.2.0.2/grid/rdbms/audit > find . -name "*.aud" |wc -l
25701
Hope this help. Regards Rupam

Thursday, August 04, 2011

Disk IO rate on Oracle Database Sever



iostat -d -m
iostat -d /dev/sdc -m -x 2
   where
         /dev/sdc is the name of the disk  ( refer my earlier post on how to map ASM device to physical disks)
         await is disk response time
         svctm is time to process i/o request by disk


Hope this help! Rupam

How to find mapping of ASM disks to Physical Devices?



1.Login as oracle and list ASM diskgroups

$ oracleasm listdisks
DATA1

2. Query Disk
$ oracleasm querydisk -d  DATA1
Disk "DATA1" is a valid ASM disk on device [8, 33]

3. oracleasm querydisk  DATA1  you will get in addition the major - minor numbers, that can be used to match the physical device,
# ls -l /dev |grep 8|grep 33
brw-r----- 1 root disk     8,  33 Aug  2 16:10 sdc1

Hope this help! Rupam

Monday, August 01, 2011

FlashBack Restore Point in oracle



1.  Requirements for Guaranteed Restore Points

The COMPATIBLE initialization parameter must be set to 10.2 or greater.

The database must be running in ARCHIVELOG mode.

A flash recovery area must be configured Guaranteed restore points use a mechanism similar to flashback logging. Oracle must store the required logs in the flash recovery area.

Oracle 10.2
If flashback database is not enabled, then the database must be mounted, not open, when creating the first guaranteed restore point
SQL> ALTER DATABASE FLASHBACK ON;

Oracle 11.x
There is no need to mount the database. Flashback can be tunred on at open state.
SQL> ALTER DATABASE FLASHBACK ON;

2. Creating Restore points [CREATE RESTORE POINT]
1
2
3
4
5
6
7
# Create Normal restore points
SQL> CREATE RESTORE POINT before_upgrade;

#Create guaranteed restore points
SQL> CREATE RESTORE POINT before_upgrade GUARANTEE FLASHBACK DATABASE;

 

3. Listing restore points [V$RESTORE_POINT]
1
2
3
4
5
6
7
# To see a list of the currently defined restore points
SQL>SELECT NAME, SCN, TIME, DATABASE_INCARNATION#,
    GUARANTEE_FLASHBACK_DATABASE,STORAGE_SIZE FROM V$RESTORE_POINT;

#To view only the guaranteed restore points:
SQL>SELECT NAME, SCN, TIME, DATABASE_INCARNATION#,
    GUARANTEE_FLASHBACK_DATABASE, STORAGE_SIZE FROM V$RESTORE_POINT
    WHERE GUARANTEE_FLASHBACK_DATABASE='YES';

For normal restore points, STORAGE_SIZE is zero. For guaranteed restore points, STORAGE_SIZE indicates the amount of disk space in the flash recovery area used to retain logs required to guarantee FLASHBACK DATABASE to that restore point.


4. Dropping restore points [DROP RESTORE POINT]
1
2
#Same statement is used to drop both normal and guaranteed restore points.
SQL> DROP RESTORE POINT before_app_upgrade;

5. Turn of Flashback
SQL> ALTER DATABASE FLASHBACK OFF;

Hope this helps! Regards Rupam