Log in [Lost Password] 
E-mail:
Password:
Remember Me:
 
 Search
Forensic Support
Forensic Support
Support Center » Knowledgebase » Maintaining Your PCE SQL Database
 Maintaining Your PCE SQL Database
Article
SQL Database Maintenance Steps

SQL Server Management Studio Express 2008
http://www.microsoft.com/download/en/details.aspx?id=7593

Maintaining a database involves shrinking, compacting, and repairing the database. By using SQL Server Management Studio, you can perform all these tasks from within the same dialog box.

Note: before applying any of the steps below please ensure you take a back up of your PCE database files (MDF and LDF).

To shrink a database
________________________________________
1. In Management Studio, open Object Explorer.
2. In Object Explorer, click Connect, and then choose SQL Server Compact 3.5.
3. In the Connect to Server dialog box, choose the SQL Server Compact 3.5 (SQL Server Compact 3.5) database that you want to shrink, and then click Connect.
4. In Object Explorer, right-click the SQL Server Compact 3.5 database that you added and choose Properties.
5. The Database Properties dialog box opens. Select Shrink and Repair from the left pane.
6. Click Shrink database by deleting free pages, and then click OK.


To compact a database
________________________________________
1. In Management Studio, open Object Explorer.
2. In Object Explorer, click Connect, and then choose SQL Server Compact 3.5.
3. In the Connect to Server dialog box, choose the SQL Server Compact 3.5 database that you want to compact, and then click Connect.
4. In Object Explorer, right-click the SQL Server Compact 3.5 database that you added and choose Properties.
5. The Database Properties dialog box opens. Select Perform full database compaction.
6. Under File Options, you can either replace the existing database after compacting, or create a new database with a new file name. By selecting the Overwrite Existing Database File check box, you can modify the name and location of the existing database and then replace it.


To repair a database
________________________________________
1. In Management Studio, open Object Explorer.
2. In Object Explorer, click Connect, and then choose SQL Server Compact 3.5.
3. In the Connect to Server dialog box, choose the SQL Server Compact 3.5 database that you want to repair, and then click Connect.
4. In Object Explorer, right-click the SQL Server Compact 3.5 database that you added and choose Properties.
5. The Database Properties dialog box opens. Select Repair physically corrupted database.
6. If you select the Recover corrupted rows check box, you can recover the corrupted rows.
7. Under File Options, you can either replace the existing database after repairing, or create a new database with a new file name. By selecting the Overwrite Existing Database File check box, you can modify the name and location of the existing database and then replace it.


Article Details
Article ID: 151
Created On: 20 Jan 2011 11:15 AM

 This article was helpful  This article was not helpful

 Back
Home | Register | Submit a Ticket | Knowledgebase | Help and Video Guides | News | Downloads