Thursday 29 February 2024

SQL Query to Find Client(session) Oracle Driver Version

select SID, AUTHENTICATION_TYPE, CLIENT_VERSION, CLIENT_DRIVER from v$session_connect_info;
SID   AUTHENTICATION_TYPE CLIENT_VERSION CLIENT_DRIVER

----- ------------------- -------------- ---------------
2046  DATABASE            21.9.0.0.0 jdbcthin : 21.9.0.0.0
2049  DATABASE            21.9.0.0.0 jdbcthin : 21.9.0.0.0
2055  DATABASE            21.9.0.0.0 jdbcthin : 21.9.0.0.0
4875  DATABASE            21.9.0.0.0 jdbcthin : 21.9.0.0.0
14937 DATABASE            21.9.0.0.0 jdbcthin : 21.9.0.0.0


Use below query to find application user and client machine
select ses.username,ses.machine,driv.CLIENT_DRIVER,driv.CLIENT_VERSION from gv$session ses , gv$session_connect_info driv where ses.sid=driv.sid;


Tuesday 6 February 2024

Changing Sql Server Compatibility Level

The compatibility level for a database can be changed very easily using the ALTER DATABASE statement. Here is the basic syntax:

ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = version;

For example, to change a database named ‘devdb’ to the SQL Server 2022 compatibility level:

ALTER DATABASE devdb SET COMPATIBILITY_LEVEL = 160;