Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The VeryTime,Stay informed and read the latest news today from The VeryTime, the definitive source.

How to Maintain a Microsoft SQL Server 2008 Database

9

    Managing Files

    • 1). Open a connection to the database using either a command prompt or the SQL Server Management Studio, or SSMS.

    • 2). Shrink the size of an individual files by typing "dbcc shrink file" followed by the file name of the file to shrink. You can optionally enter the size to shrink it to.

    • 3). Shrink the size of an entire database, including both the data files and transaction log, by typing "dbcc shrinkdatabase" followed by the database name.

    • 4). Type "dbcc cleantable," followed by the database and table name, to reduce empty space in a table or view that has had significant size reductions.

    Other Maintenance Tasks

    • 1). Clear buffers used by typing "dbcc dropcleanbuffers." This allows you to test how queries would execute after a server restart.

    • 2). Remove stale stored procedure cache information by typing "dbcc freeproccache," followed by the plan handle, SQL handle or pool name of the item to be cleared. This will cause the stored procedure to recompile the next time it is run.

    • 3). Correct row or page count issues by typing "dbcc updateusage" to update statistics. This command must be followed by either the database, table or index name to update.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.