cancel
Showing results for 
Search instead for 
Did you mean: 

how to restore db backup data file to a remote db server

Former Member
0 Kudos

Hello, everyone

I had one db recovery problem making me headache. Maybe you can give me some hints.

The question is:

1. I have a backup medium file named initdb

2. I can retore it in local computer.

3. I want to restore it to db1 in remote computer by using dbmcli in local computer.

See computer1 is local computer , computer2 as remote computer.

The command series executed in computer1 are like the followiings:

computer1> dbmcli -n computer2 -u dbm,dbm -d db1

dbmcli on computer2: db1> medium_put initialdb_recover
computer1\temp\initdb file data 0 8 no

dbmcli on computer2: db1> db_admin

dbmcli on computer2: db1> db_connect

dbmcli on computer2: db1> db_activate recover initialdb_recover

I got the following errors:

ERR

-24988,ERR_SQL: SQL error

-903,Host file I/O error

6,Data recovery failed

1,Backupmedium #1 (
computer1\temp\initdb) access denied [5]

6,Backup error occured, Errorcode 3700 "hostfile_error"

17,Servertask Info: because Error in backup task occured

10,Job 1 (Backup / Restore Medium Task) [executing] WaitingT72 Result=3700

6,Error in backup task occured, Errorcode 3700 "hostfile_error"

I thought that maybe I need to define a pipe but I can not figure out a way to define it pointing to
computer1\temp\initdb.

Wish your kind help.

Thanks

chu

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hi again chu,

the problem here is the Windows authentication.

> 1,Backupmedium #1 (
computer1\temp\initdb) access denied [5]

That error means: the MaxDB Kernelprocess tried to open shared Windowsfile but the user that is running the Kernel does not have the rights to do so.

It's the same user that runs the MaxDB service - usually it's "Local System".

The easiest solution to this may be to create a new user, assign this user access rights to the share and the backup file and run the MaxDB service with this user.

You may also set the parameter "USE_BACKUP_SECURITY_DESCRIPTOR" to NO in order to access the file w/o authentication. But than the share/file permissions have to allow unauthenticated full access to this file.

KR Lars

Former Member
0 Kudos

Hello, KR Lars

Thanks a lot for your help.

According to your advice, I solved my question by using

db_create -a -u newdb dbm,dbm sysuser,syspass

This will make the db service started by sysuser.

chu

lbreddemann
Active Contributor
0 Kudos

Hi Chu,

nice to hear that it worked and you got your data back.

best regards,

Lars

Former Member
0 Kudos

Hello KR Lars

I solved this problem by your kind advice.

But I still wish your help for the previous thread entitled "How to recover data and log".

I post the message again here.

Re: How to recover data and log

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

lbreddemann
Active Contributor
0 Kudos

Hi Chu,

of course you can recover the log-backups - they've been created for that.

As you don't have the backup history anymore, you'll have to do this manually:

1. Create Backup-Medium definitions that point to your backup files. Let's take DBFULL for the complete data backup and DBLOG for the log backups.

2. Restore the data backup:

dbmcli -d <DBSID> -u <DBM>,<pw>

> db_admin

> db_connect

> recover_start DBFULL data

after the sucessfull recovery of the data backup, the database will be still in admin mode.

You can now recover the logfiles.

ATTENTION: if there is already some data in the logarea than it may happen that all log data is still in the log area, so no log backups need to get recovered.

> recover_start DBLOG LOG 001

The "001" denotes the log backup version number which is generated when the log backup is written. If you know which number was written after the data backup had been taken, start with the logbackup with the next lowest sequence number.

If the data backup was the initial backup, just start with the first number - 001.

When the first log is recovered, replace the log backup (think of changing tapes) with the next one and continue the log recovery:

> recover_replace DBLOG LOG 002

Once you're done with all log backups, you can use

> recover_ignore

to skip all other logs and get the database into online state.

After that you should perform a new full data backup (to a new medium!).

Hope that works for you.

kind regards,

Lars

Former Member
0 Kudos

Hello KR Lars

Thank you for your help.

I succeeded until the step of recover_start DBFULL data, but failed when recover_start DBLOG LOG 001 was executed.

I have one complete data backup and 7 log files including log, log001-log006.

The error message is as follows:

dbmcli on maxdb1>recover_start DBLOG LOG 001

ERR

-24988,ERR_SQL: SQL error

-9407,System error: unexpected error

3,Database state: OFFLINE

20040,Logrecovery is not allowed, because state of log volume is 'HistoryLost' (log must be cleared)

8,Log- and Data are not compatible because 'Restore Log with Log State 'HistoryLost' is not allowed'.

20028,Initialization of log for 'restore log' failed with 'LogAndDataIncompatible'

Is there any way to handle this?

Wish your advice.

chu

lbreddemann
Active Contributor
0 Kudos

Hi Chu,

this is a real classic one:

Looks like the database instance had already been opened before you tried to recover the log.

When you recover the data area than only the datavolumes get loaded with new data - the log volume won't be touched. That way it's possible to actually use the log data in the log volume to recover the database to the very last committed/ change (e.g. in case of a data volume failure).

