SP_TRACE_CREATE. Error

  • Hi

    I am getting the below error when i try to create the trace with the network

    SET @OutputFileName = N'\\mynetwork\yuvipoy\Test.trc'

    SP_TRACE_CREATE. Error = 0x8007052e(Logon failure: unknown user name or bad password.).

    NOTE: I am able to open and create/write/delete files in \\mynetwork\yuvipoy\ path.

    Thanks

    I forgot to tell one thing when i give SET @OutputFileName = N'C:\mypath\Test.trc' it is saving .

  • The account that SQL Server is running under (the SQL Server service account) does not have permission to the share.

    I don't recommend saving a trace across the network. The network delays could result in the trace impacting the performance of the server/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • and, where possible, switch to extended events.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • Hi Gailshaw,

    This is the Dev server it is kept at the customer place i am trying to access only for few hour.

    GilaMonster (3/13/2015)


    The account that SQL Server is running under (the SQL Server service account) does not have permission to the share.

    If i want to save the file in share path what and where it needs to be done here at the Dev server?

  • You need to grant the account which SQL Server runs under permission to access the share. If the service account is not a domain account, it first needs to be changed to a domain account.

    Speak to your server admin/network admin for the permissions, if you're the DBA you may not have permission to assign permissions on the remote server.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • It is in domain account.

    I am logging as dbo.

    What grant permission is needed here and where it is needs to be given ,to which service ??

    GilaMonster (3/13/2015)


    You need to grant the account which SQL Server runs under permission to access the share.

    Thanks

  • You need to grant permission on the share and folder (the ones in Windows) to the account that SQL Server runs under.

    If you don't have permissions on the windows server to make security changes to the folders, speak to your sysadmin or windows admin and ask them to do it for you. These are not SQL permissions so the fact that you're logging into SQL as dbo is totally irrelevant.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • As i said in my first post i am able to open and create/write/delete files in \\mynetwork\yuvipoy\ path.

    Unable only when i used sp_trace_create function.

  • Steps :

    I am connecting my dev server from my local machine.

    i have created a shared path in my local machine.

    Ran the query from my local machine connecting dev server.

    I am giving my shared path here.

    when i given my dev server path it is saving.

    -------------

    but the result fails with Error = 0x8007052e(Logon failure: unknown user name or bad password.).

  • yuvipoy (3/13/2015)


    As i said in my first post i am able to open and create/write/delete files in \\mynetwork\yuvipoy\ path.

    Unable only when i used sp_trace_create function.

    The key word there is that "you" are able to open and run those things. But, when you run sp_trace_create, it's SQL Server itself that has to have permission. Whatever login it is running under.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • yuvipoy (3/13/2015)


    As i said in my first post i am able to open and create/write/delete files in \\mynetwork\yuvipoy\ path.

    Which is utterly irrelevant as the account that's running the sp_create_trace is the account which SQL Server is running under, not your login. Hence why I repeatedly referred to "the account that SQL Server runs under"

    Steps:

    * Identify the domain account that SQL Server is running under. If it's not a domain account, speak to your sysadmin/network admin about getting a domain account for SQL Server and change the service to run under that login

    * On the dev server, go to the folder that you're trying to write the trace to and give the account that SQL Server runs under permission to write to the folder and share. Again, speak to your sysadmin/network admin if you don't have permission to make security changes to a server.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply