Prepare to Configure

Download and install the files, CMAN, SQL*Plus modules, and dependencies that you'll need for this solution.

Create an Oracle Autonomous Database

Create an Oracle Autonomous Database with Secure access from everywhere network access.

  1. Go to Autonomous Database in the Oracle Cloud Infrastructure Console.
  2. If needed, switch to the region where you want to create the database.
  3. Click Create Autonomous Database.
  4. Complete the Create Autonomous Database page.
    1. Select a compartment to host the Autonomous Database
    2. Enter a user-friendly display name and database name.
      In this example, the database is named exampledb_high.
    3. Complete the workload type, configuration details, user name, and Admin password, per your requirements.
      The ADMIN user is the privileged account for database access. Later we'll create a 'normal' (unprivileged) application user to connect to the Autonomous Database through CMAN-TDM.
    4. Click Modify Access Control, then select the Secure access from everywhere option.
    5. Complete the remaining options, then submit the details.

Your display shows Provisioning until the new Autonomous Database is available.

Download the Oracle Client Files

Download the latest Oracle client files onto the Linux machine.

  1. Download the Oracle Client 21c zip package from the Oracle 21c download page using your favorite browser. Select LINUX.X64_213000_client_home.zip (64-bit, 1,075,931,428 bytes).
    Review and accept the Oracle License Agreement.
  2. Transfer the ZIP file to a preferred directory (such as /tmp) in your Linux machine.
    1. Use plain SSH or any SSH file transfer application, such as FileZilla or WinSCP, if you're working on a Windows or macOS computer.
    2. If you can't use SSH, then open the Oracle 21c client download page in a browser.
    3. Click to download LINUX.X64_213000_client_home.zip file for Linux.
    4. Right-click on the file in the Downloads section and select Copy Download Link.
      The link format will be similar to the following:
      https://download.oracle.com/otn/linux/oracle21c/LINUX.X64_213000_client_home.zip?AuthParam=1631008911_576110421cdef54a2d47d9562bee0e5a

      The AuthParam URL parameter will vary every time you click the download link.

  3. On your Linux machine, navigate to the /tmp directory and use the wget command with the download link that you copied earlier.
    $ wget "https://download.oracle.com/otn/linux/oracle21c/LINUX.X64_213000_client_home.zip?AuthParam=1631008911_576110421cdef54a2d47d9562bee0e5a" -O LINUX.X64_213000_client_home.zip

    The zip file will download directly onto the Linux machine.

Install CMAN and SQL*Plus

Install the latest versions of CMAN and SQL*Plus modules and their dependencies.

You'll use SQL*Plus as the client app that will connect to Oracle Autonomous Database through CMAN-TDM. However, the client application can be any other program in Java, C/C++, .NET, Python or Node.js.

Note:

You can install SQL*Plus (client app) and CMAN on separate machines.
  1. Create the Oracle user (oracle), base, and home directories for running CMAN. Install the pre-install libraries of the latest version of Oracle Database for setting up the oracle user in Linux.
    $ sudo -i yum install oracle-database-preinstall-21c.x86_64
    $ sudo -i mkdir /u01
    $ sudo -i chown oracle:oinstall /u01
    $ su - oracle
    $ mkdir -p /u01/app/oracle/product/cman2130
  2. Unzip the Client install binaries to a separate directory. For example, $HOME/stage.
    $ mkdir -p $HOME/stage
    $ cd $HOME/stage
    $ unzip /tmp/LINUX.X64_213000_client_home.zip
  3. Prepare the response file for installing CMAN and SQL*Plus.
    $ cat <<EOF > $HOME/client21.rsp
    oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v21.0.0
    ORACLE_HOSTNAME=$(hostname)
    UNIX_GROUP_NAME=oinstall
    INVENTORY_LOCATION=/u01/app/oraInventory
    SELECTED_LANGUAGES=en
    ORACLE_HOME=/u01/app/oracle/product/cman2130
    ORACLE_BASE=/u01/app/oracle
    oracle.install.client.installType=Custom
    oracle.install.client.customComponents="oracle.sqlplus:21.0.0.0.0","oracle.network.client:21.0.0.0.0","oracle.network.cman:21.0.0.0.0","oracle.network.listener:21.0.0.0.0"
    EOF

    Note:

    • If you are installing only CMAN, then you can remove oracle.sqlplus:21.0.0.0.0 from oracle.install.client.customComponents in the response file.
    • If you are installing only SQL*Plus, then you can remove oracle.network.cman:21.0.0.0.0 from oracle.install.client.customComponents in the response file.
  4. Run the Oracle installer using the response file that you created in the previous step.
    $ $HOME/stage/client/runInstaller -silent -responseFile $HOME/client21.rsp  ORACLE_HOME_NAME=cman2130
  5. Exit out of the oracle user back to the root user to complete the install.
    $ exit
    # /u01/app/oraInventory/orainstRoot.sh
    # /u01/app/oracle/product/cman2130/root.sh

    Note:

    Non-silent, GUI-based install of the Oracle client will also work if you have X11 or VNC setup. In that case, select Custom and then (at least) select Connection Manager and SQL*Plus in the Product Components window.
  6. As the oracle user, set the TNS_ADMIN environment variable.
    $ su - oracle
    # mkdir -p /u01/app/oracle/network/admin
    # export TNS_ADMIN=/u01/app/oracle/network/admin

    The TNS_ADMIN directory maintains the network configuration files for connecting to the Oracle Database. The benefits of having the TNS_ADMIN directory outside of the ORACLE_HOME directory are two-fold:

    • If you need to patch CMAN or the Oracle Client libraries, then there is no need to copy the network configuration files again.
    • You can maintain multiple Oracle Client or CMAN homes referring to the same TNS_ADMIN network configuration files.
  7. Navigate to the Oracle_Home directory in the relevant Linux machine and verify that both SQL*Plus and the CMAN command-line utility (bin/cmctl) are installed.
  8. (Optional) Append the following lines to your .bash_profile file ($HOME/.bash_profile) to enable easy access to the cmctl and SQL*Plus utilities whenever you log in as the oracle user:
    export ORACLE_HOME=/u01/app/oracle/product/cman2130
    export LD_LIBRARY_PATH=/u01/app/oracle/product/cman2130/lib
    export PATH=/u01/app/oracle/product/cman2130/bin:$PATH:$HOME
  9. Ensure that SQL*Plus can run and CMAN is running.
    # cd $ORACLE_HOME
    # [ oracle@oracle-cloud-linuxvm: /u01/app/oracle/product/cman2130 [14:51:59] [21.3.0.0.0 [CLIENT] SID="not set"] 0 ] #
    # sqlplus
    SQL*Plus: Release 21.3.0.0.0 - Production on Tue Sep 7 14:52:02 2021
    Version 21.3.0.0.0
    Copyright (c) 1982, 2021, Oracle. All rights reserved. 
    
    Enter user-name: ^C
    # [ oracle@oracle-cloud-linuxvm: /u01/app/oracle/product/cman2130 [14:52:04] [21.3.0.0.0 [CLIENT] SID="not set"] 0 ] #
    # cd bin
    
    # [ oracle@oracle-cloud-linuxvm: /u01/app/oracle/product/cman2130 [14:52:08] [21.3.0.0.0 [CLIENT] SID="not set"] 0 ] #
    /u01/app/oracle/product/cman2130/bin
    # cmctl
    CMCTL for Linux: Version 21.0.0.0.0 - Production on 07-SEP-2021 14:52:10
    Copyright (c) 1996, 2021, Oracle. All rights reserved. 
    Welcome to CMCTL, type "help" for information.
    CMCTL>