February 19, 2009 at 12:35 pm
Good After:
Hi , i need help from create a trace for monitor my databeses where this not have activity , is can possible, please if someone have the answare send me from this place.
Regards an tnks soo much.:crying:
February 19, 2009 at 12:49 pm
You should look up SQL Trace in BOL. There are also a set of videos about SQL Server Profiler at JumpStartTV (free registration required).
If you can be more specific about what you need to trace someone can provide more details.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
February 19, 2009 at 1:04 pm
dears DBÁs:
since I can create a monitor for my databases that do not have activity, this with the purpose of being able to make the migration of the same ones more guessed right and of not migrating bases that can resign and keep the last finished support alone
February 19, 2009 at 1:17 pm
You can use this to create the trace:
declare @ID int, @FS bigint, @FilePath nvarchar(245), @1 bit
select @FS = 10,
@filepath = 'F:\DBA\Trace\TSQLTrace', -- The path where the trace file will be created
@1 = 1
exec sp_trace_create
@traceid = @id output, -- Trace ID (output)
@options = 2, -- File rollover option
@tracefile = @filepath, -- Must be a local path on the server
@maxfilesize = @FS, -- Trace File Size (in Meg)
@stoptime = null -- No preset stop-time
-- 10 = RPC Complete
-- Sets columns for trace data
exec sp_trace_setevent @id, 10, 1, @1
exec sp_trace_setevent @id, 10, 13, @1
exec sp_trace_setevent @id, 10, 15, @1
exec sp_trace_setevent @id, 10, 16, @1
exec sp_trace_setevent @id, 10, 17, @1
exec sp_trace_setevent @id, 10, 18, @1
exec sp_trace_setevent @id, 10, 8, @1
exec sp_trace_setevent @id, 10, 10, @1
exec sp_trace_setevent @id, 10, 35, @1
-- 12 = SQL Batch Complete
-- Sets columns for trace data
exec sp_trace_setevent @id, 12, 1, @1
exec sp_trace_setevent @id, 12, 13, @1
exec sp_trace_setevent @id, 12, 15, @1
exec sp_trace_setevent @id, 12, 16, @1
exec sp_trace_setevent @id, 12, 17, @1
exec sp_trace_setevent @id, 12, 18, @1
exec sp_trace_setevent @id, 12, 8, @1
exec sp_trace_setevent @id, 12, 10, @1
exec sp_trace_setevent @id, 12, 35, @1
-- Turns on the trace
exec sp_trace_setstatus @id, 1
That will turn on a trace that you can run for however long you need. It will record activity in all databases on the server.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
February 23, 2009 at 10:10 am
my freadly DBA i need your help from create a trace , from monitor my database where this not have activity , the other trace to send me i not have idea to back the columns.
Please some one help me is cool.
Tnks
February 23, 2009 at 10:16 am
I just want to make sure I understand what you want. You want a trace that will identify databases that are no longer used? You can't specifically trace for that, but you could create a trace that includes the login events and that would show the databases that are active.
Of course how long is long enough to know that a database is not active?
One suggestion I have seen others make is that you rename a database that you suspect is inactive and wait to see if anyone complains. You still need to make sure you keep it though.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply