<?xml version="1.0"?>
<!-- RES WISDOM Building Blocks -->
<!-- Created by demo\administrator on 24-02-2009 23:07:07 -->
<!-- Copyright © 1998-2008 RES Software, All rights reserved, patents pending. -->
<reswisdom>
	<buildingblock>
		<projects/>
		<modules>
			<module>
				<properties>
					<guid>{5E5B08E9-B0F8-4DAA-BE5F-846145920399}</guid>
					<name>SQL, Shrink a database</name>
					<enabled>yes</enabled>
					<description>This module will shrink a SQL database, freeing up unused space. See this article for further information: 

http://msdn.microsoft.com/en-us/library/aa258287(SQL.80).aspx
</description>
					<folderpath>
						<folder>
							<name>Resguru.com</name>
							<folder>
								<name>PowerTrace and SQL</name>
							</folder>
						</folder>
					</folderpath>
					<deleteusedresources>yes</deleteusedresources>
				</properties>
				<tasks>
					<task hidden="yes">
						<parameters>
							<param>
								<name>DBServer</name>
								<value1>backend.demo.lab</value1>
								<value2/>
								<value3/>
								<type>0</type>
								<description>Be sure you have a Wisdom connector (1 license reqired) for the target SQL server.</description>
								<hint>Please provide the hostname of your DBMS:</hint>
								<selection/>
								<inputtiming>
									<importbb showprev="no">yes</importbb>
									<schedulejob showprev="no">no</schedulejob>
								</inputtiming>
								<inputoptions>
									<confirm>no</confirm>
									<force>no</force>
									<required>no</required>
									<validation>no</validation>
								</inputoptions>
							</param>
							<param>
								<name>DBName</name>
								<value1>wisdom_labreg</value1>
								<value2/>
								<value3/>
								<type>0</type>
								<description/>
								<hint>Enter the name of the database you wish to sizecheck:</hint>
								<selection/>
								<inputtiming>
									<importbb showprev="no">yes</importbb>
									<schedulejob showprev="yes">yes</schedulejob>
								</inputtiming>
								<inputoptions>
									<confirm>no</confirm>
									<force>no</force>
									<required>no</required>
									<validation>no</validation>
								</inputoptions>
							</param>
							<param>
								<name>Account</name>
								<value1>sa</value1>
								<value2>00CD</value2>
								<value3/>
								<type>2</type>
								<description/>
								<hint>Enter a DBO account with credentials to the databae</hint>
								<selection/>
								<inputtiming>
									<importbb showprev="no">yes</importbb>
									<schedulejob showprev="no">no</schedulejob>
								</inputtiming>
								<inputoptions>
									<confirm>no</confirm>
									<force>no</force>
								</inputoptions>
							</param>
							<param>
								<name>TruncateOption</name>
								<value1>FULL</value1>
								<value2>FULL;NOTRUNCATE;TRUNCATEONLY</value2>
								<value3>Perform both reallocation and truncation;Freed file space is retained in the database files;Reclaim only free space at the end of the file. No reallocation is performed</value3>
								<type>1</type>
								<description/>
								<hint>Please provide the necessary input</hint>
								<selection/>
								<inputtiming>
									<importbb showprev="no">no</importbb>
									<schedulejob showprev="no">yes</schedulejob>
								</inputtiming>
								<inputoptions>
									<confirm>no</confirm>
									<force>no</force>
									<required>yes</required>
								</inputoptions>
							</param>
							<param>
								<name>TargetPercent</name>
								<value1>10</value1>
								<value2/>
								<value3/>
								<type>0</type>
								<description>The desired percentage of free space left in the database file after the database has been shrunk. Note: TargetPercent is ignored when TRUNCATEONLY is used.</description>
								<hint>Please provide desired percent of free space to leave in DB:</hint>
								<selection/>
								<inputtiming>
									<importbb showprev="no">no</importbb>
									<schedulejob showprev="yes">yes</schedulejob>
								</inputtiming>
								<inputoptions>
									<confirm>no</confirm>
									<force>no</force>
									<required>no</required>
									<validation>no</validation>
								</inputoptions>
							</param>
						</parameters>
						<conditions>
							<condition guid="{10827CB9-B1CB-4240-A6CE-FB5DF02523D3}">
								<expressions>
									<expression guid="{4833CE40-F9D3-417B-BC51-BF572EFF1AA0}">
										<operand>TruncateOption</operand>
										<operator>&lt;&gt;</operator>
										<value>FULL</value>
										<type>8</type>
									</expression>
								</expressions>
								<operator>AND</operator>
								<actiontrue>3</actiontrue>
								<parametervaluetrue></parametervaluetrue>
								<when>0</when>
								<action>0</action>
								<parametervalue></parametervalue>
								<enabled>yes</enabled>
								<setparametertrue>no</setparametertrue>
								<parametertrue>DBServer</parametertrue>
								<setparameter>no</setparameter>
								<parameter>DBServer</parameter>
							</condition>
							<condition guid="{0B1EEB8A-AB9A-4763-B0A6-41D783C47C14}">
								<expressions>
									<expression guid="{4833CE40-F9D3-417B-BC51-BF572EFF1AA0}">
										<operand>TruncateOption</operand>
										<operator>=</operator>
										<value>FULL</value>
										<type>8</type>
									</expression>
								</expressions>
								<operator>AND</operator>
								<actiontrue>3</actiontrue>
								<parametervaluetrue></parametervaluetrue>
								<when>0</when>
								<action>0</action>
								<parametervalue></parametervalue>
								<enabled>yes</enabled>
								<setparametertrue>no</setparametertrue>
								<parametertrue>DBServer</parametertrue>
								<setparameter>no</setparameter>
								<parameter>DBServer</parameter>
							</condition>
						</conditions>
					</task>
					<task>
						<properties>
							<type>EXECUTESQL</type>
							<guid>{10827CB9-B1CB-4240-A6CE-FB5DF02523D3}</guid>
							<description>Execute SQL Statement</description>
							<enabled>yes</enabled>
							<comments>Run  Shrink job with selected truncate option</comments>
							<onerror>fail</onerror>
						</properties>
						<settings>
							<scripttext>DBCC SHRINKDATABASE ($[DBName],$[TargetPercent],$[TruncateOption])</scripttext>
							<dbtype>MSSQL</dbtype>
							<dbserver>$[DBServer]</dbserver>
							<dbname/>
							<dbuser>$[Account]</dbuser>
						</settings>
					</task>
					<task>
						<properties>
							<type>EXECUTESQL</type>
							<guid>{0B1EEB8A-AB9A-4763-B0A6-41D783C47C14}</guid>
							<description>Execute SQL Statement</description>
							<enabled>yes</enabled>
							<comments>Run  Shrink job without truncate options (Full job)</comments>
							<onerror>fail</onerror>
						</properties>
						<settings>
							<scripttext>DBCC SHRINKDATABASE ($[DBName],$[TargetPercent])</scripttext>
							<dbtype>MSSQL</dbtype>
							<dbserver>$[DBServer]</dbserver>
							<dbname/>
							<dbuser>$[Account]</dbuser>
						</settings>
					</task>
				</tasks>
			</module>
		</modules>
		<resources/>
		<runbooks/>
	</buildingblock>
</reswisdom>
