Urgent >>>Want To Trace The Each Activity Of Sql Server
Jul 9, 2001
Hi,
sir, i have used Trace But it does not start automaticaly when server starts, is there any other way to track the Events, Because i have to track all the updates (Insert,Delete, UPdate etc.) of all the tables of my particuylar database .
Does anybody know how to trace user activity after they log off from the SQL Server 6.5? I know SQL Trace is able to trace the user activity in real time.
A developer is running sql transactions from the application and needs to know how it is executed from database, I know I have to run Profiler Trace, but not exactly which traces , Can you please guide me?
Hi, I have no idea what i'm doing wrong: Tried to gather more detail information about Deadlock (error # 1205) set the trace flag 1204 - ON (tried 1205 - ON as well) nothing happend, still the same message outgoing "Your transaction (process ID #13) was deadlocked with...." with no any detail. If anybody met the same problem before, HELP please.
Maybe the information goes to some place other than Error Log file?
What to check on NT or Sql server it self if 1. NT performance shows that sql serve.exe -CPU 93% memory 49000 2. Sql server current activity only sa connected to master. Thanks
I recently renamed a database with sp_renamedb and created a new db with the same name as the old and restored the data into the new db. I put the old renamed db in single user mode to prevent data from becomming violated. After cycling SQL Server to flush the cache, I opened the floodgates for users. Our support line was full of calls from people saying "I'm getting the error 'Single User Mode in database DBORGINALDBNAME'. Any ideas why the application would be hitting the old database after I renamed and recycled the server?
im trying to allocate a user appropriate permissions but i would like to see the users activities to make sure i do give that user exactly what they need how do i check user activity on sql server 2005
I'm hoping that someone has experienced this problem before and knows how to get round it.
The problem we are having is that we have a job that is scheduled to run at 4:00 am each morning, for the past 6 weeks it has done this with no problem. However, this morning it failed. we know it failed because it didn't produce the results it was supposed to. However the monitor said that the job had completed successfully. On examining the history of the job we found that the job was still running!!! When we tried to stop the job by right clicking and selecting the appropriate action. The action available to us was to start the job.
After arguing for a bit we decided to try and run the job again. We did this and found that the job running in the history screen terminated with an error and than ran and completed successfully.
Confused? So are we any ideas or solutions gratefully received
I use following trigger to stop user "smith" if he try to connect through SSMS to My Server:
create TRIGGER [trg_connection_MyServer] ON ALL SERVER WITH EXECUTE AS 'Smith' FOR LOGON AS BEGIN IF ORIGINAL_LOGIN()= 'Smith' begin if exists (SELECT 1 FROM sys.dm_exec_sessions WHERE (program_name like 'Microsoft SQL Server%' and original_login_name = 'Smith') ) ROLLBACK; end
I want to log this information or send emal incase, this user try to connect through SSMS, so that I can catch it. How can I do this, if I use insert command it rollsback everything and I can't do any activity.
I am using SQL Server 2012. I Want To Maintain all Type Logs In Particulars database or server. I want to track all Query Which Execute in Particulars Database. and all other activity?
Is there a way to permanently change the order of the columns in Job Activity Monitor?
I'd like to move Duration to the right of Step Name, but this only lasts so long as I have JAM open. Once I close it and re-open, JAM goes back to its default column order. Google gives me nothing but the temporary "drag and drop" method that I already know about.
Dear AllI have problem with my database server which running SQL server 2000.The server running very slow. The worst case, to save a record requiredmore than 20-30 seconds.Since this problem, I usually monitoring Process Info from EnterpriseManager (Management - Current Activity), and I found a misteriousprocess as follow :1. User: SystemAccessTo: MasterStatus: BackgroundCommon: Task ManagerWaiting: >438 Million2. User: SystemAccessTo: MasterStatus: BackgroundCommon: Task ManagerPhysical IO: > 510003. User: Administrator (Join domain)Database: MSDBStatus: SleepingCommon: Awaiting CommandApp: SQL Agent Alert EngineCPU Usage: > 16 MillionAnybody know about these condition? Does it normal?ThanksMichael
For SQL Server 2000 we have a user login mapped to msdb with database role membership of db_datareader and public checked. This seems to allow the developers to view the Management Activity monitor. For SQL Server 2005 the same mapping is in place but the developers cannot view the Management Activity monitor. Developers are NOT granted the sysadmin role, and should not have that role.
What permissions need to be set for SQL Server 2005 to allow users to view the Management Activity monitor? They should not be allowed to take actions on the activities.
We have development and user acceptance (UA) servers. When I start a job on the development server, on the management studio, Start Jobs window and Job activity windows indicate "Executing" until the end of the job and finish with "success" or "failure"
But on the UA server, second after I start a job, Start Jobs window comes up with "success" or failure" and Job activity monitor says "idle" but Job continues to log without any error message and updates the tables. So these two windows are not reliable at all. I have to add that I have only job operator rights on the UA server.
hi, I have settup up sql mail and did the following: 1. created an E-mail account and configured Out look by creating a pop3 mail profile. tested it by sending and receiving mail, that is ook 2. I Created one domain account for MSsqlserver and Sql Agent service. both services use same account and start automatically in the control panel-services 3. I used the profile that I created in outlook to test the sql mail but got an error: Error 22030 : A MAPI error ( error number:273) occurred: MapiLogon Ex Failed due to MAPI Error 273: MAPI Logon Failed
I really do not know what went wrong. I followed the steps from bol and still having a problem. Am I missing something.
I do have a valid email account I do have a valid domain account I tested outlook using the email account and it worked. so why sql server does not recognise MAPI.
My next question, How to configure MAPI in Sql server if what I did was wrong.
Hi, I have 2 windows 2000 server in cluster with sql server 2000 enterprise edition installed. I have activated the Server-Requested Encryption by using the sql server network utility (Force Protocol Encryption). After this, I have stoped sql server service. But I can't start it at this moment. The error is: 19015: The encrypton is required but no available certificat has been found.
I am working with 3 sql 7.0 servers (Servers A, B, C) and am trying to create a trace via profiler to run against server B.
Every trace that I create keeps pointing to server A even though I have server B defined in the properties of the trace - (when I edit the trace properties it REALLY does show server B). I have server B defined in the screen where you 'Select the SQL Server to run the trace on'. I even used the wizard to run one of the canned traces and it still points to server A. Every trace I set up runs against server A. Can anyone think of what the heck I'm doin' wrong? Is is a configuration setting somewhere?
I have created a server-side procedure which captures evenst for audit purposes and save to a file onto the SQL Server. This procedure has been defined as an autoload so that when the server is restarted, this procedure automatically loads.
However, there is a fundemental flaw with this routine. When the procedure attempts to execute, it will abort due to the fact that the trace file already exists.
I have two choices:-
1. When the procedure restarts, append to existing file or 2. Make a folder which comprise of today's day ie 20080128 and move trace file/s to this folder.
Option 2 is preferred.
How can I make this achievable?
Please note I'm using SQL Server 2005.
Ken
Below is a sample of my Code
-- Create a Queue -- Declare Control Variable declare @ReturnCode int declare @Rc int -- Declare Option Variable declare @TraceID int declare @maxfilesize bigint declare @ColumnId int declare @LogicalOperator int declare @ComparisonOperator int declare @Value int declare @Option int declare @on bit declare @Event int -- Set Option Variables set @maxfilesize = 100 -- Maximum file size in megabytes set @Option = 6 -- TraceFileRollOver and ShutdownOnError set @on = 1 -- True set @ReturnCode = 0 -- No Error exec @Rc = sp_trace_create @TraceID output, @Option, N'\Server_named$SQLTraceActivity', @maxfilesize, NULL select @ReturnCode=@@Error if @ReturnCode <> 0 Begin if @ReturnCode = 1 Print 'Error 1 - Unknown error.' if @ReturnCode = 10 Print 'Error 10 - Invalid options. Returned when options specified are incompatible.' if @ReturnCode = 12 Print 'Error 12 - Cannot create tracefile - check if file already exists, or this trace already running' if @ReturnCode = 13 Print 'Error 13 - Out of memory. Returned when there is not enough memory to perform the specified action.' if @ReturnCode = 14 Print 'Error 14 - Invalid stop time. Returned when the stop time specified has already happened.' if @ReturnCode = 15 Print 'Error 15 - Invalid parameters. Returned when the user supplied incompatible parameters.' else Print 'Unexpected and Unknown error In creating trace - Please review' Goto ErrorHandler End -- Set Events -- Trace NTDomainName for Object:Altered event exec sp_trace_setevent @TraceID, 164, 7, @on -- Trace HostName for Object:Altered event exec sp_trace_setevent @TraceID, 164, 8, @on -- Trace IndexID for Object:Altered event exec sp_trace_setevent @TraceID, 164, 24, @on -- Trace RequestID for Object:Altered event exec sp_trace_setevent @TraceID, 164, 56, @on -- Trace SessionLoginName for Object:Altered event exec sp_trace_setevent @TraceID, 164, 64, @on -- Trace ClientProccessID for Object:Altered event exec sp_trace_setevent @TraceID, 164, 9, @on -- Trace IntegerData for Object:Altered event exec sp_trace_setevent @TraceID, 164, 25, @on -- Trace LogionSid for Object:Altered event exec sp_trace_setevent @TraceID, 164, 41, @on -- Trace RequestID for Object:Altered event exec sp_trace_setevent @TraceID, 164, 49, @on -- Trace NTUserName for Object:Altered event exec sp_trace_setevent @TraceID, 164, 6, @on -- Trace ApplicationName for Object:Altered event exec sp_trace_setevent @TraceID, 164, 10, @on -- Trace StartTime for Object:Altered event exec sp_trace_setevent @TraceID, 164, 14, @on -- Trace ObjectID for Object:Altered event exec sp_trace_setevent @TraceID, 164, 22, @on -- Trace ServerName for Object:Altered event exec sp_trace_setevent @TraceID, 164, 26, @on -- Trace ObjectName for Object:Altered event exec sp_trace_setevent @TraceID, 164, 34, @on -- Trace XactSequence for Object:Altered event exec sp_trace_setevent @TraceID, 164, 50, @on -- Trace DatabaseID for Object:Altered event exec sp_trace_setevent @TraceID, 164, 3, @on -- Trace LoginName for Object:Altered event exec sp_trace_setevent @TraceID, 164, 11, @on -- Trace NTDomainName for Object:Altered event exec sp_trace_setevent @TraceID, 164, 35, @on -- Trace EventSequence for Object:Altered event exec sp_trace_setevent @TraceID, 164, 51, @on -- Trace TransactionID for Object:Altered event exec sp_trace_setevent @TraceID, 164, 4, @on -- Trace SPID for Object:Altered event exec sp_trace_setevent @TraceID, 164, 12, @on -- Trace ObjectType for Object:Altered event exec sp_trace_setevent @TraceID, 164, 28, @on -- Trace IsSystem for Object:Altered event exec sp_trace_setevent @TraceID, 164, 60, @on -- Trace EventSubClass for Object:Altered event exec sp_trace_setevent @TraceID, 164, 21, @on
I have created a server-side procedure which captures evenst for audit purposes and save to a file onto the SQL Server. This procedure has been defined as an autoload so that when the server is restarted, this procedure automatically loads.
However, there is a fundemental flaw with this routine. When the procedure attempts to execute, it will abort due to the fact that the trace file already exists.
I have two choices:-
1. When the procedure restarts, append to existing file or
2. Make a folder which comprise of today's day ie 20080128 and move trace file/s to this folder.
Option 2 is preferred.
How can I make this achievable?
Please note I'm using SQL Server 2005.
Ken
Below is a sample of my Code
-- Create a Queue
-- Declare Control Variable
declare @ReturnCode int
declare @Rc int
-- Declare Option Variable
declare @TraceID int
declare @maxfilesize bigint
declare @ColumnId int
declare @LogicalOperator int
declare @ComparisonOperator int
declare @Value int
declare @Option int
declare @on bit
declare @Event int
-- Set Option Variables
set @maxfilesize = 100 -- Maximum file size in megabytes
set @Option = 6 -- TraceFileRollOver and ShutdownOnError
Hello ;Can any one point me how to trace any modification made on a certain tabeles with in any data base?what i mean is if i have table "a" and i add updated some rows with it ... is there a way to figure iut the old data and the new data?simply i can create another table "history_on_a" which will be filled by a trigger when any updates happen ...this solution will consume my hard disk so is ther a built in funtion with sql ?so if any one can tell me what to search for or any idea
Hello, I am using a component (infragistics netadvantage) within my application which uses a default database. Unfortunately this database doesn't provide me with all the functionality I need. Since the component uses stored procedures. Is there anyway I can see what stored procedures are called when an event occurs? That way I can copy over the tables and the stored procedures I need and I can alter them to suit my database.
When looking in the server trace in query analyzer – I can see how many ‘reads’ a stored procedure does. So I'm wondering if we can determine whether our query is good or bad by looking at the number of reads/writes that showing in the Trace.
When looking in the server trace in query analyzer – I can see how many ‘reads’ a stored procedure does. So I'm wondering if we can determine whether our query is good or bad by looking at the number of reads/writes that showing in the Trace.
I have decided that I needed to modify my trace file name to include date and time in a further attempt to make my file name unique. See below snippet:-
-- Build File Name
select @hr = datepart(hh,getdate())
select @min = datepart(mi,getdate())
select @sec = datepart(ss,getdate())
set @time = convert(char(2),@hr) + convert(char(2),@min) + convert(char(2),@sec)
We have replication set up. Publisher and distributor are on the same server, subscriber is in different server.
Suddenly the replication started failing and continued more than 12 hrs. When I tried to connect to the subscriber server, I am able to connect to the server but not able to run any queries or not able to open the error log from SSMS.
Is there any way to find from the default trace why the replication failed and the server is not responded?
An application that i wrote (that interacts with SQL Server 2000) is causing deadlocks on the server. i have no direct access to the server, but the user have sent me a server trace.
Having very little experience with SQL Server 2000, all that i learn from the trace is that, well, there is a deadlock, but i had already known that beforehand.
What other useful details can be interpreted from the trace above? How can i obtain information like the specific statement(s) which cause the deadlock, etc?
We have two servers each running SQL7. I cannot run a trace on one server from the other. Whatever server name I enter in the drop down box, the trace only records activity on the server that profiler is running on. Even if I put a non-existent server name in the box (!), the trace accepts the name but still only runs on the host server.
Hi All, In SQL Server 7, we had the option of opening a previously saved trace template and running it inorder to run a previously saved trace defintion repeatedly. File > Open > Trace Definition and choosing the Trace Name. Clicking OK would run the trace.
How do we do the same in SQL Server 2000? File > Open > Trace Template opens a Trace template but has only a 'Save' button and I'm therefore unable to run it.
How is it possible to run a previously defined trace repeatedly in SQL server 2000? Thanks in advance, Praveena