Move Data Between Datafile In Same Filegroup
Jan 28, 2008
Hi all
I've found this problem working with a VLDB, six month ago when I install the DBMS (Win2k3 x64+sp2, SQL 2k5 x64 +sp2, 4 dual core processor and 12 GbRAM) I've got 10 disk (actually ten LUN from a Storage Area Network), each 50Gb.
I've put TempDB and Transaction Log on two separate 50 Gb disk and put the database on 8 different data file on the 8 disk; I've created each datafile with a size of 50 Gb (autogrowth disable), so my DB has 400Gb space in it's datafile.
After a while the datafile began to fill and we decide to add a couple more 50Gb disk where I decide to put to new datafile; now my db is around 430 Gb and I've got this strange situation:
The first 8 datafile now are almost full of data, and obviously they can't growth since they already occupy the whole disk.
The two additional datafile are relatively empty (about 15 Gb each).
As far as I understand now each time that SQL should write to the databse it writes only on the 2 new datafile, and I fear that this can affect performance.
I'd like to reorganize the space in order to have 10 datafile, each with 43Gb of data, but I didn't find any instruction/tool able to move data between datafile.
Anyone has any hint ?
Thank you in advance for any suggestion
Stefano
View 5 Replies
ADVERTISEMENT
Nov 10, 2005
Hi,
In SQL Server 2000 how to move a secondary data file to different filegroup without removing and re-creating the secondary data file.
Thanks in advance.
-S
View 1 Replies
View Related
Oct 15, 2015
I need to modify a table to reside on a new filegroup and also point TEXTIMAGE_ON to that filegroup instead of PRIMARY. Apparently in the past, the only way to achieve this via SQL is to create a new table, copy over data, drop the old table and rename the new table to the original name. I found this solution in the SQL Server 2005 forum.
Is there any other way to alter this table in order to point the TEXTIMAGE_ON to new filegroup using SQL Server 2014? We are on Standard edition. The technique I am using is the drop constraint (with move option) and add constraint (to new filegroup) commands. The data and indexes move, but not the text data (it still is in primary filegroup).
View 0 Replies
View Related
Apr 15, 2015
We are running SQL Server 2014 Enterprise Edition (64-Bit) on Windows 2012 R2 Standard (64-Bit).
1. When to create indexes, before or after data is added? Please address Clustered and Non-Clustered Indexes.
2. To move indexes to it's own filegroup, is it best to create the NON-Clustered Indexes on the separate filegroup with code similar to the example below?
CREATE NONCLUSTERED INDEX IX_Employee_OrganizationLevel_OrganizationNode
ON HumanResources.Employee (OrganizationLevel, OrganizationNode)
WITH (DROP_EXISTING = ON)
ON TransactionsFG1;
GO
I have read the following links that states that if you create the Clustered Index on a separate filegroup, it would also move the base table to that particular filegroup. (So I take it that you ONLY can move NON-CLustered Indexes to a separate filegroup.)
Placing Indexes on Filegroups:
[URL]
By default, indexes are stored in the same filegroup as the base table on which the index is created. A nonpartitioned clustered index and the base table always reside in the same filegroup. However, you can do the following:
• Create nonclustered indexes on a filegroup other than the filegroup of the base table.
Move an Existing Index to a Different Filegroup:
[URL]
Limitations and Restrictions
• If a table has a clustered index, moving the clustered index to a new filegroup moves the table to that filegroup.
• You cannot move indexes created using a UNIQUE or PRIMARY KEY constraint using Management Studio. To move these indexes use the CREATE INDEX statement with the (DROP_EXISTING=ON) option in Transact-SQL.
View 1 Replies
View Related
Aug 17, 2006
I obviously did not search the archives on the right terms so what isthe easiest and fastest way to move a 3G database from a nearly full Cdrive to the nearly empty D drive that should have been used.I could back it up, drop it, recreate it using the D drive, and restoreit but it seems like there should be a way to just move the datafileand use if from the new location.I am thinking that detatch/attach is the best method, but I would likeconfirmation or suggestions on how to proceed or things to be aware ofwhen using this method.-- Mark D Powell --
View 8 Replies
View Related
Oct 9, 2007
I need to move a datafile on my secondary database which is in standby mode. I have attempted to use the Restore command with the move and standby parameters
use master
RESTORE LOG BWP FROM
DISK='L: rans_bkpBWP_20071009080001.trn'
WITH MOVE 'BWPDATA3'
TO 'N:BWPDATA3BWPDATA3.ndf',
standby='L:TRANS_BKPBWP_20071009130001.tuf'
But I get the following error message
Msg 3174, Level 16, State 1, Line 1
The file 'BWPDATA3' cannot be moved by this RESTORE operation.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE LOG is terminating abnormally.
View 20 Replies
View Related
Oct 28, 2005
I will be moving production SQL databases (one is 25Gb, the other is 3Gb) to a new server. One of the reasons is the old server has only IDE disks while the new has raid (I don't know the configuration yet).
Database 1 has a primary and one other filegroup. I want to spread the disk I/O by moving table A to it's own filegroup on it's own disk.
For the purposes of testing I have
1. brought a database onto a test server (using sp_detach_db, copying the files and attaching using sp_attach_db)
2. created a new filegroup
3. created a physical file on disk, allocated space and associated with my new filegroup
my question is how do I now move table A into this file?
View 1 Replies
View Related
Jul 8, 2004
Hi every body,
Is there anyone know the way to move a table with data to other file group?
View 3 Replies
View Related
Dec 9, 2007
SQl experts and gurus:
How to move tables to the new filegroup which i created. suppose my database has only primary FG and after that i added one FG and due to performance reasons i want to move the existing table to NEW FG.
Thanks.
View 20 Replies
View Related
May 22, 2007
Hello,
I have an PK Clustered index that I would like to move to another filegroup, which will inturn reside on another drive. Can someone point me to sql tsql or somewhere on bol that has the step by step on how to accomplish this? Thanks in advance.
John
View 1 Replies
View Related
May 25, 2007
I mange several large databases with multiple files and filegroups. During some maintenance I was trying to remove a filegroup and its files and noticed that I was unable to. It appears that some service broker objects were created on my user defined filegroup.
Looking at the system tables I see several system tables on my user defined filegroup
SELECT o.name +'.' +i.name FROM sysobjects o inner join sysindexes i on i.id = o.id where groupid = 2
queue_messages_1255675521.queue_clustered_index
queue_messages_1255675521.queue_secondary_index
queue_messages_1287675635.queue_clustered_index
queue_messages_1287675635.queue_secondary_index
queue_messages_1319675749.queue_clustered_index
queue_messages_1319675749.queue_secondary_index
my normal tricks do not work as I am unable to even select from these tables.
How to I move them or get rid of them. I am not even sure what is created them as we are not using service broker in our application.
View 3 Replies
View Related
Jul 12, 2006
Hi,
How to move existing table(include its constraint and index) into a different filegroup using tsql in Sql Server 2000. We have 1000+ tables in our system and we are planning to move around 500 tables to a new file group, which is available on another SAN drive.
Regards.
Sankar N
View 1 Replies
View Related
Oct 7, 2015
I have partitions that I have filled with data. I am not trying to figure out exactly how much data the partitions contain, and therefore I will be able to see if any of them are close to hitting their autogrow conditions. If I were looking at a single unpartitioned table, then I could maybe look at the table properties to determine data and index sizes, and compare that to the size of the mdf file size, but for partitions, then I am not sure how I would query this information out. Any pointers on how this information could be queried out of the system?
View 3 Replies
View Related
May 13, 2008
OK, I know this is out there all over and yes I did a search for this topic; however, I am confused about tables with an image data type and with moving text file group to another filegroup.
Here is what I have:
I have a table storing imaged documents and has become very large. I want to move the table to another filegroup. The table is created like this:
USE [PD51_Data]
GO
/****** Object: Table [dbo].[SCANNEDDOCUMENTS] Script Date: 05/13/2008 14:52:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SCANNEDDOCUMENTS](
[DocID] [int] IDENTITY(1,1) NOT NULL,
[CaseID] [int] NOT NULL,
[DocName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Doc] [image] NOT NULL,
[DocLocation] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DocNotes] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TopicID] [int] NULL,
[ScannedDocumentsCheckSum] [varchar](128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,PRIMARY KEY CLUSTERED
(
[DocID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[SCANNEDDOCUMENTS] WITH NOCHECK ADD CONSTRAINT [ISCANNEDDOCUMENTS2] FOREIGN KEY([TopicID])
REFERENCES [dbo].[TOPICS] ([TopicID])
GO
ALTER TABLE [dbo].[SCANNEDDOCUMENTS] CHECK CONSTRAINT [ISCANNEDDOCUMENTS2]
On a test DB, I moved the clustered and nonclustered indexes to a secondary filegroup no problem, but it still shows to be stored in the primary filegroup. I read an article about having to create a new table in the secondary in order to move the images and text file group. Has anyone come across this?
Do I need to drop the clustered index and FK to move to a secondary filegroup?
Or
Do I create a new table into the secondary filegroup and then add the Clustered index and constraints?
View 4 Replies
View Related
May 14, 2007
Hi,
I am getting below error while importing data in SQL 2005 Express:
"error 0xc0202009: Data Flow Task: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Could not allocate space for object 'dbo.HistoryLog'.'PK_HistoryLog' in database 'HistoryData' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.".
"
I have select :
Enable Autogrownth = Yes
Filegrowth = 1 MB
Maximum File Size = Unrestricted File growth
I don't know what else I am missing?
Please help
thanks
AA
View 8 Replies
View Related
Apr 26, 2008
Due to SQL's proportional fill algorithm I'd like to have the amount of data in my data files as close to equal as possible.
File sizes before:
dat 482,895 MB 0% free
2dat 436,927 MB 3% free
I made the max size of each file 600,000 MB and added a third file 3dat also 600,000 MB. I rebuilt all the clustered indexes (and nonclustered for good measure) and unfortunately the re-balancing wasn't quite right.
File sizes after:
dat 464,761 MB 77% free
2dat 443,234 MB 73% free
3dat 309,568 MB 51% free
I only have a handful of heap tables that take up <100MB total so they're not the issue. I did do an ONLINE index rebuild. I'm not sure if an offline rebuild would have been better. I will not be able to try and offline for a few weeks though as it's time consuming and I have other tasks I need to run on this test server now.
I did a FULLSCAN rebuild on any column statistics not updated by the index rebuild but that didn't help either.
View 3 Replies
View Related
Feb 18, 2015
I've got a partitioned table where I am trying to switch the first partition into a staging table, merge the first boundary and later drop the file and the file group.
This is my starting point:
boundary_idBoundary_valuePartitionNumber
11/09/2012 0:002
21/10/2012 0:003
PartitionNumberPartitionRowsFileGroupName
1799AdtLog_Archive_201208
2300AdtLog_Archive_201209
After I switch partition 1 to a staging table I run:
ALTER PARTITION SCHEME My_ps NEXT USED AdtLog_Archive_201209;
and
ALTER PARTITION FUNCTION My_pf() MERGE RANGE ('2012-09-01 00:00:00.000');
I expect the 300 records from the former 2nd partition to stay in AdtLog_Archive_201209, however I get this:
PartitionNumberPartitionRowsFileGroupName
1300AdtLog_Archive_201208
2310AdtLog_Archive_201210
How do I make sure that the data stays in AdtLog_Archive_201209 file group?
View 1 Replies
View Related
May 15, 2015
I am using SQL Server report 2008/2012 (SSRS) and my report viewer contains body content with 3 Row groups.
While printing the report, data print with blank space and move to continue data to next page.
Departure flight : 70 rows
First Page : 42 rows printed
Second Page : 23 rows printed [ Supposed to be print 28 , if the total count of records more than 23 and less than 42 then the page print only 23 records ]
Third Page : 5 rows printed
Departure flight : 42 rows
First Page : 42 rows printed [Report max. record allowed to print 42 rows so if total record is 42 then print perfectly ]
Departure flight : 26 rows
First Page : 23 rows printed [Supposed to be print 26, if the total count of records more than 23 and less than 42 then the page print only 23 records ]
Second Page : 3 rows printed
View 3 Replies
View Related
Mar 11, 2008
The ERP manufacturer used an image data type to store large text data fields. I am trying to move these data types from one database to another database using either Sql Queries or MS Access. I can cast them as an 8000 char varchar to read them directly but have no luck importing into these image data fields.
Access and Crystal are not able to read these fields directly.
Any suggestions? Most information about these fields has to do with loading files but I am just moving data.
Thanks,
Ray
View 1 Replies
View Related
Jul 27, 2015
I have been creating databases in SQL 2008 with a primary filegroup for the system objects and a secondary, marked Default, for the data.
We are preparing a migration to SQL 2014, and the administrator is complaining he won't adopt this structure on the new servers because 'there is no benefit' and 'a backup cannot be restored (!?)'.
View 2 Replies
View Related
Nov 12, 2014
I read , When sql server Database having multiple data files within single filegroup then sql server writes data in multiple proportional file algorithm where the amount of data written to a file is proportionate to the amount of free space in that file, compared to other files in the filegroup.
so if there is no filegroups created and multiple secondary files are attached in databse , is there same way data stored and writes data in multiple files by the same algorithm or any different way.
View 2 Replies
View Related
Jun 14, 2006
Next month client is moving servers to new location. The servers will get new ip and subnet Our user db's which are on a SAN will be moving to new SAN. My plan is the following, please correct any mistakes.
1. Do full backups of everything
2. Detach user db's
3. Copy these files to usb box (100 gig worth)
4. After server is in new world bring it up
5. Copy db files from usb
6. Attach db files
View 6 Replies
View Related
Jun 7, 2007
Hi,
I'm a C# developer, not a DBA, but fairly familiar with sql server 2000 and learning 2005. I have a need to update a table on one sql server from another remote sql 2005 server. Both will be SQL 2005, but will not be on the same network, so there will be firewall issues to contend with. Security is not a huge concern as the data is public info and not personal secure information or anything like that. What I'll have is a table of data in one sql database. I will have a copy of that data on another sql server that is used at an ISP and drives a web site. I need the table at the ISP sql server to get updated from the SQL server that is onsite in our office on our private network. I would like to not have to get network admins to open sql server ports if possible, so I guess I'm wondering if there is an easy way with SQL 2005 to update data from one sql server to another in the environment that I have described that maybe could expose the data over a common port (ie port 80). I don't want to have to use integrated security as I'm not sure this would work between remote databases in this scenario. I don't know if the web service end point support in sql 2005 would allow this. The examples I have seen online show a sql endpoint created and then accessed from a .NET application. I can do that if I have to, but I would rather do all of this inside the database in some fashion. I am open to any idea that would work and if I need to, I can ditch the idea of using something over port 80 and can get the necessary ports open between the sql servers. This is a pretty simple scenario that we have with one table of data needing to be updated weekly on a web based sql server from a remote sql server.
Any ideas on how you would approach this would be greatly appreciated. Security for the data I'm accessing is not a huge concern as the data is public domain as I've said, but I need to make sure the rest of the server and database on both ends are secured.
Thanks for any help!
View 6 Replies
View Related
Jul 20, 2005
Am MS Access 2000 DB To an SQL SERVER 2000?(without Enterprise manager)
View 3 Replies
View Related
May 18, 2008
hi, I currently uses SQL Server 2005.I need to move the data to my website, how do I do that? I have the SQL Server Management Studio Express but I couldn't not get it to export the data in .sql file (which is needed to import to my website's SQL database).Please let me know of any tools I need to perform the task. thanks.
View 3 Replies
View Related
May 15, 2006
Currently we update database A everyday with tables from database B.
Database is India and has poor connection speed. What would be the best method of moving this data.
Currently it's about 100 tables and on average its about 900 mb.
Any input is greatly appreciated.
thanks,
View 3 Replies
View Related
Jan 23, 2004
Hello everybody
We need to move table T1 from database A to T1 database B on same server
size of table T1 15 GB and 40000000 rows
database B just created and will act as warehouse
could it be done simply by
1.creating table T1 on db B and then
2.set db to simple recovery
3.
insert into B.dbo.T1
select * from A.dbo.T1
4. create all the indexes on table T1 in db B
free disk space is 35GB
Any idea how to optimze import
Thank you
View 5 Replies
View Related
Feb 23, 2007
Guys,
We are currently moving our environment. I was told that we need to copy all the stuff over. More specifically, we want to move everything except the data, as our data is dynamic and will fill up in a few days by itself.
What is the best way to move everything over from one server instance to another?
My current approach is the following:
1. Create the file groups we have on our current server on the new server
2. Script out all databases with stored procedures, functions, views, priviliges, indexes ...
3. Script out all the jobs
4. Script out all the dts packages (or rather save each in a file)
5. Load all scripts into the new sql server
6. Re-create user accounts (can these be scripted out also and then loaded?)
Am I missing something or is there a wiser alternative?
Thanks a lot
View 3 Replies
View Related
Mar 12, 2004
We have a problem with our SQL 2000 server which we know is a product bug.
Is there anyway of importing, Copying the sql 2000 table back down to SQL 7 until the issue is resolved,
many thanks
View 1 Replies
View Related
Jul 20, 2005
hello,my problem is how to move data files drom drive c: to drive d: ??--MarcinS
View 1 Replies
View Related
Apr 23, 2008
I need to move data from Sybase ASE to SQL Server 2005. What is the best way fo doing it?
View 1 Replies
View Related
Nov 12, 2007
I have two databases DB_1 and DB_2 on my server. Both of them have 25 identical tables.
Tables under DB_2 gets refreshed with new data daily and once it's ready with new data, those data should be copied to DB_1 tables (deleting any existing data and loading it with new data).
My question is there any other way other than using Import Data Wizard for moving the data between two databases which included deleting any existing data on DB_1 tables and loadit with new data.
Please let me know...Thanx in advance...
View 7 Replies
View Related
Sep 14, 2007
I'd like to move data from my prod. env. to my dev. env. The data in dev would be replaced by the prod one. I cannot do a detach/attach or backup and restore due to some already existing dev objects located in the dev. env.
Any lead on how I can do this?
Thanks Marcel
View 5 Replies
View Related