Showing posts with label client. Show all posts
Showing posts with label client. Show all posts

Thursday, March 29, 2012

Hooking old apps to SQL 2005

We would like to have our old apps talk with SQL 2005. What do I have to do
to make that happen. I have installed the SQL 2005 native client, and
defined an alias to the SQL Server. I still get connection errors so
obviously I have not done enough to set this up, or it can't be done .
Can someone direct me to some documentation or explain how to do this?
Thanks.
BarryNevermind, got it working
"barryfz" <barry@.noemail.noemail> wrote in message
news:u5NWWks7FHA.4076@.tk2msftngp13.phx.gbl...
> We would like to have our old apps talk with SQL 2005. What do I have to
> do to make that happen. I have installed the SQL 2005 native client, and
> defined an alias to the SQL Server. I still get connection errors so
> obviously I have not done enough to set this up, or it can't be done .
> Can someone direct me to some documentation or explain how to do this?
> Thanks.
> --
> Barry
>|||Would you be willing to post the results so we can see how you did it?
--
burt_king@.yahoo.com
"barryfz" wrote:

> Nevermind, got it working
>
> "barryfz" <barry@.noemail.noemail> wrote in message
> news:u5NWWks7FHA.4076@.tk2msftngp13.phx.gbl...
>
>

Friday, March 23, 2012

highly appreciated.

I am trying to connect the named instance from my client computer... I can
easily connect the default instance of my remote machine but when I tried to
connect through named instance it gave me an error that SQL Server doesn't
exist or access denied...
In the client network utility I have defined the IP and alias of that server
but failed to connect.
Can any one give their expert idea.
Thanks
Roy wrote:
> I am trying to connect the named instance from my client computer...
> I can easily connect the default instance of my remote machine but
> when I tried to connect through named instance it gave me an error
> that SQL Server doesn't exist or access denied...
> In the client network utility I have defined the IP and alias of that
> server but failed to connect.
> Can any one give their expert idea.
> Thanks
Why are you defining an alias? Was it because you had no luck connecting
using the named instance? The named instance runs on a different port
than the default 1433. I think it might use 1434, but am not sure. Try
using the instance name first before resorting to using an alias. For
example, if you remote computer name is MY_COMPUTER and the named
instance is SQL2, try the following as the server name:
MY_COMPUTER\SQL2
If you still have trouble, it could be a firewall issue. Try temporarily
disabling any firewall software and see if that helps.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||First of all David, thanks for your reply...
I am at client computer and how client computer diagnose MY_COMPUTER\SQL2
until and unless I have to mention that the ip which is running behind the
MY_Computer... this My_Computer doesn't exist on the network... that's why I
have to mention this My_Computer IP in the client network utility so that it
can easily diagnose it... I am mentioning you what I did for connecting named
instance... if I am wrong then please correct me...
Step 1: I did findout the port No of named instance through SQL Server
Network Utility that was 1434 right.
Step 2: I have mantioned that port and IP in client network utility like
Netowork Utility > Alias >
Alias: RemoteServer
Server: 209.45.23.55
Port : 1434
Protocol: TCP/IP
when I registered this named instance server through enterprise manager I
have defiled RemoteServer/Instancename and then trying to connect but
failed... sql server doesn't exist or access denied...
David, as you said I have to connect simply through MY_COMPUTER\SQL2 but how
my client machine know MY_Computer IP ?
I hope you understand what I wanna tell you... I would really appreciate if
you reply me ASAP... thanks and have a great day,
"David Gugick" wrote:

> Roy wrote:
> Why are you defining an alias? Was it because you had no luck connecting
> using the named instance? The named instance runs on a different port
> than the default 1433. I think it might use 1434, but am not sure. Try
> using the instance name first before resorting to using an alias. For
> example, if you remote computer name is MY_COMPUTER and the named
> instance is SQL2, try the following as the server name:
> MY_COMPUTER\SQL2
> If you still have trouble, it could be a firewall issue. Try temporarily
> disabling any firewall software and see if that helps.
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>
|||David, what I am thinking right now... do I need to create linked server
before registering the named instance on my machine ?
"David Gugick" wrote:

> Roy wrote:
> Why are you defining an alias? Was it because you had no luck connecting
> using the named instance? The named instance runs on a different port
> than the default 1433. I think it might use 1434, but am not sure. Try
> using the instance name first before resorting to using an alias. For
> example, if you remote computer name is MY_COMPUTER and the named
> instance is SQL2, try the following as the server name:
> MY_COMPUTER\SQL2
> If you still have trouble, it could be a firewall issue. Try temporarily
> disabling any firewall software and see if that helps.
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>
|||Rogers wrote:
> David, what I am thinking right now... do I need to create linked
> server before registering the named instance on my machine ?
>
If you're just connecting over the internet (which I assume from your
last post that you are), you're correct that you'll need to use the IP
address. This just makes me think there's a firewall issue on the remote
PC or remote network preventing communications on that IP over port
1434. To determine this, you could swap ports on the remote server and
make the named instance 1433 and cycle the SQL Server. If you then
connect to the named instance, you'll know it's a firewall issue.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||David, you are very right but how can I change the port of default instance
to 1434 and named instance to 1433 ... basically this is our production
machine and couple of databases are running to hit default instance.. what u
think if i do this then all would be in trouble right...
Looking forward to your reply.
Thanks
"David Gugick" wrote:

