Pervasive
Sign in | Join | Help
in

How to restore database with *.dat files?

Last post 06-30-2008 11:46 AM by Gil. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-30-2008 2:45 AM

    • kalesh
    • Not Ranked
    • Joined on 06-30-2008
    • Posts 2

    How to restore database with *.dat files?

    Hi,

    I have like 20 sotheting *.dat files, which are pervasive sql data files.

    The pervasive function executer successfully opens these files. But I have no idea what to do next here.

    How can i port these files to a databse or a database table,  like the restore or attach option in microsoft sql server?

    I could not find a restore database utility anywhere.

    Please help.

    Thanx

    Kalesh. 

  • 06-30-2008 7:14 AM In reply to

    Re: How to restore database with *.dat files?

    Are there any *.DDF files in the same directory?  The DDFs (Data Dictionary Files) have the file structure you need to create a PSQL database.  From there you could create a DSN using the Pervasive Control Center (PCC).  This would create the DSNs you would neet to port over the data.

    If you don't have any DDFs, you would have to create them.  You could check with the developer/vendor to see if they have the DDFs you need.

     

     

  • 06-30-2008 7:25 AM In reply to

    Re: How to restore database with *.dat files?

    For you to define these files to a database, you would either have to execute create table and create index queries using sql syntax or you could use the utility ddfbuilder. This process is known as defining the tables to the dictionary data files (ddfs).  Please consult the documentation, SQL Engine Reference and the DDF Builder User's Guide.  Both methods require that you know the structure of the existing record in the files i.e. you have to know each field's datatype and its length.  This information is not stored anywhere and is usually acquired from the developer who created the files.  Sometimes, the developer already has DDFs.  Sometimes, they do not want their files to be accessed in this way.  And, sometimes, the information is not readily available because the developer is not in the picture any longer.

  • 06-30-2008 9:14 AM In reply to

    Re: How to restore database with *.dat files?

    Try starting here: www.goldstarsoftware.com/press.asp

    Grab the white paper on accessing Btrieve files from ODBC, which explains much of the concepts that you need to get started.  Once this is done, you'll be in a lot better shape to identify the next step, per Jose's or Jay's replies.

    Bill Bach
    Goldstar Software Inc.
    www.goldstarsoftware.com
  • 06-30-2008 9:39 AM In reply to

    • kalesh
    • Not Ranked
    • Joined on 06-30-2008
    • Posts 2

    Re: How to restore database with *.dat files?

    Well, the vendor did not supplied any ddf files Tongue Tied

    I was able to open the dat files in the function executer. Now there is an options to view the files statistics. Here's the screenshot. (File size is - 1 ....Angry)

    Now when I save this file its contents are like

    record=739  variable=N  dupkey=0
    truncate=N  compress=N  key=4
    page=1536  data=Y
    fthreshold=5  vats=N  balance=N

    position=1  length=12  duplicates=N
    modifiable=Y  type=STR  descending=N
    alternate=N  caseinsensitive=N  repeatdup=N
    nullkey=N  value=0  segment=N

    position=13  length=35  duplicates=Y
    modifiable=Y  type=STR  descending=N
    alternate=N  caseinsensitive=Y  repeatdup=N
    nullkey=N  value=0  segment=N

    position=48  length=20  duplicates=Y
    modifiable=Y  type=STR  descending=N
    alternate=N  caseinsensitive=N  repeatdup=N
    nullkey=N  value=0  segment=N

    position=68  length=35  duplicates=Y
    modifiable=Y  type=STR  descending=N
    alternate=N  caseinsensitive=N  repeatdup=N
    nullkey=N  value=0  segment=N

    From the documentation it looks like a description file. Documentation says I can use these files to create data files and indexes. So can I use these files?.. I think il have to use the Butil command here?..

    okok... just read the last reply..

    Downloading the whitepaper !!! ...

    Thanx for helping...

    Cheers. 

  • 06-30-2008 9:57 AM In reply to

    Re: How to restore database with *.dat files?

    With no DDF files, you'll have to guess at the format.  The paper will make this make some sense.  However, without app source code, all you know is this:

    1) The record length is 739 bytes.

    2) The first 12 bytes are a unique string field.

    3) The next 35 bytes are a duplicate string field.

    4) The next 20 bytes are a duplicate string field.

    5) The next 35 bytes are a duplicate string field.

    Beyond that, we know nothing about the file's datya or structure.  Luckily, if ALL fields are strings, then you should be able to browse the records (with WBEXEC32) and see a pattern for where each field starts and stops.  This should help you to identify how to interpret the bytes.
     

    Bill Bach
    Goldstar Software Inc.
    www.goldstarsoftware.com
  • 06-30-2008 11:46 AM In reply to

    • Gil
    • Not Ranked
    • Joined on 04-15-2008
    • Posts 3

    Re: How to restore database with *.dat files?

     If you need to analyze the structure and build the DDF files you can download BtSearch in the component zone

    http://cs.pervasive.com/files/19/default.aspx?Sort=PostDate

    It will help you determine the file layout and help with the binary type data fields.

     

    Gil 

Page 1 of 1 (7 items)
© 2008 Pervasive Software Inc. All Rights Reserved.