Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

We are in the process of preparing an upgrade for our customers from ASA9 to SA12. The typical setup is a Consolidated Database and one or several Remote Databases.

From reading the documentation I see that we need an extra bit of log-file tweaking, in a test setup I've rebuild the consolidated using these steps.

The databases are rebuilt successfully, but in order to send messages from the database again I have to tweak the log offsets as SQL Remote now tries to find a log offset that exists only in the old transaction log. Proceeding to this part of the documentation some questions came to my mind:

7.Erase the current transaction log file for the new database.

8.Use dblog on the new database with the ending offset noted in Step 3 as the -z parameter, and also set the relative offset to zero.

dblog -x 0 -z 0000698242 -ir -is database-name.db

  • If I erase the current transaction log the database won't start unless I start with the -f parameter. Will the DBLOG command above create a new online log file starting at offset 0000698242 ?

9.When you run the Message Agent, provide it with the location of the original off-line directory on its command line.

  • Is this the -ml <dir> parmameter of dbremote.exe or is there another way to provide the location of off-line directory ? (dbremote is executed from a command line batch script)
  • Is it enough to supply this parameter first time or do I have to run dbremote with this parameter until SQL Remote offsett has passed into the new transaction log ? I have to take into account that some messages may be lost on the way, so after sending the first messages from the consolidated base a "missing message" scenarion at the remote site must be handled in some way.

asked 09 Dec '11, 09:53

OskarEmil's gravatar image

OskarEmil
431161831
accept rate: 50%


You should only need to use the dblog command if you manually rebuild the database. Why haven't you used the dbunload -ar to rebuild the database in place? This is much easier IMHO, as it eliminates the need to get rid of the transaction log created during the rebuild, and executes the equivalent of the dblog command against the newly created database for you.

The -ml parameter is only needed if you want dbremote to delete old mirror transaction logs in addition to old logs when it deletes transaction logs that are no longer needed. If you look at the usage for dbremote, the last parameter specified is the location of offline transaction logs. If you do not specify a value, then SQL Remote will look in the same directory where the active transaction log resides for offline logs.

You should specify a location for offline transaction logs all the time when running SQL Remote, regardless of whether or not an upgrade as recently been performed. I suspect that up until now, your offline logs have always been located in the same directory where the active transaction log resides, and you haven't had to worry about it.

permanent link

answered 09 Dec '11, 10:21

Reg%20Domaratzki's gravatar image

Reg Domaratzki
7.7k343118
accept rate: 37%

Thanks, seems to work like a charm. Just to be sure, this is the correct syntax ? dbunload -ar -c "DBF=database-file.db;uid=dba;pwd=sql"

I also noticed a new .olg file. I presume this is the old transaction log which may be deleted when all subscribers offsets have passed into the new transaction log?

(12 Dec '11, 03:11) OskarEmil

Your command line looks fine to me.

You are correct about the .olg file. I would never suggest manually deleting old logs file though. Have a look at the delete_old_logs database option for a solution that involves having SQL Remote delete the old transaction logs for you automatically when it determines that they are no longer needed.

(12 Dec '11, 16:41) Reg Domaratzki

I'll try to answer your questions:

If I erase the current transaction log the database won't start unless I start with the -f parameter.

AFAIK, you should erase the log after the database has shutdown cleanly. Then on netxt start, the database will simply start a new transaction log. Option -f should not be necessary at all.

Will the DBLOG command above create a new online log file starting at offset 0000698242?

No, it simply will change the log starting offset information in the database file. (And as you have erased the current log in the step before, there is no current one. But it will be created automatically on next start - see above.

permanent link

answered 09 Dec '11, 10:09

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822
accept rate: 34%

As to the offline log directory:

Is this the -ml "directory" parmameter of dbremote.exe or is there another way to provide the location of off-line directory ? (dbremote is executed from a command line batch script)

No, -ml is for offline transaction mirror log files. You will only need this if you are using a transaction mirror log at all.

You simply add the offline directory (i.e. the directory containing old logs - made be backups and the last v9 database log) as last parameter on DBREMOTE's command line.

Is it enough to supply this parameter first time or do I have to run dbremote with this parameter until SQL Remote offsett has passed into the new transaction log ? I have to take into account that some messages may be lost on the way, so after sending the first messages from the consolidated base a "missing message" scenarion at the remote site must be handled in some way.

This should depent on the question whether you usually have offline logs - as long as SQL Remote might need any one of them (i.e. as long as not all remotes - or the consolidated - have committed all operations from these old logfiles) it will require to access them. So I would recommend to add that directory (which might be the directory also containing the current database and log file) anyway.

permanent link

answered 09 Dec '11, 10:16

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822
accept rate: 34%

edited 09 Dec '11, 10:18

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×103
×62

question asked: 09 Dec '11, 09:53

question was seen: 2,460 times

last updated: 12 Dec '11, 16:41