> Rogers wrote:
> If you're just connecting over the internet (which I assume from your
> last post that you are), you're correct that you'll need to use the IP
> address. This just makes me think there's a firewall issue on the remote
> PC or remote network preventing communications on that IP over port
> 1434. To determine this, you could swap ports on the remote server and
> make the named instance 1433 and cycle the SQL Server. If you then
> connect to the named instance, you'll know it's a firewall issue.
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>
|||Rogers wrote:
> David, you are very right but how can I change the port of default
> instance to 1434 and named instance to 1433 ... basically this is our
> production machine and couple of databases are running to hit default
> instance.. what u think if i do this then all would be in trouble
> right...
>
Talk to your network guys and see if the firewall is in play.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Alright..... David, tell me one thing just for information... we can change
the default and named instance port through sql server network utilities
right ?
Thanks and looking forward to your reply
thanks david !
"David Gugick" wrote:

> Rogers wrote:
> Talk to your network guys and see if the firewall is in play.
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>
|||Rogers wrote:
> Alright..... David, tell me one thing just for information... we can
> change the default and named instance port through sql server network
> utilities right ?
> Thanks and looking forward to your reply
You should be able to, but since your default instance is an in-use
production database, I'd caution doing so during production hours.
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Yes but if both the databases are not in used then I can change the port of
named and default instance right through SQL Server Network Utlitiy .
Thanks
"David Gugick" wrote:

> Rogers wrote:
> You should be able to, but since your default instance is an in-use
> production database, I'd caution doing so during production hours.
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>

Higher Level Edition Error Message

Hello all,

I just installed the June CTP Client Tools on a fresh hard drive (no previous CTPs installed). I am trying to run a package that was written in the April CTP and runs successfully on other computers with the June CTP installed.

When I run the package, it fails on an 'Execute Package Task', and I get the error message:
"The task cannot run on this edition of Integration Services. It requires a higher level edition."

I know the package is okay because it runs on other June CTP computers. Did I miss something in my install? Any suggestions?

Thanks for your time,
Jessica
Did you install SSIS on the PC in question or just tools. If just the tools then that is your problem as you must install SSIS in order to run packages outside of the designer. As a workaround you can set the execute package task to run in process instead of out of process and that will also allow the package to run. We have changed the default from out of process to in process for the next CTP to try and mitigate this issue somewhat, although running outside of the designer still won't work but that is by design.

HTH,|||That was the problem!

Thanks!
Jessica

High security Needs, Cheep Clients, Need Help

