June 28, 2022 at 3:08 pm
Hi,
When I tried to open the default trace it is giving me the error message
Unable to open the file. Access is denied.
I am the part of local administrator group & sysadmin in SQL Server. I am trying to open on the same machine where sql server is running & trace files exist. What could be other reasons local administrators can’t able open the trace file?
June 28, 2022 at 3:51 pm
If you are trying to connect the trace file which SQL Server is currently writing to, you will get "Access is denied" because the file is locked.
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Use sys.fn_trace_gettable (https://docs.microsoft.com/en-us/sql/relational-databases/system-functions/sys-fn-trace-gettable-transact-sql?view=sql-server-ver16) for the active trace file
June 28, 2022 at 10:50 pm
There are 5 files. I think SQL will write on the last file, I am trying open the first file.
June 29, 2022 at 12:25 pm
IF your login and the service account are different (and oh, I hope they are), then your login may not have the same access to the underlying OS as the service account.
Also, we're in SQL Server 2017. There is the system_health Extended Event session that does both most of what default trace did (missing a couple of things) and more (adds a whole bunch of things, deadlock info for example). I'd suggest using that instead: https://docs.microsoft.com/en-us/sql/relational-databases/extended-events/use-the-system-health-session?view=sql-server-ver16
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
June 29, 2022 at 3:04 pm
When you open SSMS, you may have to right click on the icon and select "Run as Administrator".
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply