Re: setting v$session.program?

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Wed, 10 Jun 2009 01:26:48 +0200
Message-ID: <4A2EEFB8.6000504_at_gmail.com>



joel garry schrieb:
> On Jun 9, 12:59 pm, m..._at_pixar.com wrote:
>> sybra..._at_hccnet.nl wrote:
>>> On Tue, 09 Jun 2009 18:09:10 GMT, m..._at_pixar.com wrote:
>>>> It's currently the name of the interpreter executable,
>>>> and I want to change it to the "real" name of my program.
>>> Why on earth?
>> They are python programs, which are run by the
>> python interpreter.  So instead of seeing program
>> names like "update_users.py" or "nightly_cleanup.py"
>> oracle shows "python.exe" for all programs.
>>
>> --
>> Mark Harrison
>> Pixar Animation Studios

>
> I don't remember how, but there are things on the net like
> http://www.uofr.net/~greg/processname.html and
> http://mail.python.org/pipermail/python-list/2001-February/069667.html
> (I was looking for a simple wrapper from way back I'm sure I've seen,
> but couldn't find it with a quick search).
>
> It can vary significantly by OS, and even depending on which calls or
> programs are used to look. Don't know how variable Oracle is, but
> these things tend to use the local variants, as Oracle has to ask the
> OS or "trust" a client.
>
> I'm kinda wondering what would happen if you created links of the
> various names you want, pointing at python (or copying/renaming if you
> don't have links). Only if you have just a few, of course. More info
> google on spoofing oracle.
>
> jg
> --
> _at_home.com is bogus.
> Great Wall of Los Angeles http://www.sparcmurals.org/sparcone/index.php?option=com_content&task=view&id=28&Itemid=60

There should be a possibility to set the value of v$session.program over OCI process handle attribute (if i look right in the docs, it should be the OCI_ATTR_MEMPOOL_APPNAME). This is implemented in the Oracle jdbc drivers (i've seen for sure on this newsgroup a working example, a couple of metalink notes exist as well), however i don't have a clue, how difficult is it to implement in cx_Oracle, but one can ask Anthony Tuininga about it.
Personally i don't see much value in such thing, because module,clientinfo and action gives you a lot of flexibility and (thankfully) it can be set directly from cx_python without need to call dbms_application_info. These attributes can be as well changed at runtime, giving you much better instrumentation than static value of program attribute. For security reasons ( for example - restricting access for some programs) it is practically useless as well, because you can easily change this attribute by simply renaming of executables - works on windows and unix ( don't know about windows, but on linux even symlink work).

Best regards

Maxim

-- 
Why make things difficult, when it is possible to make them cryptic
and totally illogical, with just a little bit more effort?

Aksel Peter Jørgensen
Received on Tue Jun 09 2009 - 18:26:48 CDT

Original text of this message