• mcliffordDBA (3/15/2011)


    I don't know if this answers your question or not but I run 3 different jobs.

    The databases I want to be part of my transaction log shipping is set to Full. Everything else simple.

    Basic Logic

    Sunday(Midnight) - run full backups during a weekly maintenance.

    --Every hour TLog.

    Monday - Saturday (Midnight)- Diff Backups

    --Every hour TLog.

    1st job - Full Backups (Sunday Only)

    2nd Job - Diff Backups (Mon-Fri)

    3rd Job - TLog/shipping (At the top of the hour - after maintenance windows)

    Hate the session expired deal 🙂 had a nice reply and it was lost.

    Anyways here is a quick summary of what I wrote.

    I had a test db in full recovery...ran a full backup with the stored procedure...then ran several log backups...

    I switched the database to simple recovery mode to simulate some 'event' that would break the log chain...

    then attempted to run the log backup again...it ran with no error and listed the following...

    DateTime: 2011-03-15 16:09:53

    Database: [DB_UTILS]

    Status: ONLINE

    Mirroring role: None

    Standby: No

    Updateability: READ_WRITE

    User access: MULTI_USER

    Is accessible: Yes

    Recovery model: SIMPLE

    Differential base LSN: 137000000672800036

    Last log backup LSN: NULL

    DateTime: 2011-03-15 16:09:53

    This segment of code gets skipped because it the DB is in SIMPLE mode

    IF @ChangeBackupType = 'Y'

    BEGIN

    IF @CurrentBackupType = 'LOG' AND DATABASEPROPERTYEX(@CurrentDatabase,'Recovery') <> 'SIMPLE' AND @CurrentLogLSN IS NULL AND @CurrentDatabase <> 'master'

    BEGIN

    SET @CurrentBackupType = 'DIFF'

    END

    IF @CurrentBackupType = 'DIFF' AND @CurrentDifferentialLSN IS NULL AND @CurrentDatabase <> 'master'

    BEGIN

    SET @CurrentBackupType = 'FULL'

    END

    END

    and also here because it is it is a LOG backup but the database is in SIMPLE mode

    IF DATABASEPROPERTYEX(@CurrentDatabase,'Status') = 'ONLINE'

    AND NOT (DATABASEPROPERTYEX(@CurrentDatabase,'UserAccess') = 'SINGLE_USER' AND @CurrentIsDatabaseAccessible = 0)

    AND DATABASEPROPERTYEX(@CurrentDatabase,'IsInStandBy') = 0

    AND NOT (@CurrentBackupType = 'LOG' AND (DATABASEPROPERTYEX(@CurrentDatabase,'Recovery') = 'SIMPLE' OR @CurrentLogLSN IS NULL))

    AND NOT (@CurrentBackupType = 'DIFF' AND @CurrentDifferentialLSN IS NULL)

    AND NOT (@CurrentBackupType IN('DIFF','LOG') AND @CurrentDatabase = 'master')

    the whole backup process is skipped and you loop through.

    No backup occurs...

    again I am wondering if I am the one doing something wrong here.

    I am running the debugger on a SQL 2008 R2 server for testing.