Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Friday, March 30, 2012

replacing hard disk

I have a server running sql 2000. We recently had to replace a failed drive
on a raid 5 array. Subsequent to changing it, the performance of the server
has declined considerably and blocking locks are occuring, which we never had
experienced before on this server. There are no errors reported for the new
disk.
I'm now trying to work out what could be the problem and how in fact to
correct it. Will running specific maintenance jobs correct the problem? Like
UPDATE STATISTICS?
Thanks!
Hi
Has the array rebuilt?
The fact that performance is perceived to be worse, look at a hardware
problem, not at a SQL one.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"gracie" <gracie@.discussions.microsoft.com> wrote in message
news:83C86485-F322-491C-973F-DF197CD10EBE@.microsoft.com...
>I have a server running sql 2000. We recently had to replace a failed drive
> on a raid 5 array. Subsequent to changing it, the performance of the
> server
> has declined considerably and blocking locks are occuring, which we never
> had
> experienced before on this server. There are no errors reported for the
> new
> disk.
> I'm now trying to work out what could be the problem and how in fact to
> correct it. Will running specific maintenance jobs correct the problem?
> Like
> UPDATE STATISTICS?
> Thanks!
|||Yes it's been rebuilt and the status of the drive and the drive array are
reported with a status of ok.
"Mike Epprecht (SQL MVP)" wrote:

> Hi
> Has the array rebuilt?
> The fact that performance is perceived to be worse, look at a hardware
> problem, not at a SQL one.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "gracie" <gracie@.discussions.microsoft.com> wrote in message
> news:83C86485-F322-491C-973F-DF197CD10EBE@.microsoft.com...
>
>
|||Did you replace like for like..?
For instance replacing a 72Gb 15,000RPM disk with a 72Gb 10,000RPM disk
would cause the entire array to drop back to 10,000RPM
HTH
"gracie" <gracie@.discussions.microsoft.com> wrote in message
news:F84864F8-F9C5-4879-97A0-542842DD59AB@.microsoft.com...[vbcol=seagreen]
> Yes it's been rebuilt and the status of the drive and the drive array are
> reported with a status of ok.
>
> "Mike Epprecht (SQL MVP)" wrote:
drive[vbcol=seagreen]
never[vbcol=seagreen]
the[vbcol=seagreen]
to[vbcol=seagreen]
problem?[vbcol=seagreen]
sql

replacing hard disk

I have a server running sql 2000. We recently had to replace a failed drive
on a raid 5 array. Subsequent to changing it, the performance of the server
has declined considerably and blocking locks are occuring, which we never ha
d
experienced before on this server. There are no errors reported for the new
disk.
I'm now trying to work out what could be the problem and how in fact to
correct it. Will running specific maintenance jobs correct the problem? Like
UPDATE STATISTICS?
Thanks!Hi
Has the array rebuilt?
The fact that performance is perceived to be worse, look at a hardware
problem, not at a SQL one.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"gracie" <gracie@.discussions.microsoft.com> wrote in message
news:83C86485-F322-491C-973F-DF197CD10EBE@.microsoft.com...
>I have a server running sql 2000. We recently had to replace a failed drive
> on a raid 5 array. Subsequent to changing it, the performance of the
> server
> has declined considerably and blocking locks are occuring, which we never
> had
> experienced before on this server. There are no errors reported for the
> new
> disk.
> I'm now trying to work out what could be the problem and how in fact to
> correct it. Will running specific maintenance jobs correct the problem?
> Like
> UPDATE STATISTICS?
> Thanks!|||Yes it's been rebuilt and the status of the drive and the drive array are
reported with a status of ok.
"Mike Epprecht (SQL MVP)" wrote:

> Hi
> Has the array rebuilt?
> The fact that performance is perceived to be worse, look at a hardware
> problem, not at a SQL one.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "gracie" <gracie@.discussions.microsoft.com> wrote in message
> news:83C86485-F322-491C-973F-DF197CD10EBE@.microsoft.com...
>
>|||Did you replace like for like..?
For instance replacing a 72Gb 15,000RPM disk with a 72Gb 10,000RPM disk
would cause the entire array to drop back to 10,000RPM
HTH
"gracie" <gracie@.discussions.microsoft.com> wrote in message
news:F84864F8-F9C5-4879-97A0-542842DD59AB@.microsoft.com...[vbcol=seagreen]
> Yes it's been rebuilt and the status of the drive and the drive array are
> reported with a status of ok.
>
> "Mike Epprecht (SQL MVP)" wrote:
>
drive[vbcol=seagreen]
never[vbcol=seagreen]
the[vbcol=seagreen]
to[vbcol=seagreen]
problem?[vbcol=seagreen]

