Use sys_context

i m using sys_context in sql plus for queries regarding operating system information.
now i would like to use sys_context in form as select into but oracle says error
ERROR 201 at line 7
identifier 'SYS_CONTEXT' must be declare
can anyone help me.
asif ali

I don't know what you mean by "terminal name". If you want to get the user's IP address, you can create a stored function (or create a package, and include the function there), that returns the USERENV sys_context variable. Here is how you create a function on the database:Create or replace Function IP_Address return varchar2 is begin
  Return sys_context('USERENV','IP_ADDRESS');
End;
/Now, you can use the function from a SQL select, another procedure, or a form. Here are several examples:
In SQL:Select IP_Address from dual;In a form:Message('IP Address='||IP_Address);

Similar Messages

  • How to use sys_context in form

    i would like to need info about
    how to use sys_context in form
    for getting value in variable

    I don't know what you mean by "terminal name". If you want to get the user's IP address, you can create a stored function (or create a package, and include the function there), that returns the USERENV sys_context variable. Here is how you create a function on the database:Create or replace Function IP_Address return varchar2 is begin
      Return sys_context('USERENV','IP_ADDRESS');
    End;
    /Now, you can use the function from a SQL select, another procedure, or a form. Here are several examples:
    In SQL:Select IP_Address from dual;In a form:Message('IP Address='||IP_Address);

  • How to use SYS_CONTEXT Function/procedures

    Hello, I am not familiar with this function and am trying to get a better understanding of how it works and how to find WHERE the data is being stored.
    I understand that this is an Oracle Function as well as how its parameters are used, but I don't understand where the data is stored:
    Example (my client created this query - in part):
    SELECT
    COLUMN1,
    COLUMN 2
    from TABLEA A
    where a.company = sys_context('USER_CONTEXT','SL_OJSQ_COMP_CODE')
    and a.job_code = sys_context('USER_CONTEXT','SL_OJSQ_JOB_CODE')
    and a.phase = sys_context('USER_CONTEXT','SL_OJSQ_PHS_CODE')
    and a.category = nvl(sys_context('USER_CONTEXT','SL_OJSQ_CAT_CODE'), a.category)
    I am trying to figure out how the JOIN is being used. How can I find the table/data for sys_context('USER_CONTEXT','SL_OJSQ_COMP_CODE') or maybe it is not a table/data but a package...?
    Any guidance is appreciated,

    Hello, I am not familiar with this function and am
    trying to get a better understanding of how it works
    and how to find WHERE the data is being stored.
    I understand that this is an Oracle Function as well
    as how its parameters are used, but I don't
    understand where the data is stored:
    Example (my client created this query - in part):
    SELECT
    COLUMN1,
    COLUMN 2
    from TABLEA A
    where a.company =
    sys_context('USER_CONTEXT','SL_OJSQ_COMP_CODE')
    and a.job_code =
    sys_context('USER_CONTEXT','SL_OJSQ_JOB_CODE')
    and a.phase =
    sys_context('USER_CONTEXT','SL_OJSQ_PHS_CODE')
    and a.category =
    nvl(sys_context('USER_CONTEXT','SL_OJSQ_CAT_CODE'),
    a.category)
    I am trying to figure out how the JOIN is being used.
    How can I find the table/data for
    sys_context('USER_CONTEXT','SL_OJSQ_COMP_CODE') or
    maybe it is not a table/data but a package...?
    Any guidance is appreciated,There is no JOIN in your statement.
    USER_CONTEXT is the name of an application context which is already created and should be initialized in your session. It is simply a set of attributes and your query shows some of them : SL_OJSQ_COMP_CODE, SL_OJSQ_CAT_CODE, ...
    you can query the view session_context to see attributes and values of contexts initialized in your session

  • SSO  Using Sys_Context function in Discoverer to validate

    We are using a calculation which uses the function SYS_CONTEXT('USERENV','CLIENT_IDENTIFIER') in 10G, we are now upgrading to 11G and this function does not work. Can someone direct me to what action I need to change 'Client_Identifier" to or how to make this work in 11G

    Hello
    Are you talking about upgrading Discoverer from 10g to 11g or the database from 10g to 11g?
    Also, when you say "it does not work" can you be more specific? Do you get any error messages and have you been able to test this using something like TOAD?
    Perhaps it is as simple as a missing grant to the Discoverer user? Here's the script I use, perhaps you can take a look and see if your users have the same privileges.
    accept username prompt'Enter Username: '
    accept pword prompt'Enter Password: '
    create user &username identified by &password;
    grant connect, resource to &&username;
    grant analyze any to &&username;
    grant create procedure, create sequence to &&username;
    grant create session, create table, create view to &&username;
    grant execute any procedure to &&username;
    grant global query rewrite to &&username;
    grant select any table, unlimited tablespace to &&username;
    grant execute on sys.dbms_job to &&username;
    grant select on sys.v_$parameter to &&username;
    Does this help?
    Michael

  • Session data is not unique when using SYS_CONTEXT in web service applicatio

    Hi, I am using DBMS_SESSION.SET_CONTEXT in my web service application to set session variables which--according to the documentation, if I understand it correctly-- are supposed to be unique to each session. But if I change the variables from a browser on one client machine, I can then see the changes when I connect from a browser on another client machine. Do all calls to my web service connect to the database as the same session? What happens when multiple clients are connected? I also use global temporary tables in my application. My assumption was that each client that connected would have a unique session. But this doesn't appear to be the case?...or is there something I am missing?

    This has been logged as a bug and was upgraded to severe in March, but nothing has been done on it as far as I am aware. Beware this bug also affects global temporary tables--the same session and everything related to --including session context variables and global temp tables are shared by every call to the web service.
    Service Request 6067517.994 - SYS_CONTEXT SESSION DATA IS NOT PRIVATE BETWEEN MULTIPLE CLIENT SESSIONS has been updated by Oracle Support with relevant information on 18-JAN-07.
    To view the progress on-line via MetaLink, go to this URL:
    http://metalink.oracle.com/metalink/plsql/tar_main.this_tar?tar_num=6067517.994&p_ctryCode=840

  • How to use VPD in Java/Struts JSP portlet with SSO

    DB = 10.1.0 (Standard Edition)
    Portal = 9.0.4.1
    10gAS = 9.4.0.1 (EE)
    I am in the beginning stages of developing some portlets that will be Java/Struts JSP based. We use SSO and have implemented some VPD security in our DB by creating some views that use SYS_CONTEXT('USERENV','CURRENT_USERID').
    These Java portlets connect to the DB using a defined JDBC connection for the OC4J container they are deployed in. The problem I'm having is that the call to SYS_CONTEXT is returning the user of the JDBC connection and not the SSO user. So far I have been unable to find any documentation that will point me in the right direction to get this configured properly.
    Deployment and configuration are as follows. Deploy war file to custom container on app server. In the configuration of the OC4J contain the app used the containers default JDBC connection using the oracle.jdbc.pool.OracleDataSource class. Max and Min open connections are blank.
    In the portal configuration under Navigator - Providers tab we defined a new Registered Provider. In the Connections tab for the provider we Specify the URL Http://hpsrv02.simsol.com:7777/discovery-portlets/providers. Under "Specify how the user's identity will be set by the Portal..." the "The user has the same identity in the Web providers application as in the Single Sign-On identity" is selected. Under "User/Session Information" User is selected and Login Frequency is set to "Once per user session". Then we created a new portal page and created a new portlet with the new provider.
    Just an FYI I do have Discoverer working with VPD and any report portlet, dynamic page portlet and any other type of portlet I created all work correctly with VPD it is just the java/struts one that is not working.
    So does any one have any insight into what configuration steps I have missed?
    Any help is much appreciated,
    Ed Klinger

    Ed,
    Your java code must get the SSO username (it's just a HTTP header variable) :
    ie: code sample...
    Enumeration e = request.getHeaderNames();
    while (e.hasMoreElements()) {
    String name = (String)e.nextElement();
    String value = request.getHeader(name);
    out.println("<br> "+name + " = " + value);
    if (name.toUpperCase().trim().equals("OSSO-USER-DN")){
    dn_user=value;
    out.println("<br>******** USER DN = "+dn_user);
    Then, the SSO username can be used in the VPD policy.
    Note that there is a difference between the sso username and the database username . SSO username is not known by database (CURRENT_USERID will return a database username)
    Discoverer worked OK in your case with the SYS_CONTEXT (.. CURRENT_USERID) because authentication is made by database user, probably.

  • Sys_context and Order by clause

    Hi All,
    Im using Oracle 11g R2.
    Is it somehow possible to use Context variable (to store column name) in ORDER BY clause? My ultimate aim is to construct Order by at runtime without using concatenation.
    e.g. i created context as my_ctx for some pkg and its variable as v_ctx having value set as "TABLE_NAME"
    so is it possible to use it as
    select * from all_tables
    order by sys_context('my_ctx', 'v_ctx');
    if no, is there any work around??
    Thanks,
    Vivek

    Hi, Vivek,
    Vivek wrote:
    Hi All,
    Im using Oracle 11g R2.
    Is it somehow possible to use Context variable (to store column name) in ORDER BY clause? My ultimate aim is to construct Order by at runtime without using concatenation.Sure, you can use SYS_CONTEXT in an ORDER BY clause, but it's unclear what you're trying to do, so I don't know if SYS_CONTEXT will help you.
    e.g. i created context as my_ctx for some pkg and its variable as v_ctx having value set as "TABLE_NAME"
    so is it possible to use it as
    select * from all_tables
    order by sys_context('my_ctx', 'v_ctx');
    if no, is there any work around??Post a complete test script hat people can run to re-create the problem and test their ideas. Show the output you want from the parameters an data you give.
    Think about using a CASE expression in the ORDER BY clause. You can use SYS_CONTEXT in the CASE expression if you want to.

  • SYS_CONTEXT not returning results

    Hi - noobie question,sorry in advance.
    I'm studying for the OCA and I've come across a function called SYS_CONTEXT
    [http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions184.htm#SQLRF06117]
    I'm trying to retrieve my own IP address by using SYS_CONTEXT('USERENV', 'IP_ADDRESS'). SQL*Plus is accepting it but returning nothing and I don't know why. I've tried a few arguments (e.g. SYS_CONTEXT('USERENV', 'AUTHENTICATION_DATA') but still nothing is returned. Always using USERENV as I believe this is the built-in namespace in Oracle.
    any advice helpful at this point.
    PS I'm connected to OracleXE as SYSTEM

    1006948 wrote:
    Hi - noobie question,sorry in advance.
    I'm studying for the OCA and I've come across a function called SYS_CONTEXT
    [http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions184.htm#SQLRF06117]
    I'm trying to retrieve my own IP address by using SYS_CONTEXT('USERENV', 'IP_ADDRESS'). SQL*Plus is accepting it but returning nothing and I don't know why. I've tried a few arguments (e.g. SYS_CONTEXT('USERENV', 'AUTHENTICATION_DATA') but still nothing is returned. Always using USERENV as I believe this is the built-in namespace in Oracle.
    any advice helpful at this point.
    PS I'm connected to OracleXE as SYSTEMDon't connect as sys or system (there's a very small number of cases in which you need to do that).
    Those accounts are "special" and shouldn't be used for day to day operations like what you are trying to do. Playing in those accounts will cause you no shortage of headaches.
    Cheers,

  • Sys_context not working from APEX application / environment

    I am struggling to retrieve a user-defined context value using sys_context(...) from APEX application / environment
    I have created a global context to be used as a storage mechanism for log severity to be recorded.
    CREATE OR REPLACE CONTEXT PA_LOGGER_CTX USING PA_LOGGER ACCESSED GLOBALLY;It is seeded through a function pa_logger.set_severity(1) within the package pa_logger through (excerpt):
      dbms_session.set_context(c_ctx_context_label, c_ctx_severity_label, TO_CHAR(p_severity_in));
      with:
      c_ctx_context_label     CONSTANT NVARCHAR2(16) := 'PA_LOGGER_CTX';
      c_ctx_severity_label    CONSTANT NVARCHAR2(8) := 'SEVERITY';
      p_severity_in   IN  PLS_INTEGERusing the following from sqlplus, other DB-tools, works as expected:
    -- setting it
    BEGIN
      pa_logger.set_severity(2);
    END;
    -- displaying it
    SELECT sys_context('PA_LOGGER_CTX', 'SEVERITY') FROM DUAL;returns 2
    This works from different sessions, different users ... no problem.
    Using it from within an APEX (accessed via embedded gateway/XE11.2 or OHS/11.2.0.2.0 ) application or even from the "SQL Commands" from the APEX Workspace returns a NULL value for :
    SELECT sys_context('PA_LOGGER_CTX', 'SEVERITY') FROM DUAL;And
       SELECT value  FROM GLOBAL_CONTEXT WHERE NAMESPACE='PA_LOGGER_CTX' and ATTRIBUTE = 'SEVERITY';returns the right value, which obviously defies the purpose of using the CONTEXT.
    It is as well possible to set the CONTEXT to a different value, which is picked up outside APEX, but even so using sys_context does not work, always returning NULL
    As a note aside: using sys_context with a standard CONTEXT, e.g. SELECT sys_context('USERENV', 'NLS_DATE_FORMAT') from DUAL works without any problems.
    I guess I have a conceptual break somewhere. Does this have to do with the APEX user used, wrapping within the APEX environment, the way the context is defined ....
    Any help is appreciated.
    Many thanks,
    - Thomas

    Hi Rod,
    Thanks for the time to answer. Meanwhile I found some more hints on the subject (Retrieve values from my own global context in Apex and I do now understand the concept.
    I understand that I can even clear the specific CLIENT_IDENTIFIER by issuing a "dbms_session.clear_identifier()", which then subsequently works
    Looking at the CLIENT_IDENTIFIER as set by APEX it is "<apex_login_user><apex_session>";
    I understand it is set for every DISPLAY-SUBMIT it is reset by the APEX framework.
    Hence it is not sufficient to set it for a user session; it needs to be changed for every display-submit. I can achieve this through application processes, but I am really reluctant to do so, because I do not know, if APEX relies on the CLIENT_IDENTIFIER to be set the way it is done. I suspect a purpose behind this, causing me problems elsewhere. I post this as a seprate question as this question has been answered.
    On to your point about: Using a table variable. This is the way it works currently, but allegedly using the CONTEXT would give us for the logging configuration a performance gain of about 1 dimension..... but unfortunately other problems..
    Thanks!
    - Thomas

  • Probs sharing a report that uses SETPARAM to pass multiple parameters

    Ok we have master DB account Disco that creates reports. I also have oracle acct Duser for the users to run the reports.
    Per Metalink Note:304192.1, we've got the setparam stuff working to pass in date parameters into our sheet. This works fine when I run the report as Disco. When I try to share the report to Duser, it still prompts for the dates, but then the report returns all 0's for the results. I have no idea why this is happening.
    Any suggestions on how to share reports with other users that pass in parameters would be much appreciated. thanks!!
    Allen

    Hi Allen,
    I would always recommend that you use sys_context to pass parameters. You can search this site for sys_context or take a look at (Re: Passing multiple parameters into Custom Folder... for more details.
    Rod West

  • Sys_context - Error in Oracle 8 Database

    I am using sys_context but it gives error message.
    SELECT SYS_CONTEXT ('userenv', 'host') FROM dual
    ------ it gives following message
    SELECT SYS_CONTEXT ('userenv', 'host') FROM dual
    ERROR at line 1:
    ORA-00904: invalid column name
    Pl. help me urgently
    My database is ORACLE 8.

    Please post your technical questions [url http://forums.oracle.com/forums/forum.jsp?forum=61]here for quick response.
    Regards,
    Anupama
    [url http://otn.oracle.com/sample_code/]OTN Sample Code

  • SYS_CONTEXT in JDeveloper

    I use sys_context and fine grain control in our application. However, sys_context doesn't seem to work fine for application running Java. My procedure to set predicate is as following:
    /* To set select predicate. */
    CREATE OR REPLACE
    FUNCTION SELECT_POLICY
    (P_OWNER VARCHAR2
    ,P_OBJECTNAME VARCHAR2
    RETURN VARCHAR2
    IS
    -- Program Data
    V_PREDICATE VARCHAR2(2000);
    -- PL/SQL Block
    BEGIN --Begin of function
    IF (sys_context('Apps','Responsibility')='Client') THEN
    v_predicate :='CLIENT_ID=sys_context(''Apps'',''Client'')';
    ELSE
    v_predicate := '0=1';
    END IF;
    RETURN(v_predicate);
    END; -- End of function;
    The function work fine in SQL* Plus, but in JSP application written using JDeveloper, the result set:
    rs = dbConnection.executeQuery("select client_id from clients");
    rs.next();
    always return no row.
    However, if we use:
    rs = dbConnection.executeQuery("select client_id from clients");
    rs = dbConnection.executeQuery("select client_id from clients");
    rs.next();
    then the result set woulc obtain correct result.
    It seems that the sys_context function doesn't work in the first query.
    I make us very inconvinient in codding because every query must be execute twice.
    If you have any idea on this, please give me a hand.
    Thanks and regards,
    Hien.
    null

    - Does the value for CURRENT_SCHEMA actually match
    the ownername column for the tables in your IN
    clause? Yes
    >
    - Is there anything different between 9i and 10g?
    E.g. did you have any fine grained access control?Not that I know of, but I am not a DBA so I could not say for sure.
    Were you setting CURRENT_SCHEMA with an ALTER SESSION
    statement in 9i that you have missed in your 10g
    environment?No we do not use any ALTER SESSION statements.
    >
    - What do you get if you run the following?
    select user from dual;
    select sys_context('USERENV','CURRENT_SCHEMA') from
    dual;
    Exactly the same result
    >
    - What do you get if you run the following?
    SELECT tablename, ownername FROM
    mapinfo.mapinfo_mapcatalog
    WHERE tablename IN ('ESU_GRAPHICS', 'STREETS',
    'ASD_STREETS', 'NSG_ARCHIVE_ESU_GRAPHICS');
    380 rows of data including the 4 that I am interested in
    - Can you also show the value of your variable when
    you use a SELECT INTO in PL/SQL... Were you using
    uppercase for USERENV and CURRENT_SCHEMA in PL/SQL
    (there was an incorrect results bug when using
    lowercase attributes in PL/SQL SYS_CONTEXT calls)?I am showing the value of the variable and it is holding the correct value, and yes I am using uppercase USERENV and CURRENT_SCHEMA.
    After more investigation it looks like it is not SYS_CONTEXT, it is using a variable in the WHERE clause. If I set the variable to a hard coded value I still get the same result. If I replace the variable for a hard-coded string in the WHERE clause I get the correct result.

  • Query regarding sys_context function

    Hello
    I have created report with custom folder and parameters are passed using sys_context function. I have few queries regarding this.
    1) How to see actual sql query executed by report. I can see from discover administorator - sql inspector. But it is not showing which is value passed for sys_context parameter. If want to see query with full parameter then what to do? I have also tried to look it from toad - session browser, there also it is not showing parameter value.
    2) If anything special needed to manage sys_context variable. i.e i have executed report with parameter 1 = A and now next time executed with parameter 1 =b. Will it takes proper value, i mean sys_context parameter will be refreshed itself, or need to do somehting..
    Please help me out.
    Thanks in advance

    Hi,
    How to see actual sql query executed by reportSYS_CONTEXT returns values from a namespace. Normally you create a local namespace and values in this namespace can only be retrieved by the session. So there is no way to see the values for a Discoverer session from Toad. Normally, one would create a Discoverer report that returns all the values in your namespace that you can use for debugging.
    If anything special needed to manage sys_context variableNo, once you have set the context in the namespace using DBMS_SESSION.set_context then it is there for the rest of the session.
    Rod West

  • Using SCORE on top of View with UNION

    Hi guys,
    I explain what I'm trying to do quickly:
    2 Tables: table1 and table2 with same structure and both have a multi_column_datastore ctxsys.context.
    1 View: view1
    select * from table1
    union
    select * from table2
    if I run:
    select * from view1 WHERE contains(view1.COLUMN1,'%textext%',1 ) > 0;
    this works fine, I get the correct result.
    If I try to use SCORE function I have an error:
    select * from view1 WHERE contains(view1.COLUMN1,'%textext%',1 ) > 0 ORDER by SCORE(1);
    ORA-29921: Ancillary operator not supported with set view query block
    I understand the problem is in the UNION inside the view,is there any way to make it works keep filtering the VIEW?
    Thanks in advance

    There is no score in the view, so you can't reference the score when querying the view.  In order to put the score in the view, you need a contains clause, which requires a value.  One method of doing this is to use sys_context.  Please see the reproduction of the problem and solution below.
    SCOTT@orcl12c> -- reproduction of problem:
    SCOTT@orcl12c> create table table1
      2    (column1  varchar2(30))
      3  /
    Table created.
    SCOTT@orcl12c> insert into table1 values ('textext')
      2  /
    1 row created.
    SCOTT@orcl12c> create table table2
      2    (column1 varchar2(30))
      3  /
    Table created.
    SCOTT@orcl12c> insert into table2 values ('textext')
      2  /
    1 row created.
    SCOTT@orcl12c> begin
      2    ctx_ddl.create_preference ('test_ds', 'multi_column_datastore');
      3    ctx_ddl.set_attribute ('test_ds', 'columns', 'column1');
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> create index table1_idx on table1 (column1)
      2  indextype is ctxsys.context
      3  parameters ('datastore  test_ds')
      4  /
    Index created.
    SCOTT@orcl12c> create index table2_idx on table2 (column1)
      2  indextype is ctxsys.context
      3  parameters ('datastore  test_ds')
      4  /
    Index created.
    SCOTT@orcl12c> create or replace view view1
      2  as
      3  select * from table1
      4  union
      5  select * from table2
      6  /
    View created.
    SCOTT@orcl12c> select * from view1 where contains (view1.column1, '%textext%', 1) > 0
      2  /
    COLUMN1
    textext
    1 row selected.
    SCOTT@orcl12c> select * from view1 where contains (view1.column1,'%textext%',1 ) > 0 order by score(1)
      2  /
    select * from view1 where contains (view1.column1,'%textext%',1 ) > 0 order by score(1)
    ERROR at line 1:
    ORA-29921: Ancillary operator not supported with set view query block
    SCOTT@orcl12c> -- solution:
    SCOTT@orcl12c> create or replace view view1
      2  as
      3  select score(1) score, table1.* from table1
      4  where  contains (table1.column1, sys_context ('text_query', 'query_value'), 1) > 0
      5  union
      6  select score(1) score, table2.* from table2
      7  where  contains (table2.column1, sys_context ('text_query', 'query_value'), 1) > 0
      8  /
    View created.
    SCOTT@orcl12c> create or replace context text_query using text_proc
      2  /
    Context created.
    SCOTT@orcl12c> create or replace procedure text_proc
      2    (p_val in varchar2)
      3  as
      4  begin
      5    dbms_session.set_context ('text_query', 'query_value', p_val);
      6  end text_proc;
      7  /
    Procedure created.
    SCOTT@orcl12c> exec text_proc ('%textext%')
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> set autotrace on explain
    SCOTT@orcl12c> select * from view1 order  by score
      2  /
         SCORE COLUMN1
             3 textext
    1 row selected.
    Execution Plan
    Plan hash value: 4090246122
    | Id  | Operation                       | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                |            |     2 |    60 |     8   (0)| 00:00:01 |
    |   1 |  SORT ORDER BY                  |            |     2 |    60 |     8   (0)| 00:00:01 |
    |   2 |   VIEW                          | VIEW1      |     2 |    60 |     8   (0)| 00:00:01 |
    |   3 |    SORT UNIQUE                  |            |     2 |    58 |     8  (50)| 00:00:01 |
    |   4 |     UNION-ALL                   |            |       |       |            |          |
    |   5 |      TABLE ACCESS BY INDEX ROWID| TABLE1     |     1 |    29 |     4   (0)| 00:00:01 |
    |*  6 |       DOMAIN INDEX              | TABLE1_IDX |       |       |     4   (0)| 00:00:01 |
    |   7 |      TABLE ACCESS BY INDEX ROWID| TABLE2     |     1 |    29 |     4   (0)| 00:00:01 |
    |*  8 |       DOMAIN INDEX              | TABLE2_IDX |       |       |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       6 - access("CTXSYS"."CONTAINS"("TABLE1"."COLUMN1",SYS_CONTEXT('text_query','query_v
                  alue'),1)>0)
       8 - access("CTXSYS"."CONTAINS"("TABLE2"."COLUMN1",SYS_CONTEXT('text_query','query_v
                  alue'),1)>0)
    Note
       - dynamic statistics used: dynamic sampling (level=2)
    SCOTT@orcl12c>

  • Using prox user id & proxy password to create connection pool

    hi guys,
    Recently, I have a requirement that I need create a connection pool with oracle database, for the application, there are many database users, I want to make those users share a connection pool. But how could I do?
    So I create some news database users and grant those users connection through a proxy user id, and define connection string in my program as below:
    user id = tester01; password = tester01; data source = **; proxy user id=proxyUserA; proxy password = proxyPasswordA;
    user id = tester02; password = tester02; data source = **; proxy user id=proxyUserA; proxy password = proxyPasswordA;
    As my assumption, the above two connection string should share a connection pool which was created by proxy user id and proxy password. But as a result, those connections returned different sessionid, it means that they did not share same connection pool(I use sys_context('userenv', 'sessionid') to trace and check whether they use a same connection pool).
    Could anybody give me advice?
    Note that database version is 9i.
    Edited by: 817804 on 2010-12-2 下午11:33

    hi guys,
    Recently, I have a requirement that I need create a connection pool with oracle database, for the application, there are many database users, I want to make those users share a connection pool. But how could I do?
    So I create some news database users and grant those users connection through a proxy user id, and define connection string in my program as below:
    user id = tester01; password = tester01; data source = **; proxy user id=proxyUserA; proxy password = proxyPasswordA;
    user id = tester02; password = tester02; data source = **; proxy user id=proxyUserA; proxy password = proxyPasswordA;
    As my assumption, the above two connection string should share a connection pool which was created by proxy user id and proxy password. But as a result, those connections returned different sessionid, it means that they did not share same connection pool(I use sys_context('userenv', 'sessionid') to trace and check whether they use a same connection pool).
    Could anybody give me advice?
    Note that database version is 9i.
    Edited by: 817804 on 2010-12-2 下午11:33

Maybe you are looking for

  • GL Account balance as of a particular date

    Hi, Is there a report in SAP that gives GL account balances as of a particular date. Thanks, Ram

  • Auto save: document will not open in

    When I went to save a document for the first time, Appleworks crashed on me. I immediately went into my auto saved file to retrieve the doc but got an "unexpected end of file" message. What does that mean? How come other document will open from the a

  • IPod Nano 5th Gen Screen Problems

    I have only been using my nano 5G for less than a month and I'm facing screen problems. Two horizontal lines appear about one centimeter from the bottom of the screen similar the where the older nano 4G screen borders. Anyone else faced this same pro

  • What does "Render using LR" mean?

    Just wondering if someone could explain to me in layman's terms... I am using LR 2.7, ACR 5.7.  Photoshop CS3.  I understand that LR is using the newest version of ACR while CS3 does not have the capability to use ACR beyond 4.6. When I choose "Edit

  • Restoring my replacement iPhone4

    Hi, I just recieved a replacement iPhone 4 from Apple and plugged it into my itunes to restore the back up I had made from my old phone. When I initially plugged the phone it it gave me the option to restore from the back I had made a few days ago, h