Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: Transaction log very high when dropping a column on popular table

$
0
0

You can use the dbcc upgrade_object command to force renormalization.

 

use test

go

create table t1 (c1 int, c2 int)

go

create procedure p1 as select c1 from t1

go

dump tran test with truncate_only

go

alter table t1 drop c2

go

select count(*) from syslogs

go

dbcc upgrade_object(test, "p1", force)

go

select count(*) from syslogs  -- note the increase in log records from normalization here

go

execute p1

go 

select count(*) from syslogs -- note no increase here now.

go

 


The sysdepends table will generally tell you which objects depend on another, providing the dependent object (table in this case) hasn't been dropped and recreated since the referencing object (the procedure) was created.  (The table stores dependencies by object id, so when you drop the table the row is deleted, but when you re-create the table a new row isn't inserted ).

 

You can generate a dbcc_upgrade script from sysdepends for ever object that depends on a table:

 

select

     "dbcc upgrade_object(test, '"

+     object_name(id)

+     "', force) "

from sysdepends

where depid = object_id("t1")

go

 

-bret


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>