replacing hard disk

I have a server running sql 2000. We recently had to replace a failed drive
on a raid 5 array. Subsequent to changing it, the performance of the server
has declined considerably and blocking locks are occuring, which we never had
experienced before on this server. There are no errors reported for the new
disk.
I'm now trying to work out what could be the problem and how in fact to
correct it. Will running specific maintenance jobs correct the problem? Like
UPDATE STATISTICS?
Thanks!Hi
Has the array rebuilt?
The fact that performance is perceived to be worse, look at a hardware
problem, not at a SQL one.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"gracie" <gracie@.discussions.microsoft.com> wrote in message
news:83C86485-F322-491C-973F-DF197CD10EBE@.microsoft.com...
>I have a server running sql 2000. We recently had to replace a failed drive
> on a raid 5 array. Subsequent to changing it, the performance of the
> server
> has declined considerably and blocking locks are occuring, which we never
> had
> experienced before on this server. There are no errors reported for the
> new
> disk.
> I'm now trying to work out what could be the problem and how in fact to
> correct it. Will running specific maintenance jobs correct the problem?
> Like
> UPDATE STATISTICS?
> Thanks!|||Yes it's been rebuilt and the status of the drive and the drive array are
reported with a status of ok.
"Mike Epprecht (SQL MVP)" wrote:
> Hi
> Has the array rebuilt?
> The fact that performance is perceived to be worse, look at a hardware
> problem, not at a SQL one.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "gracie" <gracie@.discussions.microsoft.com> wrote in message
> news:83C86485-F322-491C-973F-DF197CD10EBE@.microsoft.com...
> >I have a server running sql 2000. We recently had to replace a failed drive
> > on a raid 5 array. Subsequent to changing it, the performance of the
> > server
> > has declined considerably and blocking locks are occuring, which we never
> > had
> > experienced before on this server. There are no errors reported for the
> > new
> > disk.
> >
> > I'm now trying to work out what could be the problem and how in fact to
> > correct it. Will running specific maintenance jobs correct the problem?
> > Like
> > UPDATE STATISTICS?
> >
> > Thanks!
>
>|||Did you replace like for like..?
For instance replacing a 72Gb 15,000RPM disk with a 72Gb 10,000RPM disk
would cause the entire array to drop back to 10,000RPM
--
HTH
"gracie" <gracie@.discussions.microsoft.com> wrote in message
news:F84864F8-F9C5-4879-97A0-542842DD59AB@.microsoft.com...
> Yes it's been rebuilt and the status of the drive and the drive array are
> reported with a status of ok.
>
> "Mike Epprecht (SQL MVP)" wrote:
> > Hi
> >
> > Has the array rebuilt?
> > The fact that performance is perceived to be worse, look at a hardware
> > problem, not at a SQL one.
> >
> > Regards
> > --
> > Mike Epprecht, Microsoft SQL Server MVP
> > Zurich, Switzerland
> >
> > IM: mike@.epprecht.net
> >
> > MVP Program: http://www.microsoft.com/mvp
> >
> > Blog: http://www.msmvps.com/epprecht/
> >
> > "gracie" <gracie@.discussions.microsoft.com> wrote in message
> > news:83C86485-F322-491C-973F-DF197CD10EBE@.microsoft.com...
> > >I have a server running sql 2000. We recently had to replace a failed
drive
> > > on a raid 5 array. Subsequent to changing it, the performance of the
> > > server
> > > has declined considerably and blocking locks are occuring, which we
never
> > > had
> > > experienced before on this server. There are no errors reported for
the
> > > new
> > > disk.
> > >
> > > I'm now trying to work out what could be the problem and how in fact
to
> > > correct it. Will running specific maintenance jobs correct the
problem?
> > > Like
> > > UPDATE STATISTICS?
> > >
> > > Thanks!
> >
> >
> >

