cancel
Showing results for 
Search instead for 
Did you mean: 

-24991,ERR_NODBSESSION: no database session available

Former Member
0 Kudos

Hello everyone

I did setup standby db MaxDB 7.6.06.

And now i want to automate redolog shipping to standby db.

But scripts faild on step of recover_replace

Here my command

E:\sapdb\programs\pgm\dbmcli.exe -n localhost -d DEV -u control,***** -uUTL -c recover_replace archivelog e:\standbydb\log\dev_log 025

Saphelp said that i need opened db_connect session. But i didn't find any solution(

Could you help me???

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hello,

I am also looking for the working script of Recovery_Builder.bat as per https://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=72123826, anyone has managed to do it?

Thanks in advance.

lbreddemann
Active Contributor
0 Kudos

>

>

> E:\sapdb\programs\pgm\dbmcli.exe -n localhost -d DEV -u control,***** -uUTL -c recover_replace archivelog e:\standbydb\log\dev_log 025

>

> Saphelp said that i need opened db_connect session. But i didn't find any solution(

Hi there!

By using -uUTL you already made sure that you get a utility/db-session.

So this is not the issue here.

Why don't you just send us the error message you get?

BTW: you may also check the MaxDB Wiki [here|http://wiki.sdn.sap.com/wiki/display/MaxDB/HowTo-StandbyDBlog+shipping] to get an example implementation of log shipping with MaxDB.

regards,

Lars

Former Member
0 Kudos

I was trying to implement windows script from wiki, but it faild on step of recovery_replace

so i ask you some help with it

>> E:\sapdb\programs\pgm\dbmcli.exe -n localhost -d DEV -u control,***** -uUTL -c recover_replace archivelog e:\standbydb\log\dev_log 025

ERR

-24990,ERR_NOBACKUPSESSION: No restore session available

lbreddemann
Active Contributor
0 Kudos

>

> I was trying to implement windows script from wiki, but it faild on step of recovery_replace

>

> so i ask you some help with it

>

> >> E:\sapdb\programs\pgm\dbmcli.exe -n localhost -d DEV -u control,***** -uUTL -c recover_replace archivelog e:\standbydb\log\dev_log 025

> ERR

> -24990,ERR_NOBACKUPSESSION: No restore session available

As we see, MaxDB is not complaining about a "db_connect" session as you wrote earlier, but about a BACKUP SESSION.

Now, think about what you're trying to do:

You want to replace one log backup with another so that it can be restored.

That implies that you already do have a log backup that had been recovered.

So there must be a BACKUP SESSION currently open.

BACKUP SESSIONS are opened by either db_activate recover or recover_start.

I don't see neither of those commands before the 'recover_replace*.

In fact, the command line itself cannot work on it's own, since there is no recover_start anywere.

I propose to read and understand how recovery works with MaxDB before trying to do fancy stuff like standby databases.

There's pretty good documentation all around here for this!

Just my 2 cents.

regards,

Lars

Former Member
0 Kudos

I'm not a specialist in MaxDB.

For this moment i did install standby db as copy of our development system and i can upload manualy redolog to standby db from masterdb.

So actual task is to setup a automatic redolog shipping to standby db.

I tryed to implement script from wiki but it faild(

Could you provide me what are wrong in my adapted scripts and help me with them??

Here my changed scripts from wiki....

standby.bat

***********************

del e:\StandbyDB\import_script.txt /f /q

call e:\StandbyDB\Recovery_Builder.bat

sleep 5

call e:\StandbyDB\Recovery_Apply.bat

***********************

recovery_builder.bar

***********************

rem %%a = Logfile Name

rem %%b = log file number

rem %%j = Page number

Set LiveDB=sap-dev02.sap-npq.local

e:\sapdb\programs\pgm\dbmcli.exe -n localhost -d DEV -u control,passw0rd db_admin

for /f "usebackq tokens=1,2,3,4 delims= " %%a in (`"e:\sapdb\programs\pgm\dbmcli.exe -n localhost -d DEV -u control,passw0rd db_restartinfo |findstr /c:"Used LOG Page""`) do (set current_page=%%d)

for /f "usebackq tokens=1,2 delims=." %%a in (`"dir E:\StandbyDB\11\dev. /b /o:e"`) do (

for /f "usebackq tokens=1,2,3,4 delims= " %%g in (`"e:\sapdb\programs\pgm\dbmcli.exe -n %LiveDB% -d DEV -u control,passw0rd medium_label Auto_log_Backup %%b |findstr /c:"Last LOG Page""`) do (

call :find_backup_page %%j %%a %%b

)

)

:exit_loop

for /f "usebackq tokens=1,2 delims=." %%a in (`"dir E:\StandbyDB\11\dev. /b /o:e"`) do (

if %%b GTR %first_file% (

echo recover_replace archivelog E:\StandbyDB\11\dev_log %%b > E:\StandbyDB\import_script.txt))

goto end

:find_backup_page

set backup_page=%1

if %current_page% EQU %1 (

echo db_connect > E:\StandbyDB\import_script.txt

echo db_admin > E:\StandbyDB\import_script.txt

echo recover_start Auto_log_Backup LOG %3 > E:\StandbyDB\import_script.txt

set first_file=%3

if %current_page% GTR %1 goto exit_loop

)

:end

*********************

recovery_apply.bar

*********************

E:\sapdb\programs\pgm\dbmcli.exe -n localhost -d DEV -u control,passw0rd -i "e:\StandbyDB\import_script.txt"

lbreddemann
Active Contributor
0 Kudos

>

> I'm not a specialist in MaxDB.

And that's why I pointed you to the documentation.

You don't need to be a specialist in MaxDB for this.

You don't need to know all the internal stuff that is going on during recovery and you don't need to be able to debug this.

But you need to understand how to use it and how it is supposed to work.

That's exactly what the documentation is telling you.

> For this moment i did install standby db as copy of our development system and i can upload manualy redolog to standby db from masterdb.

> So actual task is to setup a automatic redolog shipping to standby db.

Yeah, I got that already.

But see: if you wanna have the all-in-one-carefree-solution, then maybe it's better to just buy one of the available commercial products. WIth them, you buy the know-how.

The scripts are home-grown solutions from people that wanted to get it going and invested a little own effort into it.

> Could you provide me what are wrong in my adapted scripts and help me with them??

> Here my changed scripts from wiki....

> recovery_builder.bar

> ***********************

> rem %%a = Logfile Name

> rem %%b = log file number

> rem %%j = Page number

>

> Set LiveDB=sap-dev02.sap-npq.local

>

> e:\sapdb\programs\pgm\dbmcli.exe -n localhost -d DEV -u control,passw0rd db_admin

Ok, first bug here!

I clearly remember (and I double checked this just a minute ago) that I've removed the idiotic usage of explicit connect information with XUSER references.

Why do you want to have your passwords to the database in the scripts?

Utmost nonsense!

Use XUSER stored logon data instead!

Now, do you understand how this script is supposed to work?

If you look at the version from the WIKI you'll find that there is a distinction between two cases:

1.

For the first file (this is the one for which the last recovered log page is equal to the first saved one in the log backup file), a kind of startup part is written to the import_script.txt:

db_connect

db_admin

recover_start //medium_name// LOG //log backup no.//

and

2.

For the rest of the log backup files, for each single one of them, a

recover_replace //medum_name// "Autolog" //log backup no.//

is written to the import_script.txt

So, you should find those two parts in your import_script.txt.

Are they there?

How does your import_script.txt looks like?

Don't get me wrong - I try to help you to help yourself.

But I'm surely not going to do this work for you.

Straight questions call for straight answers - general "debug this for me" requests will get ignored.

Good luck!

Lars