2 Installing and Configuring the Oracle Database

This chapter describes installation and configuration of the DIVArchive databases and Backup Service and includes the following information:

Overview

The DIVArchive Oracle Database is distributed as a compressed (.zip) file in Windows, and as a bash script (.sh) in Linux. They are only available in 64-bit releases. The installation process is identical for both releases and the release you install depends on the computer's operating system.

You must verify the existing Oracle database release before upgrading a system to DIVArchive 7.5. The minimum release level for DIVArchive 7.5 is Oracle release 12.1. You can verify the release level by navigating to C:\app\oracle and opening the VERSION.TXT file. The Oracle release number is displayed in the file.

Exporting and Importing the Database Dump Files

Use the procedures outlined in the following sections to perform export and import operations on the Oracle Database.

Exporting the Database Dump Files from the Source Computer

You must perform the following procedure on the source computer:

  1. Open sqlplus and log in as the sys user.

  2. Execute the following commands to create the directory object:

    CREATE OR REPLACE DIRECTORY {directory_object_name} AS {'TargetPath'};
    
    GRANT READ,WRITE ON DIRECTORY {directory_object_name} TO {source_username};
    
  3. Open a command prompt and execute the following command to export to the dump file:

    expdp {source_username}/{source_user_password} schemas={source_username} flashback_time=systimestamp DIRECTORY={directory_object_name} dumpfile={dump_file_name} logfile={log_file_name}
    

The following is an example of the procedure previously outlined:

  1. Open sqlplus and log in as the sys user.

  2. Execute the following commands to create the directory object:

    Use the following command in Windows:

    CREATE OR REPLACE DIRECTORY diva_dpump_dir AS 'H:\Support\DUMPS';
    

    Use the following command in Linux:

    CREATE OR REPLACE DIRECTORY diva_dpump_dir AS '/u05/support/DUMPS';
    

    Execute the following commands regardless of the operating system:

    GRANT READ,WRITE ON DIRECTORY diva_dpump_dir TO DIVA;
    exit;
    
  3. Open a command prompt and execute the following command:

    expdp DIVA/password schemas=DIVA flashback_time=systimestamp directory=diva_dpump_dir dumpfile=diva_db.dmp logfile=diva_exp.log
    

Importing the Database Dump File to the Destination Computer

Perform the following procedures on the destination computer:

  1. Open sqlplus and log in as the sys user.

  2. Execute the following commands to create the directory object:

    CREATE OR REPLACE DIRECTORY {directory_object_name} AS {'TargetPath'};
    
    GRANT READ,WRITE ON DIRECTORY {directory_object_name} TO { destination_username};
    
  3. Open a command window and copy the exported dump file to the {'TargetPath'}.

  4. Navigate to the %DIVA_HOME%\program\database\core\install folder in your DIVArchive installation.

  5. Execute the import command as follows:

    impdp {destination_username}/{user_password} transform=OID:n:type DIRECTORY={directory_object_name} dumpfile={dump_file_name} table_exists_action=replace REMAP_SCHEMA={source_username}:{destination_username} logfile={log_file_name}
    

The following is an example of the procedure previously outlined:

  1. Open sqlplus and log in as the sys user.

  2. Execute the following commands to create the directory object:

    Use the following command in Windows:

    CREATE OR REPLACE DIRECTORY diva_dpump_dir AS 'H:\Support\DUMPS';
    

    Use the following command in Linux:

    CREATE OR REPLACE DIRECTORY diva_dpump_dir AS '/u05/support/DUMPS';
    

    Execute the following commands regardless of the operating system:

    GRANT READ,WRITE ON DIRECTORY diva_dpump_dir TO DIVA;
    exit;
    
  3. Use the following procedures to copy the dump file and create a user:

    Execute the following in Windows environments:

    1. Copy the exported dump file to the H:\Support\DUMPS folder.

    2. Navigate to the %DIVA_HOME%\program\database\core\install folder in your DIVArchive installation.

    3. Create a DIVArchive database user with the following command:

      create_diva_user.bat syspass DIVA2 divapass -useronly
      

    Execute the following in Linux environments:

    1. Copy the exported dump file to the /u05/support/DUMPS directory.

    2. Navigate to the %DIVA_HOME%/Program/Database/Core/Install/ directory in your DIVArchive installation.

    3. Create a DIVArchive database user with the following command:

      create_diva_user.sh syspass DIVA2 divapass -useronly
      
  4. Open a command prompt and execute the following:

    impdp DIVA2/pass transform=OID:n:type DIRECTORY= diva_dpump_dir dumpfile= diva_db.dmp table_exists_action=replace REMAP_SCHEMA=DIVA:DIVA2 logfile=diva_imp.log
    

Uninstalling the Existing DIVArchive Oracle Database (if required)

Before installing the new DIVArchive Oracle Database, you may be required to uninstall an existing database and database engine. If Oracle Database is already installed on the computer, then you must remove the existing database and database engine.

