Showing posts with label usage. Show all posts
Showing posts with label usage. Show all posts

Friday, March 30, 2012

Profiler : Getting the memory usage of a query

Hi

Im using profiler to get information about query on the server here but i cant seem to be able to get the memory usage of a query. I can acess the cpu, I/O and duration but i cant seem to be able to get that last info i need.

Is there any way for me to obtain it trough profiler?

Not through profiler nosql

Tuesday, March 20, 2012

Processor

How should I know if I need to add new processor to my Server?

During Submission of our Records every 24th day of the month the cpu usage of the server is steady 100% can you please help me what alternative can I do? or how can i check if need to add new processor.

Please help me guys.

thanks

Any sustained CPU usage exceeding 90% indicates a need for more 'processing' power.

If this ONLY occurs on the 24th day of the month, and the remainder of the time CPU utilization is lower, you have a couple of options.

Change the workload on the 24th, spread it out into several smaller 'batches'

OR

Get additional processor power (add one or more CPU(s)).

|||

You should also try to investigate what part of your workload is using the most CPU and see if you can do something about it. For example, you might be missing an index for a frequently run query that is causing more CPU pressure (among other things).

-- Get the most CPU intensive queries

SET NOCOUNT ON;

DECLARE @.SpID smallint

DECLARE spID_Cursor CURSOR

FORWARD_ONLY READ_ONLY FOR

SELECT TOP 25 spid

FROM master..sysprocesses

WHERE status = 'runnable'

AND spid > 50 -- Eliminate system SPIDs

AND spid <> 102 -- Replace with your SPID

ORDER BY CPU DESC

OPEN spID_Cursor

FETCH NEXT FROM spID_Cursor

INTO @.spID

WHILE @.@.FETCH_STATUS = 0

BEGIN

PRINT 'Spid #: ' + STR(@.spID)

EXEC ('DBCC INPUTBUFFER (' + @.spID + ')')

FETCH NEXT FROM spID_Cursor

INTO @.spID

END

-- Close and deallocate the cursor

CLOSE spID_Cursor

DEALLOCATE spID_Cursor

-- Get Top 50 executed SP's ordered by avg worker time

SELECT TOP 50 qt.text AS 'SP Name', qs.execution_count AS 'Execution Count', ISNULL(qs.total_elapsed_time/qs.execution_count, 0) AS 'AvgElapsedTime',

qs.total_worker_time/qs.execution_count AS 'AvgWorkerTime',

qs.total_worker_time AS 'TotalWorkerTime',

qs.max_logical_reads, qs.max_logical_writes, qs.creation_time,

DATEDIFF(Minute, qs.creation_time, GetDate()) AS Age,

ISNULL(qs.execution_count/DATEDIFF(Second, qs.creation_time, GetDate()), 0) AS 'Calls/Second'

FROM sys.dm_exec_query_stats AS qs

CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt

--WHERE qt.dbid = 5 -- Filter by database

ORDER BY qs.total_worker_time/qs.execution_count DESC

-- Missing Indexes

SELECT user_seeks * avg_total_user_cost * (avg_user_impact * 0.01) AS index_advantage,

migs.*, mid.*

FROM sys.dm_db_missing_index_group_stats AS migs

INNER JOIN sys.dm_db_missing_index_groups AS mig

ON migs.group_handle = mig.index_group_handle

INNER JOIN sys.dm_db_missing_index_details AS mid

ON mig.index_handle = mid.index_handle

--WHERE statement = '[ngservices].[dbo].[UserFeedUnreadCountRollup]' -- Specify one table

ORDER BY index_advantage DESC;

|||

Yeah, I guest we need a new server after all . . . this is really makes me difficult . . thanks for the INFO Smile

|||

Hey, I might try to use this script . . . I'll keep you update . . . thanks a lot

Monday, March 12, 2012

Processing cube from SSAS - OLE DB error

I have made a new dimension and setup the reference in dimension usage. Every time I process the cube i got the following message

Error 1 OLE DB error: OLE DB or ODBC error: Invalid column name 'PReference'.; 42S22. 0 0

The value in this column is 0,1 or 2. I have set the value in all rows to 1 and still get the same error.

I have tried to create a new column - updated value to 1 and refreshed the datasource and changed the dimension and dimension usage and I still got the same error processing the cube.

I have tried to use another integer field in dimension usage and this works fine.

Maybe it is something on the table - i have tried almost all but I can't solve this problem.

Leo Pedersen

The error message "Invalid column name 'PReference'" is saying that an invalid column name was specified in the SQL query that AS generated. Run Profiler on the AS server and capture the SQL query. It should point you to the problem.

Friday, March 9, 2012

Process throttling

Hi,
We have an application accessing an SQL Database. The problem is that due to
a flaw in design, when queries are submitted we get 100% cpu usage on the
server. Is there any way to limit processing power for specific access?
Thanks
NichHi,
Try to identify the SQL's which is doing a table scan. Then based on the
where condition in the select statement
create useful indexes, this will definitely reduce the Disk reads, which in
turn reduces the CPU usage.
Thanks
Hari
MCDBA
"Microsoft News - SQL Server" <naquilina@.gfi.com> wrote in message
news:O5yHsJP5DHA.1040@.TK2MSFTNGP10.phx.gbl...
quote:

> Hi,
> We have an application accessing an SQL Database. The problem is that due

to
quote:

> a flaw in design, when queries are submitted we get 100% cpu usage on the
> server. Is there any way to limit processing power for specific access?
> Thanks
> Nich
>
|||No.
Mike Kruchten
"Microsoft News - SQL Server" <naquilina@.gfi.com> wrote in message
news:O5yHsJP5DHA.1040@.TK2MSFTNGP10.phx.gbl...
quote:

> Hi,
> We have an application accessing an SQL Database. The problem is that due

to
quote:

> a flaw in design, when queries are submitted we get 100% cpu usage on the
> server. Is there any way to limit processing power for specific access?
> Thanks
> Nich
>
|||Hi Hari,
Thanks, we will be using the Index tune-up wizard in fact, but does any one
know if a physical cpu usage limit can be set in any way apart from using
indexes to maximize table access speed
Thanks
Nich
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OMVWVMP5DHA.360@.TK2MSFTNGP12.phx.gbl...
quote:

> Hi,
> Try to identify the SQL's which is doing a table scan. Then based on the
> where condition in the select statement
> create useful indexes, this will definitely reduce the Disk reads, which

in
quote:

> turn reduces the CPU usage.
> Thanks
> Hari
> MCDBA
> "Microsoft News - SQL Server" <naquilina@.gfi.com> wrote in message
> news:O5yHsJP5DHA.1040@.TK2MSFTNGP10.phx.gbl...
due[QUOTE]
> to
the[QUOTE]
>
|||if you have a multiprocessor machine, you could limit sql server to a subset
of
your processors. that would leave the other processors free to do other stu
ff.
you could also try lowering the priority of the sqlserver process.
i think it would be nice if we could set priority levels for db user account
s
so that certain users couldn't hog db resources or certain users' queries wo
uld
get higher priority than others.
Microsoft News - SQL Server wrote:
[QUOTE]
> Hi Hari,
> Thanks, we will be using the Index tune-up wizard in fact, but does any on
e
> know if a physical cpu usage limit can be set in any way apart from using
> indexes to maximize table access speed
> Thanks
> Nich
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:OMVWVMP5DHA.360@.TK2MSFTNGP12.phx.gbl...
> in
> due
> the

Process throttling

Hi,
We have an application accessing an SQL Database. The problem is that due to
a flaw in design, when queries are submitted we get 100% cpu usage on the
server. Is there any way to limit processing power for specific access?
Thanks
NichHi,
Try to identify the SQL's which is doing a table scan. Then based on the
where condition in the select statement
create useful indexes, this will definitely reduce the Disk reads, which in
turn reduces the CPU usage.
Thanks
Hari
MCDBA
"Microsoft News - SQL Server" <naquilina@.gfi.com> wrote in message
news:O5yHsJP5DHA.1040@.TK2MSFTNGP10.phx.gbl...
> Hi,
> We have an application accessing an SQL Database. The problem is that due
to
> a flaw in design, when queries are submitted we get 100% cpu usage on the
> server. Is there any way to limit processing power for specific access?
> Thanks
> Nich
>|||No.
Mike Kruchten
"Microsoft News - SQL Server" <naquilina@.gfi.com> wrote in message
news:O5yHsJP5DHA.1040@.TK2MSFTNGP10.phx.gbl...
> Hi,
> We have an application accessing an SQL Database. The problem is that due
to
> a flaw in design, when queries are submitted we get 100% cpu usage on the
> server. Is there any way to limit processing power for specific access?
> Thanks
> Nich
>|||Hi Hari,
Thanks, we will be using the Index tune-up wizard in fact, but does any one
know if a physical cpu usage limit can be set in any way apart from using
indexes to maximize table access speed
Thanks
Nich
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:OMVWVMP5DHA.360@.TK2MSFTNGP12.phx.gbl...
> Hi,
> Try to identify the SQL's which is doing a table scan. Then based on the
> where condition in the select statement
> create useful indexes, this will definitely reduce the Disk reads, which
in
> turn reduces the CPU usage.
> Thanks
> Hari
> MCDBA
> "Microsoft News - SQL Server" <naquilina@.gfi.com> wrote in message
> news:O5yHsJP5DHA.1040@.TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > We have an application accessing an SQL Database. The problem is that
due
> to
> > a flaw in design, when queries are submitted we get 100% cpu usage on
the
> > server. Is there any way to limit processing power for specific access?
> >
> > Thanks
> >
> > Nich
> >
> >
>|||if you have a multiprocessor machine, you could limit sql server to a subset of
your processors. that would leave the other processors free to do other stuff.
you could also try lowering the priority of the sqlserver process.
i think it would be nice if we could set priority levels for db user accounts
so that certain users couldn't hog db resources or certain users' queries would
get higher priority than others.
Microsoft News - SQL Server wrote:
> Hi Hari,
> Thanks, we will be using the Index tune-up wizard in fact, but does any one
> know if a physical cpu usage limit can be set in any way apart from using
> indexes to maximize table access speed
> Thanks
> Nich
> "Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
> news:OMVWVMP5DHA.360@.TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > Try to identify the SQL's which is doing a table scan. Then based on the
> > where condition in the select statement
> > create useful indexes, this will definitely reduce the Disk reads, which
> in
> > turn reduces the CPU usage.
> >
> > Thanks
> > Hari
> > MCDBA
> >
> > "Microsoft News - SQL Server" <naquilina@.gfi.com> wrote in message
> > news:O5yHsJP5DHA.1040@.TK2MSFTNGP10.phx.gbl...
> > > Hi,
> > >
> > > We have an application accessing an SQL Database. The problem is that
> due
> > to
> > > a flaw in design, when queries are submitted we get 100% cpu usage on
> the
> > > server. Is there any way to limit processing power for specific access?
> > >
> > > Thanks
> > >
> > > Nich
> > >
> > >
> >
> >

Wednesday, March 7, 2012

process running long

Recently i saw sysprocess due to high CPU usage n i find out that some
process are shoing login_time which is 2-3 hours old. Does this mean that
the process is runnig for 2-3 hours ?How did you identify the process and the login time?
sp_who2?
The LastBatch column indicates the last time that a specific connection
executed a sql statement.
If you are monitoring connections using sp_who2 you can use the CPUTime and
DiskIO columns to "see" how much work a specific connection (SPID) is doing.
Keith Kratochvil
"Vikram" <aa@.aa> wrote in message
news:uPmZqjDdGHA.536@.TK2MSFTNGP02.phx.gbl...
> Recently i saw sysprocess due to high CPU usage n i find out that some
> process are shoing login_time which is 2-3 hours old. Does this mean that
> the process is runnig for 2-3 hours ?
>|||I used following query
SELECT * FROM SYSPROCESSES
where status = 'runnable'
order by cpu desc
login_time is for connection?
that means a connection showing one hour means its live for 1 hour ?
If i want to get the SP execution time, then how to get it ?
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:%23sXEM$DdGHA.4276@.TK2MSFTNGP03.phx.gbl...
> How did you identify the process and the login time?
> sp_who2?
> The LastBatch column indicates the last time that a specific connection
> executed a sql statement.
> If you are monitoring connections using sp_who2 you can use the CPUTime
and
> DiskIO columns to "see" how much work a specific connection (SPID) is
doing.
> --
> Keith Kratochvil
>
> "Vikram" <aa@.aa> wrote in message
> news:uPmZqjDdGHA.536@.TK2MSFTNGP02.phx.gbl...
that
>|||login_time indicates when that connection was opened (connected).
It is possible for a connection to be sitting idle after performing lots of
work.
Is the CPU time increasing for the connection that you are intersted in?

> If i want to get the SP execution time, then how to get it ?
Do you want to know when the last command was executed? If so check the
LastBatch column within sp_who2 for the particular spid.
If you want to know how long a particular stored procedure took to execute
you would need to be running a trace when the stored procedure was called.
I am not aware of a method to get execution time after the fact.
Keith Kratochvil
"Vikram" <aa@.aa> wrote in message
news:ereZcFEdGHA.4072@.TK2MSFTNGP05.phx.gbl...
>I used following query
> SELECT * FROM SYSPROCESSES
> where status = 'runnable'
> order by cpu desc
> login_time is for connection?
> that means a connection showing one hour means its live for 1 hour ?
> If i want to get the SP execution time, then how to get it ?