Many times we delete/truncate the data from database but database does not release the space to system after that. In that case DBCC ShrinkDatabase and DBCC ShrinkFile can be usefull.
This is something important information about DBCC ShrinkDatabase.
"The NOTRUNCATE option, with or without specifying target_percent, performs the actual data movement operations of DBCC SHRINKDATABASE including the movement of allocated pages from the end of a file to unallocated pages in the front of the file. However, the free space at the end of the file is not returned to the operating system and the physical size of the file does not change. Therefore, data files appear not to shrink when the NOTRUNCATE option is specified.The TRUNCATEONLY option reclaims all free space at the end of the file to the operating system. However, TRUNCATEONLY does not perform any page movement inside the file or files. The specified file is shrunk only to the last allocated extent. target_percent is ignored if specified with the TRUNCATEONLY option."
Personally i would prefer DBCC ShrinkFile and Shrink each file (mdf/ldf) separatly.
If you have very big database then do it off peak times.
Friday, September 26, 2008
Monday, August 11, 2008
SSIS: Create File Connection
· Right click anywhere in the Connection Managers pane.
· In the Types list select File and click ADD.
· In Usage type section select the appropriate option from the dropdown.
** If Create File is selected then new file will be created to the specified location with the given name.
· Click browse and select the location for the file.
· Click OK.
· In the Types list select File and click ADD.
· In Usage type section select the appropriate option from the dropdown.
** If Create File is selected then new file will be created to the specified location with the given name.
· Click browse and select the location for the file.
· Click OK.
SSIS: Create SMTP (Mail Server) Connection
· Right click anywhere in the Connection Managers pane.
· In the Type select SMTP and then click ADD.
· Provide suitable name to the connection.
· Enter the name of the SMTP server.
· Select suitable option for Windows Authentication and Enable SSL.
· Click OK.
· In the Type select SMTP and then click ADD.
· Provide suitable name to the connection.
· Enter the name of the SMTP server.
· Select suitable option for Windows Authentication and Enable SSL.
· Click OK.
SSIS: Creating Data Source
· Right click data sources and select New Data Source.
· Click on New.
· In provider dropdown select Microsoft OLEDB Provider for SQL Server or suitable connection provider according to your data source.
· Enter the server credentials.
· Click on Test Connection to verify the connection.
· Click OK.
· Hit Next.
· In Data Source Name give proper name to your data source connection and verify the connection string in preview box.
· Click Finish.
· Click on New.
· In provider dropdown select Microsoft OLEDB Provider for SQL Server or suitable connection provider according to your data source.
· Enter the server credentials.
· Click on Test Connection to verify the connection.
· Click OK.
· Hit Next.
· In Data Source Name give proper name to your data source connection and verify the connection string in preview box.
· Click Finish.
Tuesday, July 29, 2008
Quotes
When i read about the evils of drinking, i gave up reading.
To achieve the impossible dream, try going to sleep.
To achieve the impossible dream, try going to sleep.
Monday, July 28, 2008
Subscribe to:
Posts (Atom)