cancel
Showing results for 
Search instead for 
Did you mean: 

How to recover data and log

Former Member
0 Kudos

Hello, everyone

I re-installed my windows XP due to virus with the maxdb data and log files left. After that I reinstalled maxdb 7.6 again. How can I recover the db with the existed data and log ? I did not backup the db. I can not figure out a way. Please help me.

Chu

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

Hi Chu,

creating a MaxDB instance from the data- and logvolumes is not difficult, but some requirements have to be fullfilled:

- you still have the parameter file left

- you still know the password of the database manager operator (DBM in OpenSource or CONTROL for SAP instances)

That given, all you've to do is to re-register the database, via the db_create command:

dbmcli -R "

So, let's go for an example.

I've a database called DB77, the dbm operator is called control, password is also control.

I'll drop the database but keep the files (just like you have it ... hopefully) and re-register the database afterwards:

>dbmcli db_enum OK DB77 C:sapdbdb77db 7.7.02.16 fast offline DB77 C:sapdbdb77db 7.7.02.16 slow offline >dir c:sapdbdataconfig Datenträger in Laufwerk C: ist Boot Volumeseriennummer: 08C7-EC59 Verzeichnis von c:sapdbdataconfig 24.03.2008 13:37 <DIR> . 24.03.2008 13:37 <DIR> .. 25.10.2007 14:11 12.739 .M770216 25.10.2007 14:11 97.900 .M770216.pah 25.10.2007 14:11 1.536 .M770216.upc 14.02.2008 02:21 20.579 .M770323 14.02.2008 02:21 201.850 .M770323.pah 14.02.2008 02:21 1.536 .M770323.upc 14.03.2008 02:23 20.795 .UMDB 14.02.2008 02:24 20.795 .UMDB.01 25.10.2007 14:24 20.795 .UMDB.02 14.03.2008 02:23 26 .UMDB.cfg 14.02.2008 02:24 207.625 .UMDB.pah 25.10.2007 14:24 2.048 .UMDB.upc 14.03.2008 09:23 13.405 DB77 13.03.2008 23:51 13.405 DB77.01 11.03.2008 20:10 13.405 DB77.02 14.02.2008 02:21 13.405 DB77.03 14.02.2008 02:17 13.405 DB77.04 24.01.2008 19:06 13.405 DB77.05 11.01.2008 18:57 13.405 DB77.06 31.12.2007 01:40 13.405 DB77.07 26.12.2007 14:40 13.404 DB77.08 26.12.2007 14:20 13.181 DB77.09 26.12.2007 14:01 13.181 DB77.10 14.03.2008 09:23 75 DB77.cfg 02.12.2007 18:24 648 DB77.mmm 11.03.2008 20:16 343.475 DB77.pah 24.03.2008 13:37 2.048 DB77.upc 14.02.2008 02:20 <DIR> install 27 Datei(en) 1.101.476 Bytes 3 Verzeichnis(se), 20.064.083.968 Bytes frei Ok, the database is currently correctly registered and the parameter file is present. Now let's drop the database: >dbmcli -d db77 -u control,control db_drop withoutfiles OK >dir c:sapdbdataconfig Datenträger in Laufwerk C: ist Boot Volumeseriennummer: 08C7-EC59 Verzeichnis von c:sapdbdataconfig 24.03.2008 13:37 <DIR> . 24.03.2008 13:37 <DIR> .. 25.10.2007 14:11 12.739 .M770216 25.10.2007 14:11 97.900 .M770216.pah 25.10.2007 14:11 1.536 .M770216.upc 14.02.2008 02:21 20.579 .M770323 14.02.2008 02:21 201.850 .M770323.pah 14.02.2008 02:21 1.536 .M770323.upc 14.03.2008 02:23 20.795 .UMDB 14.02.2008 02:24 20.795 .UMDB.01 25.10.2007 14:24 20.795 .UMDB.02 14.03.2008 02:23 26 .UMDB.cfg 14.02.2008 02:24 207.625 .UMDB.pah 25.10.2007 14:24 2.048 .UMDB.upc 14.03.2008 09:23 13.405 DB77 13.03.2008 23:51 13.405 DB77.01 11.03.2008 20:10 13.405 DB77.02 14.02.2008 02:21 13.405 DB77.03 14.02.2008 02:17 13.405 DB77.04 24.01.2008 19:06 13.405 DB77.05 11.01.2008 18:57 13.405 DB77.06 31.12.2007 01:40 13.405 DB77.07 26.12.2007 14:40 13.404 DB77.08 26.12.2007 14:20 13.181 DB77.09 26.12.2007 14:01 13.181 DB77.10 14.03.2008 09:23 75 DB77.cfg 02.12.2007 18:24 648 DB77.mmm 11.03.2008 20:16 343.475 DB77.pah 24.03.2008 13:37 2.048 DB77.upc 14.02.2008 02:20 <DIR> install 27 Datei(en) 1.101.476 Bytes 3 Verzeichnis(se), 20.064.083.968 Bytes frei >dbmcli db_enum OK As we see, the database is gone - but due to the withoutfiles flag all files are left in place. Therefore we can reregister the database rightaway: >dbmcli -R C:sapdbdb77db db_create DB77 control,control OK >dbmcli db_enum OK DB77 C:sapdbdb77db 7.7.02.16 fast offline DB77 C:sapdbdb77db 7.7.02.16 slow offline >dir c:sapdbdataconfig Datenträger in Laufwerk C: ist Boot Volumeseriennummer: 08C7-EC59 Verzeichnis von c:sapdbdataconfig 24.03.2008 13:42 <DIR> . 24.03.2008 13:42 <DIR> .. 25.10.2007 14:11 12.739 .M770216 25.10.2007 14:11 97.900 .M770216.pah 25.10.2007 14:11 1.536 .M770216.upc 14.02.2008 02:21 20.579 .M770323 14.02.2008 02:21 201.850 .M770323.pah 14.02.2008 02:21 1.536 .M770323.upc 14.03.2008 02:23 20.795 .UMDB 14.02.2008 02:24 20.795 .UMDB.01 25.10.2007 14:24 20.795 .UMDB.02 14.03.2008 02:23 26 .UMDB.cfg 14.02.2008 02:24 207.625 .UMDB.pah 25.10.2007 14:24 2.048 .UMDB.upc 14.03.2008 09:23 13.405 DB77 13.03.2008 23:51 13.405 DB77.01 11.03.2008 20:10 13.405 DB77.02 14.02.2008 02:21 13.405 DB77.03 14.02.2008 02:17 13.405 DB77.04 24.01.2008 19:06 13.405 DB77.05 11.01.2008 18:57 13.405 DB77.06 31.12.2007 01:40 13.405 DB77.07 26.12.2007 14:40 13.404 DB77.08 26.12.2007 14:20 13.181 DB77.09 26.12.2007 14:01 13.181 DB77.10 14.03.2008 09:23 75 DB77.cfg 02.12.2007 18:24 648 DB77.mmm 11.03.2008 20:16 343.475 DB77.pah 24.03.2008 13:42 2.048 DB77.upc 14.02.2008 02:20 <DIR> install 27 Datei(en) 1.101.476 Bytes 3 Verzeichnis(se), 20.064.083.968 Bytes frei >dbmcli -d db77 -u control,control db_online OK Database reregistered, all files are OK, database online. We're done.

