Setting up the Oracle Language Environment

Use the following steps to access Oracle databases from a Net.Data macro:

  1. Ensure the appropriate components of Oracle are installed and working as follows:
    1. Install SQL*Net on the machine where Net.Data is installed, if it is not already installed. For more information, see the following URL:
      http://www.oracle.com/products/networking/html/stnd_sqlnet.html
      
    2. Verify that the Oracle tnsping function can be used with the same security authorization that your Web server uses. To verify, log on with your Web server's user ID and type:
      tnsping oracle-instance-name
      

      Where oracle-instance-name is the name of the Oracle system that your Net.Data macros access.

      You might not be able to verify the tnsping function on Windows NT if your Web server runs under system authority. If so, skip this step.

    3. Verify that the Oracle tables can be accessed with the same security authorization that your Web server uses. To verify, enter an SQL SELECT statement, using the SQL*Plus line command tool, to access an Oracle table with an SQL SELECT statement with the authority of your Web server. For example:
      SELECT * FROM tablename
      

      You might not be able to verify table access on Windows NT if your Web server runs under system authority. If so, skip this step.

    Troubleshooting: Do not proceed if the above steps fail. If any of the steps fail, check your Oracle configuration.
  2. Ensure that the Oracle environment variables are set correctly in your Web server process. Hint: You might require additional lines for other Oracle environment variables, depending on the Oracle facilities you plan to use, such as national language support and two phase commit. Consult the Oracle administration documentation for more information on these environment variables.
  3. Test the connection to Oracle from Net.Data. In your Net.Data macro, specify the appropriate values in the LOGIN and PASSWORD variables. Do not define the Net.Data DATABASE variable when accessing Oracle databases. The following is an example of connect statement in a macro:
    %DEFINE LOGIN=user_ID@remote-oracle-instance-name
    %DEFINE PASSWORD=password 
    

    Local Oracle instances:

    If you access the local Oracle instance only, do not specify the remote-oracle-instance name as part of the login user ID, as in the following example:

    %DEFINE LOGIN=user_ID
    %DEFINE PASSWORD=password
    
    Live Connection:

    If you use Live Connection, then you can specify the LOGIN and PASSWORD in the Live Connection configuration file, although it is not recommended for security purposes. For example:

    CLIETTE DTW_ORA:{
    MIN_PROCESS=1
    MAX_PROCESS=3
    EXEC_NAME=./dtwora8
    DATABASE=not_used
    LOGIN=userid@remote_oracle_instance_name
    PASSWORD=password
    }
    
    Hint: Do not specify the DATABASE variable for Oracle.
  4. Test your configuration by running a CGI shell script to ensure that the Oracle instance can be accessed from your Web server, as in the following example:
    #! /bin/sh
    echo "content-type; text/html
    echo
    echo "<html><pre>"
    set
    echo "</pre><p>&nbsp;</p><pre>"
    tnsping oracle-instance-name
    echo
    

    Alternatively, you can execute tnsping directly from a Net.Data macro, as in the following example:

    %DEFINE testora = %exec "tnsping oracle-instance-name"
    %HTML (report){
    < P>About to test Oracle access with tnsping.
    < hr>
    $(testora)
    < hr>
    < P>The Oracle test is complete.
    %}
    

    Troubleshooting:

    If the verification step fails, check that all the preceding steps were successful by verifying the following items:

    If the verification step still fails, contact IBM Service.

Example:

After you have completed the accessing verification steps, you can make calls to the Oracle language environment with functions in the macro, as in the following example:

%FUNCTION(DTW_ORA) STL1() {
insert into $(tablename) (int1,int2) values (111,NULL)
%}


[ Top of Page | Previous Page | Next Page | Index ]