Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Tuesday, March 27, 2012

A cursor performance related question

Hi All,
I have 800 K records need to be processed one by one in a large table daily
using cursor way to update the default columns. The rest of queries are only
read information from this table. The records in this table could be very
large later on.
My question is what's the best way to use cursor to duel with this table.
here is my options:
1.Use a BIG cursor to lock all the un-processed records and use a singal
connection from Query Analyzer
2. Try to break /subgroup them with flags and run the same procedure above
with muti-Query Analyzer Connections. Each connection only duel part of the
record set.
I only have one SQL server . The testing result is Option 1 has the best
performance.
Is SQL server not good at running query parallelly with muti-connections? or
I need to improve the SQL server hardware staff by adding more memory ?
Any expert can point me to the right way?
Many Thanks,
Stevenews.microsoft.com (stevenxiu@.yahoo.com) writes:
> I have 800 K records need to be processed one by one in a large table
> daily using cursor way to update the default columns. The rest of
> queries are only read information from this table. The records in this
> table could be very large later on.
> My question is what's the best way to use cursor to duel with this
> table. here is my options:
> 1.Use a BIG cursor to lock all the un-processed records and use a singal
> connection from Query Analyzer
> 2. Try to break /subgroup them with flags and run the same procedure
> above with muti-Query Analyzer Connections. Each connection only duel
> part of the record set.
> I only have one SQL server . The testing result is Option 1 has the best
> performance.
> Is SQL server not good at running query parallelly with
> muti-connections? or I need to improve the SQL server hardware staff by
> adding more memory ?
With only this abstract narrative it is impossible to say very much. One
possibility is that you have poor indexing, cause the multiple connections
to block each other.
To get any accurate response you would need to post:
o CREATE TABLE and CREATE INDEX statements for the table.
o The code for the two options you are using.
o Some background on what the code is actually doing.
However, there is fair chance that the answer is option 0: don't use a
cursor at all, but apply set-based logic. This usually improves performance
with magnitudes.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||"news.microsoft.com" <stevenxiu@.yahoo.com> wrote in message
news:u9WHOCx8FHA.3044@.TK2MSFTNGP10.phx.gbl...
> I have 800 K records need to be processed one by one in a large table
> daily
> using cursor way to update the default columns.
Chances are that you don't need to do it "one by one" and that it will be
more efficient without a cursor. We won't know for sure unless you post a
better description of your problem. See:
http://www.aspfaq.com/etiquette.asp?id=5006
David Portas
SQL Server MVP
--|||Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. Sample data is also a good idea, along with clear
specifications. It is very hard to debug code when you do not let us
see it.
But based on a few decades with SQL, I have written only five cursors
and I know that I could have avoided three of them if I had the CASE
expression back in the old days.
The fact that you do not know the differences between records and rows
tells me your approach is probably not relational and that yoiur
mindset is still stuck in sequential file processing.|||You should avoid using cursors to perform updates. Set-based updates
perform better for a number of reasons:
(1) Set-based updates write to the transaction log more efficiently. Each
update incurs a certain amount of overhead in the transaction log to mark
the start and end of each write to each affected object in the database.
This includes not only writes to the heap or clustered index, but also
writes to each nonclustered index. In addition, if the same index page is
updated more than once during the thousands of individual updates, then that
page will be recorded in the transaction log once for each related update,
causing the log to grow faster than is necessary. Frequent disk allocations
can hugely affect performance. (This last shouldn't be a problem if you
pre-allocate log space.)
(2) With set-based updates, indexes can be updated en-mass--meaning fewer
costly page splits and fewer writes to each affected database object thus
reducing the frequency of disk head ss.
(3) Locking is more efficient. Set-based updates obtain locks on all of the
affected rows before beginning the write, and then release them as soon as
the changes have been committed. Thousands of individual updates requires
the server to go through the process of obtaining each individual exclusive
lock on each individual row. With set-based updates, locks are more likely
to be escalated when necessary, thereby reducing overhead.
(4) With set-based updates, the system is tasked with writing and writing
only. Thousands of individual updates usually means that several additional
reads are interspersed within the writes. This can cause a lot more disk
activity and in particular, a significant increase in costly disk ss.
If you must use a cursor (I'm not of the opinion that they are always bad;
however, they should only be used as a last resort.), then you should cache
the updates in a temp table or table variable and then flush them using
set-based updates. Inserting individual rows into a table with no indexes
(a heap) or appending to a table with only a clustered index performs pretty
well, and if you have enough memory, temp tables and table variables remain
for the most part in memory. (Writes to tempdb are eventually flushed out
to disk, provided the affected rows and objects still exist by the time the
system gets around to initiating the write.) By appending, I mean that
inserts occur in the same order as the clustered index key--that is, with an
ascending index, each row inserted has a key value that is greater than the
key value in any existing row in the table.
"news.microsoft.com" <stevenxiu@.yahoo.com> wrote in message
news:u9WHOCx8FHA.3044@.TK2MSFTNGP10.phx.gbl...
> Hi All,
> I have 800 K records need to be processed one by one in a large table
> daily
> using cursor way to update the default columns. The rest of queries are
> only
> read information from this table. The records in this table could be very
> large later on.
> My question is what's the best way to use cursor to duel with this table.
> here is my options:
> 1.Use a BIG cursor to lock all the un-processed records and use a singal
> connection from Query Analyzer
> 2. Try to break /subgroup them with flags and run the same procedure above
> with muti-Query Analyzer Connections. Each connection only duel part of
> the
> record set.
> I only have one SQL server . The testing result is Option 1 has the best
> performance.
> Is SQL server not good at running query parallelly with muti-connections?
> or
> I need to improve the SQL server hardware staff by adding more memory ?
> Any expert can point me to the right way?
> Many Thanks,
> Steve
>sql

Thursday, March 22, 2012

A connection could not be established...Cannot open user default database...

Hello,
I'm running SQL7 on a Win2K server. I was in the midst of
restoring a database when I lost connectivity to the
network and the job failed.
Now if I try to view the database within Enterprise
Manager, I get the following error:
---
A connection could not be established to <servername>.
Cannot open user default database '<ID>. Using master
database instead. Please varify SQL Server is running and
check your SQL Server registration properties (by right-
clicking on the <servername> node) and try again.
---
I checked and SQL is running and the registration
properties are correct.
Any help would be appreciated.Seems like the database is "lost", as you terminated the restore, and the
logins that your EM registration login is using has that database as the
default database. I suggest you login using ISQL.EXE and change default
database using sp_defaultdb.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:0c6201c3df7b$ee9a7fe0$a101280a@.phx.gbl...
> Hello,
> I'm running SQL7 on a Win2K server. I was in the midst of
> restoring a database when I lost connectivity to the
> network and the job failed.
> Now if I try to view the database within Enterprise
> Manager, I get the following error:
> ---
> A connection could not be established to <servername>.
> Cannot open user default database '<ID>. Using master
> database instead. Please varify SQL Server is running and
> check your SQL Server registration properties (by right-
> clicking on the <servername> node) and try again.
> ---
> I checked and SQL is running and the registration
> properties are correct.
> Any help would be appreciated.
>|||Thanks Tibor - I tried that as outlined in MS KB 196076,
but I still get a the same error.(?)
>--Original Message--
>Seems like the database is "lost", as you terminated the
restore, and the
>logins that your EM registration login is using has that
database as the
>default database. I suggest you login using ISQL.EXE and
change default
>database using sp_defaultdb.
>--
>Tibor Karaszi, SQL Server MVP
>Archive at:
>http://groups.google.com/groups?
oi=djq&as_ugroup=microsoft.public.sqlserver
>
>"Jimbo" <anonymous@.discussions.microsoft.com> wrote in
message
>news:0c6201c3df7b$ee9a7fe0$a101280a@.phx.gbl...
>> Hello,
>> I'm running SQL7 on a Win2K server. I was in the midst
of
>> restoring a database when I lost connectivity to the
>> network and the job failed.
>> Now if I try to view the database within Enterprise
>> Manager, I get the following error:
>> ---
>> A connection could not be established to <servername>.
>> Cannot open user default database '<ID>. Using master
>> database instead. Please varify SQL Server is running
and
>> check your SQL Server registration properties (by right-
>> clicking on the <servername> node) and try again.
>> ---
>> I checked and SQL is running and the registration
>> properties are correct.
>> Any help would be appreciated.
>>
>
>.
>|||Tibor Karaszi wrote:
> Seems like the database is "lost", as you terminated the restore, and the
> logins that your EM registration login is using has that database as the
> default database. I suggest you login using ISQL.EXE and change default
> database using sp_defaultdb.
>
Thanks for the information. That seems to have fixed the lost db server
issue in the drop down. Still can't get the damn app server to
connect to the db server though. Will keep searching.|||> Thanks for the information. That seems to have fixed the lost db server
> issue in the drop down. Still can't get the damn app server to connect
> to the db server though. Will keep searching.
Everyone may ignore my last post.

A connection could not be established...Cannot open user default database...