Anyhow, you should in any case perform a backup before you reinstall your machine the next time. I don't know if you've still got all the files I mentioned, but if not - it's not possible to get your database back easily - if at all.

Hope that helps,

Lars

Former Member
0 Kudos

Hello, Lars

Thank you very much for your answer.

Unfortunately I lost the config data except one data and one log file left.

I tried to re-create one db instance with the same name and same parameter by copying other db instance's with the same ones, and then overwrote the new db instance's data and log file with the original data and log file. But I could not restart it to on line state.

From your answer's hint, maybe I can copy the config files from other db instance with the same parameters. Can you give my further help about how to manipulte this matter?

Thanks in advance.

Chu

lbreddemann
Active Contributor
0 Kudos

Hi Chu,

hmm... just the log and the data volume files...

As a last resort I would try the following:

1. create an empty instance that has the very same log and data volume setup. Use the same control-password as in the instance you want to "restore".

2. shutdown this database

3. copy the log and data volumes you've got left from your old database to the places where the new database volumes are located, thus: replace the volumes.

4. try to startup.

If it does work: fine - if not: please post the knldiag file so that we can see what error you get.

KR Lars

Former Member
0 Kudos

Hi, Lars

Thank you very much for your kind reply.

I tried according to youer procedures but unfortuntately failed.

When I tried to excute the following command,

dbmcli -u dbm,baaaaaaa -d maxdb1

dbmcli on maxdb1>db_online

I got the following errors:

ERR

-24988,ERR_SQL: SQL error

-8,Execution failed, parse again

3,Database state: OFFLINE

6,Internal errorcode, Errorcode 1500 "old_fileversion"

20022,PAM::GetPage was called with error. It might be an unhandled error.

6,, Errorcode 1500 "old_fileversion"

20057,Data_BaseFile: filetype=4 root=14889 Dynamic Recoverable (perm)

20066,HistDir: registered files 20, max used are 20

20017,RestartFilesystem failed with 'Execution failed, parse again'

So what is the matter?

Can you give me some hints?

Thanks.

chu

lbreddemann
Active Contributor
0 Kudos

Hi Chu,

please keep it low - I did not give you a "procedure" but I said: "that would be what I would try as a last resort".

Your database is gone. Your "backup"-attempt is simply not something that is supposed to work.

So I gave you a hint that possibly may succeed - but very likely won't. And it didn't.

So I propose to give up on this, reinstall the database cleanly and enter your data from scratch.

Sorry if this may sound harsh - but no backup done means: no backup.

KR Lars

Former Member
0 Kudos

Hello, KR lars

Thank you any way for your help

chu

Former Member
0 Kudos

Hello, KR lars

Because the data is very important for me, I searched the hard disk again and found the initial backup data and serveral log files afterwards.

When I restore db from the initial backup data, I only got the initial data. Is there a way to use the several log files to restore the the last state of db?

Sorry for troubling you so much.

Chu