I have an existing server hosting several sites with associated back end
databases.
I have a new client who needs secure hosting solutions, including a secure
database, without the expense of a new server. I was thinking of the
following architecture. I know some ( most ) of this is not SQL related,
but bear with me please.
I am hosting web services on the server to provide the interface with the
external world. End-Use clients will have applications with certificates to
access these web services. I have two instances of SQL Server 2005 running,
MYSERVER\PUBLIC & MYSERVER\PRIVATE.
MYSERVER\PUBLIC contains all my existing, non-secure, databases plus some
info relevant to the new service which need not be secure.
MYSERVER\PRIVATE will contain all the new, to be secured, data.
MYSERVER\PRIVATE listens only on TCPIP Address 127.0.0.1, so should be
available only as 'localhost' from within the server, i.e. not be public to
the outside world. My web services should be able to access this data, and
the web services will only be accessible to these signed applications. Of
course, any relevant info would be encrypted.
Is this sufficient ?
Any input would be appreciated
Thanks
PhilYou have to make sure that you are using different service accounts for each
instance otherwise someone gaining elevated rights within one instance will
be able to get to the other instance. Additionally, you should not allow
any SQL logins to either instance. The web server should be configured to
connect to the instances using Windows credentials which forces anyone who
can not authenticate in Windows to not have access to either database
instance. The IIS server needs to be locked down to ensure that you don't
have any security holes. The service accounts for each instance should be
regular Windows accounts and NOT a member of local administrators or even
worse domain/enterprise administrators.
After accomplishing that, you pretty much have the front door closed. Now
you have to worry about all of the back end stuff. How are you going to
handle backups of the databases such that the data in your secure instance
remains secure even through the backup files? How are you going to control
administrator and developer access within your company to the secured
instance? How are you going to audit the operations within the secure
instance such that your customer on this secure instance can't create a
situation where they actually damaged data or caused the security to be
compromised, but are pointing the finger at you?
Mike
MHS Enterprises, Inc
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Phil" <prounds@.cassandragroup.com> wrote in message
news:eFeo0WchGHA.4080@.TK2MSFTNGP03.phx.gbl...
>I have an existing server hosting several sites with associated back end
>databases.
> I have a new client who needs secure hosting solutions, including a secure
> database, without the expense of a new server. I was thinking of the
> following architecture. I know some ( most ) of this is not SQL related,
> but bear with me please.
> I am hosting web services on the server to provide the interface with the
> external world. End-Use clients will have applications with certificates
> to access these web services. I have two instances of SQL Server 2005
> running, MYSERVER\PUBLIC & MYSERVER\PRIVATE.
> MYSERVER\PUBLIC contains all my existing, non-secure, databases plus some
> info relevant to the new service which need not be secure.
> MYSERVER\PRIVATE will contain all the new, to be secured, data.
> MYSERVER\PRIVATE listens only on TCPIP Address 127.0.0.1, so should be
> available only as 'localhost' from within the server, i.e. not be public
> to the outside world. My web services should be able to access this data,
> and the web services will only be accessible to these signed applications.
> Of course, any relevant info would be encrypted.
> Is this sufficient ?
> Any input would be appreciated
> Thanks
> Phil
>|||"Phil" <prounds@.cassandragroup.com> wrote in message
news:eFeo0WchGHA.4080@.TK2MSFTNGP03.phx.gbl...
>I have an existing server hosting several sites with associated back end
>databases.
> I have a new client who needs secure hosting solutions, including a secure
> database, without the expense of a new server. I was thinking of the
> following architecture. I know some ( most ) of this is not SQL related,
> but bear with me please.
> I am hosting web services on the server to provide the interface with the
> external world. End-Use clients will have applications with certificates
> to access these web services. I have two instances of SQL Server 2005
> running, MYSERVER\PUBLIC & MYSERVER\PRIVATE.
> MYSERVER\PUBLIC contains all my existing, non-secure, databases plus some
> info relevant to the new service which need not be secure.
> MYSERVER\PRIVATE will contain all the new, to be secured, data.
> MYSERVER\PRIVATE listens only on TCPIP Address 127.0.0.1, so should be
> available only as 'localhost' from within the server, i.e. not be public
> to the outside world. My web services should be able to access this data,
> and the web services will only be accessible to these signed applications.
> Of course, any relevant info would be encrypted.
> Is this sufficient ?
>
Can't tell if it's sufficient, but it should work.
Also don't even need to enable TCP/IP for the PRIVATE instance. Programs
running on the same box can use the shared memory provider, which only works
locally. Also make sure to put the private web apps in their own
application pool (or web site), and use a seperate set of Windows accounts
to run the secure web apps, connect to SQL and as the SQL Service account.
Segegate the data and use NTFS permissions to restrict read/write to the
database files, logs and backups.
David

Wednesday, March 21, 2012

High load SqlServer failes throwing error 3926 - what is that?

It manisfests itself in our SqlClient use (i.e. .NET 2.0) on one client side only...

with dozens of messages like:

ASP.global_asax - System.Data.SqlClient.SqlException : Server failed to resume the transaction, desc: 3500000c5b.

The transaction active in this session has been committed or aborted by another session.

That poins to SQL Server error 3926.

But I have NO clue how that comes. Anyone an idea? The code works flawless under dozens of other systems.

This looks like a exception throwed by SQL engine.

Guess what - it is SQL Error 3926 indicated by SQL Server. I already found that out and I already said so.

From "The transaction active in this session has been committed or aborted by another session.", I think more than one session in your application are accessing one transaction.

No chance. Here is the problem. I have, in the complete application, exactly 8 methods that do SQL processing. EVERY ONE of them:

* Gets a connection
* Establishes a transaction
* does it's job
* Closes the transaction
* Closes the connection

There is no open transaction ever left. All conenctions are properly disposed in a finally clause of a try/catch block in the method.

In fact, all my methods look like this:

Start:

