Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an Oracle equivalent to SQL Server's Application Name Connection String Parameters?

When connecting to a Sql Server you can include either "App" or "Application Name" in the connection string. This makes is very easy to trace apps that share a username/password.

One good use for this is Sql Server Profiler. You can filter by application. This has been quite helpful to us in the past.

However, I'm unable to find anything like this for Oracle.

Is there an equivalent to SQL Server's "Application Name" Connection String Parameters in Oracle?

We are using Oracle provided .NET drivers (obviously connecting through .NET/C#) if that is relevant.

Microsoft Connection String Keywords

Use Application Name parameter when connecting to SQL Server

like image 458
Chris Weber Avatar asked Mar 30 '12 14:03

Chris Weber


1 Answers

I don't think you can specify the application name in the connect string.

But if you have the possibility to run a statement inside your application, you can use the DBMS_APPLICATION_INFO package to set an application name:

execute DBMS_APPLICATION_INFO.SET_CLIENT_INFO('MyProgram');

You can also use it to identify different processing steps

execute DBMS_APPLICATION_INFO.SET_MODULE('INVOICE', 'Calculating invoiced');
execute DBMS_APPLICATION_INFO.SET_MODULE('CUSTOMER', 'Checking for pending things');

This information will show up in V$SESSION

like image 198
a_horse_with_no_name Avatar answered Sep 28 '22 09:09

a_horse_with_no_name