Hello,
I'm running SQL7 on a Win2K server. I was in the midst of
restoring a database when I lost connectivity to the
network and the job failed.
Now if I try to view the database within Enterprise
Manager, I get the following error:
---
A connection could not be established to <servername>.
Cannot open user default database '<ID>. Using master
database instead. Please varify SQL Server is running and
check your SQL Server registration properties (by right-
clicking on the <servername> node) and try again.
---
I checked and SQL is running and the registration
properties are correct.
Any help would be appreciated.Seems like the database is "lost", as you terminated the restore, and the
logins that your EM registration login is using has that database as the
default database. I suggest you login using ISQL.EXE and change default
database using sp_defaultdb.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Jimbo" <anonymous@.discussions.microsoft.com> wrote in message
news:0c6201c3df7b$ee9a7fe0$a101280a@.phx.gbl...
quote:

> Hello,
> I'm running SQL7 on a Win2K server. I was in the midst of
> restoring a database when I lost connectivity to the
> network and the job failed.
> Now if I try to view the database within Enterprise
> Manager, I get the following error:
> ---
> A connection could not be established to <servername>.
> Cannot open user default database '<ID>. Using master
> database instead. Please varify SQL Server is running and
> check your SQL Server registration properties (by right-
> clicking on the <servername> node) and try again.
> ---
> I checked and SQL is running and the registration
> properties are correct.
> Any help would be appreciated.
>
|||Thanks Tibor - I tried that as outlined in MS KB 196076,
but I still get a the same error.(?)
quote:

>--Original Message--
>Seems like the database is "lost", as you terminated the

restore, and the
quote:

>logins that your EM registration login is using has that

database as the
quote:

>default database. I suggest you login using ISQL.EXE and

change default
quote:

>database using sp_defaultdb.
>--
>Tibor Karaszi, SQL Server MVP
>Archive at:
>http://groups.google.com/groups?

oi=djq&as_ugroup=microsoft.public.sqlserver
quote:

>
>"Jimbo" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:0c6201c3df7b$ee9a7fe0$a101280a@.phx.gbl...
of[QUOTE]
and[QUOTE]
>
>.
>

A connection could not be established...Cannot open user default

Tibor Karaszi wrote:
quote:

> Seems like the database is "lost", as you terminated the restore, and the
> logins that your EM registration login is using has that database as the
> default database. I suggest you login using ISQL.EXE and change default
> database using sp_defaultdb.
>

Thanks for the information. That seems to have fixed the lost db server
issue in the drop down. Still can't get the damn app server to
connect to the db server though. Will keep searching.
quote:

> Thanks for the information. That seems to have fixed the lost db server
> issue in the drop down. Still can't get the damn app server to connect
> to the db server though. Will keep searching.

Everyone may ignore my last post.

Sunday, March 11, 2012

80 mode

Hello everybody.
What mean if server is runninf in the default 80 mode
What are 60, 65,70 mode.
Thanks for all respond."harry" <simon_add@.op.pl> wrote in message news:d1s8fk$rbv$1@.news.onet.pl...
> Hello everybody.
> What mean if server is runninf in the default 80 mode
> What are 60, 65,70 mode.
>
They are the versions of SQL Server - 6.0, 6.5, 7.0 and 8.0 (2000). The best
bet is to look up the differences in BOL, though the most significant
changes occurred between 7.0 and 8.0 as far as I know.
Yours,
Ann-Marie|||On Wed, 23 Mar 2005 18:19:57 +0100, harry wrote:

>Hello everybody.
>What mean if server is runninf in the default 80 mode
>What are 60, 65,70 mode.
>Thanks for all respond.
>
Hi Harry,
That's the compatibility mode.
60, 65, and 70 indicate that SQL Server takes some steps to pretend to
be a SQL Server 6.0, 6.5, or 7.0 installation, rather than SQL Server
2000. Some new commands are not available in the old compatibility
modes. Some fixed bugs will reappear in the old compatibility modes. And
some discontinued functions are still avaialable in the compatibility
modes.
Note that compatibility mode is a database setting - it doesn't affect
all databases on the server, just one - but it can't be switched on an
ad-hoc basis in case you need old behaviour AND new functionality.
Also note that the compatibility is limited. Many discuontinued or
changed commands, options or functionalities remain unavailable or
changed even when running at an older compatibility level.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

8 hours to add a bit column

I ran the following:

ALTER TABLE Recipients ADD Obscene BIT NOT NULL DEFAULT 0

On a table with 80 million records. It's been running for 8 hours and counting now. This is ridiculous. No one else is using this server.

