Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 filegroups manteinance time consuming

Author  Topic 

alejo46
Posting Yak Master

157 Posts

Posted - 2013-05-27 : 20:08:54
Good evening
because the filefroups are running out of space there are 2 mantainance procedures to increase filegroups space depending on 2 scenarios:

1st scenario OK
1.backup the whole table in a flat file
2.drop the table

2nd scenario (here's the problem)
2.1 if the table is large enough in the business logic there is a script the creates a temp table based in a where condition i.e: select * into temp_tablexx from tablexx
where start_date >= 20130101 and start_date <= 20130228
2.2 backup the temp_tablexx in a flat file
2.3 delete the records based in the where clause

Im not a DBA nor a developer but according the above script (select into) is not time consuming and overheat other processes by creating the temp table?

Instead wouldnt it better to backup the records to delete in a flat file ?

thanks in advance


James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-05-27 : 20:45:51
I didn't quite understand the problem you are trying to solve - however, backing up a database table to a flat file is really not ideal for a variety of reasons. The second approach you mentioned can be time consuming because it could potentially require a table scan, and long running transactions. If you are trying to add more disk space or move file groups, see if any of the approaches described on this MSDN page would work for you: http://msdn.microsoft.com/en-us/library/bb522469.aspx
Go to Top of Page

alejo46
Posting Yak Master

157 Posts

Posted - 2013-05-27 : 21:15:48
thanks you very much, aid ive got a question: what are some reasons we shouldnt backup to a flat table?
2.I read the MSDN page you shared and its quite useful but there must be enough available space in disks, right ?
3. in case theres no space left in disks its better to backup the records to delete in a flat file instead creating the temp table ?
Thanks in advance
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-05-28 : 01:25:04
If the data can be archived - think about creating a regular archive procedure. You could set up an archive database on cheaper storage space.
Some questions and issues on archiving databases - http://www.sqlserver-dba.com/2013/01/sql-server-archiving-data-into-a-separate-database.html

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -