Database Configuration Guide

CHAPTER 6

Configuring Oracle Databases

This chapter describes how to configure your Oracle database for use with the Novell exteNd Application Server as a SilverMaster or deployment database. It includes these sections:

For more information    For the latest information on supported database versions, see the Novell exteNd Application Server Release Notes.

 
Top of page

Basic setup for Oracle databases

You'll perform the following setup steps no matter which driver your Novell exteNd Application Server will use to access an Oracle database:

  1. Create an Oracle tablespace for use with SilverMaster.

  2. Create an Oracle user for the application server.

 
Top of section

Create an Oracle tablespace for use with SilverMaster

Creating a new Oracle tablespace for use with SilverMaster ensures optimal performance and ease of installation. To create one, run SQL Plus and connect to Oracle as System or SYSDBA.

For example, this statement creates a tablespace with an initial size of 30 MB:

  CREATE TABLESPACE SilverTablespace 
  DATAFILE `c:\databases\silvertablespace.dbf' SIZE 30M; 

You can issue this statement from a SQL Plus prompt. If you choose to use an existing tablespace, make sure there is enough space available.

 
Top of section

Create an Oracle user for the application server

To connect the application server to Oracle, create a new Oracle user for exclusive use by the application server. This user will own the SilverMaster tables.

Issue the following statements using the SQL Plus utility. These statements create the user and set the user's privileges.

  CREATE USER smuser IDENTIFIED BY password 
  DEFAULT TABLESPACE SilverTablespace 
  QUOTA UNLIMITED ON SilverTablespace; 
  GRANT CONNECT, RESOURCE to smuser; 
  REVOKE UNLIMITED TABLESPACE from smuser; 

 
Top of page

Setting up an Oracle driver

The application server connects to Oracle databases using one of the following drivers:

For more information    See the application server's Release Notes for which versions of Oracle databases you can use with which drivers.

 
Top of section

Using the Oracle Thin JDBC Driver

The application server can connect to Oracle databases using the thin JDBC driver supplied by Oracle.

Install the driver

You must have the Oracle Thin JDBC Driver installed on the machine where the application server will be. It must be able to connect to the destination Oracle database.

Add the driver path to AGCLASSPATH

The location of the Oracle Thin JDBC Driver (for example, DriverPath/ojdbc14.jar and DriverPath/nls_charset12.zip) must be specified in the AGCLASSPATH variable. For Windows, AGCLASSPATH is a system environment variable. For UNIX, you'll find it in the .agprofile file. For NetWare, you need to use the setenv command to set AGCLASSPATH (setenv AGCLASSPATH=path1;path2;path3;...).

For more information    For details, see the chapter on data source configuration in the Administrator's Guide.

 
Top of section

Using the Oracle OCI Driver

The application server can connect to Oracle 9i databases using the OCI driver supplied by Oracle.

Install the driver

You must have the Oracle OCI Driver installed on the machine where the application server will be. It must be able to connect to the destination Oracle database.

Add the driver path to AGCLASSPATH

The location of the Oracle OCI Driver (for example, DriverPath/ojdbc14.jar and DriverPath/nls_charset12.zip) must be specified in the AGCLASSPATH variable. For Windows, AGCLASSPATH is a system environment variable. For UNIX, you'll find it in the .agprofile file.

For more information    For details, see the chapter on data source configuration in the Administrator's Guide.

 
Top of section

Using the Novell exteNd Oracle driver

The application server can connect to Oracle databases using the Type 2 JDBC driver supplied by Novell. Setup involves these steps:

  1. Install the Oracle SQL Net client onto the machine where the application server will reside.

  2. Create a SQL Net Alias for use by the application server.

Install Oracle SQL Net Client

If Version 2.3.4.0.0 of the Oracle SQL Net Client is not installed on the application server machine, install it now before you continue. If you do not have this version of SQL Net, obtain it from Oracle Corporation. Using the Oracle CD, follow the steps to install the client for an application user.

If you already have the client installed, you can run Oracle Installer (from the Oracle for Windows NT Program Folder) to determine the version of SQL Net that is installed.

Create an Oracle SQL Net Alias

In order to connect to the Oracle server, you must have a valid Oracle SQL Net Alias that references the target Oracle server.

Procedure To create an Oracle SQL Net Alias:

  1. Run SQL Net Easy Configuration from the Oracle for Windows NT Program Group.

    NOTE:   On UNIX, run net8wiz.sh from the $ORACLE_HOME/bin/ directory.

  2. Choose Add a New Database Alias.

  3. Enter the name of the alias (you specify this name during the application server installation).

    A suggested name for this alias is SilverMasterORCL.

  4. Choose TCP/IP as the protocol and select OK to continue.

  5. Enter the TCP/IP Host Name for the Oracle server and enter the correct Instance name.

  6. Choose OK to continue.

  7. Choose Yes to create the new alias. At this point you can exit the SQL Net Easy Configuration utility.

  8. Test the newly created SQL Net Alias by using SQL Plus to connect to the Oracle database server.

 
Top of page

Using the database with the application server

Now you're ready to access the Oracle database from the application server. This enables you to do any of the following, as appropriate:

For more information    For more information, see the chapter on data source configuration in the Administrator's Guide.

 
Top of section

Creating a deployment database on Oracle

Adding an Oracle database to the application server equates to adding an Oracle user. Adding a database does two things:

Before adding Oracle databases

Storing system tables separately   If you want to store the application server's system tables in a separate database account, create an additional database user as described above and, if using the Novell exteNd Oracle driver, create a new Oracle SQL Net Alias. The system tables may also be stored in any other databases supported by the application server.

Using a different character set   You can tell the Novell exteNd Oracle 8 driver to use a different character set than what is specified in the Oracle instance. You would do this when the character set encoding of the data is different than the character set specified by the Oracle instance. A white paper about this topic is available on the Novell exteNd Application Server product support site.

Adding a database

Specifying the database if you are using the OCI or Novell exteNd Oracle driver   When adding an Oracle database to the application server, you are asked for the name of the database. If you are using the OCI or Novell exteNd Oracle driver, the database name refers to the Oracle SQLNet Alias or tnsnames.ora entry. The SQLNet Alias points to a specific Oracle Database Instance on a specific server. Typically you have one per Oracle database.

The application server requires a unique database name. This means that it requires you to create a unique SQLNet Alias for each Oracle database user you add. So if you have SilverMaster, application tables, and the application server's system tables stored in three different Oracle database users, you need three unique SQLNet Aliases—one for each user. Each SQLNet Alias points to the same Oracle database.

For more information    Optionally, if you do not want to configure multiple SQLNet Aliases, see Using one SQLNet Alias.

Oracle 8i notes   Note the following:

Topic

Description

Using databases containing periods in their names

When using Oracle 8i, you cannot use a database name that contains a period. You can successfully add a database with a period in the name, but later interactions between the application server and the database will result in NullPointer Exception errors and other unwanted behavior.

If you are using the Novell exteNd Oracle driver, the tnsnames.ora entry is of the form myalias.domain.com. On Windows, it is sufficient to specify only myalias for the database name when adding a database to the application server and the connection to the database will be successful. But on most UNIX platforms this truncated specification will not succeed in a match for the entry in tnsnames.ora. When you add the database to the application server, it will result in the error TNS names entry not found.

Verifying your connection

The application server's database connection behavior is consistent with that of SQLPlus. The best way to troubleshoot your connection to Oracle 8i is to first verify the connection through SQLPlus. Be sure to connect only to myalias as that is what is needed for the application server.

For example, try to connect using sqlplus login/password@myalias rather than sqlplus login/password@myalias.domain.com.

If your connection to myalias does not succeed using SQLPlus, you may need to edit the tnsnames.ora entry and remove the domain.com from the entry.

Using one SQLNet Alias

This is an optional advanced feature if you are using the OCI or Novell exteNd Oracle driver. By default, the Add Database process assumes you are adding an Oracle database with a separate SQLNet Alias (TNS NAME) for each Oracle database user that you use in the application server environment.

The steps that follow are for experienced users. They document how you can install using a single SQLNet Alias.

Procedure To install using a single SQLNet Alias:

  1. When adding a new database to the application server, do not enter the SQLNet Alias (TNS NAME) in the database name box; enter any name you want.

  2. Now enter the user name and password as before and select Oracle 7 or Oracle 8 as the database platform.

  3. Choose User-specified JDBC driver for the driver set.

  4. Click Next.

    You can now enter the JDBC connection string.

  5. For the JDBC URL, enter:

      jdbc:sssw:oracle:TNSNAME
    

    replacing TNSNAME with the TNS NAME in your tnsnames.ora file.

You can now connect as many databases as you like using the same TNS NAME. Make sure you store the system tables separately.

What to avoid   You can reduce the chance of encountering problems if you follow these rules:

Terminology differences   Different DBMSs involve different terminology. The application server uses the term databases, but on Oracle these map to Oracle database users. The following table describes other differences.

Application server term

Oracle term

SilverMaster database

Oracle database user that owns the SilverMaster tables

Add a database

Add a specific user in an Oracle database

 
Top of page

Using synonyms

The application server provides support for Oracle 8 and later synonyms for tables and views.

NOTE:   With Oracle, you can also define synonyms for other kinds of objects, including object tables, object views, and stored procedures. The application server supports synonyms only for tables and views.

 
Top of section

Specifying the driver

In order to enable synonym support, you need to specify one of the following driver sets when adding the Oracle database to the application server:

 
Top of section

Types of synonyms

Synonyms can be either private or public. A public synonym is owned by the special user group PUBLIC; every user of a database can access it.

A private synonym is in the schema of a specific user, who has control over its availability to others (see Oracle's Oracle 8 Concepts manual). Individual users can see only the public synonyms and their own private synonyms.

 
Top of section

Enabling and disabling synonym support

There is a property called includeSynonyms in the platforms.dbl file (in the application server's Resources directory) that specifies whether a driver supports synonyms. The property is in the PROPERTIES section for the driver.

  DRIVER
  /Name ...
  /JdbcDriver ...
  /DriverSet ...
  ...
  
  PROPERTIES
  /includeSynonyms       "true"

If you want to use one of these drivers but want synonym support disabled, set the includeSynonyms property to false. Similarly, if you have written your own Oracle driver and have implemented synonym support, to enable the support you need to set the includeSynonyms property to true in the PROPERTIES section for your driver.

 
Top of page

Troubleshooting

This section describes the most common errors and workarounds.

ORA-01019 "unable to allocate memory in the user side"   If you receive this message while running with a Net8 Oracle Client, free up available memory on the machine where the application server is installed.

ORA-01460 "unimplemented or unreasonable conversion requested"   If you receive this message when SilverMasterInit is creating an Oracle SilverMaster or when you are attempting to add an Oracle database to your application server, you must upgrade to at least Version 8.0.4 of the Oracle client software. This problem occurs on versions before 8.0.4.

ORA-01631, 00000, "max # extents (%s) reached in table %s.%s"   This message is caused when a table tried to extend past maxextents. To solve this problem, check your INITIAL, NEXT, and PCTINCREASE parameters on the DEFAULT TABLESPACE for the SilverMaster user. You must get your DBA to increase them. For example:

  SELECT DEFAULT_TABLESPACE 
  FROM dba_users 
  WHERE username = 'MYUSER'; 
  SELECT * 
  FROM dba_tablespaces 
  WHERE tablespace_name = 'MYTABLESPACE'; 
  ALTER TABLESPACE MYTABLESPACE 
  DEFAULT STORAGE (INITIAL 10K, NEXT 10K, PCTINCREASE 50); 

ORA-01950, 00000, "no privileges on tablespace '%s'"   This message is caused when a user does not have privileges to allocate an extent in the specified tablespace. To solve this problem, grant QUOTA to the user on the mentioned database. For example:

  ALTER USER MYUSER 
  QUOTA UNLIMITED ON MYTABLESPACE; 

TNS-12154 "TNS: could not resolve service name"   If you receive this message, you must verify that you have correctly created the SQL Net Alias as described in Create an Oracle SQL Net Alias.

Tablespaces for Oracle databases   The installation will use the default tablespace of the user name/password specified for your SilverMaster database. You can usually set the default tablespace with the following SQL statement:

  ALTER USER username DEFAULT TABLESPACE mytablespace ;

Adding large numbers of tables   If you are planning to connect the application server to a large Oracle tablespace, open the Server Management Console (SMC) and change the value of the timeout for server requests to 30,000 seconds.

You must modify this value before attempting to add any large Oracle application. Once the application has been added successfully, reset the value back to the default value (3,000). The application server must be restarted for these changes to be applied.

For more information    For more information, see the section on setting performance parameters in the Administrator's Guide.

Using different database types with the same application server   If you install with a non-Oracle SilverMaster and want to add an Oracle database, you need to have $ORACLE_HOME set and have $ORACLE_HOME/lib in your LD_LIBRARY_PATH (for Solaris and Linux).

Adding an Oracle 8i database on Solaris   On Solaris, if you are not using an Oracle 8i database as your SilverMaster but are using Oracle 8i client software and want to add an Oracle 8i database to your server, you must copy a library file in the $EXTENDAPPSERVERROOT/bin directory. By default, the installed Oracle driver library file is appropriate for Oracle 8.

The following procedure will allow you to use the Oracle 8i library file instead:

  1. Back up the libagora8_jni.so file:

      # cd $EXTENDAPPSERVERROOT/bin
      # cp libagora8_jni.so libagora8_jni.so.orig
    
  2. Copy the Oracle 8i driver library file:

      # cp libagora8_jni.so.8i libagora8_jni.so
    




Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...