Showing posts with label profiler. Show all posts
Showing posts with label profiler. Show all posts

Friday, March 30, 2012

IUSR_ to run function, drop table..

Helo all,

i dont know if that is the right way, but i was wanted to make kind of sql profiler on a webpage :) and cool features would be to usa ajax to fire it async in some time secvence.. ok, ok, here goes my code and expla... i have sql2005 (express edition,, cose i think its so cool and for a lot of projects can be used for), attached startup procedure, whit>sp_procoption 'kreni_instanco_moja', startup, true,and kreni_insta... is like:

------
setANSI_NULLSON
setQUOTED_IDENTIFIERON
GO
ALTERPROCEDURE [dbo].[kreni_instanco_moja]
AS
BEGIN
exec kp.dbo.start_trace
END
------

ok and my start_trace is:

------
ALTERPROCEDURE [dbo].[start_trace]
AS
BEGIN
DECLARE
@.traceidnumINT,@.onBIT,@.file_pathNVARCHAR(50),@.maxsizebigint;
SET @.on= 1;SET @.maxsize=5;
SET @.file_path='O:\BU_DATABASE\'+convert(varchar,getdate(), 102);
EXEC sp_trace_create @.traceid= @.traceidnumOUTPUT, @.options= 2, @.tracefile= @.file_path, @.maxfilesize= @.maxsize, @.stoptime=null, @.filecount=0;
EXEC sp_trace_setevent 2, 12, 1, @.on-- ili 12 ili 13
EXEC sp_trace_setstatus 2, 1-- 1 = START, 0 = STOP
END
------

actual code that brings table and shows sql executed is:

------
use kp
droptable trace
select textdatainto tracefrom
fn_trace_gettable(N'O:\BU_DATABASE\'+convert(varchar,getdate(), 102)+'.trc',1)
select textdatafrom trace
go
------


and it works fine,, but when its fired from my local admin connection, and try that whit IUSR*?? not going... ok, i think that IUSR have to have privilage to open that O:\BU_DATABASE ... file, and to have priv to drop tabel and to fire that function..fn_trace_get ... ?? so, that is where i got stuck up... any help would be veryyyy apreciated... hey, we can put some kind of project if anybody is interested! :) to have admin page and to monitor sql code that is executed,,, and remotely

if i was not clear in some explaining, you can ask me and ill try better

thenx, kpendic

Yes, the connecting user needs all the privileges you stated (file, drop etc.), plus system wide ALTER TRACE permission.

|||

Yes Gunteman, and even ALTER TRC permission... but do you know how to achive this maybe??

thenx

sql

ITW Errors

