Hi all,
Our company just upgraded our users' Navision client from Navision 4.0 SP3 to the Navision Classic Client from Dynamics NAV 2009 R2, both using the client with SQL Server option. Our users have been able to resume their usual functions. However ever since the conversion, super users that were able to view all the currently logged in sessions via File--> Database--> Information --> Sessions tab--> Current Sessions (F6 or drill down to open Database Sessions table) on the old Navision 4.0 SP3 client, using the Navision Classic Client from NAV 2009 all we are able to see is one User ID, despite it listing the correct amount of current sessions (which is more than one user).
Unlike others who have posted this similar problem, the User ID that I see on my current database sessions isn't my own session. Rather, it's apparently the first entry on our list of database users. I don't have any filters on the table. We have the traceflag 4616 set already as it was required for us to even log into Navision using the SQL server.
Could any please help?
My thanks in advance!
0
Answers
Also I don't think you need Trace flag 4616 any longer for NAV 2009. There was a blog about that. You should remove it.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Not sure it will resolve your problem, but just check it.
Navision Developer
@ara3n: It seems that I don't need the trace flag 4616 anymore, although removing it doesn't resolve the issue with viewing all the current database sessions under SQL.
@rmpatel22: while I don't specifically see a "sysowner" under Permissions, I've tried logging in with a user that was granted serveradmin and sysadmin rights, and I'm still unable to view all current sessions.
As a matter of fact, during the process of removing the trace flag 4616, I was forced to restart the SQL service to complete the change so it comes into effect. Naturally, it forced all users that were logged into the SQL database off of it. I still see the correct number of users currently logged in to the database under current session as I did before, but now I don't see ANY users listed on Database Sessions table when trying to view current database sessions. Before I was able to see one (and it wasn't my own session).
Any other ideas?
Search the forum for other tips. It has been discussed several times..
FD Consulting
What's weird is that users with db_owner permissions are able to view the current sessions of our test SQL database from the NAV 2009 R2 Classic client. This test database hasn't been converted for use with the NAV 2009 client, but rather our older Navision 4.0 SP3.
However, as I mentioned before, those same users can't view the current sessions for the production database, which was converted for NAV 2009.
I noticed on Navision 4.0 SP3, "Microsoft Business Solutions-Navision" is displayed on the Title Bar when you use that version. However, on NAV 2009 R2 (using the classic client), it's "Microsoft Dynamics NAV Classic". This may seem kind of silly to suggest but does anyone think that may play a role into the problem I'm having? Looking at the code for the the Session view from the production and test database in SQL Server 2005 Management Studio, I see the program_name referencing 'Microsoft Business Solutions-Navision client' on both.
Any thoughts?
This is the part in session view which does this: ??? If you can access the DB with the R2 client then it was already converted to 2009 R2.
Why db_owner should help I have no idea. You coud try to add read permissions to table Session in NAV and synchronize security.
Btw, which security model are you running?
FD Consulting
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool
@FDickschat: Thanks for bringing up the Activity Monitor. It was a helpful hint. For the record, NAV 2009 R2 also displays "Microsoft Dynamics NAV Classic client".
Here's what I did to solve my problem... (at least I hope it's the solution...):
To provide some background we are using the following:
-NAV 2009 R2's Classic client with Microsoft SQL Server (not native)
-Microsoft SQL Server 2005
We were previously using:
-Navision 4.0 SP3 with Microsoft SQL Server Option (again not native) using the same SQL Sever 2005
1. Open SQL Server Management Studio and navigate to the Session table
SQL Server-->Database-->Database name-->Views-->dbo.Session
2. Right-click on dbo.Session, go to Script View as--> ALTER To-->New Query Editor Window
3. Find the following line:
WHERE (SP.ecid = 0) AND (SP.program_name = 'Microsoft Business Solutions-Navision client')
and change 'Microsoft Business Solutions-Navision client' to 'Microsoft Dynamics NAV Classic client'.
That should solve why the Session virtual table in Navision wasn't populating the list of current users. But I ran into another error. If I just run this query, after restarting Navision I'll get the following error:
The Session table contains a Microsoft Dynamics NAV Classic field data type that is not compatible with the SQL Server data type:
Field: Wait Time (ms)
Type: Integer
SQL type: BIGINT
This where NavIndia (Sandeep) from this forum's advice came in handy (see his thread here: http://www.mibuso.com/forum/viewtopic.php?f=23&t=15451&start=0)... On to step 4!
4. Change the code
SP.[waittime]
to
CAST(SP.[waittime] AS INT)
5. Press F5 to execute the query.
and that should be it. I was able to view the current logged in database sessions without coming across any errors. Hopes this helps anyone else having this problem.
Thanks again everyone for your suggestions and time. I really appreciate it.
RIS Plus, LLC
That was my first reply but I guess he didn't understand it.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Our database (prior to any fixes):
CASE WHEN SP.[blocked] <> 0 THEN SP.[waittime] ELSE 0 END AS [Wait Time (ms)], CAST(SP.blocked AS INTEGER) AS [Blocking Connection ID],
Cronus NAV 2009 R2:
CAST(CASE WHEN SP.[blocked] <> 0 THEN SP.[waittime] ELSE 0 END AS INTEGER) AS [Wait Time (ms)], CAST(SP.blocked AS INTEGER) AS [Blocking Connection ID],
and...
Our database (prior to any fixes):
WHERE (SP.ecid = 0) AND (SP.program_name = 'Microsoft Business Solutions-Navision client')
Cronus NAV 2009 R2:
WHERE (SP.ecid = 0) AND (SP.last_batch >= CONVERT(DATETIME, '2000-01-01 00:00:00', 120))
There's probably no harm in trying the Cronus database coding on our test database to see what the effects are... but it's Super Bowl time. lol... maybe later.
I am curious as to why we even refer to the program name specifically like that to begin with. It makes us prone to these silly NAV problems with viewing sessions.
Also, would anyone care to explain what the code (SP.last_batch >= CONVERT(DATETIME, '2000-01-01 00:00:00', 120) means?
Thanks everyone.
we upgraded our customer from native to SQL database
database version is 4.0, client is 2009R2 classic, SQL 2008R2
users are unable to see session list - they can see only their session.
please, help me, what should I set up to enable them to view all sessions. I do not want to give them SYSADMIN
I tried to give permission to see server state to public, public can select from view session, I created role, which contains permission to Session virtual table in NAV and performed synchronization.
trace flag 4616 is off. I copied the Session view from cronus 2009 R2. nothing did help, unless user is sysadmin, he cannot see sessions.
thanks in advance.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
or
GRANT VIEW SERVER STATE TO [Mydomain\Myuser] with grant option;
GO
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n