Database Create Date after restore.

  • I've have the script. Thank you!

    You mention you are keeping a a list of the tlog in a control table. Why not pull it directly from the MSDB?

    SELECT msdb.dbo.backupset.backup_set_id,

    backup_start_date, backup_finish_date,

    physical_device_name, database_name, TYPE

    FROM msdb.dbo.backupset JOIN msdb.dbo.backupmediafamily

    ON msdb.dbo.backupset.media_set_id =

    msdb.dbo.backupmediafamily.media_set_id

    WHERE backup_finish_date > GETDATE()-1

    AND database_name = 'DBName'

    ORDER BY backup_finish_date

    This particular example will pull the last 24 hours of backups. Or if you know the time of the last full substitute it for the "getdate". Then when you run the curor through it - find the first full backup (that is type "D" or ends with "BAK") and then start processing out the rest of the strings.

    Just a thought. IIRC, every backup is logged in the MSDB. Why keep track of something else? Use the system.

    Just my $0.02.



    ----------------
    Jim P.

    A little bit of this and a little byte of that can cause bloatware.

  • Jim,

    The control table is not for tracking history, its for controlling the behavior of the backup procedure.  It tells the procedure which databases to backup (I can put an 'X' in the BU_Type column for a test database that doesn't need backups),  where to place the backup files, how long to keep the backups (each database can have a different retention period). 

    Steve

  • Makes sense now.

    Like I said, I'm lazy and just use the maint wizard. Break them into User, IS, System and then any other specialized groupings I need.



    ----------------
    Jim P.

    A little bit of this and a little byte of that can cause bloatware.

Viewing 3 posts - 16 through 17 (of 17 total)

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