DB Growth and Production DB Log FIle

  • can any one give suggestion below issues...

    1) can any one give sql script for to get the how DB Size is growing up on Daily basis.

    2) is there is any issue with if we maintin only one log file for logfile size:354 GB,db size:1.5 TB

  • If you just want to track database size, schedule a job to capture the information and store it into a table:

    CREATE TABLE SizeHistory (

    CaptureDate datetime,

    SizeMb float

    )

    select GETDATE() AS CaptureDate, SUM(size * 1.0 * 8 / 1024) AS SizeMb

    from your_database_name.sys.database_files

    A single log file is ok and complies to best practices.

    Hope this helps

    Gianluca

    -- Gianluca Sartori

  • HI

    FIRST OF ALL LET U KNOW ABOUT THIS SCRIPT IS FOR MONTHLY ANALYSIS

    SO U DO UR NEED FULL ACCORDINGLY

    Fisrt u run the below any of the script depens upon ur requirement and select in output window in ssms from ex--- 1/1/2011 to 1/1/2012 and calulate the growth individualy for every month present month date 31/3/2012 minus previous month 30/4/2012 tn u'vl get the growth of previous months same follow for daily accodring to ur requirement

    script 1:

    use msdb

    select DATABASE_NAME,backup_size,backup_start_date,

    backup_finish_date,database_creation_date

    from backupset where type='D'and

    database_name='Databasename'order by backup_finish_date desc //( REMOVE THIS "[DESC]"IF UWANT ASCENDING ORDER)

    script 2:

    use msdb

    select DATABASE_NAME,backup_size,

    backup_finish_date

    from backupset where type='D'and

    database_name='Databasename'order by backup_finish_date desc //( REMOVE THIS "[DESC]"IF UWANT ASCENDING ORDER)

    Thanks
    Naga.Rohitkumar

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

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