IDbConnection connection = GetConnection ();
IDbTransaction txn = null;
if (System.Transactions.Transaction.Current == null) {
txn = connection.BeginTransaction ();
}
try {

processing

} finally {
if (txn == null) {
txn.Rollback ();
txn.Dispose ();
txn = null;
}
if (connection != null) {
connection.Close ();
connection.Dispose ();
connection = null;
}

If an error would happen in the finally block, I would see it. This is the pattern ALL my methods follow. This is the only location I actually open a connection. And I have a total of 8 methods that actually use the GetConnection method - and all run through the same pattern.

That is why I am ripping my hairs out. We DO close all transactions. I do NOT reuse transactions. This stuff is as simple as it gets. How the heck CAN anything go wrong here?

Normally, you can take a sql profiler trace to find out why.

Did you actually ever try that? I said "under high load". That server is basically like processing 2000 or so sql statements a SECOND for minutes before that thing slowly starts to materialize. The error does NOT appear under low or medium load. As a matter of fact, I have been unsuccessfull in replicating it in the lab. I get it on one customer's system, and I get it occasionally on one of our hosting systems for one customer (who uses a lot of ressources). It is critical for the one customer with his own system, because I sometimes get 10 or so of those a minute. In both scenarios where the error happens I can not turn on tracing for obvious reasons. And again, in the lab I was not successfull replicating it.

But I simply am totally our of ideas on what causes this. It should just not happen.

|||Did anybody solve this problem ?

High load SqlServer failes throwing error 3926 - what is that?

It manisfests itself in our SqlClient use (i.e. .NET 2.0) on one client side only...

with dozens of messages like:

ASP.global_asax - System.Data.SqlClient.SqlException : Server failed to resume the transaction, desc: 3500000c5b.

The transaction active in this session has been committed or aborted by another session.

That poins to SQL Server error 3926.

But I have NO clue how that comes. Anyone an idea? The code works flawless under dozens of other systems.

This looks like a exception throwed by SQL engine.

Guess what - it is SQL Error 3926 indicated by SQL Server. I already found that out and I already said so.

From "The transaction active in this session has been committed or aborted by another session.", I think more than one session in your application are accessing one transaction.

No chance. Here is the problem. I have, in the complete application, exactly 8 methods that do SQL processing. EVERY ONE of them:

* Gets a connection
* Establishes a transaction
* does it's job
* Closes the transaction
* Closes the connection

There is no open transaction ever left. All conenctions are properly disposed in a finally clause of a try/catch block in the method.

In fact, all my methods look like this:

Start:

IDbConnection connection = GetConnection ();
IDbTransaction txn = null;
if (System.Transactions.Transaction.Current == null) {
txn = connection.BeginTransaction ();
}
try {

processing

} finally {
if (txn == null) {
txn.Rollback ();
txn.Dispose ();
txn = null;
}
if (connection != null) {
connection.Close ();
connection.Dispose ();
connection = null;
}

If an error would happen in the finally block, I would see it. This is the pattern ALL my methods follow. This is the only location I actually open a connection. And I have a total of 8 methods that actually use the GetConnection method - and all run through the same pattern.

That is why I am ripping my hairs out. We DO close all transactions. I do NOT reuse transactions. This stuff is as simple as it gets. How the heck CAN anything go wrong here?

Normally, you can take a sql profiler trace to find out why.

Did you actually ever try that? I said "under high load". That server is basically like processing 2000 or so sql statements a SECOND for minutes before that thing slowly starts to materialize. The error does NOT appear under low or medium load. As a matter of fact, I have been unsuccessfull in replicating it in the lab. I get it on one customer's system, and I get it occasionally on one of our hosting systems for one customer (who uses a lot of ressources). It is critical for the one customer with his own system, because I sometimes get 10 or so of those a minute. In both scenarios where the error happens I can not turn on tracing for obvious reasons. And again, in the lab I was not successfull replicating it.

But I simply am totally our of ideas on what causes this. It should just not happen.

|||Did anybody solve this problem ?
sql

Monday, March 12, 2012

High CPU

I have a client that is experiencing high CPU. In their word
everything was OK until a couple of weeks ago. It was around 50% and
then it jumped to 100%. At that point, they have:
=95 released a new version of the product
=95 upgraded server to Cumulative Update 5
=95 made a change on the way that they are doing connection pooling
=95 They are also getting (daily) new customers
Scenario
They have hosted system that collects data from wireless devices
(through MSMQ) and Windows clients that are monitoring the state by
refreshing screen every 30 sec - 5 min. From 9 - 5 they are not able
to cope with the load.
At the time the problem occurred they had around 700 customers and
corresponding databases. Now they have more (around 900).
SQL Server 2005 EE 32-bit, 4 (2x2) CPUs, 12 GB RAM
Investigating Changes
We have tried to investigate changes that they made.
I have reviewed changes that they made in the database and there is
nothing that draws attention. We have tried to disable some features
but we didn't see much impact.
They have rolled back Cumulative Update 5. Again with no visible
impact.
Originally their db connections were going directly to customer
databases. In new release, they are executing everything though master
database:
Exec DB0234.dbo.spBlaBla
They have rolled back this change - still CPU is pegged 9-5.
Investigating
Compilation
We have looked into this. There is around 600 batches (sps) executed
per sec. We have < 10 % of compilations. I've found somewhere that
that is acceptable.
Also our Cash hit ratio for SQL Server objects is over 90%.
Re-compilation
We looked into this. Very low.
IO optimizations
We spent lot of time on this. There were sps that we were able to
optimize dramatically. Typically by rewriting queries or by replacing
indexes by better ones.
Locking and blocking
We looked into this. We are under impression that this is not a
problem. We do not see excessive blocking and on top of them all
readers are running with nolocks hint anyway.
CPU Pressure
We do believe that we would do better with more CPUs.
signal_wait_time_ms %signal (cpu) waits resource_wait_time_ms
%resource waits
-- -- --
--
14801338 37.32 24863340 62.68
"In conclusion, if Signal Waits are a significant percentage of total
waits, you have CPU pressure which may be alleviated by faster or more
CPUs."
Two highest wait types that we are seeing are sos_scheduler_yield and
sos_scheduler_yield. They are also indication of CPU pressure.
It is relatively simple to put this on faster server. In fact they are
planning to do that this weekend. Instead of 4 (2x2) CPU (32-bit) we
will have 8 (2x4) CPUs (64-bit). However, we are concerned that it may
not be enough. Or that we may have the same problem in two months. We
also cannot explain why it jumped from around 50% to 100%.
What are we missing? Any ideas?
Dejan265I would try to find out the queries that the top CPU consumers. If you are
running SP2 or later, Performance Dashboard is quick and dirty for this.
Linchi
"dejan265@.gmail.com" wrote:
> I have a client that is experiencing high CPU. In their word
> everything was OK until a couple of weeks ago. It was around 50% and
> then it jumped to 100%. At that point, they have:
> â?¢ released a new version of the product
> â?¢ upgraded server to Cumulative Update 5
> â?¢ made a change on the way that they are doing connection pooling
> â?¢ They are also getting (daily) new customers
> Scenario
> They have hosted system that collects data from wireless devices
> (through MSMQ) and Windows clients that are monitoring the state by
> refreshing screen every 30 sec - 5 min. From 9 - 5 they are not able
> to cope with the load.
> At the time the problem occurred they had around 700 customers and
> corresponding databases. Now they have more (around 900).
> SQL Server 2005 EE 32-bit, 4 (2x2) CPUs, 12 GB RAM
> Investigating Changes
> We have tried to investigate changes that they made.
> I have reviewed changes that they made in the database and there is
> nothing that draws attention. We have tried to disable some features
> but we didn't see much impact.
> They have rolled back Cumulative Update 5. Again with no visible
> impact.
> Originally their db connections were going directly to customer
> databases. In new release, they are executing everything though master
> database:
> Exec DB0234.dbo.spBlaBla
> They have rolled back this change - still CPU is pegged 9-5.
>
> Investigating
> Compilation
> We have looked into this. There is around 600 batches (sps) executed
> per sec. We have < 10 % of compilations. I've found somewhere that
> that is acceptable.
> Also our Cash hit ratio for SQL Server objects is over 90%.
> Re-compilation
> We looked into this. Very low.
> IO optimizations
> We spent lot of time on this. There were sps that we were able to
> optimize dramatically. Typically by rewriting queries or by replacing
> indexes by better ones.
> Locking and blocking
> We looked into this. We are under impression that this is not a
> problem. We do not see excessive blocking and on top of them all
> readers are running with nolocks hint anyway.
> CPU Pressure
> We do believe that we would do better with more CPUs.
> signal_wait_time_ms %signal (cpu) waits resource_wait_time_ms
> %resource waits
> -- -- --
> --
> 14801338 37.32 24863340 62.68
> "In conclusion, if Signal Waits are a significant percentage of total
> waits, you have CPU pressure which may be alleviated by faster or more
> CPUs."
> Two highest wait types that we are seeing are sos_scheduler_yield and
> sos_scheduler_yield. They are also indication of CPU pressure.
> It is relatively simple to put this on faster server. In fact they are
> planning to do that this weekend. Instead of 4 (2x2) CPU (32-bit) we
> will have 8 (2x4) CPUs (64-bit). However, we are concerned that it may
> not be enough. Or that we may have the same problem in two months. We
> also cannot explain why it jumped from around 50% to 100%.
> What are we missing? Any ideas?
> Dejan265
>|||> Or that we may have the same problem in two months. We
> also cannot explain why it jumped from around 50% to 100%.
> What are we missing? Any ideas?
I have been in a similar case once, and I have 2 ideas that was an issue in
my case.
1. Fragmented indexes. Are you regularly reorganizing/rebuilding your
indices? If not, it could be because of indexes being very fragmented. You
can take a look at sys.dm_db_index_physical_stats to see the general state
of your index fragmentation. I use this rule of thumb: If the index has more
than 500 pages in it (the page_count column), and if the physical
fragmentation is above 20, then I rebuild the index. I found an index on one
of our very hot tables, that were 99% fragmented. After rebuilding that
index, the cpu instantly dropped to normal.
2. I have also been in situtuations, where the query optimizer unfortunately
compiles an ineffective execution plan, making some queries take 100 ms
insted of the 0.1 ms they used to do. If such a query are called 10-20 times
pr. sec, then it COULD make the cpu jump to a 100%. To see if this is the
case, you can take a look at the plan cache dmv (I cannot remenber the exact
name, but it should be possible to find via google). The plan cache dmv has
a plan_handle, that can be used in an other dmf to lookup the
execution_sql - wich will give you the exact sql statement of the query. And
the last dmv to look at, has the statistics of plan use. It will show stats
about when the plan was created, how many times it has been used since the
creation time, what the avg cpu time, duration, logical reads and so on are.
Then you can look at those queries taking up the most cpu-time in total, or
those queries that are called ie 100 times pr sec.
In my case we had a sp's having an avg cpu time of 150ms, that only should
take 2-3 ms. I recompiled the execution plan for that sp via "sp_recompile
myStoredProcedure", and the cpu load dropped instantly.
I have a query that can be used to join these dmv's, but it's on my other
computer. I will find it later today, and post the code here.
The reason for the cpu load, could be a lot of other things. These to things
are just what I have experienced, wich made the cpu load jump.
Linchi Shea suggested to look at the Performance Dashboard, if you are on a
SQL 2005 SP2. If you are, this custom report COULD give you some of the
answers.
/Sjang|||> I have a query that can be used to join these dmv's, but it's on my other
> computer. I will find it later today, and post the code here.
I came to think of a thing.
IF the problem is because of a bad execution plan, and IF you are willing to
do a very dirty trick, AND if you can live with the system being even more
slow for af few minutes, THEN you could flush the whole procedure cache,
making them all recompile. You can do this by "DBCC FREEPROCCACHE". BUT BUT
BUT!! Be aware, that this makes every stored procedure recompile once,
giving a overhead for a few minutes - until all procedures again can be used
from the cache.
It's a dirty trick, I know, but IF the cpu problem is related to this issue,
THEN it could be an easy fix
/Sjang|||> I have a query that can be used to join these dmv's, but it's on my other
> computer. I will find it later today, and post the code here.
Here is the code I have used. Tweak it as you like:
WITH queryCTE
AS
(
SELECT
t1.plan_handle,
MAX(text) AS sql_text,
MIN(creation_time) AS plan_creation_date,
MAX(last_execution_time) AS last_execution_date,
MIN(execution_count) AS number_of_executions,
SUM(last_worker_time)/1000.0 AS last_cpu_time_in_ms, --the dmv returns the
time i micro seconds.
SUM(total_worker_time)/MIN(execution_count)/1000.0 As
avg_cpu_time_in_ms, --some sql steps are executed several times in a batch.
ie in a cursor loop.
SUM(total_worker_time)/1000.0 As total_cpu_time_in_ms, --the dmv returns the
time i micro seconds.
SUM(last_elapsed_time)/1000.0 AS last_duration_in_ms, --the dmv returns the
time i micro seconds.
SUM(total_elapsed_time)/MIN(execution_count)/1000.0 AS
avg_duration_in_ms, --some sql steps are executed several times in a batch.
ie in a cursor loop.
SUM(total_elapsed_time)/1000.0 AS total_duration_in_ms, --the dmv returns
the time i micro seconds.
SUM(last_logical_reads) AS last_logical_reads,
SUM(total_logical_reads)/MIN(execution_count) AS avg_logical_reads,
SUM(total_logical_reads) AS total_logical_reads
FROM
sys.dm_exec_cached_plans t1
LEFT JOIN sys.dm_exec_query_stats t2 ON t1.plan_handle = t2.plan_handle
OUTER APPLY sys.dm_exec_sql_text(sql_handle) --This finds the actual sql
text.
GROUP BY t1.plan_handle --I am only interested in the top level
execution/batch. Not the actual steps in the execution.
)
SELECT
plan_handle,
query_plan,
sql_text,
t3.name as object_name,
plan_creation_date,
last_execution_date,
number_of_executions,
CASE
WHEN plan_creation_date IS NOT NULL AND DATEDIFF(ss, plan_creation_date,
last_execution_date) <> 0 THEN (number_of_executions * 1.0)/DATEDIFF(ss,
plan_creation_date, last_execution_date)
ELSE NULL END AS executions_pr_sec, --This calculates the number of
executions pr. sec
last_cpu_time_in_ms,
avg_cpu_time_in_ms,
total_cpu_time_in_ms,
last_duration_in_ms,
avg_duration_in_ms,
total_duration_in_ms,
last_logical_reads,
avg_logical_reads,
total_logical_reads,
CASE WHEN plan_creation_date IS NOT NULL AND DATEDIFF(ss,
plan_creation_date, GETDATE()) <> 0 THEN (total_cpu_time_in_ms *
1.0)/DATEDIFF(ss, plan_creation_date, GETDATE())
ELSE NULL END AS avg_cpu_time_in_ms_pr_sec -- this calculates how many ms
execution time the query takes en avg each second.
-- Be aware, that multi core cpu's can have more than a thousand ms
execution time pr. sec.
-- ie an 8 core machine would be maxed out on the cpu if the sum of
avg_cpu_time_in_ms_pr_sec is 8000.
INTO #execution_stats --We save the result in a temporary table, to do ad
hoc querys.
FROM queryCTE t1
OUTER APPLY sys.dm_exec_query_plan(plan_handle) t2 -- The reason for this
outer apply is,
-- that the resultset contains a column with the actual
-- execution plan in xml.
LEFT JOIN sys.objects t3 on t2.objectid = t3.object_id -- This gives us
information about the object_name,
-- ie the name of the stored procedure.
--Now take a look at the expensive queries:
SELECT TOP 50 *
FROM #execution_stats
WHERE sql_text NOT LIKE '%#execution_stats%' --We filter out our own
queryCTE-queries, since they are pretty heavy
ORDER BY avg_cpu_time_in_ms_pr_sec DESC
SELECT TOP 50 *
FROM #execution_stats
WHERE sql_text NOT LIKE '%#execution_stats%' --We filter out our own
queryCTE-queries, since they are pretty heavy
ORDER BY avg_cpu_time_in_ms DESC
SELECT TOP 50 *
FROM #execution_stats
WHERE sql_text NOT LIKE '%#execution_stats%' --We filter out our own
queryCTE-queries, since they are pretty heavy
ORDER BY avg_duration_time_in_ms DESC
SELECT TOP 50 *
FROM #execution_stats
WHERE sql_text NOT LIKE '%#execution_stats%' --We filter out our own
queryCTE-queries, since they are pretty heavy
ORDER BY avg_logical_reads DESC
-- Drops the temporary table
DROP TABLE #execution_stats
/Sjang|||This is an amazing query. thank you.
I did somethign simmilar myself.
Instead of going against queries in memory, I was recording them with
Profiler.
I stripped them from paramters and database names, so I got a list of
most expensive queries.
Than we optimizied some/many of them.
Unfortunately, CPU is still 100%.
Dejan265|||> Unfortunately, CPU is still 100%.
Have you looked at the index fragmentation?
Try this:
SELECT *
FROM sys.dm_db_index_physical_stats(null, null, null, null, null)
WHERE
page_count > 500
AND avg_fragmentation_in_percent > 20
ORDER BY avg_fragmentation_in_percent DESC
If you only have one (or few) databases on your server, you can use this
instead pr database. This gives you the name of the table and index, ordered
by the fragmentation:
USE YourDatabaseName
GO
SELECT
sys.objects.name as ObjectName,
sys.indexes.name as IndexName,
t1.*
FROM sys.dm_db_index_physical_stats(DB_ID('YourDatabaseName'), null, null,
null, NULL) t1
INNER JOIN sys.objects ON t1.object_id = sys.objects.object_id
INNER JOIN sys.indexes ON t1.object_id = sys.indexes.object_id and
t1.index_id = sys.indexes.index_id
WHERE
page_count > 500
AND avg_fragmentation_in_percent > 20
ORDER BY avg_fragmentation_in_percent DESC
/Sjang|||On May 2, 11:21=A0am, "Sjang" <sjang_remo...@.sjang.dk> wrote:
> > Unfortunately, CPU is still 100%.
> Have you looked at the index fragmentation?
We are rebuilding indexes every night.
I assume that this is not a problem.
Dejan265|||>We are rebuilding indexes every night.
>I assume that this is not a problem.
Ok.
If the jump from 50% to 100% came suddenly then I would expect something to
be wrong somewhere. But if the change came over a short time - perhaps it
could be as simple, as a general bigger workload? You say there are new
customers all the time, and I guess also more data, so the pressure on the
server should rise. Perhaps nothing special is wrong, except a too slow
server for the workload that are being thrown at it now.
/Sjang|||> If the jump from 50% to 100% came suddenly then I would expect something to
> be wrong somewhere.
They claim that it came suddenly.
Dejan265|||I tried query as well.
I got an error that there is not enaough memory to run it.
(We have 12 gb on the server, but I assume that only 3GB can be used
at one time since it's 32-bit.)
Dejan265|||You can use up to 32 GB (64 with DataCenter). In BOOT.INI, use /PAE and
reboot. Then run sp_configure 'awe', 1 to turn on AWE. Be sure to set the
max server memory, with sp_configure.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
<dejan265@.gmail.com> wrote in message
news:75e9277e-461e-4801-b604-0034590dac75@.l64g2000hse.googlegroups.com...
I tried query as well.
I got an error that there is not enaough memory to run it.
(We have 12 gb on the server, but I assume that only 3GB can be used
at one time since it's 32-bit.)
Dejan265|||> (We have 12 gb on the server, but I assume that only 3GB can be used
> at one time since it's 32-bit.)
I don't know why you think that. Unless your server is running 32-bit
Vista.
A|||On May 2, 11:31=A0am, "Aaron Bertrand [SQL Server]"
<ten...@.dnartreb.noraa> wrote:
> > (We have 12 gb on the server, but I assume that only 3GB can be used
> > at one time since it's 32-bit.)
> I don't know why you think that. =A0Unless your server is running 32-bit
> Vista.
> A
Another thought - check max degree of parallelism. If it is set to 0
- try setting it to 2 and see if that improves performance.|||It is really sounding to me like you simply need to hire consultant for a
quick performance review. Actually you should have done this long ago -
from your OP this situation has been ongoing for "a couple of weeks". I
guarantee you that any competent perf guru could isolate one or more causes
of the observed behavior in a matter of hours if not minutes.
--
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
<dejan265@.gmail.com> wrote in message
news:75e9277e-461e-4801-b604-0034590dac75@.l64g2000hse.googlegroups.com...
>I tried query as well.
> I got an error that there is not enaough memory to run it.
> (We have 12 gb on the server, but I assume that only 3GB can be used
> at one time since it's 32-bit.)
> Dejan265|||We are using AWE.
I just mean that SQL Server has to swap chunck in and out.
Dejan265|||We are using AWE.
However, it is just swapping cunks in and out from 3GB.
Dejan265|||> We are using AWE.
> However, it is just swapping cunks in and out from 3GB.
How do you know that? Are you verifying using Task Manager? Stop doing
that and use Performance Monitor. Task Manager isn't always going to be
telling the truth, even if you have correctly enabled 3GB and AWE.|||On May 2, 11:58 pm, "TheSQLGuru" <kgbo...@.earthlink.net> wrote:
> It is really sounding to me like you simply need to hire consultant for a
> quick performance review.
We were able to identify couple of dozens of procedures that we
optimized.
We made some design changes - denormalized couple of tables,add some
indexes, drop some idnexes, normalize some tables...
We reconfigured couple of things, dropped CU6,...
In some cases we were able to optimize things for an order or two of
magnitude.
And over the weekend we moved everything to a new server (this one was
more then years old).
We are able to process everything again.
I am sure that there are more things that we can optimize.
One question is will management going to see benefit in what we did or
consider everything simply as result of server upgrade.
Dejan265|||> One question is will management going to see benefit in what we did or
> consider everything simply as result of server upgrade.
If you did everything in one swoop and did not compare individual changes
independently, then no, there is no way for you to prove or disprove where
the performance gains came from.

Sunday, February 26, 2012

Hiding the DB Design.

Hi all,

I am going to install my application at my Client's place.

I do not want them to know about my DB design and also i have a lot of master information that I dont want the Client to view.

The Client insists that he would have the Super Administrator user ids and passwords (ie. "sa" - user).

Is there any way i can encrypt my DB design and the data in the DB.

Or is there any other way of restricting the Client from viewing my DB design and data?

Thanks

VishalDisallowing access to the Super User ... i dont think its possible in any system ...|||So how do i hide the DB design?
Is there any way?
May be encription?

Pls suggest...|||Not posible to hide anything from the System Admin user|||Though you may encrypt your stored procs .. decryption algorithms for those are readily availible on the net.|||Hi,

Thanks.

So there is no way that the DB design can be hidden.

Except that I hold the Super Admin password with myself?

Sunday, February 19, 2012

HideMemberIf ADOMD.NEt

Hello everyone!
I have a ragged hierarchy, and I'm using HideMemberIf = ParentName in the last level of the hierarchy (AS 2005)
I have a client application written using ADOMD.NET where I put the data into a cellset object.
The problem is that I can't differentiate when a level has this property set with adomd.net.
Could anyone help me here?
thanksThere is no way in ADOMD.NET to find out whether a level has HideMemberIf turned on.|||You can however check to see if a member is a placeholder member (that is should be hidden) by checking the IS_PLACEHOLDERMEMBER property in the properties collection. Note that this property isn't retrieved by default for members so you'll probably need to call FetchAllProperties() or request it when you fetch your members. Note that you also need to set the connection string property MDX Compatibility=1 for this IS_PLACEHOLDERMEMBER to be set.