8 Database and File Management

This chapter describes the how to import and export files to and from the server, how to manage the Oracle Load Testing database, and how to select the database to use.

8.1 Database Management

The Oracle Load Testing database is used to store the results of your load test sessions. You use the Oracle Application Testing Suite Database Configuration to configure databases for use in Oracle Load Testing. The Databases option on the Manage menu in Oracle Load Testing is used to set the current database to use. The Database Manager dialog box has the following options:

Name - displays the ODBC System Data Source name of the database.

Description - displays a description of the database.

Type - displays the type of database.

Connection String - displays the connection string.

8.1.1 Adding an Oracle Database

To add an Oracle database:

  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 Oracle Load Testing.

  3. Click New.

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

    This dialog box has the following options:

    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 Load Testing and as the ODBC Data Source name.

    • 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 the database on the same host, specify the port number you want to communicate with.

    • SID - enter the System Identifier for the Oracle database.

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

    • Password - enter the login password for the database.

  5. Enter the database information.

  6. Click Save.

  7. If creating a new schema, enter the password for both the Administrator and default accounts and click OK.

  8. Click Close.

  9. 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.

8.1.2 Selecting the Database to Use

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

  2. Select Oracle Load Testing as the product type.

  3. Select the database you want to use to store Oracle Load Testing data.

  4. Click Set current.

  5. Click Close.

  6. Restart Oracle Load Testing.

8.1.3 Removing Databases

You can remove databases from Oracle Load Testing. 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 Load Testing. The database cannot be deleted if it is open in Oracle Load Testing.

To remove a database from Oracle Load Testing:

  1. Select Programs from the Start menu then select Oracle Application Testing Suite 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.

8.1.4 Updating Databases

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

  1. Select Programs from the Start menu then select Oracle Application Testing Suite 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.

8.1.5 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. Oracle Application Testing Suite Release 12.5+ supports Oracle Database 11g, 12c or XE 11g 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.

8.1.5.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=olt file=olt.dmp log=olt.log statistics=none
    

8.1.5.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 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=tempuser file=olt.dmp log=t.log
    
  5. Add the new database to the Oracle Application Testing Suite using the Oracle Application Testing Suite Database Configuration utility. See Section 8.1.1, "Adding an Oracle Database" for additional information.

8.1.5.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
    

8.2 Importing Files

You can import files from the local machine to the Oracle Load Testing server. This can be useful if you are accessing Oracle Load Testing on a remote machine via the Web UI and want to import scripts from your local Oracle OpenScript.

  1. Select Import from the Tools menu.

    File Type - select the type of file.

    • Type - lists the types of files that can be imported.

    File to Import - the options listed here depend on the type of file being imported.

    • <extension> - enter the file you want to import. For MIB files, the file must have a .mib file extension to be recognized in the Import File dialog box. If you have a MIB file that does not have the .mib file extension, you will need to rename the file to include the .mib file extension.

    • Browse - opens the Choose File dialog box for browsing and selecting a file.

    Destination - the options displayed here depend on the type of file you are importing and only apply to certain file types.

    • Repository - select the repository where you want to import the file.

    • Workspace - select the workspace where you want to import the file.

  2. Select the type of file that you want to import.

    Note:

    If you are importing a ServerStats Metric Profile, the metrics associated with the profile must be imported separately.
  3. Enter the file name or click Browse to locate the file.

  4. Select the destination location to which you want to copy the file.

  5. Click OK.

  6. Click OK.

8.3 Exporting Files

You can export files from the server to the local machine. This is useful if you want to access a script from the Oracle Load Testing Server and edit it on your local machine.

  1. Select Export from the Tools menu.

    File Type - select the type of file you want to export from the Oracle Load Testing server to the local machine.

    Note:

    Exporting ServerStats configurations does not export the metrics required for those ServerStats configururations. You must explicitly download any custom metrics defined by user.

    Repository - a list of repositories from which you can download files.

    Folder - lists the folders available in the selected repository.

    <file list> - lists the files of the selected type in the selected folder that are available to export.

    Recorded Data - when selected, recorded data is included in the exported scenario package zip file.

    Playback Result - when selected, playback result data is included in the exported scenario package zip file.

    Hardware Estimation Data - when selected, hardware estimation data is included in the exported scenario package zip file. This data is used with the Testing as a Service (TaaS) features of the Oracle Cloud.

    Databank - when selected, databank playback result data is included in the exported scenario package zip file.

  2. Select the type of file that you want to export.

  3. Select the Repository and Workspace in which the file is located if applicable to the type of file you are exporting.

  4. Select the file you want to export. If you are exporting scripts, the Download Multiple Files dialog box is displayed.

    This dialog box lists script parts available for exporting for the selected script. Select the part you want to export and click Close.

  5. Select the script part that you want to export. Script parts must be exported separately.

  6. The File Download dialog box is displayed.

  7. Click Save to open the Save As dialog box.

  8. Select the location where you want to save the file and click Save.

  9. Click Close in the Download Complete dialog box.

  10. If you are downloading scripts, select another script part to download or click Close to exit the Download Multiple Files dialog box.

  11. Select another file to download or click Close to exit the Download File dialog box.