2

Is there any way to shrink SQL Anywhere databases?

With SQL Server, it was an easy task. Just do it, have a faster database again that has a size which can be transferred over a slow internet connection.

Can this be achieved with Sybase?

The question is not whether you should shrink or not - it is how it is done. So please don't quote things like "you should not" from Pinal.

Paul White
  • 94,921
  • 30
  • 437
  • 687
Offler
  • 155
  • 3
  • 8

2 Answers2

3

In command line:

dbunload -c "UID=username;PWD=password;DBF=DB_old.db" -an "DB_new"
  • DB_old.db is the name of the original database.
  • DB_new.db is the name of the database shrunken.
  • "DB_old" and "DB_new" the location of the files is relative to the path of the server that is running.
  • If more than one file up the dbspace:

    DB1_old.db, DB2_old.db, ... DBn_old.db
    

    then it is result

    DB1_new.dbr, DB2_new.dbr .... DBn_new.dbr
    

Examples of connection strings are available in the help: Unload utility (dbunload)

Andriy M
  • 23,261
  • 6
  • 60
  • 103
Luis
  • 31
  • 1
3

You can't shrink SQL Anywhere databases online.

The "correct" way to do it is to unload/reload it in a new database.

It's easy to do it via Sybase Central. Via command line it is the dbunload command with the -an command line switch. See Unload utility (dbunload) in the documentation.

A shrunk database is not by default faster than an "unshrinked" database.

Andriy M
  • 23,261
  • 6
  • 60
  • 103
André Schild
  • 251
  • 1
  • 5