Server configuration:
SQL Server 2000 Enterprise Edition with SP3a
2 GB RAM
3.0 GHz P4 with hyperthreading
SCSI RAID

Any ideas why this is taking so long? Can I find out what it's doing? Is there anything I can do to make it go faster?You won't like any of my answers.

Before we descend into that morass though, crank up the NT Performance Monitor and have a look-see at the server. Is it CPU bound, disk bound, memory bound, or are all of those counters at reasonable levels? How many SQL threads (spids) are active? What do the SQL page counters look like?

My guess would be that the box is hideously RAM bound, that it is having page splits up the ying-yang, and that it might be disk bound as well.

Is your log file on a different disk device than your data files? Is that device mirrored instead of RAID? Do you have the ability to add RAM with the box running (some servers can do that!)?

-PatP|||If your answers give me any ideas and any closer to figuring these kinds of problems out, I like them. The business that I'm working for is very data driven and we are moving quickly in a database direction and we need this knowledge.

I've been watching CPU and disc levels in perfmon all day. The system has been steadily disc bound.
sp_who 'active' returns 17 rows.
How do I look at the page counters?

A RAM bound system exhibits itself as disc bound, correct? With lots of paging to/from disc.

The data files and temp db are on a SCSI RAID 5. The main log file is on a separate 250 GB IDE disc (it has grown to 150 GB in the past which wouldn't fit on the RAID)

You won't like any of my answers.

Before we descend into that morass though, crank up the NT Performance Monitor and have a look-see at the server. Is it CPU bound, disk bound, memory bound, or are all of those counters at reasonable levels? How many SQL threads (spids) are active? What do the SQL page counters look like?

My guess would be that the box is hideously RAM bound, that it is having page splits up the ying-yang, and that it might be disk bound as well.

Is your log file on a different disk device than your data files? Is that device mirrored instead of RAID? Do you have the ability to add RAM with the box running (some servers can do that!)?

-PatP|||if you trace an alter table statement it will show you the issue i think you are hitting.

alter table creates a new table in temp space with the new column, inserts all the data from the old into the new temp, then swaps the names around.

with 80million rows, i'd be willing to bet your are being I/O thottled either creating the temp (which using a low logged select..into..) or the insert, (which is using a fully logged insert into..select).

either way, 8 hours sux but doesnt really suprise me.|||I'v never had to wait 8 hours to add a column to a big table. Besides, I thought that the EM did the swap-trick and the alter table did not.|||i'd agree...8 hours is way out there.
you are correct...EM does the old swap'r'roo trick. that was an assumption on my part - uber apologies - that you were using the Enterprise Mangler.

i would suspect the same thing is happening underneath an alter, though.
(i'm moving into the 'out of my ass' realm so i'm going to qualify that statement as an 'idea'- not something i claim to know.)

the page counters are under the Memory object with some useful other SQL specifc page counters SQLServer:BufferManager.

i wonder if your disk queues are backing up for reads or writes?

perhaps that could help understand if a large read/write is actually occuring underneath your alter?|||hm, here's another though. Perhaps the Analyzer is waiting for the table to be freed from a lock. What does sysprocesses say?|||Just curious as to why you made it NOT NULL?

USE Northwind
GO

CREATE TABLE myTable99 (Col1 int)
GO
INSERT INTO myTable99(Col1) SELECT 1
GO

SELECT * FROM myTable99

ALTER TABLE myTable99 ADD Obscene BIT NOT NULL DEFAULT 0
GO

SELECT * FROM myTable99
GO

ALTER TABLE myTable99 ADD Obscene2 BIT DEFAULT 0
GO

SELECT * FROM myTable99
GO

DROP TABLE myTable99
GO

If you needed it null maybe you caould have performed batch updates after the fact, the changed ALTERed the column to make it NOT NULL...

Is it still running?|||OK, here comes Robert with his BCP again...But it's true, no matter how you look at it! Non-logged data load would beat "in-line" DDL+DML (because this is exactly what happens when you add a new NON-NULLable column with default - the only way to add a new non-nullable column) If you added the same column but made it nullable, - you'd be onto something else 7 hours and 59 minutes ago. At this point though you can't even interrupt this operation because ALTER TABLE is a fully logged operation. It means that every 0 that came from your DEFAULT is logged in your transaction log (thus its size is very explainable). If you decide to kill the process you'll be looking at 8+ hours of rollback. If you stop the service you'll be looking at "Recovering database x..." for probably as much.|||Just curious as to why you made it NOT NULL?

That's an application issue, right? We are trying to mark certain records as "obscene", so every record should be obscene or not. There should be no NULL. I didn't realize that this would be a large performance issue. If I knew in advance I could have dealt with NULL values in one way or another.

It finished overnight but as of 12:30 AM last night, it was running for 13 hours and still going.

I've previously added datetime columns to the same table with EM (this was added via QA with a ALTER TABLE statement) and it took less than an hour. I was really surprised that this took so long. Ideally, I know what to look for to remedy such an issue and how to prevent such things from happening.

thanks guys!|||Did you look at the code that em scripted for you?

Just make sure you don't have a table called tmp_yourtable..

WAIT...damn I just tested it...it's smart enough to add a _1 to the end...damn that's good|||WAIT...damn I just tested it...it's smart enough to add a _1 to the end...damn that's goodTricky little devils, ain't they ?

-PatP|||curious - when you added the datetime values last time did you set a default of getdate()? or something else? or allow them to be null?|||curious - when you added the datetime values last time did you set a default of getdate()? or something else? or allow them to be null?

They defaulted to NULL. And it was added through EM as opposed to an ALTER TABLE statement.

The exact time on adding the bit column was 17 hours and 23 minutes.

Thursday, March 8, 2012

6G Ram but SQL doesn't make use of it by default

If I setup SQL 2005 64 bit on a win2k3 64 bit, do I need to enable/disable
AWE as for other versions or it is managed dynamically by SQL 2005 64 bit.
I have made a new fresh setup (everything is in 64 bit version) on a brand
new machine with 6Gigs of RAM, still when I display server's properties, in
the memory section, in the textbox under Max Server memory
I have 2147483647, which I think is 2 G
Thanks
You shouldn't have to do any config on a 64 bit SS on a 64 bit machine for using > 2GB memory.

> I have 2147483647, which I think is 2 G
No, that number is in MB:
2147483647 MB
= 2097151 GB
= 2047 TB
= approx 2 PB (it is Peta or Exa?)
No discussion on memory and 64 bit is complete without referring to Slava Oks blogs. In short,
consider using lock pages in memory also on 64 bit (if my memory serves me):
http://blogs.msdn.com/slavao/archive/category/9043.aspx
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"SalamElias" <eliassal@.online.nospam> wrote in message
news:60DD00FD-BFA2-4A68-B6B5-142E8B895D45@.microsoft.com...
> If I setup SQL 2005 64 bit on a win2k3 64 bit, do I need to enable/disable
> AWE as for other versions or it is managed dynamically by SQL 2005 64 bit.
> I have made a new fresh setup (everything is in 64 bit version) on a brand
> new machine with 6Gigs of RAM, still when I display server's properties, in
> the memory section, in the textbox under Max Server memory
> I have 2147483647, which I think is 2 G
> Thanks
|||2147483647 is much more than 2GB... 1024 = 1GB
Keith Kratochvil
"SalamElias" <eliassal@.online.nospam> wrote in message
news:60DD00FD-BFA2-4A68-B6B5-142E8B895D45@.microsoft.com...
> If I setup SQL 2005 64 bit on a win2k3 64 bit, do I need to enable/disable
> AWE as for other versions or it is managed dynamically by SQL 2005 64 bit.
> I have made a new fresh setup (everything is in 64 bit version) on a brand
> new machine with 6Gigs of RAM, still when I display server's properties,
> in
> the memory section, in the textbox under Max Server memory
> I have 2147483647, which I think is 2 G
> Thanks
|||Hi Salam,
As other members have mentioned, the 2147483647 default value is in MB, so
it is a quite large value( you need to reduce it according to your
machine's physical memory).
As for AWE, it is an operating system feature and is only useful when the
virtual address space(of OS process) is less than the available physical
memory. For SQL server 2005 64 bit on windows 2003 64 bit, there is no
such virtual address space limitation(normally virtual address space is
much larger than available physical memory space). also, it is recommended
that we adjust the SQL Server instance's max server memory to a proper
value so that other applications on the server can also get sufficient
physical memory for paging file switch.
#Enabling AWE Memory for SQL Server
http://msdn2.microsoft.com/en-us/library/ms190673.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Hi Salam,
Have you got any further idea on this issue? Please feel free to post here
if there is anything else we can help.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

6G Ram but SQL doesn't make use of it by default

If I setup SQL 2005 64 bit on a win2k3 64 bit, do I need to enable/disable
AWE as for other versions or it is managed dynamically by SQL 2005 64 bit.
I have made a new fresh setup (everything is in 64 bit version) on a brand
new machine with 6Gigs of RAM, still when I display server's properties, in
the memory section, in the textbox under Max Server memory
I have 2147483647, which I think is 2 G
ThanksYou shouldn't have to do any config on a 64 bit SS on a 64 bit machine for u
sing > 2GB memory.

> I have 2147483647, which I think is 2 G
No, that number is in MB:
2147483647 MB
= 2097151 GB
= 2047 TB
= approx 2 PB (it is Peta or Exa?)
No discussion on memory and 64 bit is complete without referring to Slava Ok
s blogs. In short,
consider using lock pages in memory also on 64 bit (if my memory serves me):
http://blogs.msdn.com/slavao/archive/category/9043.aspx
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"SalamElias" <eliassal@.online.nospam> wrote in message
news:60DD00FD-BFA2-4A68-B6B5-142E8B895D45@.microsoft.com...
> If I setup SQL 2005 64 bit on a win2k3 64 bit, do I need to enable/disable
> AWE as for other versions or it is managed dynamically by SQL 2005 64 bit.
> I have made a new fresh setup (everything is in 64 bit version) on a brand
> new machine with 6Gigs of RAM, still when I display server's properties, i
n
> the memory section, in the textbox under Max Server memory
> I have 2147483647, which I think is 2 G
> Thanks|||2147483647 is much more than 2GB... 1024 = 1GB
Keith Kratochvil
"SalamElias" <eliassal@.online.nospam> wrote in message
news:60DD00FD-BFA2-4A68-B6B5-142E8B895D45@.microsoft.com...
> If I setup SQL 2005 64 bit on a win2k3 64 bit, do I need to enable/disable
> AWE as for other versions or it is managed dynamically by SQL 2005 64 bit.
> I have made a new fresh setup (everything is in 64 bit version) on a brand
> new machine with 6Gigs of RAM, still when I display server's properties,
> in
> the memory section, in the textbox under Max Server memory
> I have 2147483647, which I think is 2 G
> Thanks|||Hi Salam,
As other members have mentioned, the 2147483647 default value is in MB, so
it is a quite large value( you need to reduce it according to your
machine's physical memory).
As for AWE, it is an operating system feature and is only useful when the
virtual address space(of OS process) is less than the available physical
memory. For SQL server 2005 64 bit on windows 2003 64 bit, there is no
such virtual address space limitation(normally virtual address space is
much larger than available physical memory space). also, it is recommended
that we adjust the SQL Server instance's max server memory to a proper
value so that other applications on the server can also get sufficient
physical memory for paging file switch.
#Enabling AWE Memory for SQL Server
http://msdn2.microsoft.com/en-us/library/ms190673.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Salam,
Have you got any further idea on this issue? Please feel free to post here
if there is anything else we can help.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

6G Ram but SQL doesn't make use of it by default

If I setup SQL 2005 64 bit on a win2k3 64 bit, do I need to enable/disable
AWE as for other versions or it is managed dynamically by SQL 2005 64 bit.
I have made a new fresh setup (everything is in 64 bit version) on a brand
new machine with 6Gigs of RAM, still when I display server's properties, in
the memory section, in the textbox under Max Server memory
I have 2147483647, which I think is 2 G
ThanksYou shouldn't have to do any config on a 64 bit SS on a 64 bit machine for using > 2GB memory.
> I have 2147483647, which I think is 2 G
No, that number is in MB:
2147483647 MB
= 2097151 GB
= 2047 TB
= approx 2 PB (it is Peta or Exa?)
No discussion on memory and 64 bit is complete without referring to Slava Oks blogs. In short,
consider using lock pages in memory also on 64 bit (if my memory serves me):
http://blogs.msdn.com/slavao/archive/category/9043.aspx
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"SalamElias" <eliassal@.online.nospam> wrote in message
news:60DD00FD-BFA2-4A68-B6B5-142E8B895D45@.microsoft.com...
> If I setup SQL 2005 64 bit on a win2k3 64 bit, do I need to enable/disable
> AWE as for other versions or it is managed dynamically by SQL 2005 64 bit.
> I have made a new fresh setup (everything is in 64 bit version) on a brand
> new machine with 6Gigs of RAM, still when I display server's properties, in
> the memory section, in the textbox under Max Server memory
> I have 2147483647, which I think is 2 G
> Thanks|||2147483647 is much more than 2GB... 1024 = 1GB
--
Keith Kratochvil
"SalamElias" <eliassal@.online.nospam> wrote in message
news:60DD00FD-BFA2-4A68-B6B5-142E8B895D45@.microsoft.com...
> If I setup SQL 2005 64 bit on a win2k3 64 bit, do I need to enable/disable
> AWE as for other versions or it is managed dynamically by SQL 2005 64 bit.
> I have made a new fresh setup (everything is in 64 bit version) on a brand
> new machine with 6Gigs of RAM, still when I display server's properties,
> in
> the memory section, in the textbox under Max Server memory
> I have 2147483647, which I think is 2 G
> Thanks|||Hi Salam,
As other members have mentioned, the 2147483647 default value is in MB, so
it is a quite large value( you need to reduce it according to your
machine's physical memory).
As for AWE, it is an operating system feature and is only useful when the
virtual address space(of OS process) is less than the available physical
memory. For SQL server 2005 64 bit on windows 2003 64 bit, there is no
such virtual address space limitation(normally virtual address space is
much larger than available physical memory space). also, it is recommended
that we adjust the SQL Server instance's max server memory to a proper
value so that other applications on the server can also get sufficient
physical memory for paging file switch.
#Enabling AWE Memory for SQL Server
http://msdn2.microsoft.com/en-us/library/ms190673.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Salam,
Have you got any further idea on this issue? Please feel free to post here
if there is anything else we can help.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Friday, February 24, 2012

64 bit and max server memory

Do we still need to put a cap to the max server memory settings for SQL on a
64 bit machine or just leave it to the default ?The guideline on setting Max Server Memory doesn't change whether it's 32-bit
or 64-bit.
Linchi
"Hassan" wrote:
> Do we still need to put a cap to the max server memory settings for SQL on a
> 64 bit machine or just leave it to the default ?
>
>

Thursday, February 16, 2012

4K block size vs something higher

It appears the the default block size is 4K. Is it worth increasing the size
? Pros and cons ...
Hassan
Blocks are in Oracle , did you mean Pages? It is 8096 KB
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>
|||You can find some information on this in the Operations
Guide - check the Windows NT File System (NTFS) Allocation
Unit section:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlops6.mspx
-Sue
On Sat, 4 Nov 2006 23:58:43 -0800, "Hassan"
<Hassan@.hotmail.com> wrote:

>It appears the the default block size is 4K. Is it worth increasing the size
>? Pros and cons ...
>
|||Im talking about block size on hard disks that the OS uses to write data to.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyyzhFLAHHA.4808@.TK2MSFTNGP03.phx.gbl...
> Hassan
> Blocks are in Oracle , did you mean Pages? It is 8096 KB
>
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
>
|||Hi Hassan,
Guidance is that you match the allocation size with the stripe size of the
array/lun you are using.
In reality I've yet to see a benchmark that its actually made a difference
on!
I tend to make it 64KB on drives that only SQL data is stored on (or larger
files); essentially if you have a lot of little couple of KB files then each
file will take up a minimum of 64KB so if you have 10's of thousands of
files then you'll waste a massive amount of space.
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>

4K block size vs something higher

It appears the the default block size is 4K. Is it worth increasing the size
? Pros and cons ...Hassan
Blocks are in Oracle , did you mean Pages? It is 8096 KB
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>|||I think you are talking about NTFS Allocation Unit Size (correct me if I
am wrong).
If this is the case then the answer is yes.
Pro's: If you increase it to 8K, a complete page is read in one action.
Con's: If you are using the drive also for other programs, you be reaing
to much in an action, and lose a lot of disk space if you write al lot
of small files.
Hassan wrote:
> It appears the the default block size is 4K. Is it worth increasing the si
ze
> ? Pros and cons ...
>|||You can find some information on this in the Operations
Guide - check the Windows NT File System (NTFS) Allocation
Unit section:
http://www.microsoft.com/technet/pr...in/sqlops6.mspx
-Sue
On Sat, 4 Nov 2006 23:58:43 -0800, "Hassan"
<Hassan@.hotmail.com> wrote:

>It appears the the default block size is 4K. Is it worth increasing the siz
e
>? Pros and cons ...
>|||Im talking about block size on hard disks that the OS uses to write data to.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyyzhFLAHHA.4808@.TK2MSFTNGP03.phx.gbl...
> Hassan
> Blocks are in Oracle , did you mean Pages? It is 8096 KB
>
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
>|||Hi Hassan,
Guidance is that you match the allocation size with the stripe size of the
array/lun you are using.
In reality I've yet to see a benchmark that its actually made a difference
on!
I tend to make it 64KB on drives that only SQL data is stored on (or larger
files); essentially if you have a lot of little couple of KB files then each
file will take up a minimum of 64KB so if you have 10's of thousands of
files then you'll waste a massive amount of space.
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>

4K block size vs something higher

It appears the the default block size is 4K. Is it worth increasing the size
? Pros and cons ...Hassan
Blocks are in Oracle , did you mean Pages? It is 8096 KB
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>|||I think you are talking about NTFS Allocation Unit Size (correct me if I
am wrong).
If this is the case then the answer is yes.
Pro's: If you increase it to 8K, a complete page is read in one action.
Con's: If you are using the drive also for other programs, you be reaing
to much in an action, and lose a lot of disk space if you write al lot
of small files.
Hassan wrote:
> It appears the the default block size is 4K. Is it worth increasing the size
> ? Pros and cons ...
>|||You can find some information on this in the Operations
Guide - check the Windows NT File System (NTFS) Allocation
Unit section:
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlops6.mspx
-Sue
On Sat, 4 Nov 2006 23:58:43 -0800, "Hassan"
<Hassan@.hotmail.com> wrote:
>It appears the the default block size is 4K. Is it worth increasing the size
>? Pros and cons ...
>|||Im talking about block size on hard disks that the OS uses to write data to.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyyzhFLAHHA.4808@.TK2MSFTNGP03.phx.gbl...
> Hassan
> Blocks are in Oracle , did you mean Pages? It is 8096 KB
>
> "Hassan" <Hassan@.hotmail.com> wrote in message
> news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
>> It appears the the default block size is 4K. Is it worth increasing the
>> size ? Pros and cons ...
>|||Hi Hassan,
Guidance is that you match the allocation size with the stripe size of the
array/lun you are using.
In reality I've yet to see a benchmark that its actually made a difference
on!
I tend to make it 64KB on drives that only SQL data is stored on (or larger
files); essentially if you have a lot of little couple of KB files then each
file will take up a minimum of 64KB so if you have 10's of thousands of
files then you'll waste a massive amount of space.
--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Hassan" <Hassan@.hotmail.com> wrote in message
news:%23Zzy3ALAHHA.204@.TK2MSFTNGP04.phx.gbl...
> It appears the the default block size is 4K. Is it worth increasing the
> size ? Pros and cons ...
>

Thursday, February 9, 2012

3753 Provider is not specified and there is no designated default provider.

i just bought a brand new server and put windows server 2003 x64 sp1 on it then put sql server 2000 sp4 on that and set up a trusted odbc connection. however, it gave me the following error:
SQLSTATE:IM002, diagnosis:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
so i made a vbs file (adodb.connection) to see if that could connect to it and it came out with this on the err.number err.description
err.number = 3753
err.description = Provider is not specified and there is no designated default provider.
this even happened when i tried to use a dsnless connection to the old server machine so i dont know if its a problem with whatever is trying to use the connection or odbc or what. please can someone tell me what can i do to fix this problem?
i dont know if this is just a missing driver or something, odbc only has "SQL Server" in the list (C:\WINDOWS\System32\SQLSRV32.dll i think) wheras all my other machines have something like 25 or 30 drivers in the list, but "SQL Server" is the one im trying to use anyway..
edit: iis is not installed on this new server. other machines (with iis and vbs) can connect using dsnless or dsn with uid and pwd. also i think asp might have a different err.number for this problem than vbs' 3753

Due to the length of time since this issue was posted, I'm marking it as resolved. If you're still in need of help, please respond here.

Paul

3753 Provider is not specified and there is no designated default provider.

i just bought a brand new server and put windows server 2003 x64 sp1 on it then put sql server 2000 sp4 on that and set up a trusted odbc connection. however, it gave me the following error:
SQLSTATE:IM002, diagnosis:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
so i made a vbs file (adodb.connection) to see if that could connect to it and it came out with this on the err.number err.description
err.number = 3753
err.description = Provider is not specified and there is no designated default provider.
this even happened when i tried to use a dsnless connection to the old server machine so i dont know if its a problem with whatever is trying to use the connection or odbc or what. please can someone tell me what can i do to fix this problem?
i dont know if this is just a missing driver or something, odbc only has "SQL Server" in the list (C:\WINDOWS\System32\SQLSRV32.dll i think) wheras all my other machines have something like 25 or 30 drivers in the list, but "SQL Server" is the one im trying to use anyway..
edit: iis is not installed on this new server. other machines (with iis and vbs) can connect using dsnless or dsn with uid and pwd. also i think asp might have a different err.number for this problem than vbs' 3753

Due to the length of time since this issue was posted, I'm marking it as resolved. If you're still in need of help, please respond here.

Paul