Is there a way in the database to determine the location of the transaction log file? Maybe a database variable like @@servername?

asked 19 Jan '22, 08:20

Frank%20Vestjens's gravatar image

Frank Vestjens
1.3k354563
accept rate: 21%


The file pathes of the according database files are available via database properties, such as

select db_property('LogName'), db_property('LogMirrorName');

You can also use db_extended_property('File', ...) with the specified dbspace names.

permanent link

answered 19 Jan '22, 08:30

Volker%20Barth's gravatar image

Volker Barth
40.1k361549819
accept rate: 34%

Tnx, that did it

(19 Jan '22, 08:51) Frank Vestjens
3

In addition to Volker's answer about retrieving the log filespec, you can change the log filespec with the dblog.exe utility.

Physically, the database.log location is stored inside the database.db file. That prevents mistakes from being made... when starting a database file, the SQL Anywhere server always knows exactly where the log file is located.

You have to stop the database before running dblog.exe... it is one of the few programs that can change the database.db file directly without going through the SQL Anywhere server.

(19 Jan '22, 08:52) Breck Carter

I did know that. In our setups it is even located at another disk. Separated from the DB file.

In a backup event I needed to copy the backed up transaction log file yymmddAA.log to another server. That's why I needed the location in the database.

(20 Jan '22, 02:51) Frank Vestjens
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:

×59
×48
×28

question asked: 19 Jan '22, 08:20

question was seen: 1,160 times

last updated: 20 Jan '22, 02:51