replacing cursors with sql query

i have written a cursor to select records in a sequence for processing but i think the performance is not upto the mark.i have read in many places that sql cursor should not be used.but i am unable to find a substitute for cursor.could you help me out with this..

this is the cursor we are using:

CREATE proc sp_process_cdr
as
declare @.last_call_time datetime
set @.last_call_time=(select max(calltime_gmt) from processed_cdr)
declare process_cdr cursor
read_only
for
select srcip,username,callto,calltime,duration from rawcdr
where calltime>@.last_call_time
declare
@.gatewayip varchar(50),
@.username varchar (50),
@.callto varchar(100),
@.calltime datetime,
@.duration float,
@.accountid varchar(50),
@.subscriberid varchar(10),
@.cost money,
@.country varchar(100)

open process_cdr
fetch next from process_cdr into @.gatewayip,@.username,@.callto,@.calltime,@.duration
while(@.@.fetch_status<>-1)
begin
if(@.@.fetch_status<>-2)
begin
set @.accountid=''
set @.subscriberid=''
set @.country=''
set @.cost=0

if(charindex('00',@.callto)=5)
begin
set @.callto=substring(stuff(@.callto,charindex('@.',@.callto),50,''),charindex(':',@.callto)+3,50)
end
else
if(charindex('011',@.callto)=5)
begin
set @.callto=substring(stuff(@.callto,charindex('@.',@.callto),50,''),charindex(':',@.callto)+4,50)
end
else
set @.callto=substring(stuff(@.callto,charindex('@.',@.callto),50,''),charindex(':',@.callto)+1,50)

exec sp_process_call @.gatewayip,@.username,@.duration,@.callto,@.accountid output,@.subscriberid output,@.country output,@.cost output
insert into processed_cdr
select @.accountid,@.subscriberid,@.gatewayip,@.username,@.callto,@.country,@.calltime,@.duration,@.cost
end
fetch next from process_cdr into @.gatewayip,@.username,@.callto,@.calltime,@.duration
end
close process_cdr
deallocate process_cdr

GO

i dont have a unique column in my table.

YOu are executing a stored procedure within your code, unless that you can′t change your stored procedure, you can′t keep away from that cursor (not touching the solution that you could put out some statement and execute them froma temporary table one by one, which would be nearly the same performance). Anyway you shouldn′t name your procedure with a "sp_" prefix unless these is predefined for master database procs and this will lead to performance (due to recompiling) issues.

HTH, Jens Suessmeyer.

|||

Dear Vignesh, below is an example of how to do update using query rather than cursor.

UPDATE t1
SET t1.column4 = t2.column4, t1.column5 = t3.column5
FROM table1 t1
INNER JOIN table2 t2 ON t1.column1 = t2.column1
INNER JOIN table3 t3 on t1.column2 = t3.column2
WHERE t1.column3 >= t2.column3 AND t3.column3 <> 0

Vincent

Wednesday, March 28, 2012

Replacing a cursor

I am currently evaluating the performance of an application which relies heavily on cursors. Below is an code example. I am looking for some good performance gains, is this the best method of updating rows of data?

DECLARE @.PAlloc_TimeID as int
DECLARE @.PAlloc_UniqueID as int
DECLARE PAlloc CURSOR FOR
SELECT TimeID,
UniqueID
FROM #PMatch
GROUP BY TimeID, UniqueID
HAVING SUM(Active) > 1

OPEN PAlloc
FETCH NEXT FROM PAlloc INTO @.PAlloc_TimeID , @.PAlloc_UniqueID
WHILE (@.@.FETCH_STATUS = 0)
BEGIN

UPDATE P
SET Active = 0
FROM #PMatch P
WHERE P.TimeID = @.PAlloc_TimeID
AND P.UniqueID = @.PAlloc_UniqueID
AND P.ElementID > (
SELECT MIN(ElementID)
FROM #PMatch
WHERE TimeID = @.PAlloc_TimeID
AND UniqueID = @.PAlloc_UniqueID)


FETCH NEXT FROM PAlloc INTO @.PAlloc_TimeID , @.PAlloc_UniqueID
END
CLOSE PAlloc
DEALLOCATE PAlloc

Normally, using a CURSOR is NOT the best way to update data. (However, in a few situations, it may be necessary.)

A set based operation (UPDATE) is usually the 'best' way to update. Consider if your process above could be re-written as a single UPDATE statement, perhaps using one or more sub-queries. (It might be easier than you think.)

|||

Yes... Arnie is right, It can be replace with single Update

Statement. But if the Database is gigantic then Updating in a single statement

is not preferred.

|||

u'll be able to write this query in one (or more) update statement(s)...or use a case in update statement.... most of the times u wont need a sursor at all.... and i guess even for a large database in this is a better solution..., as cursor on a large table will block resources for long...

sql

Wednesday, March 21, 2012

replace IIF statement

I believe I am running into performance issues by using the IIF for filter out zero values in my fact table. My statement that I am using is the following: IIF(Measures.[Test Scores] > 0, Measures.[Test Scores], NULL). Unfortunately this calculated measure is being referenced quite a bit and I believe this is causing major performance issues once the users start to drilldown into the lower levels of the hierarchy.

I orginally tried placing a filter on a named set I was using, but it was not filtering out the measures with a zero value. The statement I was using was the following: FILTER([Course Score Tests], Measures.[Test Scores] > 0) where [Course Score Tests] is a named set that I am referencing. Unfotunately this was not removing the zero test scores when I started to reference this newly filtered named set in one of my calculated measures to try and bypass using the IIF statement. I went back to using the IIF statement on the calculated measure and that is working, but I am see major performance issues and I am currently unable to drilldown to the lowest level of the hierarchy and the memory on the server is taken major hits.

At this point I am at a loss and I am unsure how the rectify the situation. Any advice would be greatly appreciated. I am using SSAS 2005 w/ SP1.

Is [Test Scores] a calculated measure or a real measure ? If it is a calculated measure - what is the expression for it ? If it is a real measure - can you define it as nullable - then you won't need calculated measure to do the conversion.|||Thanks for your reply. [Test Scores] is a real measure, not a calculated measure. I have actual zero values in the fact table that I want to filter out for a particular calculated measure, but not necessarily permanently. Are you refering to changing the NullProcessing on the measure from Automatic to ZeroOrBlank?|||

In that case, you may consider creating a calculated column in DSV which will convert zeros to NULLs, and creating two different measures - one with zeros and another one with NULLs. It would be an overhead during processing, of course, and the cube will be somewhat bigger, but at least it should solve the performance problem.

Saturday, February 25, 2012

Reorg select tables

Hi,
I′m not a expert DBA, please need your help!!! I have to defrag my database
because poor performance, but can′t. Our database have around 1TB and don′
t
have disk space and window time to defrag all database at one time.
I need to make this excluing bigest tables and make reorg index others
tables. How can I make this? Any idea?Fabio Rebelo wrote:
> Hi,
> I′m not a expert DBA, please need your help!!! I have to defrag my databa
se
> because poor performance, but can′t. Our database have around 1TB and don
′t
> have disk space and window time to defrag all database at one time.
> I need to make this excluing bigest tables and make reorg index others
> tables. How can I make this? Any idea?
Consider using this script of mine:
http://realsqlguy.com/twiki/bin/vie...IndexesAsNeeded
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Hi Tracy, thanks for help. Your script will help me very much, but i need
another little thing:
I need select ours biggest tables (top 30) to exclude it from script to
reorg all database. How can i make this?
If you could, please show me a script to select this tables and the sintaxe
to reorg all database without this 30 tables. After we let′s run reorg one
big table a time.
Thans your help again, and sorry my english.
"Tracy McKibben" wrote:

