I have loaded a database from one server onto another but with different device allocations.
When I LOAD the database, the sysusages entries get changed.
How can I correct them ?
You have to create the loaded database with the same device allocation as the original. Please do the following:
source server
select * from sysusages where dbid = <source_database_ID>
go
--this will give all the info with segmap = 3 being data,
-- = 4 log and = 7 (data + log). The size is the size of
--segment and you need to devide it by 512 to get it in MB
--In the target data server create database for load with the same segment order as the source database. The first line can be create database. For example.
create database <target_database> on device01 = 100 log on device02 = 50 for load
alter database <target_database> on device 01 = 200 for load
alter database <target_database> log on device02 = 50 for load
and so on.
Once the target database is created OK, load it from the dump. The segments should match OK. Then set the database options.
Many times what I have seen in the field is a database is created starting to use small increments(100MB, 200MB), and then all of the sudden, the application starts to be used extensively and DBA starts to use 2GB increments.
Well, you can start to run out of device fragments within a DB, and may want to clean it up and reduce the fragmentation of you sysusages.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.