10 Configuring Databases

This chapter explains how to add and remove databases from Oracle Test Manager, and how to update name, location, and login information for databases that you are using in Oracle Test Manager.

10.1 Adding Databases

You can add an existing Oracle Database 11g Enterprise Edition, 10g Enterprise Edition, or 10g Express Edition database for Oracle Test Manager and Oracle Load Testing or you can create a new schema. In addition, you can create tables in an empty database. When you add a database, the Database Configuration Utility creates a user account for the default user and the administrator. Use Oracle Test Manager Administrator to add more users and to customize projects.

10.1.1 Adding Oracle Databases

To add an Oracle database or configuration schema:

  1. Use the Oracle Application Testing Suite Database Configuration utility to configure database connections to Oracle Load Testing databases. On Windows machines, you can access the Database Configuration utility from the Tools sub menu of the Oracle Application Testing Suite Start menu. On Linux machines, you can access the Database Configuration utility from <oats_install>/bin/DbConfig.sh.

  2. Select the type of database to add: Oracle Test Manager, Oracle Load Testing, or Configuration schema.

  3. Click New.

  4. Select Use existing schema or Create new schema & tables.

    This dialog box has the following options:

    Use existing schema - when selected, a database is added using an existing Oracle database schema.

    Create new schema & tables - when selected, a database is added using an new Oracle database schema and tables.

    System user credentials - specify the login authentication credentials if you select to create a new schema and tables, as follows:

    • User name - enter the login user name for the database system.

    • Password - enter the login password for the database system.

    Connection details - enter the Oracle database connection information.

    • Name - enter the name of the database This name appears in the database selection lists for Oracle Test Manager.

    • Description - enter any description text to identify the database.

    • Host - enter the host name of the machine on which the database server is running.

    • Port - enter the port number that you want to communicate with. If you are running multiple instances of Oracle Database on the same host, specify the port number you want to communicate with.

    • Service - enter the Service name for the Oracle database.

    • User name - enter the login user name for the database.

    • Password - enter the login password for the database.

    • Tablespace - the tabespace name. When creating a new configuration schema and tables, you can choose to create a new user on the database or use an existing user. If creating a new user, provide a tablespace name where the user will be created. The "USERS" tablespace will be used as default.

    Options - select options, as follows:

    • Project Template - specifies which project template to use for test management including specific fields, reports, and, if selected, sample data for each module (Requirements, Tests, Issues, and Reports):

      • Default - when selected, the Database Configuration utility creates the default test management database schema for the Oracle Test Manger application database.

    • Insert sample data - when selected, the sample data is installed into the new database. For Oracle Test Manager, the sample data is the Sample Project used for the tutorial. For Oracle Load Testing, the sample data is the two load sessions that can be used to generate sample reports.

  5. Enter the database connection details. If you selected Create new schema & tables, enter the System user credentials and the Tablespace name.

  6. Select the Project Template to use.

  7. Select Insert sample data, if desired.

  8. Click Save.

  9. Click Close. When you add a new connection for an Oracle Load Testing database or a new Configuration schema, the new database is not automatically set as the default connection. Select the database in the Database Connections list and click the Set current toolbar button if you want the new connection to be the current database connection.

  10. Either restart the computer or restart the Oracle Application Testing Suite Application service by going to the Control Panel Administrative Tools and open Services and restart the Oracle Application Testing Suite Application Service.

10.2 Removing Databases

You can remove databases from Oracle Test Manager. Doing so does not delete the database files. It removes the database from the database selection lists so that the database is no longer available in Oracle Test Manager. The database cannot be deleted if it is open in Oracle Test Manager.

To remove a database from Oracle Test Manager:

  1. Select Programs from the Start menu then select Oracle Test Manager Database Configuration from the Oracle Application Testing Suite - Tools menu.

  2. Select the database that you want to remove.

  3. Click Remove.

  4. Click Yes to confirm the deletion.

10.3 Updating Databases

You can change the name, location, and login information for databases that you are using in Oracle Test Manager.

  1. Select Programs from the Start menu then select Oracle Test Manager Database Configuration from the Oracle Application Testing Suite - Tools menu.

  2. Select the database that you want to update.

  3. Click Update.

  4. Make any changes.

  5. Click OK.

