Results 1 to 7 of 7

Thread: shrink database

  1. #1
    Join Date
    Jul 2006
    Posts
    115

    Unanswered: shrink database

    can we shrink database in sybase?
    ase 12.5

    regards

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    No easy way. Create a new smaller database then use sybmigrate or bcp to transfer the data.

  3. #3
    Join Date
    Jul 2006
    Posts
    115
    but i want to maintain the table structure ... sp & trigger in the database
    can sybmigrate work?

  4. #4
    Join Date
    Aug 2002
    Location
    Madrid, Spain
    Posts
    97
    IIRC, sybmigrate will handle all metadata and permissions (grants).
    On some versions, sybmigrate may forget users and groups; to
    avoid problems, I'd suggest creating groups and users in the
    empty target database before running sybmigrate.

    sybmigrate pivots on a temporary repository of objects. If the
    first run fails, you may run it again, and sybmigrate will only
    retry the failed objects; the repository tells sybmigrate which
    are the pending objects. This is good if some stored procedures
    failed because they had lacking dependencies when sybmigrate
    tried to copy them for the first time.

    Regards,
    Mariano Corral

  5. #5
    Join Date
    Sep 2006
    Location
    Czech Republic
    Posts
    82
    But it seems that sybmigrate cannot migrate databases on same server (Error the source and target ASE servers cannot be the same...)

    What about a backup database from Sybase Central? Dump to file. Than drop database delete devices, create new one and new database and from Sybase Central Restore?

    But...

    I have 1500 Mbyte devices... Dumped database to file (size of file 50 Mbyte)... Created data devices 500 Mbyte....

    But during restoreing .. I ve got message: "Backup Server session id is: 11. Use this value when executing the 'sp_volchanged' system stored procedure after fulfilling any volume change request from the Backup Server.
    Backup Server: 6.28.1.1: Dumpfile name 'my_db072820796C ' section number 1 mounted on disk file 'c:\database_dump'
    Data on dump will not fit into current database. Need 1500 Mbyte database."

    Data cannot fit? Why? Data are 50 Mb and device is 500 Mb... Why I need 1500 Mb????

    Any thoughts? Did someone tried it?

    David

  6. #6
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Quote Originally Posted by Musil David
    Data on dump will not fit into current database. Need 1500 Mbyte database."

    Data cannot fit? Why? Data are 50 Mb and device is 500 Mb... Why I need 1500 Mb????
    e.g. your database has 3 pages
    page 1 has data
    page 2 is empty
    page 3 has data

    Your database dump backup used pages i.e. 2 pages

    When you try and load to a database with 2 pages, page 3 can't be restored as the database is not large enough

  7. #7
    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    443
    This is one of the many reasons, you need your DDL in text form atleast if not a design tool like PowerDesigner with appropriate version controls.

    If you are going into a middle of a project with no such setup, you need to get that done asap.

Posting Permissions

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