RMAN backup report through Python

Dear Readers,

I recently completed Python programming course which was authorized by “University of Michigan” offered through Coursera. It was really good course & worth the time I invested in.

So here comes my first python program, which can be useful for Oracle DBA’s like me to get consolidated report on RMAN backup.

Of course we can always get this information from v$rman_backup_job_details but what if database is not available or you are looking for backup information older than your retention period. You need to go to backup location & read through all backup out/log files & capture the details you need

So I thought of writing a python program & see if we can get desired results in one shot.

Note: You cant just copy/paste this code & use in your environment. But you can definitely refer it & modify wherever needed.

Prerequisites:

1. You will create a file named bkp.txt. This file will contain all names of logfiles you need to read. I am using below file for my demo.

2. python binaries with version 3.

3. Program file, in this example bkp.py & bkp.txt should be copied to location which contains all logfiles.

Actual program:

How to execute:

Here comes the result:

Please find below the course link through which I was able to write my first program.

Coursera – Python for Everybody

You can download sample files from below location:

Sample log files

bkp.py + bkp.txt

Hope u will find this post very useful.

Cheers

Regards,
Adityanath

2 thoughts on “RMAN backup report through Python

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s