Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2006
    Posts
    6

    Unanswered: Extract SQL statements from the old sybase DBMS (10.0 or 11.5)

    Hi
    I'm a newbie to Sybase. I was assigned a task to migrate the databases in the old sybase version (10.0,11.5) to the current Sybase version or extract the sql statements from the data device files (.dat). And the old DBMS cannot be on the running-time states becasue we don't have the DBMS rec, which means I only have some .dat files and bcp backup files. Can anyone point me a direction of how can I get the SQL file out of these cold data files without start the old sybase DBMS. I have installed a latest sybase ASE express edition.
    Thank you very much
    John

  2. #2
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    If they are bcp files, then all you need is a TEXT editor. If these are actual sybase data and trransaction devices, then you have to start them under the same release of Sybase and then perhaps bcp out.

  3. #3
    Join Date
    Jul 2006
    Posts
    6
    Thanks willy. I have some bcp output files. Why do I need a text editor? for what? Can you give me some more detail information? I read the bcp information in the sybase manual. It seems they don't need text editor to change someting. Are they compatible with the new version?
    Thanks again

  4. #4
    Join Date
    Jul 2006
    Posts
    6
    Another question, we have many .dat file which is the device files for sybase to put data. Is it possible any tools can extract the data directly from .dat files? Please give me a direction. I read some articles said that MS access and powerbuilder have the ability to extract data from .dat files, is it correct?
    Thank you very much.

  5. #5
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    On unix or linux I would use the "strings" command to extract ALL ASCII strings from the .dat files, and then start to go through them to find the stored procs, etc.

    However that won't help in terms of reverse engineering the table definitions. For that you'll have to analyse the BCP file structure and do the best you can to find what datatypes where used.

    As Willy said, the best solution is to actually start the old server with the original software...

    Michael

  6. #6
    Join Date
    Jul 2006
    Posts
    6
    Thank you. I got an old version Sybase ASE(11.0.33) installed. But I didn't find any document to talk about how to recover my old .dat files (master.dat,model.dat...etc.) to this new installation. Could you please point me a direction? I read almost all documents for 11.0.3 on the syabse website.

  7. #7
    Join Date
    Jul 2006
    Posts
    6
    Is the dump file dumped on Solaris can be load to Linux? I read some articels said it cannot because of the different endianess in Intel and RISC platform. Is it right?

  8. #8
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    Cross platform dumps only work if the target system is at 12.5.3 or higher, and you can only load from source systems that are at 11.0.x or later.

    So if you have a 12.5.3 or 15.0 install on linux you *may* be able to recover from dumps performed on your old 11.x systems.

    Michael

  9. #9
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    To start using the old .dat files again, I'll create a new 11.0.3.3 server that has a master device the same size as the old e.g.
    # ls -l master.dat
    -rw-r--r-- 1 syb1103 sybase 104857600 Jul 24 09:37 master.dat
    # echo $((104857600/1024/1024))
    100
    So in this case create a 100MB master device
    Then shutdown, copy your old master.dat over the newly created one
    Start the new server in single user mode
    select * from sysdevices to find what the path to all the devices are
    shutdown with nowait and copy all devices to the required paths
    OR just update sysdevices with the new path to the devices
    after restart all should be OK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •