Can any one tell me about how do i decrease database size ?
i have requirement like this
I have to refresh the database but my target database is less in size.
Can any body tell me the steps have to follow?
Calculate the estimated size of db.
create new db
bcp all tables to new db but it will not create constrants, triggers, procedures. U have to run the script for it if u have.
or you can use data pipeline in PB but you have to scripts for triggers and procedures
or u can use 'select * into' .
It is possible to shrink a database by dropping the last allocated UNPOPULATED disk fragment from sysusages .. that is ONLY if it isn't populated with any data ..
If it is populated with data, it's possible you can free it with defragging the tables residing on it .. after you can drop the fragment ..
I've done this a few times. I wouldn't suggest doing it on a prod server unless you are adept at this kind of "brain surgery", and be sure to have a master backup and a good knowledge on how to recover master if you muck it up.
or as a prior poster sida .. use "fast" BCP to offload-load .. and hope your target db houses the size of the resulting data, indexes etc.
-- you can bcp from view .. this is usefull for subsets of data ..
From v12.5 on, sybmigrate is a nice utility to copy
a database to a smaller target. Depending on the
version, sybmigrate might have some senseless
limitations, and you'll have to find a way to work around
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?
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: 22.214.171.124: 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????