This Post defines the simple process on how to setup automatic daily backup of ODI Master and Work Repository. This process is especially important where there is no backup or improper schedule backup is carried out by DBAs.
Steps
Export Master Repository using ODIEXPORTMASTER
Export Work Repository using ODIEXPORTWORK
Refresh the Variable SYSDATE
Delete the Required day files using ODIDELETEFILE
Finally Send Mail for notification ( optional)
ODIEXPORTMASTER
Provide your target directory and give the zip file_name as
MASTER_REP_BACKUP_<%=odiRef.getSysDate(“dd-MM-yyyy”)%>.zip
This way Exported Master Repository is saved with Meaningful Filename and Date of the backup.
ODIEXPORTWORK
Repeat the above process for ODIEXPORTWORK
Provide your target directory and give the zip file_name as
WORK_REP_BACKUP_<%=odiRef.getSysDate(“dd-MM-yyyy”)%>.zip
Sample output of the above files.
Creating daily such Exports of Repository won’t be an ideal solution, so its good to delete the old archive and keep just two days of archive .
To do so , Please follow these simple steps.
Create a variable named ‘SYSDATE’ and write a following query
Here iam using -2 as i want to keep just two days of files and delete all the previous day files.Change this value according to your need.
ODIFILEDELETE
Call ‘ ODIFILEDELETE ‘ to delete the required files.
The Filename ‘ *_#SYSDATE.zip ‘ will delete the required day file. so if the sysdate is 23-09-2009 , the above command will delete 21-09-2009 files.
This simple procedure would enable you to have a simple backup of the Master and Work Repository especially in condition where there is no proper backup of Development database or backup is not being carried out at proper interval.
Schedule the Package using ODI Scheduler and schedule it accordingly and add odisendmail for any success or failure notification.
[ Note : No write permission should be given any ODI developer in the Archived Folder so that no one deletes the above file accidentally or corrupt them with improper handling. Only ODI should be have write access to this Folder]
If any error occurred and you are not being able to recover the Database or Repository ,these backup files can come into handy and using the right Import procedure the whole Development box can be brought back to action. Please keep looking into future post of ‘ odiexperts.com ‘ for how to do a proper Import without affecting objects Internal Id .
16 Comments
Leave a reply →