Saturday, 6 January 2018

How to identify the applied patche-set of your Oracle Home

Many a times you will need to find the patch level of your database.

The easiest way to get this information is from the OPatch utility.  The OPatch utility can be found under $ORACLE_HOME/OPatch directory.

The command below will list out all the currently applied patches to your Oracle environment using the files in the oraInventory.


$ORACLE_HOME/OPatch/opatch lsinventory

The same information can be seen from dynamic views


SQL>select * from sys.v$version ;
SQL>select * from sys.registry$history;

Sunday, 31 December 2017

Worth Sharing: Things you should NOT do when you are angry

 Things you should NOT do when you are angry  😼

*Hit your phone/gadgets on the wall.
*Punch the door/wall multiple times until your knuckles start to bleed.
*Verbally abuse people who love you and care for you, online or offline.
(All these things will only add up to the pain and will hurt you even more later.)

Things you can do when you get angry 😊

*Punch a pillow/cushion/a pile of blankets. (Find a punching bag if these are too soft for you).
*Use this anger to better yourself and do a ton of crunches/pushups/your fav. exercise at home/gym.
*Go on a long drive, preferably alone and notice the beauty of nature that surrounds you. You can also simply walk or run.
*Grab a pen and write the hell out of your thoughts. It's not childish. It's one of the smartest things you can do to yourself. Don't hesitate, no one except you is going to see that.
(Vent your anger. Don't contain it. Anger is like poison. You need to let it You need to let it out and make sure you don't hurt yourself in the process.)
Best of luck. Share to others in need. 💙 😊

Happy New Year
May this new year bring all your dreams and happiness come true.. 
Stay Blessed

Steps to Schedule any RMAN Jobs In Windows Server

This post is about the backup configuration made in Windows server and what are the backup strategies mainly used in most of production databases.

Backup strategy followed in most of  production Databases.
1) Weekly RMAN full backup
2) Daily Archive log backup
3) Daily incremental backup

In windows server environment, we use “scheduler” (such as cronjob in UNIX) to schedule any job.

The important steps to configure a scheduler are as follows :

Taking Database backup weekly(incremental level 0):
First create a cmd file (command file ) in windows: 

Let us create a file name week_backup.cmd using a text file editor(any editor) write the rman script to take the backup.

Assume, I want to take full backup (i.e, LEVEL 0 Backup)
-        Then the script for taking the weekly Level 0 backup would be like this, (here controlfile autobackup is off(default)).

Step 1.

Allocate channel ch1 type disk format '\path of taking backup_\%d_data_%U'; 
Backup incremental level=0 database tag=full_backup'; 
Release channel ch1; 
Allocate channel t1 type disk format '\ backup location \%d_ctrl_%U'; 
Backup current controlfile; 
Release channel t1; 

Step 2.

Create the .bat file (Batch file is for batch job execution by scheduler)
Let us create a batch file week_backup.bat

The script looks like as below:


rman target sys/db1@db1

cmdfile=\Path of cmd file\week_backup.cmd   <-------- you need to mention the file location we created at Step 1 above.
log=E:\Path of log file\Full_DB_Backup_%date:~4,2%_%date:~7,2%_%date:~10%.log
The file will be created as follows

This batch file is used executing this file through schedule.

Step 3.
Here comes the scheduling part. We have to use scheduler for scheduling job:
Goto- Start Menu>
 control panel >scheduler tasks >Add scheduler task >command prompt >Perform this task > weekly >choose day and timings when you want to run this job weekly >specify your administrator username and password >finish

Configuring  Database backup Daily(incremental LEVEL 1)

For this activity, all the above steps remains same, but the scripts and scheduler task option changes here:

1. backup_incr_1.cmd  

allocate channel ch1 type disk format '\path of backup location_\%d_data_%U';
backup incremental level=1 database tag=Level_1_Backup';
release channel ch1;

2. backup_incr_1.bat 

rman target sys/db1@DBNAME 
cmdfile=\Path of cmd file created in Step1 above\ backup_incr_1.cmd 
log=E:\Logfile location\Level_1_Backup_%date:~4,2%_%date:~7,2%_%date:~10%.log

Now, Configure the scheduler as we did above in Step 3 and  simply  change the Scheduler option > as ‘daily’ and timings whichever  you want.


For information on  UNIX System Commands you can check an article here – UNIX for DBA's

Click here for RMAN recovery scenarios

Everything comes to us that belongs to us, if we create the capacity to receive it

-Rabindranath Tagore