Is there any other way in fixing negative space used of log segment. I
understand that there is a dbcc command but it doesn't work for us because
our data and log segment resides on different devices.
Thanks in advance.
Jiggs
I pasted the following statement which I got from local sybase vendor when
we upgraded our sybase version from 11.5.x to 12.0. I guess that you have a
sybase 12.0.X version of sybase and your patch version is not the one of
the latest patches. Please read the following statement:
The negative space values occur because a value in the dbtable
structure is incorrect. Sp_helpsegment and sp_helpdb both use a system
function
curunreservedpgs() which accesses the databases internal memory structure,
called
DBTABLE, and reads the value for dbt_unrsvd for each database fragment, if
this
value is negative then the value returned by the procedure will also be
negative.
The fact that the dbt_unrsvd value is incorrect should not in any way effect
the
space usage in the database. When pages need to be allocated ASE uses the
allocation
pages and GAM pages, not the value stored in the dbtable, to determine if
there is
space available. The dbt_unrsvd value should however be regularly updated on
extent
allocations and deallocations.
The workaround is to run dbcc usedextents, if the user does not already have
sybase_ts_role then run:
sp_role "grant", sybase_ts_role, loginname
go
set role sybase_ts_role on
go
then to update the dbtable
dbcc traceon(3604)
dbcc usedextents(dbid, 0, 1, 1)
go
NOTE this will not update the sysusages.unreservedpgs value until the ASE is
rebooted. This also corrects the incorrect value in the free kbytes field.
ALPER ONEY
I.S.E TAKASBANK INC
TEL:+902123152109
<Jiggs> wrote in message
news:4E89280F03BF6F7D0012B6C985256C8C.0012B6DA85256C8C@webforums...
Thanks for responding to this message. However, when I tried the
suggestion. It still shows the negative value. I think it will only work
for a data-and-log segment and not for the log segment only devices as
shown in the traceon message:-
------------
DBCC execution completed. If DBCC printed error messages, contact a user
with System Administrator (SA) role.
Disk piece 0 (5242880 pages), extents used = 535283, free = 120077
Disk piece 0: unreserved pages array claims free pages = 950947, but this
function counted 950868
Disk piece 5242880 (1048576 pages), extents used = 2899, free = 128173
1 bad per-diskpiece page count were found in dbtable.
Those for data or data-and-log were corrected in memory;
dedicated log segment page counts are not changed by this function.
<<<<<<<< This is what am saying earlier
Total used extents = 538182
Total free extents = 248250
Total extents = 786432
DBCC execution completed. If DBCC printed error messages, contact a user
with System Administrator (SA) role.
---------------
By the way, our current version is:-
Adaptive Server Enterprise/12.0.0.4/P/SWR 10051 ESD 2/NT (IX86)/OS
4.0/1789/32bit/OPT/Mon Feb 04 16:51:23 2002
Any idea?
Thanks,
Jiggs
use <db>
go
create table mytb ( i int )
go
checkpoint
go
drop table mytb
go
The dummy table creation is to ensure the checkpoint really will be
written to disk.
At this point, 'dbcc dbinfo' should show the 'dbi_freelogpages_at_ckpt'
field with the corrected value.
'dbi_freelogpages_at_ckpt' is the base variable for the
lct_admin("logsegment_freepages",dbid) calculation (this is what
sp_helpdb uses to
calculate log freespace).
Now take off the -T7408 flag and reboot the server.
--
Posted via http://dbforums.com
It works! Many thanks for your help!
Regards,
Jiggs