Hi,
I'm trying to use the ITW for one of our German servers. I have created an
input file using Profiler that captures the SQL:BatchCompleted and the
RPC:Completed events. When I run the ITW using the input file I recieve the
following error:
"The workload does not contain any events or queries that can be tuned
against the current database. Check to see that the trace contains valid
events or that the SQL script contains valid queries and you are tuning
against the right database"
If I select only certain tables to analyze I recieve the following error:
"There are no events in the workload. Either the trace file contained no
SQL batch or RPC events or the SQL script contained no SQL queries.
I have run a broad trace and a narrow trace using the specific database id
as a filter.
Both using a file and a table return the same errors.
If I use the Query Analyzer Selection option with the ITW with a specific
query from the input file then the ITW does work properly. Also, the size
of the input file is < 100 rows (just a test at this point).
It looks as though the ITW has an issue with the code of one or more of the
statements in the input file. Is this an accurate assumption? Does anyone
know how to resolve this issue so that I can use ITW with many statements as
opposed to using only a few at a time?
Thanks
Jerry
Jerry Spivey wrote:
> Hi,
> I'm trying to use the ITW for one of our German servers. I have
> created an input file using Profiler that captures the
> SQL:BatchCompleted and the RPC:Completed events. When I run the ITW
> using the input file I recieve the following error:
> "The workload does not contain any events or queries that can be tuned
> against the current database. Check to see that the trace contains
> valid events or that the SQL script contains valid queries and you
> are tuning against the right database"
> If I select only certain tables to analyze I recieve the following
> error:
> "There are no events in the workload. Either the trace file
> contained no SQL batch or RPC events or the SQL script contained no
> SQL queries.
> I have run a broad trace and a narrow trace using the specific
> database id as a filter.
> Both using a file and a table return the same errors.
> If I use the Query Analyzer Selection option with the ITW with a
> specific query from the input file then the ITW does work properly.
> Also, the size of the input file is < 100 rows (just a test at this
> point).
> It looks as though the ITW has an issue with the code of one or more
> of the statements in the input file. Is this an accurate assumption?
> Does anyone know how to resolve this issue so that I can use ITW with
> many statements as opposed to using only a few at a time?
> Thanks
> Jerry
There used to be a problem with SQL Server 7.0 with running the ITW on a
client PC using a different locale than the one on the server. Have you
tried running the ITW on the server itself (off-hours)?
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||David,
I saw the KB article that referenced that issue but it looked as though it
was fixed in SP1 of Version 7. We're running SP3 of Version 2000. I used
the client utilities from a separate client machine here in the states. I
had a colleague remote desktop to the SQL Server itself running the tools on
the local SQL Server and he received the same errors that I'm getting.
Jerry
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:uMu8ZbIjFHA.3784@.tk2msftngp13.phx.gbl...
> Jerry Spivey wrote:
> There used to be a problem with SQL Server 7.0 with running the ITW on a
> client PC using a different locale than the one on the server. Have you
> tried running the ITW on the server itself (off-hours)?
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
|||Jerry Spivey wrote:
> David,
> I saw the KB article that referenced that issue but it looked as
> though it was fixed in SP1 of Version 7. We're running SP3 of
> Version 2000. I used the client utilities from a separate client
> machine here in the states. I had a colleague remote desktop to the
> SQL Server itself running the tools on the local SQL Server and he
> received the same errors that I'm getting.
> Jerry
>
Have you examined the contents of the workload file to see what was
actually captured? If so, what happens if you copy one of the commands
and tune is manually from Query Analyzer. Does it work? How many
workload queries did you tell the ITW to examine in the workload file?
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Yea that is my approach right now. I'm copy and pasting individual
statements into QA using the QAS option. Haven't found the culprit yet -
about 90 left to go.
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eOlxUkIjFHA.2904@.tk2msftngp13.phx.gbl...
> Jerry Spivey wrote:
> Have you examined the contents of the workload file to see what was
> actually captured? If so, what happens if you copy one of the commands and
> tune is manually from Query Analyzer. Does it work? How many workload
> queries did you tell the ITW to examine in the workload file?
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
sql

ITW Errors

Hi,
I'm trying to use the ITW for one of our German servers. I have created an
input file using Profiler that captures the SQL:BatchCompleted and the
RPC:Completed events. When I run the ITW using the input file I recieve the
following error:
"The workload does not contain any events or queries that can be tuned
against the current database. Check to see that the trace contains valid
events or that the SQL script contains valid queries and you are tuning
against the right database"
If I select only certain tables to analyze I recieve the following error:
"There are no events in the workload. Either the trace file contained no
SQL batch or RPC events or the SQL script contained no SQL queries.
I have run a broad trace and a narrow trace using the specific database id
as a filter.
Both using a file and a table return the same errors.
If I use the Query Analyzer Selection option with the ITW with a specific
query from the input file then the ITW does work properly. Also, the size
of the input file is < 100 rows (just a test at this point).
It looks as though the ITW has an issue with the code of one or more of the
statements in the input file. Is this an accurate assumption? Does anyone
know how to resolve this issue so that I can use ITW with many statements as
opposed to using only a few at a time?
Thanks
JerryJerry Spivey wrote:
> Hi,
> I'm trying to use the ITW for one of our German servers. I have
> created an input file using Profiler that captures the
> SQL:BatchCompleted and the RPC:Completed events. When I run the ITW
> using the input file I recieve the following error:
> "The workload does not contain any events or queries that can be tuned
> against the current database. Check to see that the trace contains
> valid events or that the SQL script contains valid queries and you
> are tuning against the right database"
> If I select only certain tables to analyze I recieve the following
> error:
> "There are no events in the workload. Either the trace file
> contained no SQL batch or RPC events or the SQL script contained no
> SQL queries.
> I have run a broad trace and a narrow trace using the specific
> database id as a filter.
> Both using a file and a table return the same errors.
> If I use the Query Analyzer Selection option with the ITW with a
> specific query from the input file then the ITW does work properly.
> Also, the size of the input file is < 100 rows (just a test at this
> point).
> It looks as though the ITW has an issue with the code of one or more
> of the statements in the input file. Is this an accurate assumption?
> Does anyone know how to resolve this issue so that I can use ITW with
> many statements as opposed to using only a few at a time?
> Thanks
> Jerry
There used to be a problem with SQL Server 7.0 with running the ITW on a
client PC using a different locale than the one on the server. Have you
tried running the ITW on the server itself (off-hours)?
--
David Gugick
Quest Software
www.imceda.com
www.quest.com|||David,
I saw the KB article that referenced that issue but it looked as though it
was fixed in SP1 of Version 7. We're running SP3 of Version 2000. I used
the client utilities from a separate client machine here in the states. I
had a colleague remote desktop to the SQL Server itself running the tools on
the local SQL Server and he received the same errors that I'm getting.
Jerry
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:uMu8ZbIjFHA.3784@.tk2msftngp13.phx.gbl...
> Jerry Spivey wrote:
>> Hi,
>> I'm trying to use the ITW for one of our German servers. I have
>> created an input file using Profiler that captures the
>> SQL:BatchCompleted and the RPC:Completed events. When I run the ITW
>> using the input file I recieve the following error:
>> "The workload does not contain any events or queries that can be tuned
>> against the current database. Check to see that the trace contains
>> valid events or that the SQL script contains valid queries and you
>> are tuning against the right database"
>> If I select only certain tables to analyze I recieve the following
>> error:
>> "There are no events in the workload. Either the trace file
>> contained no SQL batch or RPC events or the SQL script contained no
>> SQL queries.
>> I have run a broad trace and a narrow trace using the specific
>> database id as a filter.
>> Both using a file and a table return the same errors.
>> If I use the Query Analyzer Selection option with the ITW with a
>> specific query from the input file then the ITW does work properly. Also,
>> the size of the input file is < 100 rows (just a test at this
>> point).
>> It looks as though the ITW has an issue with the code of one or more
>> of the statements in the input file. Is this an accurate assumption?
>> Does anyone know how to resolve this issue so that I can use ITW with
>> many statements as opposed to using only a few at a time?
>> Thanks
>> Jerry
> There used to be a problem with SQL Server 7.0 with running the ITW on a
> client PC using a different locale than the one on the server. Have you
> tried running the ITW on the server itself (off-hours)?
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com|||Jerry Spivey wrote:
> David,
> I saw the KB article that referenced that issue but it looked as
> though it was fixed in SP1 of Version 7. We're running SP3 of
> Version 2000. I used the client utilities from a separate client
> machine here in the states. I had a colleague remote desktop to the
> SQL Server itself running the tools on the local SQL Server and he
> received the same errors that I'm getting.
> Jerry
>
Have you examined the contents of the workload file to see what was
actually captured? If so, what happens if you copy one of the commands
and tune is manually from Query Analyzer. Does it work? How many
workload queries did you tell the ITW to examine in the workload file?
--
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Yea that is my approach right now. I'm copy and pasting individual
statements into QA using the QAS option. Haven't found the culprit yet -
about 90 left to go.
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eOlxUkIjFHA.2904@.tk2msftngp13.phx.gbl...
> Jerry Spivey wrote:
>> David,
>> I saw the KB article that referenced that issue but it looked as
>> though it was fixed in SP1 of Version 7. We're running SP3 of
>> Version 2000. I used the client utilities from a separate client
>> machine here in the states. I had a colleague remote desktop to the
>> SQL Server itself running the tools on the local SQL Server and he
>> received the same errors that I'm getting.
>> Jerry
> Have you examined the contents of the workload file to see what was
> actually captured? If so, what happens if you copy one of the commands and
> tune is manually from Query Analyzer. Does it work? How many workload
> queries did you tell the ITW to examine in the workload file?
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com

ITW Errors

Hi,
I'm trying to use the ITW for one of our German servers. I have created an
input file using Profiler that captures the SQL:BatchCompleted and the
RPC:Completed events. When I run the ITW using the input file I recieve the
following error:
"The workload does not contain any events or queries that can be tuned
against the current database. Check to see that the trace contains valid
events or that the SQL script contains valid queries and you are tuning
against the right database"
If I select only certain tables to analyze I recieve the following error:
"There are no events in the workload. Either the trace file contained no
SQL batch or RPC events or the SQL script contained no SQL queries.
I have run a broad trace and a narrow trace using the specific database id
as a filter.
Both using a file and a table return the same errors.
If I use the Query Analyzer Selection option with the ITW with a specific
query from the input file then the ITW does work properly. Also, the size
of the input file is < 100 rows (just a test at this point).
It looks as though the ITW has an issue with the code of one or more of the
statements in the input file. Is this an accurate assumption? Does anyone
know how to resolve this issue so that I can use ITW with many statements as
opposed to using only a few at a time?
Thanks
JerryJerry Spivey wrote:
> Hi,
> I'm trying to use the ITW for one of our German servers. I have
> created an input file using Profiler that captures the
> SQL:BatchCompleted and the RPC:Completed events. When I run the ITW
> using the input file I recieve the following error:
> "The workload does not contain any events or queries that can be tuned
> against the current database. Check to see that the trace contains
> valid events or that the SQL script contains valid queries and you
> are tuning against the right database"
> If I select only certain tables to analyze I recieve the following
> error:
> "There are no events in the workload. Either the trace file
> contained no SQL batch or RPC events or the SQL script contained no
> SQL queries.
> I have run a broad trace and a narrow trace using the specific
> database id as a filter.
> Both using a file and a table return the same errors.
> If I use the Query Analyzer Selection option with the ITW with a
> specific query from the input file then the ITW does work properly.
> Also, the size of the input file is < 100 rows (just a test at this
> point).
> It looks as though the ITW has an issue with the code of one or more
> of the statements in the input file. Is this an accurate assumption?
> Does anyone know how to resolve this issue so that I can use ITW with
> many statements as opposed to using only a few at a time?
> Thanks
> Jerry
There used to be a problem with SQL Server 7.0 with running the ITW on a
client PC using a different locale than the one on the server. Have you
tried running the ITW on the server itself (off-hours)?
David Gugick
Quest Software
www.imceda.com
www.quest.com|||David,
I saw the KB article that referenced that issue but it looked as though it
was fixed in SP1 of Version 7. We're running SP3 of Version 2000. I used
the client utilities from a separate client machine here in the states. I
had a colleague remote desktop to the SQL Server itself running the tools on
the local SQL Server and he received the same errors that I'm getting.
Jerry
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:uMu8ZbIjFHA.3784@.tk2msftngp13.phx.gbl...
> Jerry Spivey wrote:
> There used to be a problem with SQL Server 7.0 with running the ITW on a
> client PC using a different locale than the one on the server. Have you
> tried running the ITW on the server itself (off-hours)?
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com|||Jerry Spivey wrote:
> David,
> I saw the KB article that referenced that issue but it looked as
> though it was fixed in SP1 of Version 7. We're running SP3 of
> Version 2000. I used the client utilities from a separate client
> machine here in the states. I had a colleague remote desktop to the
> SQL Server itself running the tools on the local SQL Server and he
> received the same errors that I'm getting.
> Jerry
>
Have you examined the contents of the workload file to see what was
actually captured? If so, what happens if you copy one of the commands
and tune is manually from Query Analyzer. Does it work? How many
workload queries did you tell the ITW to examine in the workload file?
David Gugick
Quest Software
www.imceda.com
www.quest.com|||Yea that is my approach right now. I'm copy and pasting individual
statements into QA using the QAS option. Haven't found the culprit yet -
about 90 left to go.
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:eOlxUkIjFHA.2904@.tk2msftngp13.phx.gbl...
> Jerry Spivey wrote:
> Have you examined the contents of the workload file to see what was
> actually captured? If so, what happens if you copy one of the commands and
> tune is manually from Query Analyzer. Does it work? How many workload
> queries did you tell the ITW to examine in the workload file?
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com