Onconfig name
Posted in 2014
Kenneth wanted to read the server's $ONCONFIG environment variable via SQL from a JDBC app, so logs could go to a d$ONCONFIG directory per instance. The informix.sysenv view he used on IDS 11.70 doesn't exist in IDS 10, and the server environment isn't exposed through SQL there (sysmaster:syscfgtab gives onconfig parameter values, not the file name). Suggestions: a UDR calling a shell script (onstat -g env) to stash the value in a table, a flat file keyed by DBSERVERNAME, or a small repository table in each instance. Kenneth chose to store the onconfig name in a table and query it from the code.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Connectivity: ODBC / JDBC / .NET, Server Administration
Hi, I am developing a JDBC application, and need to read from within SQL the onconfig environment variable. From with IDS 11.70, I can extract the need information using the query: select trim(env_value) env_value from informix.sysenv where env_name = 'ONCONFIG'; The code needs to run on IDS 10 as we have not migrated it yet. Can you please provide some pointers from were I can read the onconfig name ? Kenneth
Hello Kenneth, Hope you're fine and it's nice to "see you" here :) I doubt it would be possible without some relatively weird trick... the views you mention did not exist in V10... But can we know why you need it? If you want to access the values inside onconfig, those are available in sysmaster:syscfgtab Regards. On Fri, May 9, 2014 at 8:35 AM, KENNETH PENZA <kenneth.penza@gov.mt> wrote: > Hi, > > I am developing a JDBC application, and need to read from within SQL the > onconfig environment variable. > > >From with IDS 11.70, I can extract the need information using the query: > > select trim(env_value) env_value from informix.sysenv where env_name = > 'ONCONFIG'; > > The code needs to run on IDS 10 as we have not migrated it yet. Can you > please > provide some pointers from were I can read the onconfig name ? > > Kenneth > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently... --089e013a18c20b84a604f8f4fb15
Kenneth: One question: Why do you need the value of this env variable? Art Art S. Kagel, Principal Consultant ASK Database Management Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, May 9, 2014 at 3:35 AM, KENNETH PENZA <kenneth.penza@gov.mt> wrote: > Hi, > > I am developing a JDBC application, and need to read from within SQL the > onconfig environment variable. > > >From with IDS 11.70, I can extract the need information using the query: > > select trim(env_value) env_value from informix.sysenv where env_name = > 'ONCONFIG'; > > The code needs to run on IDS 10 as we have not migrated it yet. Can you > please > provide some pointers from were I can read the onconfig name ? > > Kenneth > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --047d7bfcf9c2b7efd204f8f72f3d
Hi Fernando, Yes, I am find thank you:) Yes sure, actually we have a set of shell scripts that do most of our housekeeping tasks. At the moment I am writing a Java application that extracts some data from the Informix instance, process it and sends out some pdf's. In order to be consistent with our directory structure I need to put some logs to a directory with name d$ONCONFIG for a particular instance. Since from the Java application I am processing 3/4 instances, I need to get this info from the engine. Regards Kenneth Penza Systems Engineer | Service Management Department MALTA INFORMATION TECHNOLOGY AGENCY Email: Office: URL: kenneth.penzat@gov.mt +356 2599 2867 http://www.mita.gov.mt Please read our Legal Notice: http://emailpolicy.mita.gov.mt Kindly consider your environmental responsibility before printing this e-mail -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of Fernando Nunes Sent: Friday, 09 May 2014 12:23 To: ids@iiug.org Subject: Re: Onconfig name [32972] Hello Kenneth, Hope you're fine and it's nice to "see you" here :) I doubt it would be possible without some relatively weird trick... the views you mention did not exist in V10... But can we know why you need it? If you want to access the values inside onconfig, those are available in sysmaster:syscfgtab Regards. On Fri, May 9, 2014 at 8:35 AM, KENNETH PENZA <kenneth.penza@gov.mt> wrote: > Hi, > > I am developing a JDBC application, and need to read from within SQL > the onconfig environment variable. > > >From with IDS 11.70, I can extract the need information using the query: > > select trim(env_value) env_value from informix.sysenv where env_name = > 'ONCONFIG'; > > The code needs to run on IDS 10 as we have not migrated it yet. Can > you please provide some pointers from were I can read the onconfig > name ? > > Kenneth > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently... --089e013a18c20b84a604f8f4fb15 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Kenneth: Since you are running v10.00 and the server's environment is not available through SQL directly, I would suggest one of two approaches: 1. Create your own repository table in each instance either in a separate database that you can query by DBSERVERNAME, or 2. Create a flat file with the information you need that the Java app can read into a data structure at startup, say an associative array keyed by the server's DBSERVERNAME. Either way you can acquire the DBSERVERNAME from the server or from where ever you are getting the information about which instance to connect to. However, I suggest getting the server name from the server so that the app can connect to any DBSERVERALIAS, connection manager SLA name, or sqlhosts group name should you change things around to use one or more of those and still be able to look up the correct information simply without having to maintain multiple, essentially redundant, mappings. Art Art S. Kagel, Principal Consultant ASK Database Management Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, May 9, 2014 at 10:17 AM, Penza Kenneth at MITA <kenneth.penza@gov.mt > wrote: > Hi Fernando, > > Yes, I am find thank you:) Yes sure, actually we have a set of shell > scripts > that do most of our housekeeping tasks. At the moment I am writing a Java > application that extracts some data from the Informix instance, process it > and > sends out some pdf's. In order to be consistent with our directory > structure I > need to put some logs to a directory with name d$ONCONFIG for a particular > instance. Since from the Java application I am processing 3/4 instances, I > need to get this info from the engine. > > Regards > Kenneth Penza > Systems Engineer | Service Management Department > MALTA INFORMATION TECHNOLOGY AGENCY > > Email: > Office: > URL: > kenneth.penzat@gov.mt > +356 2599 2867 > http://www.mita.gov.mt > > Please read our Legal Notice: http://emailpolicy.mita.gov.mt > Kindly consider your environmental responsibility before printing this > e-mail > > -----Original Message----- > From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of > Fernando > Nunes > Sent: Friday, 09 May 2014 12:23 > To: ids@iiug.org > Subject: Re: Onconfig name [32972] > > Hello Kenneth, > > Hope you're fine and it's nice to "see you" here :) I doubt it would be > possible without some relatively weird trick... the views you mention did > not > exist in V10... > But can we know why you need it? If you want to access the values inside > onconfig, those are available in sysmaster:syscfgtab > > Regards. > > On Fri, May 9, 2014 at 8:35 AM, KENNETH PENZA <kenneth.penza@gov.mt> > wrote: > > > Hi, > > > > I am developing a JDBC application, and need to read from within SQL > > the onconfig environment variable. > > > > >From with IDS 11.70, I can extract the need information using the query: > > > > select trim(env_value) env_value from informix.sysenv where env_name = > > 'ONCONFIG'; > > > > The code needs to run on IDS 10 as we have not migrated it yet. Can > > you please provide some pointers from were I can read the onconfig > > name ? > > > > Kenneth > > > > > > > > > > > ******************************************************************************* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > > > -- > Fernando Nunes > Portugal > > http://informix-technology.blogspot.com > My email works... but I don't check it frequently... > > --089e013a18c20b84a604f8f4fb15 > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001a113373023130c104f8f8b502
Well... I can't think of anything that doesn't look awkward...
You could setup a table with
sid INTEGER,
value VARCHAR(255)
and a procedure that calls a system (shell script passing the session's SID
That script should be able to get the $ONCONFIG and INSERT the
SID/$ONCONFIG on that table.
The procedure would delete it and return it...
There can be variations of this trick... but I can't think of a clean way
to do that....
From the shell I believe you would be able to get the $ONCONFIG more easily
(onstat -g env)
Regards
On Fri, May 9, 2014 at 3:17 PM, Penza Kenneth at MITA
<kenneth.penza@gov.mt>wrote:
> Hi Fernando,
>
> Yes, I am find thank you:) Yes sure, actually we have a set of shell
> scripts
> that do most of our housekeeping tasks. At the moment I am writing a Java
> application that extracts some data from the Informix instance, process it
> and
> sends out some pdf's. In order to be consistent with our directory
> structure I
> need to put some logs to a directory with name d$ONCONFIG for a particular
> instance. Since from the Java application I am processing 3/4 instances, I
> need to get this info from the engine.
>
> Regards
> Kenneth Penza
> Systems Engineer | Service Management Department
> MALTA INFORMATION TECHNOLOGY AGENCY
>
> Email:
> Office:
> URL:
> kenneth.penzat@gov.mt
> +356 2599 2867
> http://www.mita.gov.mt
>
> Please read our Legal Notice: http://emailpolicy.mita.gov.mt
> Kindly consider your environmental responsibility before printing this
> e-mail
>
> -----Original Message-----
> From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
> Fernando
> Nunes
> Sent: Friday, 09 May 2014 12:23
> To: ids@iiug.org
> Subject: Re: Onconfig name [32972]
>
> Hello Kenneth,
>
> Hope you're fine and it's nice to "see you" here :) I doubt it would be
> possible without some relatively weird trick... the views you mention did
> not
> exist in V10...
> But can we know why you need it? If you want to access the values inside
> onconfig, those are available in sysmaster:syscfgtab
>
> Regards.
>
> On Fri, May 9, 2014 at 8:35 AM, KENNETH PENZA <kenneth.penza@gov.mt>
> wrote:
>
> > Hi,
> >
> > I am developing a JDBC application, and need to read from within SQL
> > the onconfig environment variable.
> >
> > >From with IDS 11.70, I can extract the need information using the query:
> >
> > select trim(env_value) env_value from informix.sysenv where env_name =
> > 'ONCONFIG';
> >
> > The code needs to run on IDS 10 as we have not migrated it yet. Can
> > you please provide some pointers from were I can read the onconfig
> > name ?
> >
> > Kenneth
> >
> >
> >
> >
>
>
>
*******************************************************************************
> > Forum Note: Use "Reply" to post a response in the discussion forum.
> >
> >
>
> --
> Fernando Nunes
> Portugal
>
> http://informix-technology.blogspot.com
> My email works... but I don't check it frequently...
>
> --089e013a18c20b84a604f8f4fb15
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...
--047d7b67815eb2a7a004f8fa58b9
Art, Thanks a lot for your feedback, I will add store the onconfig name within the database and query it form the code. Thanks again Kenneth Penza -----Original Message----- From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of Art Kagel Sent: Friday, 09 May 2014 16:50 To: ids@iiug.org Subject: Re: Onconfig name [32976] Kenneth: Since you are running v10.00 and the server's environment is not available through SQL directly, I would suggest one of two approaches: 1. Create your own repository table in each instance either in a separate database that you can query by DBSERVERNAME, or 2. Create a flat file with the information you need that the Java app can read into a data structure at startup, say an associative array keyed by the server's DBSERVERNAME. Either way you can acquire the DBSERVERNAME from the server or from where ever you are getting the information about which instance to connect to. However, I suggest getting the server name from the server so that the app can connect to any DBSERVERALIAS, connection manager SLA name, or sqlhosts group name should you change things around to use one or more of those and still be able to look up the correct information simply without having to maintain multiple, essentially redundant, mappings. Art Art S. Kagel, Principal Consultant ASK Database Management Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, May 9, 2014 at 10:17 AM, Penza Kenneth at MITA <kenneth.penza@gov.mt > wrote: > Hi Fernando, > > Yes, I am find thank you:) Yes sure, actually we have a set of shell > scripts > that do most of our housekeeping tasks. At the moment I am writing a Java > application that extracts some data from the Informix instance, process it > and > sends out some pdf's. In order to be consistent with our directory > structure I > need to put some logs to a directory with name d$ONCONFIG for a particular > instance. Since from the Java application I am processing 3/4 instances, I > need to get this info from the engine. > > Regards > Kenneth Penza > Systems Engineer | Service Management Department > MALTA INFORMATION TECHNOLOGY AGENCY > > Email: > Office: > URL: > kenneth.penzat@gov.mt > +356 2599 2867 > http://www.mita.gov.mt > > Please read our Legal Notice: http://emailpolicy.mita.gov.mt > Kindly consider your environmental responsibility before printing this > e-mail > > -----Original Message----- > From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of > Fernando > Nunes > Sent: Friday, 09 May 2014 12:23 > To: ids@iiug.org > Subject: Re: Onconfig name [32972] > > Hello Kenneth, > > Hope you're fine and it's nice to "see you" here :) I doubt it would be > possible without some relatively weird trick... the views you mention did > not > exist in V10... > But can we know why you need it? If you want to access the values inside > onconfig, those are available in sysmaster:syscfgtab > > Regards. > > On Fri, May 9, 2014 at 8:35 AM, KENNETH PENZA <kenneth.penza@gov.mt> > wrote: > > > Hi, > > > > I am developing a JDBC application, and need to read from within SQL > > the onconfig environment variable. > > > > >From with IDS 11.70, I can extract the need information using the query: > > > > select trim(env_value) env_value from informix.sysenv where env_name = > > 'ONCONFIG'; > > > > The code needs to run on IDS 10 as we have not migrated it yet. Can > > you please provide some pointers from were I can read the onconfig > > name ? > > > > Kenneth > > > > > > > > > > > ************************************************************************ ******* > > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > > > -- > Fernando Nunes > Portugal > > http://informix-technology.blogspot.com > My email works... but I don't check it frequently... > > --089e013a18c20b84a604f8f4fb15 > > > > ************************************************************************ ******* > Forum Note: Use "Reply" to post a response in the discussion forum. > > > > ************************************************************************ ******* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001a113373023130c104f8f8b502 ************************************************************************ ******* Forum Note: Use "Reply" to post a response in the discussion forum.
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g