Uninstalling the Database in Windows

Use the following procedure to uninstall the existing database in Windows environments:

Caution:

Use the same DIVArchive Oracle Database package to uninstall the database that was used to install it.
  1. Stop all running DIVArchive services.

  2. Export the existing database contents using the procedures previously described.

    Caution:

    Confirm the export completed successfully before continuing.
  3. Extract the original DIVArchive database .zip file used to perform the installation.

  4. For DIVArchive database package releases 2.3.4 and earlier, use the following commands in the exact sequence shown:

    uninstall_database.cmd
    
    uninstall_engine.cmd
    
  5. For DIVArchive database packages release 3.0.0 and later, execute C:\app\Oracle\product\12.1.0\db_home1\deinstall\deinstall.bat and follow the displayed instructions.

Uninstalling the Database in Linux

Use the following procedure to uninstall the existing database (package release 3.0.0 and later) in a Linux environment:

  1. Log in as the Oracle operating system user.

  2. Open a terminal window.

  3. Export the existing Oracle database.

  4. Execute $ORACLE_HOME/deinstall/deinstall and follow the displayed instructions.

Installing the DIVArchive Oracle Database in Windows

You must log in to the computer as an Administrator. After you have backed up and uninstalled the existing database (see the previous sections in this chapter), use the following procedure to install the new database:

  1. Locate the latest release of the DIVAOracle database package for Windows and unzip it. See the DIVArchive Oracle Database and Backup Service Overview section in Chapter 1 for supported DIVAOracle database package releases.

  2. Execute install.bat to start the installation.

  3. Follow the prompts through the wizard to complete the installation.

  4. Import the previously exported data into the new database using the procedure previously described.

Assuming no errors occurred, you have successfully installed the database and imported the existing data from the original database.

Installing the DIVArchive Oracle Database in Linux

Before running the installer verify the following is complete:

  • Yum is configured to connect to the latest release of Oracle Linux.

  • The recommended partitions for the Oracle Database exist. Oracle recommends partitions that dedicate the space to the Oracle Database.

    • /u01 partition for the Oracle Binaries

    • /u02 partition for the Oracle Database files (8 KB cluster size recommended)

    • /u03 partition for the Oracle Archive Logs (4 KB cluster size recommended)

    • /u04 partition for the Oracle database backups (64 KB cluster size recommended)

    See the Oracle DIVArchive Installation and Configuration Guide in the Oracle DIVArchive 7.5 Core documentation library for partitioning information.

To begin installation, locate the latest release of the DIVAOracle database package for Linux, execute it as root, and follow the displayed instructions. See the DIVArchive Oracle Database and Backup Service Overview section in Chapter 1 for supported DIVAOracle database package releases.

Using the create_diva_user Script

The create_diva_user script has been enhanced to provide greater functionality, and is located in the %DIVA_HOME%\Program\Database\Core\Install folder. This section describes the use of the script for creating user accounts and assigning, or updating, the user passwords. The following is the general script syntax.

Use the following syntax in Windows environments:

create_diva_user.bat {db_sys_passwd} {diva_dbuser} {diva_dbuser_password} oracle_connection [-useronly|-tablesonly] [-customer_tablespaces tables_tablespace indexes_tablespace temp_tablespace]

Use the following syntax in Linux environments:

./create_diva_user.sh {db_sys_passwd} {diva_dbuser} {diva_dbuser_password} oracle_connection [-useronly|-tablesonly] [-customer_tablespaces tables_tablespace indexes_tablespace temp_tablespace]

To assign a new password, or change an existing password, in Windows environments use the following command:

create_diva_user.bat {DIVA|SYS} {current_password} {new_password} -orapwd

To assign a new password, or change an existing password, in Linux environments use the following command:

./create_diva_user.bat {DIVA|SYS} {current_password} {new_password} -orapwd

The following are the mandatory parameters used in the previous commands:

db_sys_passwd

This parameter is the Oracle sys account password.

diva_dbuser

This parameter is the user name being created.

diva_dbuser_password

This parameter is the associated user password.

oracle_connection

This parameter is the Oracle TNS service name or Oracle connection string. For example, IP_ADDRESS:PORT/ORACLE_SERVICE_NAME.

DIVA|SYS

You must use either DIVA or SYS to reset the password for that account in the password file.

new_password

This parameter is the new password for the user.

current_password

This parameter is the current password. If there is no current database password, then enter a new password for this parameter.

The following are the optional parameters used in the previous commands:

-useronly

This option only creates the database user and no database objects.

-tablesonly

This option only creates the database objects for the given user.

-custom_tablespaces

This option create the user using customer tablespaces.

tables_tablespace

This option creates the tablespaces for the tables.

indexes_tablespace

This option creates the tablespaces for indexes.

temp_tablespace

This option creates the database temporary tablespace.