.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Maintenance of Database of Size 620 GB on Production

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :Sql Server

Hi Guys

I have a serious problem here. I have a Audit database of 620 GB with just two tables in it.  This database has 2 years worth of data. Both these tables have around 900 million rows in each of them. Each of the tables get around total of 2-3 million rows everyday. This database is on SQL Server 2005 Enterprise Edition. Machine has just 870 GB of total Space Drive. We are left with just 180 GB of free space. Now I have a requirement to make it smaller and keep just 1 year of data in live database. I have a option of purging the data every week. But I believe it wont be easy to purge such a large of rows if we do purging just on weekends.

Can you please suggest me some ways to attain this goal of 1 year of data in database ? Also if you could you suggest for future how can i maintain the database. I am not able to do any maintenance task(like re-indexing,update stats  etc..) on it.


Please help me to find some solution for it.



View Complete Post

More Related Resource Links

XML size cost to a database

I am in the process of integrating a procedure that imports data into an xml format. The question I have what is the cost on disk versus just importing each colunm. Say I have 10 columns of data, how much more space does an xml column take than just 10 individual columns with the same data. I have searched everywhere and I can not find a definite answer that addresses this question. Any help is greaty appreciated.

How to copy table data from test to production database

I'm using SQL Server 2008 R2 and I'd like to copy all data rows from one table of a test database to the identical table in a production database. The primary key of the table is referred to by other tables so a DELETE followed by a number of INSERTs won't do it because of referential integrity issues. What is the best method to replace the data rows in the destination database with the values from the source database? Thanks, Guido

Database Mail configuring the maximum mail size (not attachment 'MaxFileSize')

Hi can anyone tell me if it's possible to configure the maximum size of an email when using database mail?  I know it's possible to use sysmail_configure_sp to set 'MaxFileSize', I want to prevent an email being sent the size of the body of the email is very large. In my case the body is based on a query result set inserted as html. Thanks      

calculating the size required for backup of database

Hi, How to calculate the size required to take backup of a database in mssql 2000.the results returned by sp_spaceused differ too much from the actual size taken on the disk. Thanks in advance

database size limit about SQL Server 2005 Express

I know that there is a size limit (4 GB) for SQL Server 2005 Express, but I am not quite sure if the limit is applied for only ONE database data file or for ALL the database data, suppose I have two databases DB1 and DB2, so which of the following statement is correct? A. The size limit for DB1 is 4GB, and the size limit for DB2 is also 4GB, so if DB1 is 3G and DB2 is 3.5G,that will be OK. B. The total size for both DB1 and DB2 can not be larger than 4GB, which means if DB1 is 3G, then DB2 can not be large than 1G.

Sharepoint Database size question

We have just installed Sharepoint 2010 in our network.  We currently have 2 users who are accessing the system, since we are in alpha stage.  What I have noticed is that  User Profile Service Application_SyncDB database size is at 800mb.  is this normal? In addtion, WSS_Logging database size is at 140mb. 

Powerhsell script for MOSS 2007 to get content database size



Can you please provide me a script to get content database size in MOSS 2007.




Catch 22 Database Connection Validation Issue w/ BIDS and Production Server


I have a rather simple SSIS package that exports data through an ODBC connection from an IBM iSeries database and copies that data to a SQL Server 2005 database.  When I was designing the application, I was able to connect to the iSeries database and store the user ID and password with my BIDS project and copy the data with out any problems.  Great!

When I finished designing and testing the project, I loaded it to the production server.  The final test was to schedule the process so that it would run each night.  I didn't realize it at the time but the password that I had stored with the project in BIDS was removed from the package and various MS documentation stated that I should create a configuration file and load the password from there.  So, I made the necessary changes to the project, adding a configuration file.  The config file is in the Miscellaneous folder within the BIDS project, however, it isn't automatically copied to the bin directory when I build the project.  I have to manually save it to the server, and then after importing the project I have to manually link to the necessary config fields.

This fixed the problem with the server, however, now I can not get BIDS to save my password with the connection string from within the designer.  This is a huge problem.  I am exporting from 21 different da

Database mail process does not start, no error generated, for only one maintenance plan

I have three maintenance plans:

1. Application DBs - 2am (checks integrity, full backup, log backup)
2. System DBs - 3am (checks integrity, updates statistics, full backup)
3. Backup and log file cleanup - 3:30am (removes backup history, .bak and .trn files)

For items 1 and 3 above, I see the database mail process start up and receive emails that the jobs completed.  For item 2, no email....the database mail process does not start and there are no errors in the event log.  The job history shows that the job completed successfully.

I'm having the same problem on a different server, except that items 2 and 3 email me their results, but item 1 does not.  Same exact job steps and times of execution.  None of the jobs are set to notify the operator, the notification is coming from the maintenance plan.

Obviously I've gone through the basics:

Configured an operator
Created a default, public profile
Enabled mail profile in SQL Server agent
Tested mail delivery

How do I diagnose the database mail process just not starting?  Has anyone seen this before?

SQL Server 2005 SP3, with KB 970892 applied.

index rebuild (offline) on sql 2005 sp3 enterprise causes drastics growth of the database size(mdf)


index rebuild (offline) on sql 2005 sp3 enterprise causes drastics growth of the database size(mdf)

database grew from 40 GB to 500 GB. space is reserved no free space to reclaim after reindex completes.

pls guide

Restore database from system dbs and log file when .mdf file size set to 0KB after Windows Update ?


This can't be right. Friday I tried to install some Windows updates including ‘Security Update for …Windows Server 2008 for x64-based Systems (KB2416473)’ on both my host Server 2008 box and on a VM instance of Server 2008 running on the same physical box. An important SQL Server 2008 instance lives on that VM.


The above mentioned update failed on both the host and the VM, but a system shutdown and reboot were required for both OS’s anyway. When SQL Server started up again on the VM, the *.MDF file size for 2 (out of maybe 15 total) databases had been reduced to 0KB. Additionally, 1 of accompanying *.LDF files was now also 0KB in size, while the other *.LDF file was probably its normal size of 2.9GB. All the other databases and log files, including Master.mdf, seem to be okay.


I’m new to SQL Server and have a couple of questions of cours

Share point database and site collection size, and restrictions and workflow


Sharepoint site collections


More Detail



We had a 3rd party into to develop the share-point service, This is really a very difficult situation not the solution but the documents that are stored and the way it was retrieved.


The real thing is that we receive an item it is booked into SAP and then we send an automated xml to set up a local site this site will then have details from the SAP system fed by ABAP. After the site is created, and then we add documents files and .jpg. These documents must show a detailed audit trail so that if challenged in a court of law can show who had access and who updated documents. 


SO the problem is 


1 Site Collection that is 170gig and the design means that we have 1600 sites and these contain images that are stored in the single site collection. How do we remove the full documents and images and replace with links rather than the doc, img. 


2. We have around 8 business units the problem is that they can share information acros

How do I limit size of Usage ( Usage and Health Data Collection ) database size please?



How do I control the size of my usage database ( Usage and Health Data Collection database ) in SP2010 so it never exceeds a certain size?

Its not clear how you do this - does anyone know? I want to set it so it never exceeds 100 GB in size but logs pretty much everything.

Thanks in advance,


T-SQL for database size and space available (like on Database Properties page on SQL 2008 SSMS)


How can i (using T-SQL) get the database size and free space like the database properties page of SQL 2008 SSMS shows? I want to be able to display that information in our software.


Reduce PDF size on upload to database


Hi all

I have an application that allows users to upload a pdf. I am saving the PDF into SQL (I know already this is not the best practice, but it was not my decision) and I need to some how duing this upload process reduce the size of the pdf. Is there a way to get the uploaded file, reduce its size, then stream it to SQL?

Thank you for any help


"Initial Size" of a database ...

Since these days almost all applications require some kind of db repository, we are also in the same boat. We have an email archiving system that has atleast 6 SQL Server DB repositories (sigh). The problem is that the scripts that were run to create these databases, assumed an initial size. For instance, one such DB file's initial size is 1110 MB of which most of it is empty. We are trying to reclaim the free space but to no avail. My question is this, when you right click a db in Management Studio and click on the files tab, does the ""Initial Size (MB)" column indicate the size used to define the db when it was created? Can I reduce the DB size to less than this defined size? APpreciate any feedback.
Jagannathan Santhanam

script to check the database size



I work with Microsoft SQL Server Workgroup Edition 2008 and I would like to know if there is a script to check the database size.

I need something like ‘give databasename’ and return the database size.
Can I do this via a vbscript?

Background info:
Different departments one SQL Server.
Every department has one or more databases on the SQL Server.
Department managers are billed per GB in use.
Department managers require a script to check the database size without using Microsoft SQL Server Management Studio or any other console. Just a shortcut on their desktop.

Let me know if you need more information.
Thank you,

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend