Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

How do I know which software version was created db file?You have any command line that I can use?

asked 29 Sep '15, 15:09

Walmir%20Taques's gravatar image

Walmir Taques
690374151
accept rate: 12%


There is a sys.syshistory system view which has an 'INIT' record in it that will tell you that.

permanent link

answered 29 Sep '15, 16:18

Nick%20Elson%20SAP%20SQL%20Anywhere's gravatar image

Nick Elson S...
7.3k35107
accept rate: 32%

Maybe the better question to ask is... Why do you need to know?

So far we do know it was created with a version that has not shipped anytime in the last decade or so. Whatever do need from this exercise is probably going to require a rebuild with current releases before you can do anything with that; unless you have 9.0.2 or earlier software to work with.

permanent link

answered 30 Sep '15, 12:34

Nick%20Elson%20SAP%20SQL%20Anywhere's gravatar image

Nick Elson S...
7.3k35107
accept rate: 32%

edited 30 Sep '15, 12:35

@Nick Elson S...

Why do you need to know?

There structure of tables that are not contained in inferior versions ASA V9 version.

example:

 IF NOT EXISTS (select constraint_name from SYSCONSTRAINT WHERE CONSTRAINT_NAME = 'xxxxxxxx') then
 //bla bla bla...   
 end if;

Displays error: Table 'SYSCONSTRAINT "not found

The system created functions that check if the table is still there trying to create it with this customer (db) that are not updated to 9.0.2.3951 EBF present error. I want to create a mechanism to detect all clients that are outdated in order to update them (have to generate a report) for technical support form an action plan (among other things).

(30 Sep '15, 14:53) Walmir Taques
Replies hidden
1

Well, then as stated, you simply may have to look if the database has the mentioned SYS.SYSHISTORY table - if so, it it version 9.0.1 or above (and what exact version, the row with the "INIT" record will tell, see Nick's first answer), and if not, it's v9.0.0 or below - and then would have to be upgraded. Would that not do the trick?

(30 Sep '15, 15:26) Volker Barth
Comment Text Removed

Just to add a little bit more "history": In case your database does not have a SYSHISTORY table in the system catalog, it has been created with v9.0.0 or before, as SYSHISTORY has been introduced in 9.0.1.


Furthermore, if you are interested in a programmatical method, you can also use the DBTools API function DBCreatedVersion() to get file version information, though that does only differentiate between the major versions (pre-v10, v10, v11, v12 and the like) and does not help w.r.t. to versions before v10...

permanent link

answered 30 Sep '15, 01:02

Volker%20Barth's gravatar image

Volker Barth
40.5k365556827
accept rate: 34%

edited 30 Sep '15, 01:09

Here's a brute force approach: with any program that allows to view binary data you scan the header block of the DB file. Here I even used Wordpad (works only for small files). Next to the copyright string you'll find the version and build of the engine that was used to create the database

alt text

I've use this technique to write a batch file which automatically starts the database using the corresponding engine version by open ISQL with the proper connection parameters.

permanent link

answered 30 Sep '15, 09:49

Reimer%20Pods's gravatar image

Reimer Pods
4.5k384891
accept rate: 11%

One might add that this does also work for strongly encrypted database files (at least with AES encryption).

(30 Sep '15, 10:03) Volker Barth

My problem is just with lower versions ASA V9. Using "brute force" see the following text:

    ÿÿÿÿÿÿÿÿv7   WATCOM Iÿÿÿÿÿÿÿÿ              right (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) ÿÿÿÿÿÿÿÿ94 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International Corp., Copyright (c) 1987, 1994 WATCOM International CorpNSA
(30 Sep '15, 12:00) Walmir Taques
Replies hidden

That could be any version 7.0.x or earlier from what I can estimate. If it were an 8.0.x created database I would expect the version to be exposed (as I can verify from an 8.0.2 database I still have access to).

(30 Sep '15, 12:31) Nick Elson S...

That same copyright string is present in databases created with Watcom SQL 4.0 all the way up to 7.0.4. (Watcom SQL 3.2 contains a similar string with the dates 1987, 1993).

Perhaps the 'Capabilities' database property could help?

(30 Sep '15, 14:24) Mikel Rychliski
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:

×22

question asked: 29 Sep '15, 15:09

question was seen: 2,742 times

last updated: 30 Sep '15, 15:46