If the database instance contained "different" data than the backup before you started the data recovery, than the log volume does not fit to the data area anymore. ("different" here means that the data area has a different DBIdentifier).

In this case it seems that the db instance has been created, opened and no backup of it had been taken yet - thus the "Histlost-State".

After that you probably shut down the db, recovered the data backup and tried to recover the log which lead to the error.

To recover the the log you'll first have clear the log via "util_execute clear log". This can be done in ADMIN mode.

After that, you should be able to recover the log.

KR Lars

Former Member
0 Kudos

Hello KR lars,

Thanks a lot for your help.

But unfortunately I still could not figure out a way to handle this problem. What I did is as follows:

1. dbmcli on maxdb1>util_execute clear log

OK

2. dbmcli on maxdb1>recover_start DBLOG LOG 001

OK

Returncode -7075

Date

Time

Server

Database

Kernel Version

Pages Transferred 0

Pages Left 0

Volumes

Medianame

Location

Errortext

Label

Is Consistent

First LOG Page

Last LOG Page

DB Stamp 1 Date

DB Stamp 1 Time

DB Stamp 2 Date

DB Stamp 2 Time

Page Count 0

Devices Used

Database ID

Max Used Data Page

Converter Page Count

SEEMS NOTHING HAPPEND.

3. dbmcli on maxdb1>recover_replace DBLOG LOG 002

ERR

-24988,ERR_SQL: SQL error

-104,DBM command impossible at this time

So I tried another way below:

1.dbmcli on maxdb1>recover_start DBLOG LOG 002

OK

Returncode -8020

Date 20080401

Time 00235202

Server ITACCEL_NOTE_ROSE

Database MAXDB1

Kernel Version Kernel 7.6.00 Build 037-121-149-748

Pages Transferred 856

Pages Left 0

Volumes 1

Medianame dblog

Location F:\maxdbbackup\MAXDB1\backup\log.002

Errortext

Label LOG_000000002

Is Consistent

First LOG Page 3807

Last LOG Page 9715

DB Stamp 1 Date 20071211

DB Stamp 1 Time 00104208

DB Stamp 2 Date 20071217

DB Stamp 2 Time 00150856

Page Count 833

Devices Used 1

Database ID ITACCEL_NOTE_ROSE:MAXDB1_20071203_033408

Max Used Data Page

Converter Page Count

2. dbmcli on maxdb1>recover_replace DBLOG LOG 003

ERR

-24988,ERR_SQL: SQL error

-3004,Invalid host file sequence

1,Backupmedium #1 (LOG.003) invalid file or device name [2]

6,Backup error occured, Errorcode 5220 "wrong_hostfile"

17,Servertask Info: because Error in backup task occured

10,Job 1 (Backup / Restore Medium Task) [executing] WaitingT71 Result=5220

6,Error in backup task occured, Errorcode 5220 "wrong_hostfile"

It looked like that if I can start with log 002, but can not continue the next log 003.

I can not understand this!

Maybe I did something wrong? This really make me crazy.

Chu

lbreddemann
Active Contributor
0 Kudos

Hi Chu,

ok, step by step ...

>

> 1. dbmcli on maxdb1>util_execute clear log

> OK

Fine...

> 2. dbmcli on maxdb1>recover_start DBLOG LOG 001

> OK

> Returncode -7075

> SEEMS NOTHING HAPPEND.

-7075 means: this log cannot be recovered now. It could be that this logfile does not contain any "new" data so that the data won't be changed. This could happen if the data backup contains a version of the database that was saved by a savepoinz after the log segment saved in log.001 was written.

Therefore: Ok, but nothing is done.

> 3. dbmcli on maxdb1>recover_replace DBLOG LOG 002

> ERR

> -24988,ERR_SQL: SQL error

> -104,DBM command impossible at this time

As the log recovery did not actually start with step 2 (since it was the wrong log backup) you cannot "replace" the log but have to start the logbackup first.

> So I tried another way below:

>

> 1.dbmcli on maxdb1>recover_start DBLOG LOG 002

> OK

> Returncode -8020

-> Ok, data from the second logfile was recovered and now you can either stop the recovery by recovery_ignore or put in another logbackup by recovery_replace.

>

> 2. dbmcli on maxdb1>recover_replace DBLOG LOG 003

> ERR

> -24988,ERR_SQL: SQL error

> -3004,Invalid host file sequence

> 1,Backupmedium #1 (LOG.003) invalid file or device name [2]

> 6,Backup error occured, Errorcode 5220 "wrong_hostfile"

> 17,Servertask Info: because Error in backup task occured

> 10,Job 1 (Backup / Restore Medium Task) [executing] WaitingT71 Result=5220

> 6,Error in backup task occured, Errorcode 5220 "wrong_hostfile"

--> is there a third log backup file ??? If not the message is pretty self-explaining ...

> It looked like that if I can start with log 002, but can not continue the next log 003.

> I can not understand this!

> Maybe I did something wrong? This really make me crazy.

Don't give up now - you're nearly done...

kind regards,

Lars

Answers (0)