cancel
Showing results for 
Search instead for 
Did you mean: 

revert to snapshot via script

martin_vombruch4
Explorer
0 Kudos

Hi maxdb-fans,

we have a education system which must every day revert to a snapshot. What I want is a script thats run via crontab (we use suse linux enterprise server 10 sp2) the dbmcli command to revert to a initial snapshot

Did anyone have an idea?

KG

Martin

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

> we have a education system which must every day revert to a snapshot. What I want is a script thats run via crontab (we use suse linux enterprise server 10 sp2) the dbmcli command to revert to a initial snapshot

>

> Did anyone have an idea?

Sure.

Script to create the snapshot


db_admin
db_execute CREATE SNAPSHOT
db_online

Script to revert to the snapshot


db_admin
db_execute RESTORE SNAPSHOT
db_online

You can then simply call these scripts via dbmcli:


dbmcli -U c -i <script_name> -l <log_file>

Make sure to have the XUSER entry 'c' for the above call for the user that runs the cron-job.

That way you don't need to have the logon or db instance data in the cron-job.

regards,

Lars