> Fabio Rebelo wrote:
> Consider using this script of mine:
> http://realsqlguy.com/twiki/bin/vie...IndexesAsNeeded
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
>|||On Mon, 31 Jul 2006 11:26:02 -0700, Fabio Rebelo
<FabioRebelo@.discussions.microsoft.com> wrote:
>Hi Tracy, thanks for help. Your script will help me very much, but i need
>another little thing:
>I need select ours biggest tables (top 30) to exclude it from script to
>reorg all database. How can i make this?
Just change his one statement from:
SELECT @.Command = 'USE ' + RTRIM(@.DBName) + ' SELECT table_name FROM
INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = ''BASE TABLE'''
to:
SELECT @.Command = 'USE ' + RTRIM(@.DBName)
+ ' SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE
TABLE_TYPE = ''BASE TABLE'' AND table_name NOT IN (''bigtable1'',
''bigtable2'', ... ''bigtable30'')'
You might get other ideas along the same lines!
Good luck.
Josh

Reorg select tables

Hi,
I´m not a expert DBA, please need your help!!! I have to defrag my database
because poor performance, but can´t. Our database have around 1TB and don´t
have disk space and window time to defrag all database at one time.
I need to make this excluing bigest tables and make reorg index others
tables. How can I make this? Any idea?Fabio Rebelo wrote:
> Hi,
> I´m not a expert DBA, please need your help!!! I have to defrag my database
> because poor performance, but can´t. Our database have around 1TB and don´t
> have disk space and window time to defrag all database at one time.
> I need to make this excluing bigest tables and make reorg index others
> tables. How can I make this? Any idea?
Consider using this script of mine:
http://realsqlguy.com/twiki/bin/view/RealSQLGuy/DefragIndexesAsNeeded
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Hi Tracy, thanks for help. Your script will help me very much, but i need
another little thing:
I need select ours biggest tables (top 30) to exclude it from script to
reorg all database. How can i make this?
If you could, please show me a script to select this tables and the sintaxe
to reorg all database without this 30 tables. After we let´s run reorg one
big table a time.
Thans your help again, and sorry my english.
"Tracy McKibben" wrote:
> Fabio Rebelo wrote:
> > Hi,
> >
> > I´m not a expert DBA, please need your help!!! I have to defrag my database
> > because poor performance, but can´t. Our database have around 1TB and don´t
> > have disk space and window time to defrag all database at one time.
> >
> > I need to make this excluing bigest tables and make reorg index others
> > tables. How can I make this? Any idea?
> Consider using this script of mine:
> http://realsqlguy.com/twiki/bin/view/RealSQLGuy/DefragIndexesAsNeeded
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
>|||On Mon, 31 Jul 2006 11:26:02 -0700, Fabio Rebelo
<FabioRebelo@.discussions.microsoft.com> wrote:
>Hi Tracy, thanks for help. Your script will help me very much, but i need
>another little thing:
>I need select ours biggest tables (top 30) to exclude it from script to
>reorg all database. How can i make this?
Just change his one statement from:
SELECT @.Command = 'USE ' + RTRIM(@.DBName) + ' SELECT table_name FROM
INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = ''BASE TABLE'''
to:
SELECT @.Command = 'USE ' + RTRIM(@.DBName)
+ ' SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE
TABLE_TYPE = ''BASE TABLE'' AND table_name NOT IN (''bigtable1'',
''bigtable2'', ... ''bigtable30'')'
You might get other ideas along the same lines!
Good luck.
Josh

reorg database files

