Wednesday, September 12, 2012

BIML Maintenance Cleanup

Example file for creating a Maintenance Cleanup Integrity SSIS Package
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
    <Connections>
        <AdoNetConnection
            Name ="CnAdoAdventureWorks2012"
            Provider="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
            ConnectionString ="Data Source=.\MSSQL2012;Integrated Security=SSPI;Connect Timeout=30;"
            RetainSameConnection="true">
        </AdoNetConnection>
    </Connections>
    <Packages>
        <Package Name ="Maintenance.MaintenanceCleanup" ConstraintMode="Linear">
            <Annotations>
                <Annotation>
                    File: Maintenance.MaintenanceCleanup.biml
                    Demo biml for setting up a Maintenance Cleanup package
                    Enviroment:
                    DB: MS-SQL2012
                    BIML: 1.6 VS2010 BIDS Helper
                    (c) John Minkjan biml101.blogspot.com
                </Annotation>
            </Annotations>
            <Tasks>
                <MaintenanceCleanup   
                    Name="MCU AdventureWorks2012"
                    ConnectionName="CnAdoAdventureWorks2012"
                    AgeBased="true"
                    OlderThanTimeUnitType="Weeks"
                    OlderThanTimeUnits="1" 
                    FileTypeSelected="BackupFiles" >
                    <FolderAndExtension
                        FileExtension="bak"
                        Folder="C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQL2012\MSSQL\Backup">
                    </FolderAndExtension>                   
                </MaintenanceCleanup>                
            </Tasks>
        </Package>
    </Packages>
</Biml>

No comments:

Post a Comment