cancel
Showing results for 
Search instead for 
Did you mean: 

Log Switches

Former Member
0 Kudos

I am trying to find a way to see which log file number will be generated next. I am searching system tables but am not finding anything yet. I have also went through the dbm commands with no success. Any help would be greatly appreciated.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi John,

what do you mean by log file number? If you mean the log backups, their numbers always increment by one.

I guess I am unclear about your question.

Former Member
0 Kudos

I have my log segment size set to 12500. Which when it fills it writes out a 100m log file. I have a backup_medium writing these logs to a directory called /sapdb/LCx/saparch. These are the files I am interested in trying to find out via a script what the next sequence number is. I realize they increment by one but I am trying to develop a Disaster Recovery environmnet and will be using the log file number information in that.

Please Advise

former_member229109
Active Contributor
0 Kudos

Hello John,

-> If you are SAP customer, please review the SAP notes::

869267 FAQ: MaxDB LOG area

952783 FAQ: MaxDB high availability

-> The Database documentation available at

http://maxdb.sap.com/doc/7_7/default.htm -> Database Manager CLI Tutorial

-> Backing Up Data and Log Entries -> Log Area

-> Backing Up Log Entries < There is the section "Archiving Backup Files" >

&&

http://maxdb.sap.com/doc/7_7/default.htm -> Database Administration ->

Replication and High Availability

Thank you and best regards, Natalia Khlopina

Edited by: Natalia Khlopina on Jan 11, 2008 1:29 PM

Former Member
0 Kudos

John,

since the log backup files increment by one, you know the file names. But you can't predict how many log backups are going to be written, since you don't know the logging activity.

The MAXDB link says, "At regular intervals, repeat the data changes in the original database in the standby database by reading in the log backups of the original database into the standby database. You can use scripts to automate this process."

It should be possible to write a script that checks for new log backups at regular intervals, and applies them if any are found. If no new backups are found, then the script should exit without doing anything.

Does this answer your question?

Former Member
0 Kudos

Natalia,

Thanks for your reply. I have already been looking at this documents and have not found my answer.

This is a snippet from the one piece of documentation you sent me. it talks about log entries DEMODB_MYLOG.001 DEMODB_MYLOG.002 etc...

I am trying to query some system table to get the next log entry sequence number. This is what I am in search of but can't find. For example in oracle you can query the v$log, v$loghistory etc...

That is what I am looking for here.

Thanks

.

Former Member
0 Kudos

Ashwath,

That is what I am trying to do nut I need to know what log entries need to be applied. That is where I am not understanding the process. Are you using a standyby database?

Thanks

Former Member
0 Kudos

John,

what exactly do you mean by log entries? You don't apply log entries, you apply log files (which contain logs of individual transactions, arranged according to their I/O sequence number, which is roughly the order in which these transactions were executed). If you open your backup history file dbm.knl, you can see the range of I/O sequence numbers in each log backup. But you will never need to work directly with these I/O sequence numbers to apply any logs; all you need is the log backup filename and medium name.

Let's say you have applied DEMODB_MYLOG.001 on your standby database. Then, you can write a script that checks periodically for DEMODB_MYLOG.002 and applies it if found. Then the script checks for DEMODB_MYLOG.003 and applies it too, and so on (until all new log files are applied). If DEMODB_MYLOG.002 is not found, then the script does nothing and looks for it again the next time.

I work in liveCache and MAXDB Development Support at SAP, and have configured standby setups before.

Former Member
0 Kudos

Aswath,

Thanks for your reply. I do mean log files to be applied. This is how I do things currently (subject to change). I take a full disk backup, auto_log turned on. If I need to recover a livecache instance I can use the disk backup then use the log files to get up to the last log file. I thought maybe there was a system table of some sort that held this information. Apparently not. I can write a script to look at the dbm.knl file to get this information. That would work great.

I am not sure how to do the standby piece. As we have the SCM system with R/3 using livecache technology. At this point we have a DR server with the proper install sitting there. If we need the DR server to become the primary server I would restore the latest livecache disk backup and recover the latest log files. I see the hot standby in the dbm gui but am not sure where to start. This is all pretty new to me. Is there any good, straight forward documentation I can use to set this up. My end result would be to have a server in admin mode (perhaps) applying log files as they are generated.

Does this make sense?

Please advise

former_member229109
Active Contributor
0 Kudos

Hello John,

-> What option did you selected from::

http://maxdb.sap.com/doc/7_7/default.htm -> Database Administration -> Replication and High Availability ??

What is the OS of the liveCache server?

-> To Display the backup history you could use the dbm command

backup_history_list

See more details at http://maxdb.sap.com/doc/7_7/default.htm -> Tools

-> Database Manager CLI -> Overview of All DBM Commands -> backup_history_list

< Please also review More Information at

!!!! Database Administration Tutorial,

Evaluating the Restart Information and Backup History for Importing Backups

< You will see the needed dbm commands listed >

&& -> More Information

Restoring the Database Instance, section "Displaying Backup Information"

Setting Up and Updating Standby Instances , where you will see how to run the dbm commands you are

looking for.>

To Display the data backup information in the ONLINE or ADMIN operational state you could use

the dbm command medium_label < or medium_labeloffline if the database in OFFLINE state >.

Thank you and best regards, Natalia Khlopina

Former Member
0 Kudos

Hi Natalia,

We are currently in the process of upgrading from 7.6.01.09 to 7.6.03.08. Thanks for the information as I will continue to research what you have provided. We also use the dbmgui tool and when I display the backup history there it shows me exactly what I want to see. Do you happen to know what query it may be executing?

Thanks

markus_doehr2
Active Contributor
0 Kudos

Hi John,

in DBMGUI you can select "Instance - Show Console" and it will show you which commands DBMGUI is executing in what sequence.

Markus

Former Member
0 Kudos

Hi Markus,

Thank You very much I never knew about that option. It definitely gave me what I am looking for. I can now incorporate this command into my script.

John