10.4 Exporting and Importing Databases

Oracle Application Testing Suite Release 12.1 supports Oracle Database 10g, 11g or XE 10g as the RDBMS for its load testing and test management components. In some cases, it may be necessary to transfer data between databases. The basic procedure to is to export a database dump from one database and then import the dump file into the new database. The following sections provide basic details for exporting and importing an Oracle XE database. See the Oracle Database Utilities documentation for additional information about using the original Export (exp) and Import (imp) utilities and the Data Pump Export (expdp) and Data Pump Import (impdp) utilities.

10.4.1 Exporting Databases Using Export Utility

The Database Export utility provides a way to transfer data objects between Oracle databases, even if the database reside on different platforms. Running the Export utility on an Oracle database extracts objects (such as tables) with all related objects (such as indexes, comments, and grants), if any. The extracted data is written to an Export file.

To export a database using the export utility:

  1. Open a command prompt.

  2. Change directory to Oracle home. For example, C:\OracleATS\oxe\app\oracle\product\10.2.0\server\BIN

  3. Enter the following command:

    exp userid=username/password owner=schema name file=Exportfile.dmp log=Export.log
    

    where:

    userid= specifies the username/password of the user performing the export.

    owner= specifies the schema name to export ("oats", "olt", "otm").

    file= specifies the file name to which the schema will be exported.

    log= specifies the log file name to save any warnings or errors that may have occurred during export.

    For additional parameter information, type exp help=y at the command prompt.

    Example:

    exp userid=system/oracle owner=OATS file=OATS.dmp log=Error.log
    

10.4.2 Importing Databases Using Import Utility

The Import utility reads the object definitions and table data from an Export dump file and inserts the data objects into an Oracle database.

To import a database from an exported dump file:

  1. Open Sql Plus and create a user (for example, Test) and grant roles (connect, resource, create any view) to the newly created user.

    • create user Test identified by password;

    • grant connect, resource, create any view to user Test;

  2. Open a command prompt.

  3. Change directory to Oracle home. For example, C:\OracleATS\oxe\app\oracle\product\10.2.0\server\BIN

  4. Enter the following command.

    imp userid=user/pwd fromuser=OATS touser=Test file=Exportfile.dmp log=test.log
    

    where:

    userid= specifies the username/password of the user performing the import.

    fromuser= specifies a list of owner usernames. This parameter enables you to import a subset of schemas from an export file containing multiple schemas.

    touser= specifies a list of usernames whose schemas will be targets for import.

    file= specifies the name of the exported dump file. For example, Exportfile.dmp.

    log= specifies the log file name to save any warnings or errors that may have occurred during import.

    For additional parameter information, type imp help=y at the command prompt.

    Example:

    imp userid=system/oracle fromuser=olt touser=Test file=Exportfile.dmp log=test.log
    
  5. Add the new database to the Oracle Application Testing Suite using the Oracle Application Testing Suite Database Configuration utility. See Section 10.1, "Adding Databases" for additional information.

10.4.3 Importing Databases Using Data Pump Import Utility

In cases where the database was exported using the Data Pump Export (expdp) utility, you use the Data Pump Import (impdp) utility to import the database.

To import a database from a Data Pump Export utility:

  1. Create a folder. (for example c:\test)

  2. Open Sql Plus and enter the following command:

    SQL> create directory test as '/backup/db_name/exports/dpump' ;
    
  3. Grant read and write permissions to the users who will be performing the data pump import. Note: before granting following permission please log in as sys as sysdba (different user than logged in user and should be logged in as dba)

    SQL> grant read, write on directory test to system, user1, user2, user3; 
    
  4. Open a command prompt.

  5. Change directory to Oracle home. For example, C:\OracleATS\oxe\app\oracle\product\10.2.0\server\BIN

  6. Enter the following command:

    impdp system/<Password> DIRECTORY=<dir name> DUMPFILE=<dmpfile.dmp> LOGFILE=<logfilename.log> remap_schema=<source_schema>:<target_schema>
    

    For additional parameter information, type impdp help=y at the command prompt.

    Example:

    impdp system/oracle DIRECTORY=test DUMPFILE=expdp_Exportfile.dmp LOGFILE=impfull.log remap_schema=oats:oats