Friday, November 14, 2014

ASM MONITORING COMMAND

///////////TO CHECK DISKGROUP SPACE INFORMATION

SQL> SELECT name, free_mb/1024, total_mb/1024, free_mb/total_mb*100 as percentage FROM v$asm_diskgroup;


////////////////////IDENTIFY CANDIDATE DISK



 SELECT
    NVL(a.name, '[CANDIDATE]') as disk_group_name
  , b.path as disk_file_path
  , b.name as disk_file_name
  , b.failgroup as disk_file_fail_group
 FROM
    v$asm_diskgroup a RIGHT OUTER JOIN v$asm_disk b USING (group_number)
 ORDER BY
    a.name;


/////////////////////CHECK ASM FILE INFORMATION

select file_number , sum(bytes)/(1024*1024) from v$asm_file group by file_number;

ORACLE RAC MONITORING COMMANDS

/////////////////check services

dbserver2:oracle$
dbserver2:oracle$
dbserver2:oracle$
dbserver2:oracle$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    dbserver1
ora....R1.lsnr application    ONLINE    ONLINE    dbserver1
ora....er1.vip application    ONLINE    ONLINE    dbserver1
ora....SM2.asm application    ONLINE    ONLINE    dbserver2
ora....R2.lsnr application    ONLINE    ONLINE    dbserver2
ora....er2.gsd application    ONLINE    ONLINE    dbserver2
ora....er2.ons application    ONLINE    ONLINE    dbserver2
ora....er2.vip application    ONLINE    ONLINE    dbserver2
ora....ogdb.db application    ONLINE    ONLINE    dbserver1
ora....ebdb.cs application    ONLINE    ONLINE    dbserver1
ora....db1.srv application    ONLINE    ONLINE    dbserver1
ora....db2.srv application    ONLINE    ONLINE    dbserver2
ora....b1.inst application    ONLINE    ONLINE    dbserver1
ora....b2.inst application    ONLINE    ONLINE    dbserver2
dbserver2:oracle$
dbserver2:oracle$
dbserver2:oracle$




/////////////////////////////cluster health status


dbserver1:oracle$ crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
dbserver1:oracle$
dbserver1:oracle$



/////////////////ocr backup info


dbserver2:oracle$ ocrconfig -showbackup

dbserver1     2014/10/07 11:47:21     /u01/app/oracle/product/10.2.0/crs/cdata/crs

dbserver1     2014/10/07 07:47:21     /u01/app/oracle/product/10.2.0/crs/cdata/crs

dbserver1     2014/10/07 03:47:19     /u01/app/oracle/product/10.2.0/crs/cdata/crs

dbserver1     2014/10/05 19:47:11     /u01/app/oracle/product/10.2.0/crs/cdata/crs

dbserver1     2014/09/29 07:46:33     /u01/app/oracle/product/10.2.0/crs/cdata/crs
dbserver2:oracle$





//////////////////////all node cluster database status

dbserver1:oracle$
dbserver1:oracle$ srvctl status database -d weblogdb
Instance weblogdb1 is running on node dbserver1
Instance weblogdb2 is running on node dbserver2
dbserver1:oracle$


///////////////////////////instance staus

////node1

srvctl status instance -d weblogdb -i weblogdb1

dbserver1:oracle$ srvctl status instance -d weblogdb -i weblogdb1
Instance weblogdb1 is running on node dbserver1
dbserver1:oracle$


////node2

srvctl status instance -d weblogdb -i weblogdb2

dbserver2:oracle$
dbserver2:oracle$ srvctl status instance -d weblogdb -i weblogdb2
Instance weblogdb2 is running on node dbserver2
dbserver2:oracle$
dbserver2:oracle$




////////////////////asm instance status/////////////////////////////////






////node1

srvctl status asm -n dbserver1

dbserver1:oracle$
dbserver1:oracle$ srvctl status asm -n dbserver1
ASM instance +ASM1 is running on node dbserver1.
dbserver1:oracle$
dbserver1:oracle$


////////node2

srvctl status asm -n dbserver2

dbserver2:oracle$
dbserver2:oracle$ srvctl status asm -n dbserver2
ASM instance +ASM2 is running on node dbserver2.
dbserver2:oracle$


///////////////////cluster nodeapps status/////////////////////////////////////////////





////node1

srvctl status nodeapps -n dbserver1
dbserver1:oracle$
dbserver1:oracle$ srvctl status nodeapps -n dbserver1
VIP is running on node: dbserver1

///node2

srvctl status nodeapps -n dbserver2
dbserver2:oracle$
dbserver2:oracle$ srvctl status nodeapps -n dbserver2
VIP is running on node: dbserver2
GSD is running on node: dbserver2
Listener is running on node: dbserver2
ONS daemon is running on node: dbserver2
dbserver2:oracle$


/////////////////////

Tuesday, July 29, 2014

CRON SCHEDULING



1. Scheduling a Job For a Specific Time

The basic usage of cron is to execute a job in a specific time as shown below. This will execute the Full backup shell script (full-backup) on 10th June 08:30 AM.

Please note that the time field uses 24 hours format. So, for 8 AM use 8, and for 8 PM use 20.

30 08 10 06 * /home/ramesh/full-backup
30 – 30th Minute
08 – 08 AM
10 – 10th Day
06 – 6th Month (June)
* – Every day of the week
2. Schedule a Job For More Than One Instance (e.g. Twice a Day)

The following script take a incremental backup twice a day every day.

This example executes the specified incremental backup shell script (incremental-backup) at 11:00 and 16:00 on every day. The comma separated value in a field specifies that the command needs to be executed in all the mentioned time.

00 11,16 * * * /home/ramesh/bin/incremental-backup
00 – 0th Minute (Top of the hour)
11,16 – 11 AM and 4 PM
* – Every day
* – Every month
* – Every day of the week
3. Schedule a Job for Specific Range of Time (e.g. Only on Weekdays)

If you wanted a job to be scheduled for every hour with in a specific range of time then use the following.

Cron Job everyday during working hours
This example checks the status of the database everyday (including weekends) during the working hours 9 a.m – 6 p.m

00 09-18 * * * /home/ramesh/bin/check-db-status
00 – 0th Minute (Top of the hour)
09-18 – 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm
* – Every day
* – Every month
* – Every day of the week
Cron Job every weekday during working hours
This example checks the status of the database every weekday (i.e excluding Sat and Sun) during the working hours 9 a.m – 6 p.m.

00 09-18 * * 1-5 /home/ramesh/bin/check-db-status
00 – 0th Minute (Top of the hour)
09-18 – 9 am, 10 am,11 am, 12 am, 1 pm, 2 pm, 3 pm, 4 pm, 5 pm, 6 pm
* – Every day
* – Every month
1-5 -Mon, Tue, Wed, Thu and Fri (Every Weekday)
4. How to View Crontab Entries?

View Current Logged-In User’s Crontab entries
To view your crontab entries type crontab -l from your unix account as shown below.




# * * * * *  command to execute
# ┬ ┬ ┬ ┬ ┬
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ └───── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0)
# │ │ │ └────────── month (1 - 12)
# │ │ └─────────────── day of month (1 - 31)
# │ └──────────────────── hour (0 - 23)
# └───────────────────────── min (0 - 59)                                         


http://en.wikipedia.org/wiki/Cron

Monday, July 28, 2014

ORA-19809 ERROR CHANGE DB_RECOVERY_FILE_DEST_SIZE

SQL> show parameter db_recovery



SQL > alter system set db_recovery_file_dest_size=15G scope=both;


ORA-19809 : limit exceeded for recovery  due to  lack of space