cancel
Showing results for 
Search instead for 
Did you mean: 

recover a specific backup from backup history with dbmcli

Former Member
0 Kudos

hello friends,

how can i recover a specific backup from backup history with dbmcli with inizialization. in dbmcli i can only find methods for medium recovery. with dbmgui i try "instance" in menu, then "Recovery with Initialization", then i try i choose admin_state, then i choose the radiobutton recover from backup history. I get my choice with specific date.

How can I build a script in dbmcli for this scenario. when i am try the command backup_history_open and backup_history_list i cant see the specific backup, what i see in dbmgui.

the backup history item, that i need has a specific system key "492FB68F0002". with which dbmcli command i get this system key for recover.

which command i take for this scenarion db_activate RECOVER?

many thanks for suggestions,

christoph

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Christoph,

the command db_activate RECOVER can handle external bachup id's, but if you do not use such tools, than I would suggest the following:

Get the backup you need (system key "492FB68F0002") create a new backup device and make the backup available there (copy it to the new location).

Now your db_activate RECOVER should work in dbmcli, because there is only one backup available.

This will not be the best version, but it should work.

Did you try Instance -> show console in dbmgui to record the statements when preparing the restore?

Best regards

Christian

Former Member
0 Kudos

hi christian,

how can i record the staments for my script? I am looking for an automatism to recover an instance from a specific item from backup history, because we test ower deliverys with import in stms - see return codes.

content for script:

1. stopsap r3 in sidadm context

2. db_admin of instance in dbmcli context

3. recover a specific item from backup history from nfs mount in dbmcli context

4. restartable check in dbcmcli context

5. restart instance in dbmcli context

6. logmode to overwrite in dbmcli context

7. db_offline in dbmcli context

8. startsap all in sidadm context

that ist, what i need.

thanks,

christoph

lbreddemann
Active Contributor
0 Kudos

> how can i record the staments for my script?

Do you know the "show console" feature in DBMGUI/DB Studio?

With that you can display all commands used by DBMGUI and the Recovery Wizard.

> I am looking for an automatism to recover an instance from a specific item from backup history, because we test ower deliverys with import in stms - see return codes.

Ok, but why do you need a recovery for that?