I want to reorganize the data files for optimum
performance. I have described below the existing
and the intended scenario that I wish to attain.
** existing database scenario **
database files
mydb.mdf (50gb) - primary data file
mydblog.ldf (1gb) - log file
** intended database scenario **
database files:
mydb1.mdf (10gb) - primary data file
mydb2.ndf (10gb) - secondary data file
mydb3.ndf (10gb) - secondary data file
mydb4.ndf (10gb) - secondary data file
mydb5.ndf (10gb) - secondary data file
mydblog.ldf (1gb) - log file
Are there tools that can me help do this?
Thank you in advance.Using T-SQL tools, you can do this:
Use ALTER DATABASE to create new files and place them in filegroups.
Now, use sp_spaceused to determine which tables and/or indexes you want to
move to the new filegroups.
You can use ALTER TABLE with ON FileGroupName to move data around. Notice
that the filegroup is actually home to an index, but a clustered index is
the table, of course. From the BOL:
ON {filegroup | DEFAULT}
Specifies the storage location of the index created for the constraint. If
filegroup is specified, the index is created in the named filegroup. If
DEFAULT is specified, the index is created in the default filegroup. If ON
is not specified, the index is created in the filegroup that contains the
table. If ON is specified when adding a clustered index for a PRIMARY KEY or
UNIQUE constraint, the entire table is moved to the specified filegroup when
the clustered index is created.
Once you have successfully moved tables by recreating the clustered indexes,
you can use DBCC SHRINKFILE to shrink the original large file down to the
appropriate size.
Russell Fields
"fragb" <anonymous@.discussions.microsoft.com> wrote in message
news:0ca401c47b0c$fb6e7280$a401280a@.phx.gbl...
> I want to reorganize the data files for optimum
> performance. I have described below the existing
> and the intended scenario that I wish to attain.
> ** existing database scenario **
> database files
> mydb.mdf (50gb) - primary data file
> mydblog.ldf (1gb) - log file
> ** intended database scenario **
> database files:
> mydb1.mdf (10gb) - primary data file
> mydb2.ndf (10gb) - secondary data file
> mydb3.ndf (10gb) - secondary data file
> mydb4.ndf (10gb) - secondary data file
> mydb5.ndf (10gb) - secondary data file
> mydblog.ldf (1gb) - log file
> Are there tools that can me help do this?
> Thank you in advance.
>|||None that I know of that would do much in that situation. If you want to
spread your data evenly across a filegroup with multiple files from one that
has a single file you pretty much have to export all the data. Then
truncate all the tables and reimport it back again. It's not that difficult
of a task but obviously you will need to take your users off line for some
period of time. In the past when I have done this I basically scripted out
the database and all the objects in such a way that I could recreate the
database schema with the new files and all the tables , sp's UDF's ect but
leaving off the triggers, RI and Indexes. Then after you BCP out all the
data you can drop the DB and recreate it without those to make it easier and
faster to load. Then Bulk Insert the data and add back the RI, Triggers
etc. Just make sure you have good and tested backups first.
--
Andrew J. Kelly SQL MVP
"fragb" <anonymous@.discussions.microsoft.com> wrote in message
news:0ca401c47b0c$fb6e7280$a401280a@.phx.gbl...
> I want to reorganize the data files for optimum
> performance. I have described below the existing
> and the intended scenario that I wish to attain.
> ** existing database scenario **
> database files
> mydb.mdf (50gb) - primary data file
> mydblog.ldf (1gb) - log file
> ** intended database scenario **
> database files:
> mydb1.mdf (10gb) - primary data file
> mydb2.ndf (10gb) - secondary data file
> mydb3.ndf (10gb) - secondary data file
> mydb4.ndf (10gb) - secondary data file
> mydb5.ndf (10gb) - secondary data file
> mydblog.ldf (1gb) - log file
> Are there tools that can me help do this?
> Thank you in advance.
>|||Hi,
The CREATE TABLE & ALTER TABLE statements only allow you to specify the
FILEGROUP on which you wish to create the table. Not the actual data
file within the Filegroup.
In your intended scenario, you do not draw a distinction between Data
Files, and FileGroups. A possible alternative is :
FileGroupPRIMARY mydb1.mdf (10gb)
FileGroup02 mydb2.ndf (10gb)
FileGroup03 mydb3.ndf (10gb)
FileGroup04 mydb4.ndf (10gb)
FileGroup05 mydb5.ndf (10gb)
mydblog.ldf (1gb)
I use Power Designer - Data Architect to model my databases. After I
make changes to the model (ie, change the FileGroup for a table), Data
Architect compares my Model against the database on the server, and
generates a "Modify" script, which I then run against the database.
It generates the typical script to move to a different Filegroup :
alter table dbo.tbl_Customer
drop constraint PK_Customer
go
alter table dbo.tbl_Customer
add constraint PK_Customer primary key clustered (CustomerId)
on "NEW_FILEGROUP"
go
thanks
Ian
fragb wrote:
> I want to reorganize the data files for optimum
> performance. I have described below the existing
> and the intended scenario that I wish to attain.
> ** existing database scenario **
> database files
> mydb.mdf (50gb) - primary data file
> mydblog.ldf (1gb) - log file
> ** intended database scenario **
> database files:
> mydb1.mdf (10gb) - primary data file
> mydb2.ndf (10gb) - secondary data file
> mydb3.ndf (10gb) - secondary data file
> mydb4.ndf (10gb) - secondary data file
> mydb5.ndf (10gb) - secondary data file
> mydblog.ldf (1gb) - log file
> Are there tools that can me help do this?
> Thank you in advance.
>