dbcc updateusage

  • i want to schedule a job with dbcc updateusage(dbname) then run the dbcc sqlperf (logspace) in the same job.

    how to do this.any suggessions pls...

    thanks.........

  • whats the problem in creating it?

    for dbcc sqlperf(logspace) you may want to capture the results to a table... use dynamic query for this..



    Pradeep Singh

  • for the logspace part, the following code will write the results in a table which you can query later.

    create table tblLogSize(dbname varchar(100),

    logsize float,

    used float,

    status int

    )

    go

    ----------------------

    create procedure LogSpace

    as

    dbcc sqlperf(logspace)

    go

    -----------------------

    Create Procedure InsertIntoTable

    as

    truncate table tblLogSize

    insert into tblLogSize exec LogSpace

    go

    -----------------------

    exec InsertIntoTable

    select * from tblLogSize



    Pradeep Singh

  • charipg (9/4/2009)


    i want to schedule a job with dbcc updateusage(dbname) then run the dbcc sqlperf (logspace) in the same job.

    Why? What's the purpose of UpdateUsage in there?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply