dbTalk Databases Forums  

sp_create_trace throws Errorcode = 12

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss sp_create_trace throws Errorcode = 12 in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bartolo
 
Posts: n/a

Default sp_create_trace throws Errorcode = 12 - 11-06-2007 , 03:50 AM






Hi,

I'm trying to execute server-side trace with SqlServer 2000 on
cluster. After scripting trace by Profiler I executed this script in
Queryanalyzer and got error code 12. According to BOL this code says
that file is not created but I don't know why, is there are any
obstacles which preventing to add this trace??
Does anybody had that problem?

If it helps I added script which I tried to execute:

-- Create a Queue
declare @rc int
declare @TraceID int
declare @maxfilesize bigint
set @maxfilesize = 5

exec @rc = sp_trace_create @TraceID output, 0, N'C:\Profiler_result
\result.trc', @maxfilesize, NULL
if (@rc != 0) goto error

-- Client side File and Table cannot be scripted

-- Set the events
declare @on bit
set @on = 1
exec sp_trace_setevent @TraceID, 10, 1, @on
/*here are n-setevents*/
exec sp_trace_setevent @TraceID, 43, 35, @on

-- Set the Filters
declare @intfilter int
declare @bigintfilter bigint

exec sp_trace_setfilter @TraceID, 1, 1, 6, N'history'
exec sp_trace_setfilter @TraceID, 1, 1, 6, N'move_history'
exec sp_trace_setfilter @TraceID, 10, 0, 7, N'SQL Profiler'
exec sp_trace_setfilter @TraceID, 35, 1, 6, N'kis'


-- Set the trace status to start
exec sp_trace_setstatus @TraceID, 1

-- display trace id for future references
select TraceID=@TraceID
goto finish

error:
select ErrorCode=@rc

finish:
go


Thanks in advance for any advice
Regards,
Bartolo


Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: sp_create_trace throws Errorcode = 12 - 11-06-2007 , 05:57 AM






Bartolo (andrew.osa (AT) gmail (DOT) com) writes:
Quote:
I'm trying to execute server-side trace with SqlServer 2000 on
cluster. After scripting trace by Profiler I executed this script in
Queryanalyzer and got error code 12. According to BOL this code says
that file is not created but I don't know why, is there are any
obstacles which preventing to add this trace??
Does anybody had that problem?
Does the directory exist? Does the file already exist? In the latter case,
you need to deletet it first.

Quote:
exec @rc = sp_trace_create @TraceID output, 0, N'C:\Profiler_result
\result.trc', @maxfilesize, NULL
Also try removing ".trc". Trace adds that for you.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #3  
Old   
Bartolo
 
Posts: n/a

Default Re: sp_create_trace throws Errorcode = 12 - 11-06-2007 , 06:58 AM



Hello Erland,

Yes, I have directory and the file didn't exists and I tried
removing .trc extension. I thougt that it could be problem with
Profiler, because I had executed within it different trace and could
block directory. I stopped it, closed Profiler and still got Errorcode
12.
Do you have any other idea what would be the reason of this error?

Regards,
Bartolo

On 6 Lis, 12:57, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Quote:
Bartolo (andrew.... (AT) gmail (DOT) com) writes:
I'm trying to execute server-side trace with SqlServer 2000 on
cluster. After scripting trace by Profiler I executed this script in
Queryanalyzer and got error code 12. According to BOL this code says
that file is not created but I don't know why, is there are any
obstacles which preventing to add this trace??
Does anybody had that problem?

Does the directory exist? Does the file already exist? In the latter case,
you need to deletet it first.

exec @rc = sp_trace_create @TraceID output, 0, N'C:\Profiler_result
\result.trc', @maxfilesize, NULL

Also try removing ".trc". Trace adds that for you.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx



Reply With Quote
  #4  
Old   
Greg D. Moore \(Strider\)
 
Posts: n/a

Default Re: sp_create_trace throws Errorcode = 12 - 11-06-2007 , 08:24 AM



"Bartolo" <andrew.osa (AT) gmail (DOT) com> wrote

Quote:
Hello Erland,

Yes, I have directory and the file didn't exists and I tried
removing .trc extension.
The directory exists on the server or on your client?

Quote:
I thougt that it could be problem with
Profiler, because I had executed within it different trace and could
block directory. I stopped it, closed Profiler and still got Errorcode
12.
Do you have any other idea what would be the reason of this error?

Regards,
Bartolo

On 6 Lis, 12:57, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Bartolo (andrew.... (AT) gmail (DOT) com) writes:
I'm trying to execute server-side trace with SqlServer 2000 on
cluster. After scripting trace by Profiler I executed this script in
Queryanalyzer and got error code 12. According to BOL this code says
that file is not created but I don't know why, is there are any
obstacles which preventing to add this trace??
Does anybody had that problem?

Does the directory exist? Does the file already exist? In the latter
case,
you need to deletet it first.

exec @rc = sp_trace_create @TraceID output, 0, N'C:\Profiler_result
\result.trc', @maxfilesize, NULL

Also try removing ".trc". Trace adds that for you.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Books Online for SQL Server 2005
athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000
athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx




--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html




Reply With Quote
  #5  
Old   
Bartolo
 
Posts: n/a

Default Re: sp_create_trace throws Errorcode = 12 - 11-06-2007 , 09:26 AM



Hello Greg,

Thanks for clue. Problem resloved. Yes, I know it's written within
script but I didn't know how it's working in order to cluster
environment.
-- Client side File and Table cannot be scripted
I don't connect to active node in my cluster during administrative
task jobs, most of them I manage from passive node.
So summarise, for executing server-side trace on cluster I must
connect to active node.

Regards
Bartolo


On 6 Lis, 15:24, "Greg D. Moore \(Strider\)"
<mooregr_deletet... (AT) greenms (DOT) com> wrote:
Quote:
"Bartolo" <andrew.... (AT) gmail (DOT) com> wrote in message

news:1194353919.690014.304560 (AT) 50g2000hsm (DOT) googlegroups.com...

Hello Erland,

Yes, I have directory and the file didn't exists and I tried
removing .trc extension.

The directory exists on the server or on your client?



I thougt that it could be problem with
Profiler, because I had executed within it different trace and could
block directory. I stopped it, closed Profiler and still got Errorcode
12.
Do you have any other idea what would be the reason of this error?

Regards,
Bartolo

On 6 Lis, 12:57, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Bartolo (andrew.... (AT) gmail (DOT) com) writes:
I'm trying to execute server-side trace with SqlServer 2000 on
cluster. After scripting trace by Profiler I executed this script in
Queryanalyzer and got error code 12. According to BOL this code says
that file is not created but I don't know why, is there are any
obstacles which preventing to add this trace??
Does anybody had that problem?

Does the directory exist? Does the file already exist? In the latter
case,
you need to deletet it first.

exec @rc = sp_trace_create @TraceID output, 0, N'C:\Profiler_result
\result.trc', @maxfilesize, NULL


Also try removing ".trc". Trace adds that for you.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Books Online for SQL Server 2005
athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000
athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.