Showing posts with label logical. Show all posts
Showing posts with label logical. Show all posts

Wednesday, March 21, 2012

How many logical volumes for large database?

We are about to migrate a large database server (600+ GB data) onto new
hardware. It is currently on a 450 MHz quad CPU, 4 GB RAM box with local
SCSI storage, and will be moving to a new 3 GHz Quad CPU, 6 GB RAM box with
SAN attached storage. My question concerns how many logical volumes we
should have to support the various database components.
Currently, we have separate logical drives for the Data files, Indexes,
Logs, and TempDB. This was done for two reasons:
First, we had four available SCSI channels, so by creating four arrays each
on a different channel we increased disk I/O.
Second, we did it to reduce fragmentation. The database is used mainly for
running reports and analyses off of data from our main business application,
which is run on a VMS cluster. That system can't handle the performance hit
for all of the reporting, so once a week data is dumped from the mainframe
into the SQL Server. The rest of the week the SQL db is essentially
read-only. So the data volume is fairly static, growing on a weekly basis
but almost never shrinking. For performance reasons, the indexes are
dropped and recreated weekly, the logs are truncated and then grow, and of
course TempDB grows and shrinks as needed. By separating each component
onto a different logical drive, we should have less fragmentation.
Now that we are moving to a new architecture, the question has been raised
as to whether this is still the best setup, or if it just creates
unnecessary administrative overhead. Obviously we no longer get a
performance gain from multiple I/O channels, because all of the storage will
be accessed via the same fiber channel to the SAN.
As for the fragmentation issue, is it really that much of a problem? Would
it cause issues if we were to, say, combine data and indexes on the same
volume, or logs and TempDB?
The goal is to reduce administrative overhead. But since we have data
files, indexes, logs, and tempDB in any case, does it make a difference from
a management standpoint whether they are all on one volume or on four
separate ones? Would it be an issue either way from a backup/restore
standpoint?
Thanks,
Gary
Gary,
You can still benefit from multiple volumes on a SAN, specifically for data,
log, and tempdb. (Since it is essentially a read only db,
you apparently don't need a volume for backups.) Even with one HBA, having
independent sets of spindles for different types of IO (data, log, and
tempdb) usually provides some performance gain.
If the queries are active and make any use of temp tables, then you can
benefit from having tempdb on its own volume. The database log files will be
active when loading, so keeping them on their own volume should help with
load time.
I've seen many installations with that much or more data that don't use
separate volumes for indexes. If you never update the tables, and recreate
all the indexes weekly with each new load, you should not have problems with
defragmentation. But check anyway by using DBCC SHOWCONTIG.
Hope this helps,
Ron
Ron Talmage
SQL Server MVP
"Gary Dom" <domgATsutterhealthDOTorg@.no.spam> wrote in message
news:%230VstQAnEHA.2140@.TK2MSFTNGP11.phx.gbl...
> We are about to migrate a large database server (600+ GB data) onto new
> hardware. It is currently on a 450 MHz quad CPU, 4 GB RAM box with local
> SCSI storage, and will be moving to a new 3 GHz Quad CPU, 6 GB RAM box
with
> SAN attached storage. My question concerns how many logical volumes we
> should have to support the various database components.
> Currently, we have separate logical drives for the Data files, Indexes,
> Logs, and TempDB. This was done for two reasons:
> First, we had four available SCSI channels, so by creating four arrays
each
> on a different channel we increased disk I/O.
> Second, we did it to reduce fragmentation. The database is used mainly
for
> running reports and analyses off of data from our main business
application,
> which is run on a VMS cluster. That system can't handle the performance
hit
> for all of the reporting, so once a week data is dumped from the mainframe
> into the SQL Server. The rest of the week the SQL db is essentially
> read-only. So the data volume is fairly static, growing on a weekly basis
> but almost never shrinking. For performance reasons, the indexes are
> dropped and recreated weekly, the logs are truncated and then grow, and of
> course TempDB grows and shrinks as needed. By separating each component
> onto a different logical drive, we should have less fragmentation.
> Now that we are moving to a new architecture, the question has been raised
> as to whether this is still the best setup, or if it just creates
> unnecessary administrative overhead. Obviously we no longer get a
> performance gain from multiple I/O channels, because all of the storage
will
> be accessed via the same fiber channel to the SAN.
> As for the fragmentation issue, is it really that much of a problem?
Would
> it cause issues if we were to, say, combine data and indexes on the same
> volume, or logs and TempDB?
> The goal is to reduce administrative overhead. But since we have data
> files, indexes, logs, and tempDB in any case, does it make a difference
from
> a management standpoint whether they are all on one volume or on four
> separate ones? Would it be an issue either way from a backup/restore
> standpoint?
> Thanks,
> Gary
>
>

How many logical volumes for large database?

We are about to migrate a large database server (600+ GB data) onto new
hardware. It is currently on a 450 MHz quad CPU, 4 GB RAM box with local
SCSI storage, and will be moving to a new 3 GHz Quad CPU, 6 GB RAM box with
SAN attached storage. My question concerns how many logical volumes we
should have to support the various database components.
Currently, we have separate logical drives for the Data files, Indexes,
Logs, and TempDB. This was done for two reasons:
First, we had four available SCSI channels, so by creating four arrays each
on a different channel we increased disk I/O.
Second, we did it to reduce fragmentation. The database is used mainly for
running reports and analyses off of data from our main business application,
which is run on a VMS cluster. That system can't handle the performance hit
for all of the reporting, so once a week data is dumped from the mainframe
into the SQL Server. The rest of the week the SQL db is essentially
read-only. So the data volume is fairly static, growing on a weekly basis
but almost never shrinking. For performance reasons, the indexes are
dropped and recreated weekly, the logs are truncated and then grow, and of
course TempDB grows and shrinks as needed. By separating each component
onto a different logical drive, we should have less fragmentation.
Now that we are moving to a new architecture, the question has been raised
as to whether this is still the best setup, or if it just creates
unnecessary administrative overhead. Obviously we no longer get a
performance gain from multiple I/O channels, because all of the storage will
be accessed via the same fiber channel to the SAN.
As for the fragmentation issue, is it really that much of a problem? Would
it cause issues if we were to, say, combine data and indexes on the same
volume, or logs and TempDB?
The goal is to reduce administrative overhead. But since we have data
files, indexes, logs, and tempDB in any case, does it make a difference from
a management standpoint whether they are all on one volume or on four
separate ones? Would it be an issue either way from a backup/restore
standpoint?
Thanks,
GaryGary,
You can still benefit from multiple volumes on a SAN, specifically for data,
log, and tempdb. (Since it is essentially a read only db,
you apparently don't need a volume for backups.) Even with one HBA, having
independent sets of spindles for different types of IO (data, log, and
tempdb) usually provides some performance gain.
If the queries are active and make any use of temp tables, then you can
benefit from having tempdb on its own volume. The database log files will be
active when loading, so keeping them on their own volume should help with
load time.
I've seen many installations with that much or more data that don't use
separate volumes for indexes. If you never update the tables, and recreate
all the indexes weekly with each new load, you should not have problems with
defragmentation. But check anyway by using DBCC SHOWCONTIG.
Hope this helps,
Ron
--
Ron Talmage
SQL Server MVP
"Gary Dom" <domgATsutterhealthDOTorg@.no.spam> wrote in message
news:%230VstQAnEHA.2140@.TK2MSFTNGP11.phx.gbl...
> We are about to migrate a large database server (600+ GB data) onto new
> hardware. It is currently on a 450 MHz quad CPU, 4 GB RAM box with local
> SCSI storage, and will be moving to a new 3 GHz Quad CPU, 6 GB RAM box
with
> SAN attached storage. My question concerns how many logical volumes we
> should have to support the various database components.
> Currently, we have separate logical drives for the Data files, Indexes,
> Logs, and TempDB. This was done for two reasons:
> First, we had four available SCSI channels, so by creating four arrays
each
> on a different channel we increased disk I/O.
> Second, we did it to reduce fragmentation. The database is used mainly
for
> running reports and analyses off of data from our main business
application,
> which is run on a VMS cluster. That system can't handle the performance
hit
> for all of the reporting, so once a week data is dumped from the mainframe
> into the SQL Server. The rest of the week the SQL db is essentially
> read-only. So the data volume is fairly static, growing on a weekly basis
> but almost never shrinking. For performance reasons, the indexes are
> dropped and recreated weekly, the logs are truncated and then grow, and of
> course TempDB grows and shrinks as needed. By separating each component
> onto a different logical drive, we should have less fragmentation.
> Now that we are moving to a new architecture, the question has been raised
> as to whether this is still the best setup, or if it just creates
> unnecessary administrative overhead. Obviously we no longer get a
> performance gain from multiple I/O channels, because all of the storage
will
> be accessed via the same fiber channel to the SAN.
> As for the fragmentation issue, is it really that much of a problem?
Would
> it cause issues if we were to, say, combine data and indexes on the same
> volume, or logs and TempDB?
> The goal is to reduce administrative overhead. But since we have data
> files, indexes, logs, and tempDB in any case, does it make a difference
from
> a management standpoint whether they are all on one volume or on four
> separate ones? Would it be an issue either way from a backup/restore
> standpoint?
> Thanks,
> Gary
>
>sql

Monday, March 19, 2012

How many drives can be mapped to 2 SQLServer on cluster

Dear all,

We have just configured a SAN system and 2 SQLServer clustered(A/P).

The vendor has mapped 2 logical drives each one is accessed by each SQLServer

ex:

Logical Drives on SAN :- H: and G:

Server S1 have accesses to H: and Server S2 have accesses to G: but at a time we can see both logical drive on each system but can access there mapped drives.

Is this possible to have 2 logical drives on each server mapped with each other on the cluster server.

Server 1 having drive H: and G:

Server 2 having drive H: and G:

Note : Vendor told us that there is a BUG in SQLServer 2005 that only one drive can be mapped with each sqlserver in a cluster.

Please help

Is there can Document Released from Microsoft Regarding Clusting SQLServer2005 Please the link.

Regards

Mohd Sufian

This is not a bug, but functionality. You can only add one drive to each cluster group. If the drive is already used by one SQL server instance, you can not use the same with other instance.

Here is a webcast on 'How to custer SQL Server 2005':

http://support.microsoft.com/kb/891798

And here is a white paper:

http://www.microsoft.com/downloads/details.aspx?FamilyID=818234dc-a17b-4f09-b282-c6830fead499&DisplayLang=en

|||This is technically not a problem with SQL. Most SAN's don't allow you to point more than 1 computer to 1 logical volume on the SAN.

Wednesday, March 7, 2012

How is represented the Updated Table in a Trigger?

Hello

I am a newbie creating triggers and I would like to know what is the name of the updated logical table. That is, since the are identifiers like "inserted" and "deleted" that represent the inserted and deleted rows, respectivaly, I presumed that "updated" existed - but it does not.

I have a table with a column named "UpdatedTimeStamp" which I would like to update anytime the other columns are modified. I intended to create the following trigger:

create trigger myTrigger
on myTable
after update
as

update updated set UpdateTimeStamp=GetDate()

Of course, "updated" is not a valid identifier that represents the updated row.

Please, help me in creating this trigger. What is the correct way of doing a trigger like this?

Thanks a lot in advanced.Do you have books online?

Its inerted and deleted|||I know, but as I stated in my previous post, I do not know how to update a row which has just been updated. For example: I have a table with 2 columns, A and B -where B is a datetime column. I would like that when A has just been updated (not inserted or deleted), B would have the datetime value when that happened. Something like:

update [updated] set B=GetDate()

Of course, [updated] is not valid identifier for a logical table. Can you please help me in how to accomplish this scenary?|||The way you tell a row or rows have been updated is that both the inserted and deleted tables contain data. On an insert, the data only appears in the inserted table. On a delete, the data only appears in the deleted table.

Now with this information, try and put together a trigger for an update, and come back with your results. Also, you might want to include some schema information, so we can see the table or tables you are trying to maintain.

And remember, you want the trigger to update all rows updated, not just one of them. Think about set based operations.|||Do you have books online?

Its inerted :shocked: and deleted

How long have you been working in the bomb disposal unit at your office?

:D

hmscott|||I came up with the following solution:

suppose the existence of a table called myTable, having the columns:
- ID numeric (PK)
- Value varchar(50)
- UpdateTimeStamp datetime

Now, my trigger is

create trigger myTrigger
on myTable
after update
as

if update(Value)
begin
update myTable
set
UpdateTimeStamp=GetDate()
from myTable
inner join inserted i on i.ID=myTable.ID
inner join deleted d on d.ID=myTable.ID
end

Is this code ok?

If I open the table and modify a row, the UpdateTimeStamp column is updated as expected. However, when I update only some rows with a query, for a reason I failed to understand, all the rows get their UpdateTimeStamp field updated.

What could be wrong?|||Personally, I would not bother with the UPDATE() function. It can be misleading, especially when dealing with interfaces that my issue spurious update statements, as it merely indicates whether a column was part of an update statement, and does not indicate whether the value actually changed.

For instance, this code:
update A set Value = 5 where Value = 5
...would result in the UPDATE() function indicating that a set of records were updated, whereas in reality they have the same value as before.

If you really want to check whether the value has changed, try something like this:
begin
update myTable
set UpdateTimeStamp=GetDate()
from myTable
inner join inserted i on i.ID=myTable.ID
inner join deleted d on d.ID=myTable.ID
where inserted.Value <> deleted.Value
or inserted.Value is null and deleted.Value is not null
or inserted.Value is not null and deleted.Value is null
...or use the BINARY_CHECKSUM() function to quickly compare multiple columns.