Use SNAPSHOTS instead (read the docu [here|http://maxdb.sap.com/doc/7_7/44/c4afa67ca22e17e10000000a114a6b/content.htm]!).

Create your base instance.

Create a SNAPSHOT.

Now run your tests.

When you finished your tests, simply restore the SNAPSHOT.

This takes seconds.

Bring the database online again and run some new tests.

When you want your initial instance again - just restore the SNAPSHOT once again.

Really, SNAPSHOTs are made for such a scenario.

> content for script:

>

> 1. stopsap r3 in sidadm context

> 2. db_admin of instance in dbmcli context

> 3. recover a specific item from backup history from nfs mount in dbmcli context

> 4. restartable check in dbcmcli context

> 5. restart instance in dbmcli context

> 6. logmode to overwrite in dbmcli context

> 7. db_offline in dbmcli context

> 8. startsap all in sidadm context

Ok. if you still would like to do it this way... how about this:


dbmcli -U c -i refresh_db.txt

refresh_db.txt:
==============
db_admin
db_activate RECOVER <medium_name> DATA AUTOIGNORE
db_online
db_execute SET LOG AUTO OVERWRITE ON
db_offline

I leave the stopsap/startsap and the rest of the script to you, but I guess you got the idea.

BTW: there's no need to check for restart ability of the database after the recovery since by definition all full data restores are restartable with MaxDB!

So have fun (and go for the SNAPSHOTS instead!).

regards,

Lars

Former Member
0 Kudos

> Hi Christoph,

>

> the command db_activate RECOVER can handle external bachup id's, but if you do not use such tools, than I would suggest the following:

>

> Get the backup you need (system key "492FB68F0002") create a new backup device and make the backup available there (copy it to the new location).

> Now your db_activate RECOVER should work in dbmcli, because there is only one backup available.

> This will not be the best version, but it should work.

>

> Did you try Instance -> show console in dbmgui to record the statements when preparing the restore?

>

> Best regards

> Christian

Aha - Christian. show console, i see this now in dbmgui - thats the way to record my commands. many thanks

Former Member
0 Kudos

SHOW CONSOLE

cool. i know that now. see reply to christian. this is a big feature - very nice.

SNAPSHOTS

i miss this feature in maxdb rel. 7.6.XX, it is in dbmgui in grey. i must read first about snapshots, i am a rookie in snapshots.

DB_ACTIVATE OR RECOVER_START in DBMCLI

hm - for command "db_activate" is the right syntax, i need a specific medium from backup history, how can i get only this one.

SNAPSHOTS

snapshots are the rigt way, many thanks i will read the parts from link and i hopne it is a feature of rel. 7.6.XX

best regards,

christoph

Edited by: Christoph Kautz on Dec 22, 2009 1:13 PM

lbreddemann
Active Contributor
0 Kudos

> SNAPSHOTS

>

> snapshots are the rigt way, many thanks i will read the parts from link and i hopne it is a feature of rel. 7.6.XX

>

It is!

The only thing with 7.6 is that SNAPSHOTS can only be created/restored/deleted in ADMIN mode.

With 7.7 it's possible to create SNAPSHOTS online as well.

regards,

Lars

lbreddemann
Active Contributor
0 Kudos

> DB_ACTIVATE OR RECOVER_START in DBMCLI

>

> hm - for command "db_activate" is the right syntax, i need a specific medium from backup history, how can i get only this one.

Since you have your backup file on a NFS share anyhow, just create a new medium and have it point to that file.

This way you don't have to think about the backup history etc.

regards,

Lars

Former Member
0 Kudos

ah - ich dödel - logisch - im admin mode. danke.

Former Member
0 Kudos

>

> > DB_ACTIVATE OR RECOVER_START in DBMCLI

> >

> > hm - for command "db_activate" is the right syntax, i need a specific medium from backup history, how can i get only this one.

>

> Since you have your backup file on a NFS share anyhow, just create a new medium and have it point to that file.

> This way you don't have to think about the backup history etc.

>

> regards,

> Lars

my nfs share is full. ;-(

a little question to show console. is this is to use in dbmgui or i become an output for dbmcli in sidadm context?

lbreddemann
Active Contributor
0 Kudos

> a little question to show console. is this is to use in dbmgui or i become an output for dbmcli in sidadm context?

"Show console" just displays the commands used by DBMGUI / DB Studio.

You can use these commands to build your script.

Hmm... I don't think I fully understand what you mean here.

Anyhow, the commands you see are meant to be used within a DBMCLI session.

To use them from within the shell of <SID>ADM you either have to put them into a script file (see my example above) and call dbmcli with this file


dbmcli -U c -i <scriptfilename>

or you call the commands one by one:


dbmcli -U c db_state
dbmcli -U c db_online
dbmcli -U c db_offline 
...

regards,

Lars

Former Member
0 Kudos

hi lars,

and the content of scriptnamefile is the output from "show console"?

regards,

christoph

but, i know what i want, many thanks for suggestions.

regards,

christoph

Hi Lars,

please wait a minute ;-). Where is the physical Place for bits and bytes of the snapshot. 1. the RUN-DIR of MaxDB on SAP_APP-Server or the NFS-Share as place for the medium? Okay, scheints in der DB selber in einer Pages.

thanks,

christoph

Edited by: Christoph Kautz on Dec 22, 2009 2:14 PM

Former Member
0 Kudos

i tested the snapshot possibility with success. i need only putty for sidadm stopsap r3 and the dbmgui for snapshot procedere and last but not least the putty sesion for startsap all ...

thanks & merry christmas,

christoph

lbreddemann
Active Contributor
0 Kudos

> please wait a minute ;-). Where is the physical Place for bits and bytes of the snapshot. 1. the RUN-DIR of MaxDB on SAP_APP-Server or the NFS-Share as place for the medium? Okay, scheints in der DB selber in einer Pages.

>

> thanks,

>

> christoph

Hi Christoph,

the snapshots are kept within the data area.

Basically, all we do is to lock the pages from beeing overwritten and allocate new pages when data changes.

So the more data you change the more space the snapshot will require, up to the theoretical maximum that all pages that belonged to the savepoint got changed.

I gues it's worth to get a bit background on how MaxDB stores data.

Check [No-Reorganization Principle; Data Storage Without I/O Bottlenecks |http://maxdb.sap.com/training/internals_7.6/reorgfree_EN_76.pdf] if the documentation is not right for you.

Be aware that this is very different from how Oracle or MSSQL Server do things in that area!

Make sure to fully understand the concept of this.

Best regards,

Lars

Answers (0)