Pierre Forstmann Oracle Database blog

Subscribe to Pierre Forstmann Oracle Database blog feed Pierre Forstmann Oracle Database blog
Pierre Forstmann Oracle Database blog
Updated: 4 hours 10 min ago

Statspack Documentation

Tue, 2019-01-15 14:15

There is a lot of information on Statspack on the web but I have not found the official Statspack documentation except for Oracle 9i. As of Oracle 10g the official Statspack documentation is the text file named ORACLE_HOME/rdbms/admin/spdoc.txt.

Here is this text file taken from Oracle Database Home 18c from OTN Oracle Hands On Labs:

-----------------------------------------------------------------------

Oracle12g Server

Release 12.1

Production

-------------------------------------------------------------------------

 Copyright (c) 1993, 2014, Oracle and/or its affiliates. All rights reserved.

Author:  Connie Dialeris Green
Contributors:  Cecilia Gervasio, Graham Wood, Russell Green, Patrick Tearle,
               Harald Eri, Stefan Pommerenk, Vladimir Barriere, Kathryn Chou

Please refer to the Oracle11g server README file in the rdbms doc directory,
for copyright, disclosure, restrictions, warrant, trademark, disclaimer, 
and licensing information.  The README file is README_RDBMS.HTM.

Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065.

-------------------------------------------------------------------------


Statistics Package (STATSPACK) README (spdoc.txt)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

TABLE OF CONTENTS
-----------------

0.  Introduction and Terminology
1.  Enterprise Manager (EM), Automatic Workload Repository (AWR) and Statspack
2.  Statspack Configuration
    2.1. Database Space Requirements
    2.2. Installing the Tool
    2.3. Errors during Installation
3.  Gathering data - taking a snapshot
    3.1. Automating Statspack Statistics Gathering
    3.2. Using dbms_job
4.  Running the Performance reports
    4.1. Running the instance report
    4.2. Running the instance report when there are multiple instances
    4.3. Configuring the Instance Report
    4.4. Running the SQL report
    4.5. Running the SQL report when there are multiple instances
    4.6. Configuring the SQL report
    4.7. Gathering optimizer statistics on the PERFSTAT schema
5.  Configuring the amount of data captured
    5.1. Snapshot Level
    5.2. Snapshot SQL thresholds
    5.3. Changing the default values for Snapshot Level and SQL Thresholds
    5.4. Snapshot Levels - details
    5.5. Specifying a Session Id
    5.6. Input Parameters for the SNAP and
         MODIFY_STATSPACK_PARAMETERS procedures
6.  DB time,, and Time Units used for Performance Statistics
    6.1.  DB time compared to Total Call Time
    6.2.  Time Units used for Performance Statistics
7.  Event Timings
8.  Managing and Sharing performance data
    8.1. Baselining performance data
       8.1.1. Input Parameters for the MAKE_BASELINE and CLEAR_BASELINE 
              procedure and function which accept Begin and End Snap Ids
       8.1.2. Input Parameters for the MAKE_BASELINE and CLEAR_BASELINE
              procedure and function which accept Begin and End Dates
    8.2. Purging/removing unnecessary data
       8.2.1. Input Parameters for the PURGE procedure and function
              which accept Begin Snap Id and End Snap Id       
       8.2.2. Input Parameters for the PURGE procedure and function
              which accept Begin Date and End Date
       8.2.3. Input Parameters for the PURGE procedure and function
              which accept a single Purge Before Date
       8.2.4. Input Parameters for the PURGE procedure and function
              which accept the Number of Days of data to keep
       8.2.5. Using sppurge.sql
    8.3. Removing all data
    8.4. Sharing data via export
9.  New and Changed Features
    9.1. Changes between 11.1  and 12.1
    9.1. Changes between 10.2  and 11.1
    9.2. Changes between 10.1  and 10.2
    9.3. Changes between 9.2   and 10.1
    9.4. Changes between 9.0   and 9.2
    9.5. Changes between 8.1.7 and 9.0
    9.6. Changes between 8.1.6 and 8.1.7
10. Compatibility and Upgrading from previous releases
    10.1. Compatibility Matrix
       10.1.2. Using Statspack shipped with 12.1
       10.1.2. Using Statspack shipped with 11.1
       10.1.2. Using Statspack shipped with 10.2
       10.1.3. Using Statspack shipped with 10.1
       10.1.4. Using Statspack shipped with 10.0
       10.1.5. Using Statspack shipped with 9.2
       10.1.6. Using Statspack shipped with 9.0
       10.1.7. Using Statspack shipped with 8.1.7 on 9i releases
    10.2. Upgrading an existing Statspack schema to a newer release
       10.2.1. Upgrading the Statspack schema from 11.2  to 12.1
       10.2.1. Upgrading the Statspack schema from 11.1  to 11.2
       10.2.1. Upgrading the Statspack schema from 11.2.0.1 to 11.2.0.2
       10.2.2. Upgrading the Statspack schema from 10.2  to 11.1
       10.2.3. Upgrading the Statspack schema from 10.1  to 10.2
       10.2.4. Upgrading the Statspack schema from 9.2   to 10.1
       10.2.5. Upgrading the Statspack schema from 9.0   to 9.2
       10.2.6. Upgrading the Statspack schema from 8.1.7 to 9.0
       10.2.7. Upgrading the Statspack schema from 8.1.6 to 8.1.7
       10.2.8. Upgrading the Statspack schema from 8.1.6 to 9.2
       10.2.9. Upgrading the Statspack schema from 8.1.6 to 9.0
       10.2.10. Upgrading the Statspack schema from 8.1.7 to 9.2
11. Oracle Real Application Clusters specific considerations
    11.1. Changing Instance Numbers
    11.2. Cluster Specific Reports
    11.3. Cluster Specific Data
12. Conflicts and differences compared to UTLBSTAT/UTLESTAT
    12.1. Running BSTAT/ESTAT in conjunction to Statspack
    12.2. Differences between Statspack and BSTAT/ESTAT
13. Removing the package
14. Supplied Scripts Overview
15. Limitations and Modifications
    15.1. Limitations
    15.2. Modifications


0.  Introduction and Terminology
--------------------------------

To effectively perform reactive tuning, it is vital to have an established 
baseline for later comparison when the system is running poorly.  Without 
a baseline data point, it becomes very difficult to identify what a new 
problem is attributable to:  Has the volume of transactions on the system 
increased?  Has the transaction profile or application changed?  Has the 
number of users increased?

Statspack fundamentally differs from the well known UTLBSTAT/UTLESTAT 
tuning scripts by collecting more information, and also by storing the 
performance statistics permanently in Oracle tables, which can later
be used for reporting and analysis.  The data collected can be analyzed 
using the report provided, which includes an 'instance health and load' 
summary page, high resource SQL statements, as well as the traditional 
wait events and initialization parameters.

Statspack improves on the existing UTLBSTAT/UTLESTAT performance scripts 
in the following ways:

  - Statspack collects more data, including high resource SQL
    (and the optimizer execution plans for those statements)

  - Statspack pre-calculates many ratios useful when performance
    tuning, such as cache hit ratios, per transaction and per 
    second statistics (many of these ratios must be calculated 
    manually when using BSTAT/ESTAT)

  - Permanent tables owned by PERFSTAT store performance statistics; 
    instead of creating/dropping tables each time, data is inserted 
    into the pre-existing tables.  This makes historical data
    comparisons easier

  - Statspack separates the data collection from the report generation.
    Data is collected when a 'snapshot' is taken; viewing the data 
    collected is in the hands of the performance engineer when he/she
    runs the performance report

  - Data collection is easy to automate using either dbms_job or an 
    OS utility


  NOTE:  The term 'snapshot' is used to denote a set of statistics gathered
         at a single time, identified by a unique Id which includes the 
         snapshot number (or snap_id).  This term should not be confused 
         with Oracle's Snapshot Replication technology.


How does Statspack work?

Statspack is a set of SQL, PL/SQL and SQL*Plus scripts which allow the 
collection, automation, storage and viewing of performance data.  A user 
is automatically created by the installation script - this user, PERFSTAT, 
owns all objects needed by this package.  This user is granted limited 
query-only privileges on the V$views required for performance tuning.

Statspack users will become familiar with the concept of a 'snapshot'.
'snapshot' is the term used to identify a single collection of
performance data.  Each snapshot taken is identified by a 'snapshot id' 
which is a unique number generated at the time the snapshot is taken; 
each time a new collection is taken, a new snap_id is generated.  

The snap_id, along with the database identifier (dbid) and instance number 
(instance_number) comprise the unique key for a snapshot (using this
unique combination allows storage of multiple instances of a Clustered
database in the same tables).

Once snapshots are taken, it is possible to run the performance report.
The performance report will prompt for the two snapshot id's the report
will process.  The report produced calculates the activity on the instance
between the two snapshot periods specified, in a similar way to the 
BSTAT/ESTAT report; to compare - the first snap_id supplied can be 
considered the equivalent of running BSTAT; the second snap_id 
specified can be considered the equivalent of ESTAT.  Unlike BSTAT/ESTAT 
which can by its nature only compare two static data points, the report 
can compare any two snapshots specified.



1.  Enterprise Manager (EM), Automatic Workload Repository (AWR) and Statspack
------------------------------------------------------------------------------

Enterprise Manager
------------------
Statspack allows you to capture Oracle instance-related performance data, and 
report on this data in a textual format.

For EM managed databases in 9i, Oracle Enterprise Manager uses Statspack data 
and displays it graphically.  Starting with 10g, Enterprise Manager instead
uses data collected by the Automatic Workload Repository (AWR).  AWR
data is internally captured and stored by Oracle 10g databases.

For more information about Oracle Enterprise Manager visit the Oracle website
oracle.com --> Database --> Manageability 

Automatic Workload Repository and Statspack
-------------------------------------------
The Automatic Workload Repository (AWR) is an integrated part of the Oracle 
server.  Its purpose is to collect server-related performance data 
automatically every 60 minutes (by default) when the statistics_level 
parameter is set to 'typical' (or 'all').  As the data is collected by the 
server itself, the Automated Database Diagnostic Monitor (ADDM) component of
the server uses this data automatically to diagnose performance issues.  
DBAs and performance engineers can access the performance recommendations
by using EM, or view the captured data in the AWR report, which is similar to 
the Statspack Instance report.

To compare, Statspack is a manually installed and configured set of SQL and 
PL/SQL scripts which gather performance statistics.  The data gathered
is used by DBAs and performance engineers to manually diagnose performance 
problems.

The AWR schema was initially based on the Statspack schema, but has since been
modified.  Because of this shared history, there are some similarities
(e.g. concept of a snapshot, similar base tables).  However, AWR is 
separate from Statspack.

For more information on using AWR, please see the Oracle 10g Server 
Performance Tuning Guide.  For license information regarding AWR, please
see the Oracle database Licensing Information Manual.

If you are going to use AWR instead of Statspack, and you have been using
Statspack at your site, it is recommended that you continue to capture 
Statspack data for a short time (e.g. one month) after the upgrade to 10g.  
This is because comparing post-upgrade Statspack data to pre-upgrade Statspack
data may make diagnosing initial upgrade problems easier to detect.

  WARNING:  If you choose to continue Statspack data collection after
            upgrading to 10g, and statistics_level is set to typical or
            all (which enables AWR collection), it is advised to stagger
            Statspack data collection so it does not coincide with AWR
            data collection (AWR data collection is by default is every
            hour, on the hour).  Staggering data collection should be done 
            to avoid the potential for any interference (e.g. stagger data 
            collection by 30 minutes).

Long term, typically, there is little reason to collect data through both
AWR and Statspack.  If you choose to use AWR instead of Statspack, you should
ensure you should keep a representative set of baselined Statspack data for 
future reference.



2.  Statspack Configuration
---------------------------

2.1.  Database Space Requirements

  The amount of database space required by the package will vary considerably
  based on the frequency of snapshots, the size of the database and instance,
  and the amount of data collected (which is configurable).
 
  It is therefore difficult to provide general storage clauses and space 
  utilization predictions that will be accurate at each site.

  Space Requirements
  ------------------
  The default initial and next extent sizes are 100k, 1MB, 3MB or 5MB for all 
  Statspack tables and indexes.  To install Statspack, the minimum 
  space requirement is approximately 100MB.  However, the amount of space
  actually allocated will depend on the Tablespace storage characteristics
  of the tablespace Statspack is installed in (for example, if your minimum
  extent size is 10m, then the storage requirement will be considerably more
  than 100m).

  Using Locally Managed Tablespaces
  ---------------------------------
  If you install the package in a locally-managed tablespace, such as 
  SYSAUX, modifying storage clauses is not required, as the storage 
  characteristics are automatically managed.

  Using Dictionary Managed Tablespaces
  ------------------------------------
  If you install the package in a dictionary-managed tablespace, Oracle
  suggests you monitor the space used by the objects created, and adjust
  the storage clauses of the segments, if required.


2.2.  Installing the Tool

    Installation scripts create a user called PERFSTAT, which will own all
    PL/SQL code and database objects created (including the STATSPACK tables, 
    constraints and the STATSPACK package).

    During the installation you will be prompted for the PERFSTAT 
    user's password and default and temporary tablespaces.

    The default tablespace will be used to create all Statspack
    objects (such as tables and indexes).  Oracle recommend using the
    SYSAUX tablespace for the PERFSTAT user's default tablespace; the
    SYSAUX tablespace will be the tablespace defaulted during the
    installation, if no other is specified.

    A temporary tablespace is used for workarea activities, such 
    as sorting (for more information on temporary tablespaces, see 
    the Oracle10g Concepts Manual).  The Statspack user's temporary 
    tablespace will be set to the database's default temporary tablespace
    by the installation, if no other temporary tablespace is specified.

      NOTE:
      o  A password for PERFSTAT user is mandatory and there is no default
         password; if a password is not specified, the installation will
         abort with an error indicating this is the problem.

      o  For security reasons, keep PERFSTAT's password confidential.

      o  Do not specify the SYSTEM tablespace for the PERFSTAT users
         DEFAULT or TEMPORARY tablespaces; if SYSTEM is specified the
         installation will terminate with an error indicating this is the
         problem.  This is enforced as Oracle does not recommend using 
         the SYSTEM tablespace to store statistics data, nor for workareas.
         Use the SYSAUX (or a TOOLS) tablespace to store the data, and 
         your instance's TEMPORARY tablespace for workareas.

      o  During the installation, the dbms_shared_pool PL/SQL package
         is created.  dbms_shared_pool is used to pin the Statspack 
         package in the shared pool
         dbms_job is no longer created as part of the installation, as
         it is already created by catproc.sql (dbms_job can be used by 
         the DBA to schedule periodic snapshots automatically).


    To install the package, either change directory to the ORACLE_HOME
    rdbms/admin directory, or fully specify the ORACLE_HOME/rdbms/admin
    directory when calling the installation script, spcreate.

    To run the installation script, you must use SQL*Plus and connect as
    a user with SYSDBA privilege.

    e.g.  Start SQL*Plus, then:
      on Unix:
        SQL>  connect / as sysdba
        SQL>  @?/rdbms/admin/spcreate

      on Windows:
        SQL>  connect / as sysdba
        SQL>  @%ORACLE_HOME%\rdbms\admin\spcreate


    The spcreate install script runs 3 other scripts - you do not need to 
    run these - these scripts are called automatically:
      1.  spcusr  ->  creates the user and grants privileges
      2.  spctab  ->  creates the tables
      3.  spcpkg  ->  creates the package

    Check each of the three output files produced (spcusr.lis,
    spctab.lis, spcpkg.lis) by the installation to ensure no 
    errors were encountered, before continuing on to the next step.

    Note that there are two ways to install Statspack - interactively (as
    shown above), or in 'batch' mode; batch mode is useful when you do 
    not wish to be prompted for the PERFSTAT user's password, and default 
    and temporary tablespaces.


      Batch mode installation
      ~~~~~~~~~~~~~~~~~~~~~~~
      To install in batch mode, you must assign values to the SQL*Plus
      variables which specify the password and the default and temporary
      tablespaces before running spcreate.

      The variables are:
        perfstat_password    -> for the password
        default_tablespace   -> for the default tablespace
        temporary_tablespace -> for the temporary tablespace

      e.g.
        on Unix:
          SQL>  connect / as sysdba
          SQL>  define default_tablespace='tools'
          SQL>  define temporary_tablespace='temp'
          SQL>  define perfstat_password='erg8oiw'
          SQL>  @?/rdbms/admin/spcreate
          SQL>  undefine perfstat_password

      spcreate will no longer prompt for the above information.


2.3.  Errors during installation

  Specifying SYSTEM tablespace
    A possible error during installation is to specify the SYSTEM
    tablespace for the PERFSTAT user's DEFAULT or TEMPORARY tablespace.
    In such a situation, the installation will fail, stating the problem.

  To install Statspack after receiving errors during the installation
    To correctly install Statspack after such errors, first run the 
    de-install script, then the install script.  Both scripts must be 
    run from SQL*Plus.

    e.g.  Start SQL*Plus, connect as a user with SYSDBA privilege, then:
       SQL> @spdrop
       SQL> @spcreate



3.  Gathering data - taking a snapshot
--------------------------------------

The simplest interactive way to take a snapshot is to login to SQL*Plus
as the PERFSTAT user, and execute the procedure statspack.snap:
    e.g.
      SQL>  connect perfstat/perfstat_password
      SQL>  execute statspack.snap;

  Note:  In a Clustered database environment, you must connect to the 
         instance you wish to collect data for.

This will store the current values for the performance statistics
in the Statspack tables, and can be used as a baseline snapshot
for comparison with another snapshot taken at a later time.

For better performance analysis, set the initialization parameter 
timed_statistics to true;  this way, Statspack data collected will include 
important timing information.  The timed_statistics parameter is also 
dynamically changeable using the 'alter system' command.  Timing data is 
important and is usually required by Oracle support to diagnose performance 
problems.

The default level of data collection is level 5.  It is possible to change
the amount of data captured by changing the snapshot level, and the default
thresholds used by Statspack.  For information on how to do this, please see
the 'Configuring the amount of data captured' section of this file.

Typically, in the situation where you would like to automate the gathering
and reporting phases (such as during a benchmark), you may need to know the
snap_id of the snapshot just taken.  To take a snapshot and display the 
snap_id, call the statspack.snap function.  Below is an example of calling
the snap function using an anonymous PL/SQL block in SQL*Plus:

   e.g. 
     SQL> variable snap number;
     SQL> begin   :snap := statspack.snap;   end;
       2  /
     PL/SQL procedure successfully completed.
     SQL> print snap
           SNAP
     ----------
             12


3.1.  Automating Statspack statistics gathering

  To be able to make comparisons of performance from one day, week or 
  year to the next, there must be multiple snapshots taken over a period 
  of time.

  The best method to gather snapshots is to automate the collection on 
  a regular time interval.  It is possible to do this:

    - within the database, using the Oracle dbms_job procedure to 
      schedule the snapshots

    - using Operating System utilities.  On Unix systems, you could use 
      utilities such as 'cron' or 'at'.  On Windows, you could schedule a 
      task (e.g. via Start> Programs> Accessories> System Tools> 
      Scheduled Tasks).


3.2.  Using dbms_job

  To use an Oracle-automated method for collecting statistics, you can use
  dbms_job.  A sample script on how to do this is supplied in spauto.sql,
  which schedules a snapshot every hour, on the hour.

  You may wish to schedule snapshots at regular times each day to reflect your
  system's OLTP and/or batch peak loads. For example take snapshots at 9am, 
  10am, 11am, 12 midday and 6pm for the OLTP load, then a snapshot at 
  12 midnight and another at 6am for the batch window.

  In order to use dbms_job to schedule snapshots, the job_queue_processes 
  initialization parameter must be set to a value greater than 0 for the job
  to run automatically.

  Example of setting the job_queue_processes parameter in an init.ora file:
    #  Set to enable the job queue process to start.  This allows dbms_job
    #  to schedule automatic statistics collection using STATSPACK
    job_queue_processes=1

  If using spauto.sql in a Clustered database environment, the spauto.sql 
  script must be run once on each instance in the cluster.  Similarly, the 
  job_queue_processes parameter must also be set for each instance.


  Changing the interval of statistics collection
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  To change the interval of statistics collection use the dbms_job.interval
  procedure
  e.g.
    execute dbms_job.interval(1,'SYSDATE+(1/48)');

  Where 'SYSDATE+(1/48)' will result in the statistics being gathered each
  1/48th of a day (i.e. every 30 minutes).

  To force the job to run immediately, 
    execute dbms_job.run();

  To remove the auto collect job,
    execute dbms_job.remove();

  For more information on dbms_job, see the Supplied Packages Reference
  Manual.



4.  Running the Performance reports
-----------------------------------

Once snapshots are taken, it is possible to generate a performance report.
There are two reports available - an Instance report, and a SQL report:

 - The Instance Report (spreport.sql and sprepins.sql)
   is a general instance health report, covering all aspects of instance 
   performance.  The instance report calculates and prints ratios, 
   increases etc. for all statistics between the two snapshot periods, 
   in a similar way to the BSTAT/ESTAT report.

   Note: spreport.sql calls sprepins.sql, first defaulting the dbid and
         instance number of the instance you are connected to.  For more
         information on the difference between sprepins and spreport,
         see the 'Running the instance report when there are multiple 
         instances' section of this document.

 - The SQL report (sprepsql.sql and sprsqins.sql)
   is a report for a specific SQL statement.  The SQL report is usually 
   run after examining the high-load SQL sections of the instance health 
   report.  The SQL report provides detailed statistics and data for a 
   single SQL statement (as identified by the Hash Value).

   Note: sprepsql.sql calls sprsqins.sql, first defaulting the dbid and
         instance number of the instance you are connected to.  For more
         information on the difference between sprsqins and sprepsql,
         see the 'Running the SQL report when there are multiple instances' 
         section of this document.

Both reports prompt for the beginning snapshot id, the ending snapshot id,
and the report name.  The SQL report additionally requests the Hash Value
for the SQL statement to be reported on.

  Note:  It is not correct to specify begin and end snapshots where the
         begin snapshot and end snapshot were taken from different
         instance startups.  In other words, the instance must not have 
         been shutdown between the times that the begin and end snapshots 
         were taken.
         The reason for this requirement is the database's dynamic 
         performance tables which Statspack queries to gather the data 
         are memory resident, hence shutting down the database will 
         reset the values in the performance tables to 0.  As Statspack 
         subtracts the begin-snapshot statistics from the end-snapshot
         statistics, the resulting output will be invalid.
         If begin and end snapshots which were taken between shutdowns 
         are specified in the report, an appropriate error is signaled
         and the report exits.

Separating the phase of data gathering from producing a report, allows the 
flexibility of basing a report on any data points selected.  For example 
it may be reasonable for the DBA to use the supplied automation script to 
automate data collection every hour on the hour; If at some later point 
a performance issue arose which may be better investigated by looking 
at a three hour data window rather than an hour's worth of data, the 
only thing the DBA need do, is specify the required start point and end 
point when running the report.

The majority of cases, you will only need to read the following sections 
of this document, to run the reports:
  Running the instance report
  Running the SQL report
  Gathering optimizer statistics on the PERFSTAT schema

If your database is a Real Application Clusters database, you may also benefit
from reading:
  Running the instance report when there are multiple instances
  Running the SQL report when there are multiple instances

If you would like a greater degree of configuration in the report output, you 
may also be interested in reading:
  Configuring the Instance Report
  Configuring the SQL report


4.1.  Running the instance report

  To examine the change in instance-wide statistics between two time periods, 
  the spreport.sql file is executed while being connected to the PERFSTAT 
  user.  The spreport.sql command file is located in the rdbms/admin 
  directory of the Oracle Home.

  This report assumes you are connected to the database you wish to report
  on.  In a clustered database environment (RAC), you must connect to the 
  instance you wish to report on when running spreport.sql.  To avoid 
  this, see the 'Running the instance report when there are multiple 
  instances' section of this document.

  When running spreport, you will be prompted for:
    1. The beginning snapshot Id
    2. The ending    snapshot Id
    3. The name of the report text file to be created

  Note:  Blank lines between lines of snapshot Id's means the instance 
         has been restarted (shutdown/startup) between those times - 
         this helps identify which begin and end snapshots can be used
         together when running a Statspack report (ones separated by
         a blank line can not).

         By default, the report shows all completed snapshots for this instance
         when choosing the begin and end snapshot Id's.  However, the number 
         of days worth of snapshots to list is now configurable: to change 
         this, please see 'Snapshot related report settings - num_days' in the
         'Configuring the Instance Report' section of this document.

    e.g. on Unix
      SQL>  connect perfstat/perfstat_password
      SQL>  @?/rdbms/admin/spreport

    e.g. on Windows
      SQL>  connect perfstat/perfstat_password
      SQL>  @%ORACLE_HOME%\rdbms\admin\spreport
   

    Example output:
    SQL>  connect perfstat/perfstat_password
    Connected.
    SQL>  @spreport
 

Current Instance
~~~~~~~~~~~~~~~~

   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
 2618106428 PRD1                1 prd1


Instances in this Statspack schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id    Inst Num DB Name      Instance     Host
----------- -------- ------------ ------------ ------------
 2618106428        1 PRD10        prd1         dlsun525

Using  261810642 for database Id
Using          1 for instance number



Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed.  Pressing  without
specifying a number lists all completed snapshots.


Listing all Completed Snapshots

                           Snap                    Snap
Instance     DB Name         Id   Snap Started    Level Comment
------------ ------------ ----- ----------------- ----- ----------------------
prd1         PRD1             1 11 May 2000 12:07     5
                              2 11 May 2000 12:08     5

                              3 12 May 2000 07:07     5
                              4 12 May 2000 08:08     5



Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 1
Begin Snapshot Id specified: 1

Enter value for end_snap: 2
End   Snapshot Id specified: 2


Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is sp_1_2  To use this name,
press  to continue, otherwise enter an alternative.
Enter value for report_name: 

Using the report name sp_1_2


  The report will now scroll past, and also be written to the file
  specified (e.g. sp_1_2.lis).


      Batch mode report generation
      ----------------------------
      To run a report without being prompted, assign values to the 
      SQL*Plus variables which specify the begin snap id, the end snap id
      and the report name before running spreport.

      The variables are:
        begin_snap   -> specifies the begin Snapshot Id
        end_snap     -> specifies the end   Snapshot Id
        report_name  -> specifies the Report output name

      e.g.
        on Unix:
          SQL>  connect perfstat/perfstat_password
          SQL>  define begin_snap=1
          SQL>  define end_snap=2
          SQL>  define report_name=batch_run
          SQL>  @?/rdbms/admin/spreport

      spreport will no longer prompt for the above information.


4.2. Running the instance report when there are multiple instances

  spreport.sql assumes you are connected to the database you wish to report
  on.  There are certain situations where this assumption may not be
  valid:

   - In a clustered database environment (RAC), you may be connected to
     an instance which is not the instance you wish to report on

   - If you are archiving baseline Statspack data in a separate database
     from your production database, or when importing Statspack data
     (e.g. in the case of Oracle support)

  In these situations, you would not be able to produce the Statspack
  instance report using spreport.sql, as the instance assumed may be 
  unavailable, possibly on a totally different host.

  To circumvent this problem, you should run the sprepins.sql report
  instead.  The sprepins.sql report output is identical to the
  spreport.sql output, as spreport.sql simply calls sprepins.sql, first 
  defaulting the Instance Number and DBId of the database you are
  currently connected to.

  If you run sprepins.sql directly, you are prompted for the DBId and
  Instance Number for the instance you wish to report on, in addition
  to the begin_snap and end_snap Ids and report output name (i.e. the 
  current DBId and Instance Number are not defaulted).

  Note:  By default, the report shows all completed snapshots for this instance
         when choosing the begin and end snapshot Id's.  However, the number 
         of days worth of snapshots to list is now configurable: to change 
         this, please see 'Snapshot related report settings - num_days' in the
         'Configuring the Instance Report' section of this document.


  You will be prompted for:

    1. The DBId
    2. The Instance Number
    3. The beginning snapshot Id
    4. The ending    snapshot Id
    5. The name of the report text file to be created

    Example output:
    SQL>  connect perfstat/perfstat_password
    Connected.
    SQL>  @sprepins
 

Instances in this Statspack schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id    Inst Num DB Name      Instance     Host
----------- -------- ------------ ------------ ------------
  590400074        1 CON90        con90        dlsun525
 4290976145        1 MAIL         MAIL         mailhost


Enter value for dbid: 4290976145
Using 4290976145 for database Id
Enter value for inst_num: 1
....

  Then similarly to spreport, the available snapshots are displayed, 
  and the begin and end snaps and report name are prompted for.


      Batch mode report generation
      ----------------------------
      To run the sprepins.sql report without being prompted, assign values 
      to the SQL*Plus variables which specify the dbid, instance number,
      begin snap id, the end snap id, and the report name, before running 
      spreport.

      The variables are:
        dbid         -> specifies the dbid
        inst_num     -> specifies the instance number
        begin_snap   -> specifies the begin Snapshot Id
        end_snap     -> specifies the end   Snapshot Id
        report_name  -> specifies the Report output name

      e.g.
          SQL>  connect perfstat/perfstat_password
          SQL>  define dbid=4290976145
          SQL>  define inst_num=1
          SQL>  define begin_snap=1
          SQL>  define end_snap=2
          SQL>  define report_name=batch_run
          SQL>  @?/rdbms/admin/sprepins

      sprepins will no longer prompt for the above information.


4.3. Configuring the Instance Report

  It is now possible to configure some aspects of the Statspack Instance
  report output.  These are discussed below.

  For the majority of sites, the only variable which should be modified (if
  required) is num_days.  The remaining variables have been documented solely 
  for benchmarks, or for sites who have very specific application requirements.

  Note:  Modifying the default value of any variable other than num_days
         may result in useful data being excluded from the report.  Please
         be very cautious when choosing values for the remaining variables.

         Backup the original Statspack report (sprepins.sql) to a different 
         file name before making changes to the file.  Once the changes
         have been made, backup the newly modified report.  As this file
         will be replaced when the server is upgraded to a new release, you
         will need to make the same changes to this file each time the 
         server is upgraded.

  The configuration is performed by modifying the 'Customer Configurable
  Report Settings' section of the file sprepins.sql for the instance report
  (and for num_days, sprsqins.sql for the SQL report).


  Snapshot related report settings - num_days
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  The number of days of snapshots to list when displaying the snapshots 
  to choose the begin and end snapshot Ids from.  The default is to list
  all snapshots.  However it is now possible to configure the number of 
  days worth of snapshots to list.

  This facility has been added for sites that have a large number of snapshots 
  stored in the Statspack schema, and who typically only look at the last
   days worth of data.

  For example, setting the number of days of snapshots to list (num_days) to
  31 would result in the most recent 31 days worth of snapshots being listed
  when choosing the begin and end snapshot Ids.

  Note:  This variable is the only variable modifiable in both the instance 
         report (sprepins.sql) and the SQL report (sprsqins.sql).

  The value of this variable is configured by changing the value assigned to
  the variable num_days.
  e.g.
        define num_days = 60

  The variable has the following valid values:

          - When a null string is used, all snapshots will be displayed.
                  This is the default setting.
                  e.g.  
                        define num_days = ''

             - Where n is the number of days of snapshots to list.
                  e.g. to set the number of days of snapshots to list to 31,
                  set num_days to 31:
                        define num_days = 31

    0           - A value of 0 means do not print out any snapshots.
                  This value would be of most use for batch execution of
                  the instance report, where the values for begin snap id and
                  end snap id are already known, thus printing out a list to
                  choose from is unneeded.
                  e.g.
                        define num_days = 0

     - This means the parameter is commented out in (or totally 
                  removed from) the file sprepins.sql
                  An undefined value for num_days will result in the report
                  prompting you for the number of days to enter, interactively.
                  Using '--' before the 'define' comments out the definition
                  of the variable, thus leaving it undefined.
                  e.g.
                       -- define num_days=31
                  Choosing this setting as your site's default means the 
                  instance report cannot be run in batch mode.

  If num_days is set to any value other than , you will not be
  prompted to enter a value.  However, if the variable is set to 
  running the instance report (or the SQL report) will result in you 
  being prompted for the value, as follows:

Current Instance
~~~~~~~~~~~~~~~~

   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
 1296193444 MAINDB              1 maindb


Instances in this Statspack schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id    Inst Num DB Name      Instance     Host
----------- -------- ------------ ------------ ------------
 1296193444        1 MAINDB       maindb       main1

Using 1296193444 for database Id
Using          1 for instance number


Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed.  Pressing  without
specifying a number lists all completed snapshots.

Enter value for num_days: 5

Listing the last 5 days of Completed Snapshots

                           Snap                    Snap
Instance     DB Name         Id   Snap Started    Level Comment
------------ ------------ ----- ----------------- ----- ----------------------
                             13 26 Sep 2002 17:01     5
                             14 27 Sep 2002 13:28     5
                             15 27 Sep 2002 13:29     5
                             16 30 Sep 2002 14:40     5

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 
....


  SQL section report settings - top_n_sql
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Total number of rows of SQL output to display in each SQL section of the 
  report.  Note this is not related to a specific SQL statement, nor to the 
  total number of SQL statements, merely to the maximum number of lines 
  outputted for each separate SQL section of the report.
  The default value is 65.  To change the value, change the value of the 
  variable top_n_sql.
  e.g.
        define top_n_sql = 65;

  SQL section report settings - num_rows_per_hash
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  This is the upper limit of the number of rows of SQL Text to print for 
  each SQL statement appearing in the SQL sections of the report.  This 
  variable applies to each SQL statement (i.e. hash_value).  The default value
  is 4, which means at most 4 lines  of the SQL text will be printed for 
  each SQL statement.  To change this value, change the value of the variable 
  num_rows_per_hash.
  e.g.
        define num_rows_per_hash = 10;

  SQL section report settings - top_pct_sql
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  This is a number which restricts the rows of SQL shown in the SQL sections  
  of the report.  Only SQL statements which exceeded top_pct_sql percentage
  of resources used, are candidates for listing in the report.
  The default value is 1.0%  To change the default, change the value of the
  variable top_pct_sql.
  e.g. 
        define top_pct_sql = 0.5;

  In the SQL ordered by gets section of the report, a top_pct_sql of 0.5% would
  only include SQL statements which had exceeded 0.5% of the total buffer gets
  in the interval.


  Segment related report settings - top_n_segstat
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  The number of top segments to display in each of the Segment sections of 
  the instance report.
  The default value is 5, which means only the top 5 segments in each category
  (e.g. top 5 logical reads) will be displayed.  To change the default, 
  change the value of the variable top_n_segstat.
  e.g. 
         define top_n_segstat = 5;


4.4. Running the SQL report

  Once the instance report has been analyzed, often there are high-load SQL
  statements which should be examined to determine if they are causing 
  unnecessary resource usage, and hence avoidable load.

  The SQL report sprepsql.sql, displays SQL-specific statistics, the 
  complete SQL text and (if level 6 snapshot has been taken), information 
  on any SQL Plan(s) associated with that statement.

  The SQL statement to be reported on is identified by the statement's Hash
  Value (which is a numerical representation of the statement's SQL text).
  The Hash Value for each statement is displayed in the high-load SQL
  sections of the instance report.

  The sprepsql.sql file is executed while being connected to the PERFSTAT 
  user, and is located in the rdbms/admin directory of the Oracle Home.

  Note:  To run sprepsql.sql in a Cluster environment, you must connect 
         to the instance you wish to report on.

  You will be prompted for:
    1. The beginning snapshot Id
    2. The ending    snapshot Id
    3. The Hash Value for the SQL statement
    4. The name of the report text file to be created

    Example output:
    SQL>  connect perfstat/perfstat_password
    Connected.
    SQL>  @sprepsql
 

   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
 2618106428 PRD1                1 prd1

Completed Snapshots
                           Snap                    Snap
Instance     DB Name         Id   Snap Started    Level Comment
------------ ------------ ----- ----------------- ----- ----------------------
prd1         PRD1            37 02 Mar 2001 11:01     6
                             38 02 Mar 2001 12:01     6

                             39 08 Mar 2001 09:01     5
                             40 08 Mar 2001 10:02     5

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 39
Begin Snapshot Id specified: 39

Enter value for end_snap: 40
End   Snapshot Id specified: 40

Specify the Hash Value
~~~~~~~~~~~~~~~~~~~~~~
Enter value for hash_value: 1988538571
Hash Value specified is: 1988538571

Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is sp_39_40_1988538571.  To use this name,
press  to continue, otherwise enter an alternative.
Enter value for report_name: 

Using the report name sp_39_40_1988538571
....

  The report will scroll past, and also be written to the file
  specified (e.g. sp_39_40_1988538571.lis).


      Batch mode report generation
      ----------------------------
      Similarly to spreport.sql, the SQL report can be run in batch mode.
      To run a report without being prompted, assign values to the 
      SQL*Plus variables which specify the begin snap id, the end snap id,
      the SQL hash value, and the report name before running spreport.

      The variables are:
        begin_snap   -> specifies the begin Snapshot Id
        end_snap     -> specifies the end   Snapshot Id
        hash_value   -> specifies the Hash Value
        report_name  -> specifies the Report output name

      e.g.
          SQL>  connect perfstat/perfstat_password
          SQL>  define begin_snap=39
          SQL>  define end_snap=40
          SQL>  define hash_value=1988538571
          SQL>  define report_name=batch_sql_run
          SQL>  @sprepsql

      sprepsql will no longer prompt for the above information.


4.5.  Running the SQL report when there are multiple instances

  sprepsql.sql assumes you are connected to the database you wish to report
  on.  There are certain situations where this assumption may not be
  valid:

   - In a clustered database environment (RAC), you may be connected to
     an instance which is not the instance you wish to report on

   - If you are archiving baseline Statspack data in a separate database
     from your production database, or when importing Statspack data
     (e.g. in the case of Oracle support)

  In these situations, you would not be able to produce the Statspack
  SQL report using sprepsql.sql, as the instance assumed may be 
  unavailable, possibly on a totally different host.

  To circumvent this problem, you should run the sprsqins.sql report
  instead.  The sprsqins.sql report output is identical to the
  sprepsql.sql output, as sprepsql.sql simply calls sprsqins.sql, first 
  defaulting the Instance Number and DBId of the database you are
  currently connected to.

  If you run sprsqins.sql directly, you are prompted for the DBId and
  Instance Number for the instance you wish to report on, in addition
  to the begin_snap and end_snap Ids, hash value and report output name 
  (i.e. the current DBId and Instance Number are not defaulted).

  Note:  By default, the report shows all completed snapshots for this instance
         when choosing the begin and end snapshot Id's.  However, the number 
         of days worth of snapshots to list is now configurable: to change 
         this, please see 'Snapshot related report settings - num_days' in the
         'Configuring the Instance Report' section of this document.


  You will be prompted for:

    1. The DBId
    2. The Instance Number
    3. The beginning snapshot Id
    4. The ending    snapshot Id
    5. The Hash Value for the SQL statement
    6. The name of the report text file to be created

    Example output:
    SQL>  connect perfstat/perfstat_password
    Connected.
    SQL>  @sprsqins
 

Current Instance
~~~~~~~~~~~~~~~~

   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
 1296193444 MAINDB              1 maindb

Instances in this Statspack schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id    Inst Num DB Name      Instance     Host
----------- -------- ------------ ------------ ------------
 1296193444        1 MAINDB       maindb       main1
 4290976145        1 MAIL         MAIL         mailhost

Enter value for dbid: 4290976145
Using 4290976145 for database Id
Enter value for inst_num: 1
....

  Then similarly to sprepsql, the available snapshots are displayed, 
  and the begin and end snap Ids, the hash value and report name are 
  prompted for.

      Batch mode report generation
      ----------------------------
      To run the sprsqins.sql report without being prompted, assign values 
      to the SQL*Plus variables which specify the dbid, instance number,
      begin snap id, the end snap id, hash value and the report name, 
      before running sprsqins.

      The variables are:
        dbid         -> specifies the dbid
        inst_num     -> specifies the instance number
        begin_snap   -> specifies the begin Snapshot Id
        end_snap     -> specifies the end   Snapshot Id
        hash_value   -> specifies the Hash Value        
        report_name  -> specifies the Report output name

      e.g.
          SQL>  connect perfstat/perfstat_password
          SQL>  define dbid=4290976145
          SQL>  define inst_num=1
          SQL>  define begin_snap=1
          SQL>  define end_snap=2
          SQL>  define hash_value=1988538571
          SQL>  define report_name=batch_run
          SQL>  @?/rdbms/admin/sprsqins

      sprsqins will no longer prompt for the above information.


4.6. Configuring the SQL report

  It is now possible to configure the number of days of snapshots to view
  when choosing the begin and end snapshot Ids.

  Note:  Backup the original Statspack SQL report (sprsqins.sql) to a 
         different file name before making changes to the file.  Once the 
         changes have been made, backup the newly modified report.  As this 
         file will be replaced when the server is upgraded to a new release, 
         you will need to make the same changes to this file each time the 
         server is upgraded.

  The configuration is performed by modifying the 'Customer Configurable
  Report Settings' section of the file sprsqins.sql.  For details on how
  to modify the number of days of snapshots to view, please see 
  'Snapshot related report settings - num_days' in the 'Configuring the 
  Instance Report' section of this document.


4.7. Gathering Optimizer statistics on the PERFSTAT schema

  For best performance when running the performance reports, Optimizer
  statistics should be gathered on the Statspack schema.

  In 10g, the Oracle server automatically gathers optimizer statistics
  on database segments when the segments become stale.

  If you have disabled this on your site, you should manually collect 
  optimizer statistics for tables and indexes owned by PERFSTAT.  This 
  should be performed whenever significant change in data volumes in 
  PERFSTAT's tables.  To do this, use dbms_stats and specify the PERFSTAT 
  user:

     execute dbms_stats.gather_schema_stats(ownname=>'PERFSTAT',cascade=>true);



5.  Configuring the amount of data captured
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Both the snapshot level, and the thresholds specified will affect the amount
of data Statspack captures.

5.1. Snapshot Level

  It is possible to change the amount of information gathered by the package,
  by specifying a different snapshot 'level'.  In other words, the level
  chosen (or defaulted) will decide the amount of data collected.
  The higher the snapshot level, the more data is gathered.  The default
  level set by the installation is level 5.

  For typical usage, level 5 snapshot is effective on most sites.  There
  are certain situations when using a level 6 snapshot is beneficial, such
  as when taking a baseline.

  The events listed below are a subset of events which should prompt
  taking a new baseline, using level 6:
  - when taking the first snapshots
  - when a new application is installed, or an application is modified/upgraded
  - after gathering optimizer statistics
  - before and after upgrading

  The various levels are explained in detail 'Snapshot Levels - details'
  section of this document.


5.2. Snapshot SQL thresholds

  There are other parameters which can be configured in addition to the 
  snapshot level.

  These parameters are used as thresholds when collecting data on SQL
  statements; data will be captured on any SQL statements that breach 
  the specified thresholds.

  Snapshot level and threshold information used by the package is stored 
  in the stats$statspack_parameter table.


5.3. Changing the default values for Snapshot Level and SQL Thresholds

  If you wish to, you can change the default parameters used for taking
  snapshots, so that they are tailored to the instance's workload.

  The full list of parameters which can be passed into the 
  modify_statspack_parameter procedure are the same as those for the 
  snap procedure.  These are listed in the 'Input Parameters for the SNAP and
  MODIFY_STATSPACK_PARAMETERS procedures' section of this document.


  Temporarily using new values
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  To temporarily use a snapshot level or threshold which is different to
  the instance's default snapshot values, simply specify the required 
  threshold or snapshot level when taking the snapshot.  This value will 
  only be used for immediate snapshot taken - the new value will
  not be saved as the default.

  e.g. Take a single level 6 snapshot (do not save level 6 as the default):
    SQL>  execute statspack.snap(i_snap_level=>6);


  Saving new defaults
  ~~~~~~~~~~~~~~~~~~~~
  If you wish to save the new value as the instance's default, you can do 
  this either by:

  o  Taking a snapshot, and specifying the new defaults to be saved to the
     database (using statspack.snap, and using the i_modify_parameter
     input variable).

     SQL>  execute statspack.snap - 
           (i_snap_level=>10, i_modify_parameter=>'true');

     Setting the i_modify_parameter value to true will save the new
     thresholds in the stats$statspack_parameter table; these thresholds 
     will be used for all subsequent snapshots.

     If the i_modify_parameter was set to false or if it were omitted, the
     new parameter values would not be saved.  Only the snapshot taken at 
     that point will use the specified values, any subsequent snapshots will
     use the preexisting values in the stats$statspack_parameter table. 

  o  Changing the defaults immediately without taking a snapshot, using the
     statspack.modify_statspack_parameter procedure.  For example to change 
     the snapshot level to 10, and the SQL thresholds for buffer_gets and
     disk_reads, the following statement can be issued:

     SQL>  execute statspack.modify_statspack_parameter - 
            (i_snap_level=>10, i_buffer_gets_th=>10000, i_disk_reads_th=>1000);

     This procedure changes the values permanently, but does not
     take a snapshot.


5.4 Snapshot Levels - details

 Levels  >= 0   General performance statistics
    Statistics gathered:
    This level and any level greater than 0 collects general
    performance statistics, such as: wait statistics, system events, 
    system statistics, rollback segment data, row cache, SGA, background 
    events, session events, lock statistics, buffer pool statistics, 
    latch statistics, resource limit, enqueue statistics, and statistics
    for each of the following, if enabled: automatic undo management,
    buffer cache advisory data, auto PGA memory management, Cluster DB
    statistics.

 Levels  >= 5  Additional data:  SQL Statements
    This level includes all statistics gathered in the lower level(s),
    and additionally gathers the performance data on high resource 
    usage SQL statements.

    In a level 5 snapshot (or above), note that the time required for the 
    snapshot to complete is dependent on the shared_pool_size and on the 
    number of SQL statements in the shared pool at the time the snapshot 
    is taken: the larger the shared pool, the longer the time taken to 
    complete the snapshot.

    SQL 'Thresholds'
       The SQL statements gathered by Statspack are those which exceed one of 
       six predefined threshold parameters:
        - number of executions of the SQL statement            (default 100)
        - number of disk reads performed by the SQL statement  (default 1,000)
        - number of parse calls performed by the SQL statement (default 1,000)
        - number of buffer gets performed by the SQL statement (default 10,000)
        - size of sharable memory used by the SQL statement    (default 1m)
        - version count for the SQL statement                  (default 20)

       The values of each of these threshold parameters are used when 
       deciding which SQL statements to collect - if a SQL statement's 
       resource usage exceeds any one of the above threshold values, it 
       is captured during the snapshot.
 
       The SQL threshold levels used are either those stored in the table 
       stats$statspack_parameter, or by the thresholds specified when 
       the snapshot is taken.

 Levels  >= 6  Additional data:  SQL Plans and SQL Plan usage
    This level includes all statistics gathered in the lower level(s),
    and additionally gathers optimizer execution plans, and plan usage 
    data for each of the high resource usage SQL statements captured.

    A level 6 snapshot gathers information which is invaluable when 
    determining whether the execution plan used for a SQL statement 
    has changed.  Therefore level 6 snapshots should be used 
    whenever there is the possibility a plan may change, such as
    after large data loads, or after gathering new optimizer
    statistics.

    To capture the plan for a SQL statement, the statement must be in the 
    shared pool at the time the snapshot is taken, and must exceed one of
    the SQL thresholds.  To gather plans for all statements in the
    shared pool, you can temporarily specify the executions threshold 
    (i_executions_th) to be zero (0) for those snapshots.  For information 
    on how to do this, see the 'Changing the default values for Snapshot 
    Level and SQL Thresholds' section of this document.

 Levels  >= 7  Additional data:  Segment level statistics
    This level includes all statistics gathered in the lower level(s),
    and additionally gathers the performance data on highly used segments.

    A level 7 snapshot captures Segment-level statistics for segments which 
    are heavily accessed or heavily contended for.

    Segment-level statistics captured are:
       - logical reads
       - db block changes
       - physical reads
       - physical writes
       - physical reads direct
       - physical writes direct
       - global cache cr blocks served *
       - global cache current blocks served *
       - buffer busy waits
       - ITL waits
       - row lock waits

       *  Denotes the Statistic is Real Application Clusters specific.

    There are many uses for segment-specific statistics.  Below are three
    examples:
    - The statistics relating to physical reads and writes can help you 
      decide to modify the physical layout of some segments (or of the 
      tablespaces they reside in).  For example, to better spread the 
      segment IO load, you can add files residing on different disks to a 
      tablespace storing a heavily accessed segment, or you can (re)partition 
      a segment.
    - High numbers of ITL waits for a specific segment may indicate a need to
      change segment storage attributes such as PCTFREE and/or INITRANS.
    - In a Real Application Clusters database, global cache statistics
      make it easy to spot the segments responsible for much of the 
      cross-instance traffic.
 
    Although Statspack captures all segment statistics, it only displays the
    following statistics in the Instance report:
       - logical reads
       - physical reads
       - buffer busy waits
       - ITL waits
       - row lock waits
       - global cache cr blocks served *
       - global cache current blocks served *

    Segment statistics 'Thresholds'
       The segments for which statistics are gathered are those whose 
       statistics exceed one of the following seven threshold parameters:
        - number of logical reads on the segment                (default 10000)
        - number of physical reads on the segment               (default 1000)
        - number of buffer busy waits on the segment            (default 100)
        - number of row lock waits on the segment               (default 100)
        - number of ITL waits on the segment                    (default 100)
        - number of global cache Consistent Read blocks served* (default 1000)
        - number of global cache CUrrent blocks served*         (default 1000)

       The values of each of these thresholds are used when deciding which 
       segments to collect statistics for.  If any segment's statistic value 
       exceeds its corresponding threshold value, all statistics for this 
       segment are captured.

       The threshold levels used are either those stored in the table
       stats$statspack_parameter, or by the thresholds specified when
       the snapshot is taken.
 
 Levels  >= 10 Additional statistics:  Parent and Child latches
    This level includes all statistics gathered in the lower levels, and
    additionally gathers Parent and Child Latch information.  Data 
    gathered at this level can sometimes cause the snapshot to take longer 
    to complete i.e. this level can be resource intensive, and should 
    only be used when advised by Oracle personnel.


5.5.  Specifying a Session Id

  If you would like to gather session statistics and wait events for a 
  particular session (in addition to the instance statistics and wait events),
  it is possible to specify the session id in the call to Statspack.  The 
  statistics gathered for the session will include session statistics, 
  session events and lock activity.  The default behaviour is to not to 
  gather session level statistics.

    SQL>  execute statspack.snap(i_session_id=>3);

  Note that in order for session statistics to be included in the report
  output, the session's serial number (serial#) must be the same in the 
  begin and end snapshot.  If the serial numbers differ, it means the 
  session is not the same session, so it is not valid to generate session 
  statistics.  If the serial numbers differ, the following warning will 
  appear (after the begin/end snapshot has been entered by the user) to 
  signal the session statistics cannot be printed:

    WARNING: SESSION STATISTICS WILL NOT BE PRINTED, as session statistics
    captured in begin and end snapshots are for different sessions
    (Begin Snap sid,serial#: 10,752,  End Snap sid,serial#: 10,754).


5.6.  Input Parameters for the SNAP and MODIFY_STATSPACK_PARAMETERS procedures

   Parameters able to be passed in to the statspack.snap and
   statspack.modify_statspack_parameter procedures are as follows:

                    Range of      Default
Parameter Name      Valid Values  Value    Meaning
------------------  ------------  -------  -----------------------------------
i_snap_level        0,5,6,7,10    5        Snapshot Level
i_ucomment          Text            Comment to be stored with Snapshot
i_executions_th	    Integer >=0   100      SQL Threshold: number of times
                                           the statement was executed
i_disk_reads_th	    Integer >=0   1,000    SQL Threshold: number of disk reads 
                                           the statement made
i_parse_calls_th    Integer >=0   1,000    SQL Threshold: number of parse 
                                           calls the statement made
i_buffer_gets_th    Integer >=0   10,000   SQL Threshold: number of buffer
                                           gets the statement made
i_sharable_mem_th   Integer >=0   1048576  SQL Threshold: amount of sharable
                                           memory
i_version_count_th  Integer >=0   20       SQL Threshold: number of versions
                                           of a SQL statement
i_seg_phy_reads_th  Integer >=0   1,000    Segment statistic Threshold: number
                                           of physical reads on a segment. 
i_seg_log_reads_th  Integer >=0   1,0000   Segment statistic Threshold: number 
                                           of logical reads on a segment.
i_seg_buff_busy_th  Integer >=0   100      Segment statistic Threshold: number 
                                           of buffer busy waits for a segment.
i_seg_rowlock_w_th  Integer >=0   100      Segment statistic Threshold: number 
                                           of row lock waits for a segment.
i_seg_itl_waits_th  Integer >=0   100      Segment statistic Threshold: number 
                                           of ITL waits for a segment.
i_seg_cr_bks_sd_th  Integer >=0   1000     Segment statistic Threshold: number
                                           of Consistent Reads blocks served by
                                           the instance for the segment*.
i_seg_cu_bks_sd_th  Integer >=0   1000     Segment statistic Threshold: number
                                           of CUrrent blocks served by the
                                           instance for the segment*.
i_session_id        Valid sid     0 (no    Session Id of the Oracle Session
                    from          session) to capture session granular
                    v$session              statistics for
i_modify_parameter  True,False    False    Save the parameters specified for 
                                           future snapshots?



6.  DB time, and Time Units used for Performance Statistics

----------------------------------------------

6.1.  DB time compared to Total Call Time

  DB time is a statistic manintained by the database, and was introduced
  in Oracle 10g Release 10.1.  It can be queried in the view v$sys_time_model,
  along with other time model statistcs.

  DB time measures the amount of time spent in the database by foreground
  processes in non-Idle state (e.g. the process is either on the CPU, or 
  actively waiting for a resource or action).  There is also a foreground
  CPU time statistic called 'DB CPU'.

  Non-idle time spent in the database is also accumulated for background 
  processes separately, in the time model statistic 'background 
  elapsed time' (there is also a 'background cpu time').

  Call Time, or Total Call Time is a proxy computed by Statspack for 
  'DB Time + bacground elapsed'.  It is based on the v$sysstat
  statistic 'CPU used by this session' + 'time spent in non-Idle waits'
  (where Idle events are in stats$idle_event).

  These numbers are usually very close, but may diverge.  Either can be used
  to perform accurate problem diagnosis.  Statspack uses both Call Time, and
  DB time, and AWR exclusively uses DB time.


6.2.  Time Units used for Performance Statistics
  Oracle now supports capturing certain performance data with millisecond and
  microsecond granularity.

  Views which include microsecond timing include:
    - v$session_wait, v$system_event, v$session_event (time_waited_micro column)
    - v$sql, v$sqlarea (cpu_time, elapsed_time columns)
    - v$latch, v$latch_parent, v$latch_children (wait_time column)
    - v$sql_workarea, v$sql_workarea_active (active_time column)

  Views which include millisecond timings include:
    - v$enqueue_stat (cum_wait_time)

  Note that existing columns in other views continue to capture centi-second 
  times.

  As centi-second and microsecond timing may not be appropriate for rolled 
  up data such as that displayed by Statspack, Statspack displays most 
  cumulative times in seconds, and average times in milliseconds (for easier 
  comparison with Operating System monitoring utilities which often report 
  timings in milliseconds).

  For clarity, the time units used are specified in the column headings of
  each timed column in the Statspack report.  The convention used is:
        (s)  - a second
        (cs) - a centisecond - which is       100th of a second
        (ms) - a millisecond - which is     1,000th of a second 
        (us) - a microsecond - which is 1,000,000th of a second 



7.  Event Timings
-----------------
If timings are available, the Statspack report will order wait events by time
(in the Top-5 and background and foreground Wait Events sections).

If timed_statistics is false for the instance, however a subset of users or
programs set timed_statistics set to true dynamically, the Statspack report
output may look inconsistent, where some events have timings (those which the
individual programs/users waited for), and the remaining events do not.
The Top-5 section will also look unusual in this situation.

Optimally, timed_statistics should be set to true at the instance level for
ease of diagnosing performance problems.



8.  Managing and Sharing performance data
-----------------------------------------

8.1. Baselining performance data

  It is possible to identify snapshot data worthy of keeping, which will not
  be purged by the Statspack purge.  This is called baselining.  Once you have
  determined which snap Ids or times of day most represent a particular 
  workload whose performance data you would like to keep, you can mark the 
  data representing those times as baselines.  Baselined snapshots will not 
  be purged by the Statspack purge.

  If you later decide you no longer want to keep previously baselined 
  snapshots, you can clear the baseline (clearing the baseline does not 
  remove the data, it just identifies the data as candidates for purging).

  NOTE:  Statspack baseline does not perform any consistency checks on the
         snapshots requested to be baselined (e.g. it does not check whether
         the specified baselines span an instance shutdown).  Instead, the
         baseline feature merely marks Snapshot rows as worthy of keeping, 
         while other data can be purged.

  New procedures and functions have been added to the Statspack package to
  make and clear baselines:  MAKE_BASELINE, and CLEAR_BASELINE.  Both of these
  are able to accept varying parameters (e.g. snap Ids, or dates, etc), and 
  can be called either as a procedure, or as a function (the function returns 
  the number of rows operated on, whereas the procedure does not).

  Snap Ids or Begin/End dates
  ---------------------------
  The Statspack MAKE_BASELINE procedures and functions provide flexibility in
  the manner baselines are made or cleared. These can take various input
  parameters:

    - Begin Snap Id and End Snap Id

      A begin and end snap Id pair can be specified.  In this case, you choose
      either to baseline the range of snapshots between the begin and end 
      snapshot pair, or just the two snapshots.  The default is to baseline
      the entire range of snapshots.

    - Begin Date and End Date

      A begin and end date pair can be specified.  All snapshots which fall in
      the date range specified will be marked as baseline data.

  Similarly to the MAKE_BASELINE procedures and functions, the CLEAR_BASELINE 
  procedures and functions accept the same arguments.  

  Procedure or Function
  ---------------------
  It is possible to call either the MAKE_BASELINE procedure, or the
  MAKE_BASELINE function.  The only difference is the MAKE_BASELINE function
  returns the number of snapshots baselined, whereas the MAKE_BASELINE
  procedure does not.
  Similarly, the CLEAR_BASELINE procedure performs the same task as the
  CLEAR_BASELINE function, however the function returns the number of
  baselined snapshots which were cleared (i.e. no longer identified as
  baselines).
  
  8.1.1. Input Parameters for the MAKE_BASELINE and CLEAR_BASELINE
         procedure and function which accept Begin and End Snap Ids

  This section describes the input parameters for the MAKE_BASELINE and 
  CLEAR_BASELINE procedure and function which accept Snap Ids.  The input 
  parameters for both MAKE and CLEAR baseline are identical.  The
  procedures/functions will either baseline (or clear the baseline for) the 
  range of snapshots between the begin and end snap Ids identified (the 
  default), or if i_snap_range parameter is FALSE, will only operate on 
  the two snapshots specified.
  If the function is called, it will return the number of snapshots 
  operated on.

                    Range of           Default
Parameter Name      Valid Values       Value    Meaning
------------------  -----------------  -------  -------------------------------
i_begin_snap        Any Valid Snap Id  -        SnapId to start the baseline at
i_end_snap          Any valid Snap Id  -        SnapId to end the baseline at
i_snap_range        TRUE/FALSE         TRUE     Should the range of snapshots
                                                between the begin and end snap
                                                be included?
i_dbid              | Any valid DBId/  Current  Caters for RAC databases
i_instance_number   | inst number      DBId/    where you may wish to baseline
                      combination      Inst #   snapshots on one instance
                      in this                   which were physically taken
                      Statspack                 on another instance
                      schema

  Example 1:
       To make a baseline of snaps 45 and 50 including the range of snapshots
       in between (and you do not wish to know the number of snapshots 
       baselined, so call the MAKE_BASELINE procedure).  Log into the PERFSTAT 
       user in SQL*Plus, and:

       SQL> exec statspack.make_baseline -
                 (i_begin_snap => 45, -
                  i_end_snap   => 50);

           Or without specifying the parameter names:

       SQL> exec statspack.make_baseline(45, 50);

  Example 2:
       To make a baseline of snaps 1237 and 1241 (including the range of 
       snapshots in between), and be informed of the number of snapshots 
       baselined (by calling the function), log into the PERFSTAT 
       user in SQL*Plus, and:

       SQL> variable num_snaps number;
       SQL> begin
       SQL>   :num_snaps := statspack.make_baseline(1237, 1241);
       SQL> end;
       SQL> /
       SQL> print num_snaps

  Example 3:
       To make a baseline of only snapshots 1237 and 1241 (excluding the
       snapshots in between), log into the PERFSTAT user in SQL*Plus, 
       and:

       SQL> exec statspack.make_baseline(5, 12, false);

  All of the prior examples apply equally to CLEAR_BASELINE.


  8.1.2. Input Parameters for the MAKE_BASELINE and CLEAR_BASELINE
         procedure and function which accept Begin and End Dates

  The input parameters for the MAKE_BASELINE and CLEAR_BASELINE procedure and
  function which accept begin and end dates are identical.  The procedures/ 
  functions will either baseline (or clear the baseline for) all snapshots
  which were taken between the begin and end dates identified.

                    Range of           Default
Parameter Name      Valid Values       Value    Meaning
------------------  -----------------  -------  -------------------------------
i_begin_date        Any valid date     -        Date to start the baseline at
i_end_date          Any valid date >   -        Date to end baseline at
                    begin date
i_dbid              | Any valid DBId/  Current  Caters for RAC databases
i_instance_number   | inst number      DBId/    where you may wish to baseline
                      combination      Inst #   snapshots on one instance
                      in this                   which were physically taken
                      Statspack                 on another instance
                      schema

  Example 1:
       To make a baseline of snapshots taken between 12-Feb-2003 at 9am, and 
       12-Feb-2003 at 12 midday (and be informed of the number of snapshots 
       affected), call the MAKE_BASELINE function.  Log into the PERFSTAT 
       user in SQL*Plus, and:

       SQL> variable num_snaps number;
       SQL> begin
       SQL>   :num_snaps := statspack.make_baseline 
                (to_date('12-FEB-2003 09:00','DD-MON-YYYY HH24:MI'),
                 to_date('12-FEB-2003 12:00','DD-MON-YYYY HH24:MI'));
       SQL> end;
       SQL> /
       SQL> print num_snaps

  Example 2:
       To clear an existing baseline which covers the times 13-Dec-2002 at 
       11pm and 14-Dec-2002 at 2am (without wanting to know how many 
       snapshots were affected), log into the PERFSTAT user in SQL*Plus, and:

       SQL> exec statspack.clear_baseline - 
              (to_date('13-DEC-2002 23:00','DD-MON-YYYY HH24:MI'), -
               to_date('14-FEB-2002 02:00','DD-MON-YYYY HH24:MI'));


8.2. Purging/removing unnecessary data

  It is possible to purge unnecessary data from the PERFSTAT schema using the
  PURGE procedures/functions.  Any Baselined snapshots will not be purged.

  NOTE:
  o It is good practice to ensure you have sufficient baselined snapshots
    before purging data.
  o It is recommended you export the schema as a backup before running this
    script. Refer to the Oracle Database Utilities manual to use Data Pump Export 
    to export the schema.
  o WARNING:  It is no longer possible to rollback a requested purge operation.
  o The functionality which was in the sppurge.sql SQL script has been moved 
    into the STATSPACK package.  Moving the purge functionality into the 
    STATSPACK package has allowed significantly more flexibility in how 
    the data to be purged can be specified by the performance engineer.


  Purge Criteria for the STATSPACK PURGE procedures and functions
  ---------------------------------------------------------------
  Data to be purged can either be specified by:

    - Begin Snap Id and End Snap Id

      A begin and end snap Id pair can be specified.  In this case, you choose
      either to purge the range of snapshots between the begin and end 
      snapshot pair (inclusive, which is the default), or just the two 
      snapshots specified.
      The preexisting Statspack sppurge.sql SQL script has been modified to 
      use this PURGE procedure (which purges by begin/end snap Id range).

    - Begin Date and End Date

      A begin and end date pair can be specified.  All snapshots which were
      taken between the begin and end date will be purged.

    - Purge before date

      All snapshots which were taken before the specified date will be purged.

    - Number of days (N)

      All snapshots which were taken N or more days prior to the current date
      and time (i.e. SYSDATE) will be purged.

  Extended Purge
  --------------
  In prior releases, Statspack identifier tables which contained SQL Text, 
  SQL Execution plans, and Segment identifiers were not purged.

  It is now possible to purge the unreferenced data in these tables.  This is
  done by requesting the 'extended purge' be performed at the same time as 
  the normal purge.  Requesting the extended purge be performed along with a
  normal purge is simply a matter of setting the input parameter 
  i_extended_purge to TRUE when calling the regular purge.

  Purging this data may be resource intensive, so you may choose to perform
  an extended purge less frequently than the normal purge.

  Procedure or Function
  ---------------------
  Each of the purge procedures has a corresponding function.  The function
  performs the same task as the procedure, but returns the number of 
  Snapshot rows purged (whereas the procedure does not).


  8.2.1. Input Parameters for the PURGE procedure and function
         which accept Begin Snap Id and End Snap Id

  This section describes the input parameters for the PURGE procedure and 
  function which accept Snap Ids.  The input parameters for both procedure
  and function are identical.  The procedure/function will purge all 
  snapshots between the begin and end snap Ids identified (inclusive, which 
  is the default), or if i_snap_range parameter is FALSE, will only purge 
  the two snapshots specified. If i_extended_purge is TRUE, an extended purge 
  is also performed.
  If the function is called, it will return the number of snapshots purged.

                    Range of           Default
Parameter Name      Valid Values       Value    Meaning
------------------  -----------------  -------  -------------------------------
i_begin_snap        Any Valid Snap Id  -        SnapId to start purging from
i_end_snap          Any valid Snap Id  -        SnapId to end purging at
i_snap_range        TRUE/FALSE         TRUE     Should the range of snapshots
                                                between the begin and end snap
                                                be included?
i_extended_purge    TRUE/FALSE         FALSE    Determines whether unused
                                                SQL Text, SQL Plans and 
                                                Segment Identifiers will be
                                                purged in addition to the
                                                normal data purged
i_dbid              | Any valid DBId/  Current  Caters for RAC databases
i_instance_number   | inst number      DBId/    where you may wish to baseline
                      combination      Inst #   snapshots on one instance
                      in this                   which were physically taken
                      Statspack                 on another instance
                      schema

  Example 1:
       Purge all snapshots between the specified begin and end snap ids.  Also
       purge unused SQL Text, SQL Plans and Segment Identifiers, and
       return the number of snapshots purged.  Log into the PERFSTAT user 
       in SQL*Plus, and:

       SQL> variable num_snaps number;
       SQL> begin
       SQL>   :num_snaps := statspack.purge
                 ( i_begin_snap=>1237, i_end_snap=>1241
                 , i_extended_purge=>TRUE);
       SQL> end;
       SQL> /
       SQL> print num_snaps       


  8.2.2.  Input Parameters for the PURGE procedures and functions
          which accept Begin Date and End Date

  This section describes the input parameters for the PURGE procedure and 
  function which accept a begin date and an end date.  The procedure/
  function will purge all snapshots taken between the specified begin and 
  end dates.  The input parameters for both procedure and function are 
  identical.  If i_extended_purge is TRUE, an extended purge is also performed.
  If the function is called, it will return the number of snapshots purged.

                    Range of           Default
Parameter Name      Valid Values       Value    Meaning
------------------  -----------------  -------  -------------------------------
i_begin_date        Date               -        Date to start purging from
i_end_date          End date > begin   -        Date to end purging at
                    date               -        SnapId to end the baseline at
i_extended_purge    TRUE/FALSE         FALSE    Determines whether unused
                                                SQL Text, SQL Plans and 
                                                Segment Identifiers will be
                                                purged in addition to the
                                                normal data purged
i_dbid              | Any valid DBId/  Current  Caters for RAC databases
i_instance_number   | inst number      DBId/    where you may wish to baseline
                      combination      Inst #   snapshots on one instance
                      in this                   which were physically taken
                      Statspack                 on another instance
                      schema

  Example 1:
       Purge all snapshots which fall between 01-Jan-2003 and 02-Jan-2003.
       Also perform an extended purge.  Log into the PERFSTAT user in 
       SQL*Plus, and:

        SQL> exec statspack.purge -
               (i_begin_date=>to_date('01-JAN-2003', 'DD-MON-YYYY'), -
                i_end_date  =>to_date('02-JAN-2003', 'DD-MON-YYYY'), -
                i_extended_purge=>TRUE);


  8.2.3. Input Parameters for the PURGE procedure and function
         which accept a single Purge Before Date

  This section describes the input parameters for the PURGE procedure and 
  function which accept a single date.  The procedure/function will purge
  all snapshots older than the date specified.  If i_extended_purge is TRUE,
  also perform an extended purge.  The input parameters for both 
  procedure and function are identical.
  If the function is called, it will return the number of snapshots purged.

                    Range of           Default
Parameter Name      Valid Values       Value    Meaning
------------------  -----------------  -------  -------------------------------
i_purge_before_date Date               -        Snapshots older than this date
                                                will be purged
i_extended_purge    TRUE/FALSE         FALSE    Determines whether unused
                                                SQL Text, SQL Plans and 
                                                Segment Identifiers will be
                                                purged in addition to the
                                                normal data purged.
i_dbid              | Any valid DBId/  Current  Caters for RAC databases
i_instance_number   | inst number      DBId/    where you may wish to baseline
                      combination      Inst #   snapshots on one instance
                      in this                   which were physically taken
                      Statspack                 on another instance
                      schema

  Example 1:
       To purge data older than a specified date, without wanting to know the 
       number of snapshots purged, log into the PERFSTAT user in SQL*Plus,
       and:

       SQL> exec statspack.purge(to_date('31-OCT-2002','DD-MON-YYYY'));


  8.2.4. Input Parameters for the PURGE procedure and function
         which accept the Number of Days of data to keep

  This section describes the input parameters for the PURGE procedure and 
  function which accept the number of days of snapshots to keep.  All data
  older than the specified number of days will be purged.  The input 
  parameters for both procedure and function are identical.  If 
  i_extended_purge is TRUE, also perform an extended purge.
  If the function is called, it will return the number of snapshots purged.

                    Range of           Default
Parameter Name      Valid Values       Value    Meaning
------------------  -----------------  -------  -------------------------------
i_num_days          Number > 0         -        Snapshots older than this
                                                number of days will be purged
i_extended_purge    TRUE/FALSE         FALSE    Determines whether unused
                                                SQL Text, SQL Plans and 
                                                Segment Identifiers will be
                                                purged in addition to the
                                                normal data purged
i_dbid              | Any valid DBId/  Current  Caters for RAC databases
i_instance_number   | inst number      DBId/    where you may wish to baseline
                      combination      Inst #   snapshots on one instance
                      in this                   which were physically taken
                      Statspack                 on another instance
                      schema

  Example 1:
       To purge data older than 31 days, without wanting to know the number 
       of snapshots operated on, log into the PERFSTAT user in SQL*Plus, and:

       SQL> exec statspack.purge(31);


8.2.5. Using sppurge.sql

  When sppurge is run, the instance currently connected to, and the
  available snapshots are displayed.  The DBA is then prompted for the
  low Snap Id and high Snap Id.  All snapshots which fall within this 
  range will be purged.

  WARNING:  sppurge.sql has been modified to use the new Purge functionality
            in the STATSPACK package, therefore it is no longer possible to 
            rollback a requested purge operation - the purge is automatically
            committed.

  e.g. Purging data - connect to PERFSTAT using SQL*Plus, then run the
       sppurge.sql script - sample example output appears below.

SQL>  connect perfstat/perfstat_password
SQL>  set transaction use rollback segment rbig;
SQL>  @sppurge

Database Instance currently connected to
========================================

                                Instance
   DB Id    DB Name    Inst Num Name
----------- ---------- -------- ----------
  720559826 PERF              1 perf


Snapshots for this database instance
====================================

                               Base-  Snap
 Snap Id   Snapshot Started    line? Level Host            Comment
-------- --------------------- ----- ----- --------------- --------------------
       1  30 Feb 2000 10:00:01           6 perfhost
       2  30 Feb 2000 12:00:06 Y         6 perfhost
       3  01 Mar 2000 02:00:01 Y         6 perfhost
       4  01 Mar 2000 06:00:01           6 perfhost

WARNING
~~~~~~~
sppurge.sql deletes all snapshots ranging between the lower and
upper bound Snapshot Id's specified, for the database instance
you are connected to.  Snapshots identified as Baseline snapshots
which lie within the snapshot range will not be purged.

It is NOT possible to rollback changes once the purge begins.

You may wish to export this data before continuing.

Specify the Lo Snap Id and Hi Snap Id range to purge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for losnapid: 1
Using 1 for lower bound.

Enter value for hisnapid: 2
Using 2 for upper bound.

Deleting snapshots 1 - 2

Purge of specified Snapshot range complete.

SQL> -- end of example output


      Batch mode purging
      ------------------
      To purge in batch mode, you must assign values to the SQL*Plus
      variables which specify the low and high snapshot Ids to purge.

      The variables are:
        losnapid   -> Begin Snapshot Id
        hisnapid   -> End Snapshot Id

      e.g.
          SQL>  connect perfstat/perfstat_password
          SQL>  define losnapid=1
          SQL>  define hisnapid=2
          SQL>  @sppurge

      sppurge will no longer prompt for the above information.


8.3. Removing all data

  If you wish to truncate all performance data indiscriminately, it is
  possible to do this using sptrunc.sql  This script truncates all
  statistics data gathered, including snapshots marked as baselines.

  NOTE:
  It is recommended you export the schema as a backup before running this
  script.  Refer to the Oracle Database Utilities manual to use Data Pump Export 
  to export the schema.

  If you run sptrunc.sql in error, the script allows you to exit before
  beginning the truncate operation (you do this at the 'begin_or_exit' 
  prompt by typing in 'exit').

  To truncate all data, connect to the PERFSTAT user using SQL*Plus, 
  and run the script - sample output which truncates data is below:

    SQL>  connect perfstat/perfstat_password
    SQL>  @sptrunc

    Warning
    ~~~~~~~
    Running sptrunc.sql removes ALL data from Statspack tables.  You may
    wish to export the data before continuing.


    About to Truncate Statspack Tables
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If would like to exit WITHOUT truncating the tables, enter any text at the
    begin_or_exit prompt (e.g. 'exit'), otherwise if you would like to begin
    the truncate operation, press 


    Enter value for begin_or_exit: 
    Entered at the 'begin_or_exit' prompt

    ... Starting truncate operation

    Table truncated.
    Table truncated.
    

    Commit complete.

    Package altered.

    ... Truncate operation complete


8.4. Sharing data via export

  If you wish to share data with other sites (for example if Oracle
  Support requires the raw statistics), it is possible to export 
  the PERFSTAT user.

  You can use Data Pump Export to export the perfstat schema.
  For example to export using Data Pump :

   % expdb perfstat/perfstat_password schemas=PERFSTAT dumpfile=STATSPACK.dmp logfile=expSTATSPACK.log
  
  This will create a file called STATSPACK.dmp and the log file expSTATSPACK.log

  If you wish to load the data into another database, use Data Pump
  Import.  For information on using Data Pump Export and Import, please
  see the Oracle Database Utilities manual.

  
9.  New and Changed Features
----------------------------
9.1.  Changes between 11.1  and 12.1
  o  Idle Events
     - Added Idle Events that span LogMiner, PQ, SQL*Net, Capture Reply, AQ,
       Emon, Recovery, iowp, lreg, netp, imco
  o  Multitenant Database Support
     - Added support for Statspack installation and reporting at the Pluggable
       Database (PDB) level.  However, some data sources in the report are for 
       the entire instance and may not be restricted to the PDB.
     - Statspack installation and reporting is not supported at the root level
       (CDB$ROOT) 


9.1.  Changes between 10.2  and 11.1

Changes on the Summary Page of the Instance Report 
  o  Host
     - Platform name has been added to the Host information.
     - The number of CPU cores and sockets is displayed, where available.
     - Physical Memory is now shown in GB rather than MB.
  o  Snapshot information
     - The DB time and DB CPU in seconds, is now printed close to the 
       snapshot Elapsed time.
  o  Load Profile
     - DB time and DB CPU have been added to Load Profile.  Units are
       Per Second, Per Transaction, Per Execute and Per Call
       The addtion of this normalized data assists when examinig
       to reports to see whether the load is comparable.
     - The number of 'Sorts' has been replaced with 'W/A MB processed'.  
       Displaying workarea statistics more accurately reflects not
       only sorts, but also other workarea operations such as hash
       joins.  Additionally, using MB processed rather than the number
       of workarea operations indicates the quantity of workarea work
       performed.
     - The following statistics have been removed from the front page,
       as they are no longer considered as important as they once were:
         % Blocks changed per Read
         Recursive Call %
         Rollback per transaction %
         Rows per Sort

  o Instance Efficiency
    - This section has been renamed from 'Instance Efficiency Percentages'
      to 'Instance Efficiency Indicators', as this more accurately
      represents that these values are simply indicators of possible
      areas to consider, rather than conclusive evidence.
   - 'In-memory Sort %' has been replaced with 'Optimal W/A Exec %'
     as the old statistic only showed sorts, and not all workarea
     operations.


Modified sections of the Instance Report
  o  Wait Events and Background Wait Event
     The % of Total Call Time has been added to these sections.  Rows which
     have null for the % of Call Time are Idle Events, and so do not
     contribute to the % Total Call time.

  o  The PGA Memory Advisory now shows the Estimated Time to process the
     data.

  o  The init.ora parameters section now shows the entire parameter value
     rather than truncating the output

  o  SQL sections
     SQL statements which have not completed execution (e.g. have a 0
     execution count as the statement was still running when the End
     snapshot was taken) can now appear in the SQL reports.


New Data captured/reported on - Level 1
  o  Foreground Wait Events
     A new wait event section has been added.  This shows wait events
     for foreground processes only.

  o  OS Statistics - detail (from v$osstat)
     This is a new section which shows the Load, %Busy, %User, %System
     %WIO and %WCPU for each snapshot between the Begin and End snapshot
     Ids specified.

  o  IO Stat by Function - summary (from v$iostat_function)
     This section shows IO statistics broken down by Oracle function.
     A by-function breakdown can help identify where the IO bandwith 
     is being consumed (e.g. by RMAN, DBWR, recovery, direct IO).
     The summary section summarizes IO requests and IO rates.

  o  IO Stat by Function - detail (from v$iostat_function)
     Similar to above, however this section shows details how the
     IO requests and IO rates break down by small requests and
     large requests (requests > 128k).

  o  Memory Target Advice (from v$memory_target_advice)
     Shows potential values for memory_target parameter, and
     their estimated cost, in DB time.

  o  Memory Dynamic Components
     Shows infomration about the last resize operation for each
     Memory Component.

  o  Memory Resize Operations
     Shows all known Memory resize operations which occured between
     the Begin and End snapshots.


Obsoleted data
  o  v$temp_histogram view and the corresponding Statspack table have
     been dropped.



9.2.  Changes between 10.1  and 10.2

Changes on the Summary Page of the Instance Report 
  o  The front summary page of the instance report has been modified to show
      - Host CPU and Memory configuration
      - begin/end buffer cache and shared pool sizes (end values are only 
        shown if they differ from the begin values)
      - Ave Wait (ms) for the Top-5 Timed Events section


Continuation of Summary Page on Page 2
  o  Page 2 of the Statspack report should be considered a continuation of
     the front-page summary of the Statspack report.  This page includes:
        - Memory and CPU statistics captured by Oracle in the v$osstat view
        - ratios derived from v$osstat and the Time model data 
          (v$sys_time_model)
        - the raw Time-model system statistics data

     These statistics should be consulted in conjunction with page 1 data 
     during the initial performance analysis stage, when formulating the
     list of potential drill-down data to examine:
     o  The Operating System statistics data should be used to identify
        whether the host is CPU bound, and if so, how much this Oracle 
        instance is  contributing to the CPU usage.
     o  The Memory usage statistics show how much of physical memory is 
        consumed, and how much physical memory is used by the SGA and 
        PGA for this instance.
     Please note that not all of the OS statistics are available on all
     platforms.


Sections moved in the Instance Report
  o  The Time Model System Stats section has moved to page 2 of the report
     (see Continuation of Summary Page on Page 2, above).

  o  The OS Stats section has been moved to follow the System Statistics
     sections.


Modified sections of the Instance Report
  o  The Wait Events and Background Wait Events section of the report have
     been modified to only show events with a total wait time of > .001s
     to filter out unimportant events.

  o  The Timeouts column in the System Event and Background Event sections have
     changed to be %Timeouts (as compared to Waits).  Note that to avoid
     loss of data, a %Timeouts value of 0 indicates timeouts occurred in  Captured SQL accounts for   74.8% of total Buffer Gets

      This identifies that 74.8% of the total Buffer gets incurred during 
      the interval is attributable to the high-load SQL captured by Statspack
      (Note that not all captured statements are displayed in the report, only
      those which are the highest load).

  o  New SQL report 'SQL ordered by Cluster Wait Time'
  There is a new SQL report added to the SQL reports section.  This report
  lists the top-SQL ordered by Cluster Wait Time.  This report may be useful
  in Real Application Cluster databases.


Derived Statistics
  There is one new statistic in the Instance Activity Sections which
  does not come from V$SYSSTAT: 'log switches (derived)'.
  This statistic is derived from the v$thread view which Statspack now 
  captures.  This statistic is shown in a new Instance Activity Stats sections
  of the instance report, as described below.


Two new Instance Activity Stats sections
  There are two new Instance Activity Stats sections in the instance report.

  The first shows the begin and end absolute values of statistics which 
  should not be diffed (typically performing a diff is incorrect, because 
  the statistics show current values, rather than cumulative values).
  These statistics come from v$sysstat (as do the other Instance Activity
  statistics).
  
   Instance Activity Stats  DB/Inst: MAINDB/maindb  Snaps: 22-23
   -> Statistics with absolute values (should not be diffed)
   -> Statistics identified by '(derived)' come from sources other than SYSSTAT

   Statistic                             Begin Value       End Value
   --------------------------------- --------------- ---------------
   logons current                                 10              10
   opened cursors current                         41              49
   session cursor cache count                     24              36

  The second shows the number of log switches, which is derived from the 
  v$thread view.

   Instance Activity Stats  DB/Inst: MAINDB/maindb  Snaps: 22-23

   Statistic                                      Total  per Hour
   --------------------------------- ------------------ ---------
   log switches (derived)                             0       .00


New Scripts
  o  sprsqins.sql - Reports on a single SQL statement (i.e. hash_value), 
                    including the SQL statistics for the snapshot, the
                    complete SQL text and optimizer execution plan information.
                    This report differs from sprepsql.sql, in that it
                    can report on a SQL statement for any instance which 
                    the PERFSTAT schema contains, whereas sprepsql.sql defaults
                    the dbid and instance number to the instance you are
                    currently connected to, thus restricting reporting of
                    SQL statements to those related to that instance only.
                    sprsqins.sql will prompt for a dbid, instance_number,
                    begin and end snap id's and the hash value of the SQL
                    statement to report on.
                    This report can be used when importing data from another
                    instance, or in a Real Application Clusters environment
                    to report on an instance which you are not directly 
                    connected to.
 o  sprepcon.sql  - This file contains SQL*Plus parameters which determine
                    some aspects of what is printed out in the Statspack
                    Instance report spreport.sql  For more details on what
                    is configurable, see the sprepcon.sql file itself.


New Data captured/reported on - Level 1
  Time Model data (from v$sys_time_model and v$sess_time_model)
  Operating System statistics (from v$osstat)
  Streams statistics (from 
     Streams Capture            - v$streams_capture
     Streams Apply              - v$streams_apply_coordinator/reader/server
     Propagation Sender         - v$propagation_sender, dba_queue_schedules
     Propagation Receiver       - v$propagation_receiver
     Buffered Queues            - v$buffered_queues
     Buffered Queue Subscribers - v$buffered_subscribers
     Rule Sets                  - v$rule_set
  Additional RAC Sections (from v$cr_block_server, v$current_block_server, 
     v$class_cache_transfer)
  Enqueue Statistics (from v$enqueue_statistics, rather than v$enqueue_stat)
  Java Pool Advisory (from v$java_pool_advice)
  Thread information (from v$thread)


New Data captured, optionally reported on - Level 1
  Event Histogram Statistics (from v$event_histogram)
     (only displayed if SQL*Plus variable event_histogram = Y)
  File Histogram Statistics (from v$datafile_histogram and 
     v$tempfile_histogram)
     (only displayed if SQL*Plus variable file_histogram = Y)


New columns added to
  o  stats$shared_pool_advice
       estd_lc_load_time, estd_lc_load_time_factor
  o  stats$sql_plan
       sql_id, projection, time, object_alias, object_type, qblock_name,
       remarks
  o  stats$sql_summary
       sql_id, direct_writes, application_wait_time, concurrency_wait_time,
       cluster_wait_time, user_io_wait_time, plsql_exec_time, java_exec_time,
       sql_profile, program_id, program_line#, end_of_fetch_count
  o  stats$sql_text
       sql_id
  o  stats$undostat
       maxqueryhash, maxqueryid, activeblks, unexpiredblks, expiredblks,
       tuned_undoretention


Cluster Features
  o  Real Application Clusters Statistics page (page 2 of a clustered 
     database report) has been modified to add new ratios and remove ratios 
     considered less useful. 

  o  The Global Enqueue Statistics section, previously on page 3 of a RAC 
     instance report, has been moved to behind the Library Cache Activity 
     statistics.

  o  Statistics for CR and CURRENT blocks served, and for INSTANCE CACHE 
     TRANSFER, have been added after Global Enqueue Statistics page.

  o  New SQL report 'SQL ordered by Cluster Wait Time' has been added.


9.4.  Changes between 9.0 and 9.2

Changes on the Summary Page of the Instance Report (spreport.sql)

  o  The Top 5 Wait Events has been changed to be the Top 5 Timed Events.

     What was previously the Top 5 Wait Events has been expanded to give the
     Top 5 timed events within the instance: i.e. in addition to including 
     Wait events, this section can now include the CPU time as reported in the
     'CPU used by this session' statistic.  This statistic will appear in the 
     Top 5 only if it's value is one of the Top 5 users of time for the 
     snapshot interval.

         Note that the name of the statistic 'CPU used by this session' will
         actually appear in the Top 5 section as 'CPU Time'.  The statistic
         name is masked in the Top 5 to avoid the confusion of the suffix
         'by this session'.
         The statistic will continue to appear in the System Statistics
         (SYSSTAT) section of the report as 'CPU used by this session'.

     Additionally, instead of the percentage calculation being the % Total 
     Wait Time (which is time for each wait event divided by the total wait
     time), the percentage calculation is now the % Total Call Time.

     Call Time is the total time spent in database calls (i.e. the total 
     non-idle time spent within the database either on the CPU, or actively 
     waiting).

     We compute 'Call Time' by adding the time spent on the CPU ('CPU used by 
     this session' statistic) to the time used by all non-idle wait events.
     i.e. 
         total call time = total CPU time + total wait time for non-idle events

     The % Total Call Time shown in the 'Top 5' heading on the summary page 
     of the report, is the time for each timed event divided by the total call 
     time (i.e. non-idle time).
     i.e.
       previously the calculation was:
         time for each wait event  / total wait time for all events
       now the calculation is:
         time for each timed event / total call time


     Purpose
     ~~~~~~~
     The purpose for including CPU time with wait events:

     When tuning a system, the first step is to identify where the most of the 
     time is spent, in order to identify where the most productive tuning 
     effort should be concentrated.

     The majority of time could be spent in waiting for events to complete
     (and so be identifiable in the wait event data), or the system could be 
     consuming much CPU (for which Operating System statistics, and the Oracle
     CPU statistic 'CPU used by this session' in SYSSTAT are examined).
     Having the CPU Time co-located with the wait events in the Top 5 section 
     of the instance report makes it easier to compare the relative values
     and to identify whether the most productive investigation would occur 
     by drilling down the wait events, or in reducing Oracle CPU usage 
     (e.g. by tuning SQL).

Changes on the Top SQL sections of the Report (spreport.sql)

  o  When specified by the application, the MODULE information is reported
     just before the SQL statement itself.
     This information is preceded by the mention "Module: "

New columns added to
  - stats$db_cache_advice
    size_factor: compares the estimated cache size with the current cache size
  - stats$sql_plan
    search_columns: the number of index columns with matching predicates.
    access_predicates: predicates used to locate rows in an access structure.
        For example, start and/or stop predicates for an index range scan.
    filter_predicates: predicates used to filter rows before producing them.
  - stats$sql_summary
    child_latch: the library cache child latch number which protects this
        SQL statement (join to v$latch_children.child#). A parent SQL
        statement, and all it's children are protected by the same library
        cache child latch.
    fetches: the number of fetches performed for this SQL statement

New Scripts
  o  spup90.sql  - Upgrades a 9.0 Statspack schema to the 9.2 format

New Data captured/reported on - Level 1
  - Shared Pool Advisory
  - PGA statistics including PGA Advisory, PGA Histogram usage

New Data captured/reported on - Level 7
  - Segment level Statistics

Cluster Features
  o  Real Application Clusters Statistics page (page 2 of a clustered database
     report) has been significantly modified to add new ratios and remove 
     ratios deemed less useful.
  o  RAC specific segment level statistics are captured with level 7

SQL Plan Usage capture changed
  o  The logic for capturing SQL Plan Usage data (level 6) has been modified
     significantly.  Instead of capturing a Plan's Usage once the first time
     the plan is used and never again thereafter, the algorithm now captures
     the plans used each snapshot.  This allows tracking whether multiple
     plans are in use concurrently, or whether a plan has reverted back to
     an older plan.
     Note that plan usage data is only captured for high-load SQL (this is
     unchanged between 9.0 and 9.2).

     Due to the significant change in data capture, it is not possible to
     convert existing data.  Instead, any pre-existing data will be
     archived into the table STATS$SQL_PLAN_USAGE_90 (this allows querying
     the archived data, should this be necessary).


sprepsql.sql
  o  'All Optimizer Plan(s) for this Hash Value' change:
     Instead of showing the first time a plan was seen for a specific hash
     value, this section now shows each time the Optimizer Plan
     changed since the SQL statement was first seen e.g. if the SQL statement
     had the following plan changes:
       snap ids      plan hash value
       --------      ---------------
         1 ->  12    AAAAAAA
        13 -> 134    BBBBBBB
       145 -> 299    CCCCCCC
       300 -> 410    AAAAAAA

    Then this section of the report will now show:
       snap id       plan hash value
       --------      ---------------
              1      AAAAAAA
             13      BBBBBBB
            145      CCCCCCC
            300      AAAAAAA

     Previously, only the rows with snap_id's 1, 13 and 145 would have been 
     displayed, as these were the first snap Id's these plans were found.
     However this data could not show that plan AAAAAA was found again in 
     snap_id 300.

     The new output format makes it easier to see when an older plan is again
     in use.  This is possible due to the change in the SQL Plan Usage 
     capture (described above).


9.5.  Changes between 8.1.7 and 9.0

Timing data
  o columns with cumulative times are now displayed in seconds.

Changes on the Summary Page
  o  All cache sizes are now reported in M or K

New Statistics on the Summary page
  o  open cursors per session values for the begin and end snapshot
  o  comments specified when taking a snapshot are displayed for the
     begin and end snapshots

Latches
  o The Latch Activity, Child and Parent Latch sections have the following
   additional column:
   -  wait_time: cumulative time spent waiting for the latch

New Scripts
  o  spup817.sql  - Upgrades an 8.1.7 Statspack schema to the 9.0 format
  o  sprepsql.sql - Reports on a single hash_value, including
                    the SQL statistics for the snapshot, the complete SQL
                    text and optimizer execution plan information.
  o  sprepins.sql - A report which can be run to query performance data
                    for any instance which the PERFSTAT schema contains.
                    The report will prompt for a dbid, instance_number and
                    begin and end snap id's.
                    This report can be used when importing data from another
                    instance, or in a Real Application Clusters environment
                    to report on an instance which you are not directly 
                    connected to.

New Data captured/reported on - Level 1
  - Data from v$resource_limit
  - If the instance is a Cluster instance, v$dlm_misc data
  - Additional columns are now captured in stats$enqueue_stat
  - Automatic Undo Management statistics
  - Buffer Cache advisory data
  - New Auto-PGA memory management data
  - Support for multiple sized-block buffer pools
  - Support for resizable buffer pool and shared pool
  - Data from v$instance_recovery

New Snapshot Level - Level 6
  - New SQL plans and SQL Plan usage information for high-load SQL 
    statements are captured.

Cluster Features
 o  There is additional derived data and statistics which are now included
    in the Statspack report for a clustered database.  For more information,
    see the 'Cluster Specific Data' section of this document.

New SNAP function
  o the call to take a snapshot can also be a PL/SQL function call which
    returns the snapshot Id of the snapshot taken.  Using the function rather
    than the procedure is useful in situations where you wish to know the
    snap_id immediately, such as when running Statspack reports in batch
    mode, or during benchmark runs.

Installation
  o  The installation script will no longer accept the SYSTEM tablespace for
     the PERFSTAT user's DEFAULT or TEMPORARY tablespace.  If SYSTEM is
     specified, the installation will error.

SQL
  o  Each SQL report has two new columns CPU Time and Elapsed Time.  These
     show the cumulative CPU time and Elapsed time for all executions of
     that SQL statement for the snapshot period.  If cumulative CPU and
     Elapsed times are not shown, the CPU and Elapsed times per execute
     are shown.

Changed
  o  The SGA Breakdown difference section of the Statspack report now 
     shows the difference between begin and end values as a percentage
     of the begin value, rather than in bytes.
  o  The data in the Dictionary Cache Stats and Library Cache Activity
     sections are only printed if the number of gets is greater than zero.


9.6.  Changes between 8.1.6 and 8.1.7

New Statistics on the Summary page
  o  connections at the begin snapshot and connections at the end snapshot

  Load Profile
  o  executes per transaction and per second
  o  logons per transaction and per second

  Instance Efficiency
  o  % Non-Parse CPU: which is the parse time CPU / CPU used by this session
  o  Parse CPU to Parse Elapsd%: which is the parse time CPU / parse time 
     elapsed
  o  Execute to Parse %:  The ratio of executions to parses

  Instance Efficiency - Shared Pool Statistics are shown for the begin and 
  end snapshots.
  o  Memory Usage %:  The percentage of the shared pool which is used.
  o  % SQL with executions>1:  The percentage of reused SQL (i.e. the
     percentage of SQL statements with more than one execution).
  o  % Memory for SQL w/exec>1:  The percentage of memory used for SQL
     statements with more than one execution.
  This data is newly gathered by the 8.1.7 Statspack for level 5 snapshots
  and above, and so will not evident if the report is run against older 
  data captured using the 8.1.6 Statspack.

Tablespace and File IO
  o  Tempfile statistics are now captured.  The statistics for tempfiles are
     shown in the same sections with statistics for datafiles and tablespaces.
  o  The tablespace and File IO reports have been modified to include reads/s
     and writes/s.

Latches
  o  The report has been modified to include parent and child latch 
     sections, which only appears in the report when a level 10 snapshot 
     is taken.

New Scripts
  o  sppurge.sql - Purges a range of Snapshot Ids
  o  sptrunc.sql - Deletes all data
  o  spup816.sql - Upgrades an 8.1.6 Statspack to the 8.1.7 schema

Batch Mode execution
  o  The installation, reporting and purge scripts (spcreate.sql, spreport.sql
     and sppurge.sql) have been modified so they can be run in batch mode, if 
     the appropriate SQL*Plus variables are defined before the scripts are run.

SQL
  o  Two new SQL thresholds (and sections in the report) have been added:  
     sharable_mem and version_count
  o  The report which was previously ordered by rows processed has been
     changed to be ordered by executions
  o  The full text of a SQL statement is now captured (previously only the
     first 1000 bytes of the text was captured); the text is captured once
     only.  Previously, Statspack gathered all SQL related information, 
     including all the SQL text for each snapshot.  The new strategy will
     result less space usage.
  o  The first 5 lines of a SQL statement are shown in each SQL report
     (rather than the first line)

File Rename
  o  The Statspack files have been renamed, with all files now beginning 
     with the prefix sp.
     The new and old file names are given below.  For more information on
     the purpose of each file, please see the Supplied Scripts Overview 
     section.

     New Name       Old Name
     ------------   -------------
     spdoc.txt      statspack.doc
     spcreate.sql   statscre.sql
     spreport.sql   statsrep.sql
     spauto.sql     statsauto.sql
     spuexp.par     statsuexp.par
     sppurge.sql    - new file -
     sptrunc.sql    - new file -
     spup816.sql    - new file -
     spdrop.sql     statsdrp.sql
     spcpkg.sql     statspack.sql
     spctab.sql     statsctab.sql
     spcusr.sql     statscusr.sql
     spdtab.sql     statsdtab.sql
     spdusr.sql     statsdusr.sql

  o  The default Statspack report output file name prefix has been modified 
     to sp_ (was st_) to be consistent with the new script names.



10.  Compatibility and Upgrading from previous releases
-------------------------------------------------------

10.1  Compatibility Matrix

    Database       ---- Statspack Release ----
    Release     12.1  11.1  10.2   10.1   9.2    9.0   8.1.7  8.1.6
    --------    ----  ----  ----   ----   ----  -----  -----  -----
    12.1           Y     -     -     -      -      -      -      -
    11.1           -     Y     -     -      -      -      -      -
    10.2           -     -     Y     -      -      -      -      -
    10.1           -     -     -     Y      -      -      -      -
    9.2            -     -     -     -      Y      -      -      -
    9.0            -     -     -     -      -      Y      -      -
    8.1.7          -     -     -     -      -      -      Y      -
    8.1.6          -     -     -     -      -      -      -      Y

In summary, it is best to use the Statspack release shipped with
the version of the database you are using.

If you are already using an earlier release of Statspack must use
a newer Statspack release (e.g. because you are upgrading the database),
it is possible to upgrade an existing Statspack schema, and so
keep previously captured data.  See the 'Upgrading an existing Statspack 
schema to a newer release' section of this document.


10.1.1. Using Statspack shipped with 12.1

The Statspack scripts shipped with 12.1 can not be used with any release
earlier than 12.1, as Statspack uses new v$views (and new columns added to 
existing v$views) introduced in this server release.

10.1.1. Using Statspack shipped with 11.1

The Statspack scripts shipped with 11.1 can not be used with any release
earlier than 11.1, as Statspack uses new v$views (and new columns added to 
existing v$views) introduced in this server release.


10.1.2. Using Statspack shipped with 10.2

The Statspack scripts shipped with 10.2 can not be used with any release
earlier than 10.2, as Statspack uses new v$views (and new columns added to 
existing v$views) introduced in this server release.


10.1.3. Using Statspack shipped with 10.1

The Statspack scripts shipped with 10.1 can not be used with any release
earlier than 10.1, as Statspack uses new v$views (and new columns added to 
existing v$views) introduced in this server release.


10.1.4. Using Statspack shipped with 9.2

The Statspack scripts shipped with 9.2 can not be used with any release
earlier than 9.2, as Statspack uses new v$views (and new columns added to 
existing v$views) introduced in this server release.


10.1.5. Using Statspack shipped with 9.0

The Statspack scripts shipped with 9.0 can not be used with any release
earlier than 9.0, as the 9.2 release uses new v$views (and new columns added 
to existing v$views) introduced in this server release.


10.1.6. Using Statspack shipped with 8.1.7 on 9i releases

It is not possible to use the Statspack shipped with 8.1.7 with any 9i
instance, due to the definition of an undocumented view Statspack 8i used,
changing between Oracle8i and Oracle9i.  Attempting to use 8.1 Statspack 
on an instance running 9i will result in package compilation errors.


10.2.  Upgrading an existing Statspack schema to a newer release

Scripts are provided which convert performance data in an existing 
Statspack schema running an older Statspack release, to the newer schema
format.

Although data conversion is not a supported activity, these scripts have been 
provided as a convenient way of keeping previously captured Statspack data.

Due to the differences in schema layout, minor irregularities may result 
in statistics captured before conversion.  An example of this is the 
Enqueue statistics data migration: do not compare Enqueue statistics data 
collected pre-10.1 to the Enqueue statistics data captured in 10.1 (for more 
details, see section 'Upgrading the Statspack schema from 9.2 to 10.1').


Backups
~~~~~~~
Note: There is no downgrade script.  Backup the PERFSTAT schema using
      export BEFORE attempting the upgrade, in case the upgrade fails.
      The only method of downgrading, or re-running the upgrade is to 
      de-install Statspack, and import a previously made export.

Before running the upgrade script, export the Statspack schema (for a
backup), then disable any scripts which use Statspack, as these will 
interfere with the upgrade.  For example, if you use a dbms_job to 
gather statistics, disable this job for the duration of the upgrade.


Data Volumes
~~~~~~~~~~~~
If there is a large volume of data in the Statspack schema (i.e. a large 
number of snapshots), to avoid a long upgrade time or avoid an unsuccessful 
upgrade:
 - ensure there is enough free space in PERFSTAT's default tablespace
   before starting the upgrade (each individual upgrade section will 
   describe how to estimate the required disk space)
 - if you do not use Automatic Undo Management, ensure you specify a large 
   rollback segment, if prompted
 - if you do not use Automatic Memory Management, ensure you specify a large 
   sort_area_size (e.g. 1048576), if prompted



Rollback segment errors during upgrade
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If it is required, the upgrade script will prompt you for the rollback segment
and sort_area_size to be used on your site.  If you do not need to specify a 
rollback segment or sort_area_size (e.g. because you use Automatic Undo 
Management and PGA Aggregate Target) simply press return, and ignore the 
following errors appearing in the upgrade log file:

  alter session set sort_area_size =
                                  *
  ERROR at line 1:
  ORA-02017: integer value required


  set transaction use rollback segment
                                    *
  ERROR at line 1:
  ORA-02245: invalid ROLLBACK SEGMENT name
  

Package Compilation errors during upgrade over multiple releases
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Errors in compiling the STATSPACK *package body* *while in the process* of 
running multiple Statspack upgrade scripts consecutively (e.g. when 
upgrading multiple releases) should be ignored.

If your site is upgrading from (for example) 9.0 to 10.1 and has 10.1 
installed, to upgrade the Statspack schema from 9.0 to 10.1, spup90.sql 
followed by spup92.sql must be run.

The Statspack package compilation which is a part of the first upgrade
script (spup90.sql) will fail with errors; this is expected, as the schema 
is in a partially upgraded state, and will not be fully upgraded to 10.1 until
spup92.sql is also run.

The final package compilation which is run as a part of the last upgrade 
script (in this case spup92.sql), must complete successfully.

Note:  The above example is not specific for the 9.0 to 10.1 upgrade, 
       it applies equally when upgrading Statspack through multiple 
       releases, no matter which releases.  


10.2.1. Upgrading the Statspack schema from 11.2   to 12.1

   Follow the general instructions in section 10.2. 'Upgrading an existing 
   Statspack schema to a newer release' above.

   To upgrade:
     - ensure you have sufficient free space in the tablespace
     - disable any programs which use Statspack
     - backup the Statspack schema (e.g. using export)
     - run the upgrade by connecting as a user with SYSDBA privilege:
    SQL>  connect / as sysdba
    SQL>  @spup112

Once the upgrade script completes, check the log files (spup112a.lis and
spup112b.lis) for errors.  If errors are evident, determine and rectify the 
cause.  If no errors are evident, re-enable any Statspack data 
collection or reporting scripts which were previously disabled.


10.2.1. Upgrading the Statspack schema from 11.1   to 11.2

   Follow the general instructions in section 10.2. 'Upgrading an existing 
   Statspack schema to a newer release' above.

   To upgrade:
     - ensure you have sufficient free space in the tablespace
     - disable any programs which use Statspack
     - backup the Statspack schema (e.g. using export)
     - run the upgrade by connecting as a user with SYSDBA privilege:
    SQL>  connect / as sysdba
    SQL>  @spup1101

Once the upgrade script completes, check the log files (spup1101a.lis and
spup1101b.lis) for errors.  If errors are evident, determine and rectify the 
cause.  If no errors are evident, re-enable any Statspack data 
collection or reporting scripts which were previously disabled.

   To upgrade from 11.2.0.1 to 11.2.0.2
     - ensure you have sufficient free space in the tablespace
     - disable any programs which use Statspack
     - backup the Statspack schema (e.g. using export)
     - run the upgrade by connecting as a user with SYSDBA privilege:
    SQL>  connect / as sysdba
    SQL>  @spup11201

Once the upgrade script completes, check the log files (spup11201a.lis and
spup11201b.lis) for errors.  If errors are evident, determine and rectify the 
cause.  If no errors are evident, re-enable any Statspack data 
collection or reporting scripts which were previously disabled.


10.2.2. Upgrading the Statspack schema from 10.2   to 11.1

   Follow the general instructions in section 10.2. 'Upgrading an existing 
   Statspack schema to a newer release' above.

   To upgrade:
     - ensure you have sufficient free space in the tablespace
     - disable any programs which use Statspack
     - backup the Statspack schema (e.g. using export)
     - run the upgrade by connecting as a user with SYSDBA privilege:
    SQL>  connect / as sysdba
    SQL>  @spup102

Once the upgrade script completes, check the log files (spup102a.lis and
spup102b.lis) for errors.  If errors are evident, determine and rectify the 
cause.  If no errors are evident, re-enable any Statspack data 
collection or reporting scripts which were previously disabled.


10.2.3. Upgrading the Statspack schema from 10.1   to 10.2

   Follow the general instructions in section 10.2. 'Upgrading an existing 
   Statspack schema to a newer release' above.

   To upgrade:
     - ensure you have sufficient free space in the tablespace
     - disable any programs which use Statspack
     - backup the Statspack schema (e.g. using export)
     - run the upgrade by connecting as a user with SYSDBA privilege:
    SQL>  connect / as sysdba
    SQL>  @spup10

Once the upgrade script completes, check the log files (spup10a.lis and
spup10b.lis) for errors.  If errors are evident, determine and rectify the 
cause.  If no errors are evident, re-enable any Statspack data 
collection or reporting scripts which were previously disabled.


10.2.4. Upgrading the Statspack schema from 9.2   to 10.1

   Follow the general instructions in section 10.2. 'Upgrading an existing 
   Statspack schema to a newer release' above.

   This release creates new tables and indexes, and requires approx.
   20 extra MB.

   To upgrade:
     - ensure you have sufficient free space in the tablespace
     - disable any programs which use Statspack
     - backup the Statspack schema (e.g. using export)
     - run the upgrade by connecting as a user with SYSDBA privilege:
    SQL>  connect / as sysdba
    SQL>  @spup92

Once the upgrade script completes, check the log files (spup92a.lis and
spup92b.lis) for errors.  If errors are evident, determine and rectify the 
cause.  If no errors are evident, re-enable any Statspack data 
collection or reporting scripts which were previously disabled.


  Data Compatibility - 'enqueue' wait event
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Note that in 10.1, each enqueue has it's own distinct wait event, and the
  general 'enqueue' wait event will no longer be used.  Instead of seeing 
  'enqueue' as a wait event, you will now see 'enqueue: enqueue name - 
  request reason'
  e.g.
       enqueue: Transaction - row lock contention


  Data Compatibility - 'latch free' wait event
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Note that in 10.1, many latches each have their distinct wait event.  The
  general 'latch free' wait event is still used, but only represents data
  for those latches which do not have their own event.  So it is now possible
  to see 'latch free' as well as 'latch: ' in the list of
  wait events
  e.g. 
          latch: cache buffers chains
          latch free


  Data Compatibility - Enqueue Statistics
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  A new v$view has been added in 10.1 - v$enqueue_statistics.  This view
  differs from the existing v$enqueue_stat view, as in addition to breaking
  down enqueue activity by enqueue Type, it also breaks down enqueue requests
  by Request Reason.  So for enqueues which can be requested for multiple 
  purposes, the data is broken down by reason.

  e.g. TX enqueue (transaction enqueue) can be requested for multiple reasons.

       In 10.1 the data may look like:
         Enqueue Type (Request Reason)              Requests
         -----------------------------------   -------------
         TX-Transaction (row lock contention)             55
         TX-Transaction (allocate ITL entry)               1

       Whereas in 9.2 the data would look like:
         Enqueue Type                               Requests
         -----------------------------------   -------------
         TX                                               56

  Statspack has been enhanced to use the new v$enqueue_statistics view, rather
  than continue using v$enqueue_stat.
  The Statspack upgrade script spup92.sql migrates the data captured from
  prior releases into the new format, in order to avoid losing historical data.

  Note for the reasons explained in the example above, you must sum up the
  enqueue statistics by Type in a 10.1 Statspack report, to be able to 
  make the equivalent comparison to the data shown in a 9.2 report.


  Data Compatibility - Changing of RAC Statistics and Event Names
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Real Application Cluster Event Names and Statistics have been changed
  from 'global cache xxx' to 'gc xxx'.  Historical performance data stored
  in the Statspack schema has not been modified to reflect the new names,
  so when comparing a Statspack report on a pre-10g system, be aware the
  statistic names and event names may have changed.


  Data Compatibility - Changing SQL Hash Value, and new SQL Id
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  The computed value of the Hash Value column in the V$SQL family of tables 
  (v$sql, v$sqlarea, v$sqltext etc) has changed in release 10g.  This means the
  same SQL statement will have a different hash_value in 10g than in prior
  releases.  This change has been made as a consequence of introducing the
  new SQL Id column.  SQL Id can be considered a 'more unique' hash_value.
  The new SQL Id has been introduced to further reduce the probability of a 
  'hash collision' where two distinct SQL statements hash to the same
  hash_number.
  Statspack captures SQL Id, but does not use it as the unique identifier.
  Instead, Statspack continues to use the hash_value and first 31 bytes of the
  SQL text to uniquely identify a SQL statement (AWR uses SQL Id).



10.2.5. Upgrading the Statspack schema from 9.0   to 9.2

   Follow the general instructions in section 10.2. 'Upgrading an existing 
   Statspack schema to a newer release' above.

   This release creates new tables and indexes, and requires approx.
   20 extra MB.

   To upgrade:
     - ensure you have sufficient free space in the tablespace
     - disable any programs which use Statspack
     - backup the Statspack schema (e.g. using export)
     - run the upgrade by connecting as a user with SYSDBA privilege:
    SQL>  connect / as sysdba
    SQL>  @spup90

Once the upgrade script completes, check the log files (spup90a.lis and
spup90b.lis) for errors.  If errors are evident, determine and rectify the 
cause.  If no errors are evident, re-enable any Statspack data 
collection or reporting scripts which were previously disabled.


  SQL Plan Usage Data Upgrade note:
    If there is more than one database in a single Statspack schema (i.e.
    there are multiple distinct dbid's), AND if Level 6 snapshots have 
    been taken using the 9.0 release Statspack, then the SQL plan usage 
    data will be saved, but will not be queried by the sprepsql.sql 
    SQL report (this is because during the data conversion, it will not
    be possible to identify which database first identified a plan
    usage).
    For more details see 'SQL Plan Usage capture changed' in the 'Changes 
    between 9.0 and 9.2' section of this document. 


10.2.6. Upgrading the Statspack schema from 8.1.7 to 9.0

   Follow the general instructions in section 10.2. 'Upgrading an existing 
   Statspack schema to a newer release' above.

   Then, to estimate whether you have sufficient free space to run this 
   upgrade, execute the following SQL statement while connected as PERFSTAT in 
   SQL*Plus:

     select 10 + (2*sum(bytes)/1024/1024) est_space_mb
       from dba_segments
      where segment_name in ('STATS$ENQUEUESTAT');

   The est_space_mb column will give you a guesstimate as to the required
   free space, in megabytes.

   To upgrade:
     - ensure you have sufficient free space in the tablespace
     - disable any programs which use Statspack
     - backup the Statspack schema (e.g. using export)
     - run the upgrade by connecting as a user with SYSDBA privilege:
    SQL>  connect / as sysdba
    SQL>  @spup817

Once the upgrade script completes, check the log files (spup817a.lis and
spup817b.lis) for errors.   If errors are evident, determine and rectify 
the cause before proceeding.  If no errors are evident, and you are upgrading
to 9.2, you may proceed with the upgrade.


  Data Compatibility
  ~~~~~~~~~~~~~~~~~~
  Prior to release 9.0, the STATS$ENQUEUESTAT table gathered data based on
  an X$ table, rather than a V$view.  In 9.0, the column data within the 
  underlying X$ table has been considerably improved, and the data 
  externalised via the V$ENQUEUE_STAT view.

  The Statspack upgrade script spup817.sql migrates the data captured from
  prior releases into the new format, in order to avoid losing historical data.

  Note however, that the column names and data contained within the columns
  has changed considerably between the two releases: the STATS$ENQUEUE_STAT 
  columns in 9.0 capture different data to the columns which existed in the
  STATS$ENQUEUESTAT table in the 8.1. Statspack releases.

  The column data migration performed by spup817.sql is as follows:

      8.1 STATS$ENQUEUESTAT   9.0 STATS$ENQUEUE_STAT
      ---------------------   ----------------------
      GETS                    TOTAL_REQ#
      WAITS                   TOTAL_WAIT#


  To further emphasise the difference, the column definitions appear below:

      STATS$ENQUEUESTAT.GETS         - 8.1
      Reflected the number of enqueue gets, excluding enqueue conversions.
      This statistic was incremented at the end of a get.

      STATS$ENQUEUE_STAT.TOTAL_REQ#  - 9.0
      Is the total number of requests for an enqueue + the number of
      enqueue conversions.  This statistic is incremented at the beginning 
      of a get request.

      STATS$ENQUEUESTAT.WAITS        - 8.1
      Reflected the number of times a session waited for at least 3 
      seconds for an enqueue operation (get or convert).  The statistic 
      was incremented at the end of the wait (either if the enqueue was 
      successfully gotten or if the request timed out).  If a session waited
      for less than 3 seconds, this statistic was not incremented.

      STATS$ENQUEUE_STAT.TOTAL_WAIT# - 9.0
      Is the total number of times a session waited for any enqueue operation.
      This statistic is incremented at the beginning of the wait.

  For these reasons it is not valid to compare Enqueue statistics data 
  collected pre-9.0, to Enqueue statistics data captured in Oracle9i.


10.2.7. Upgrading the Statspack schema from 8.1.6 to 8.1.7

   Follow the general instructions in section 10.2. 'Upgrading an existing 
   Statspack schema to a newer release' above.

   Then, to estimate whether you have sufficient free space to run this 
   upgrade, execute the following SQL statement while connected as PERFSTAT in 
   SQL*Plus:

     select 1.3*sum(bytes)/1024/1024 est_space_mb
       from dba_segments
      where segment_name in ('STATS$SQL_SUMMARY','STATS$SQL_SUMMARY_PK');
   The est_space_mb column will give you a guesstimate as to the required
   free space, in megabytes.
   The larger the SQL statements in the sql_summary table, the more space will
   be released after the upgrade is complete.

   To upgrade:
     - ensure you have sufficient free space in the tablespace
     - disable any programs which use Statspack
     - backup the Statspack schema (e.g. using export)
     - run the upgrade by connecting as a user with SYSDBA privilege:
    SQL>  connect / as sysdba
    SQL>  @spup816

Once the upgrade script completes, check the log files (spup816a.lis and 
spup816b.lis) for errors.  If errors are evident, determine and rectify 
the cause before proceeding.  If no errors are evident, and you are upgrading
to 9.0, you may proceed with the upgrade.


10.2.8. Upgrading the Statspack schema from 8.1.6 to 9.2

If you are running 8.1.6 Statspack and wish to upgrade to 9.2 Statspack, you 
must follow the upgrade steps - in the following order:
  - 10.2.4. Upgrading the Statspack schema from 8.1.6 to 8.1.7
  - 10.2.3. Upgrading the Statspack schema from 8.1.7 to 9.0
  - 10.2.2. Upgrading the Statspack schema from 9.0   to 9.2


10.2.9. Upgrading the Statspack schema from 8.1.6 to 9.0

If you are running 8.1.6 Statspack and wish to upgrade to 9.0 Statspack, you 
must follow the upgrade steps - in the following order:
  - 10.2.4. Upgrading the Statspack schema from 8.1.6 to 8.1.7
  - 10.2.3. Upgrading the Statspack schema from 8.1.7 to 9.0


10.2.10. Upgrading the Statspack schema from 8.1.7 to 9.2

If you are running 8.1.7 Statspack and wish to upgrade to 9.2 Statspack, you 
must follow the upgrade steps - in the following order:
  - 10.2.2. Upgrading the Statspack schema from 8.1.7 to 9.0
  - 10.2.1. Upgrading the Statspack schema from 9.0   to 9.2



11. Oracle Real Application Clusters specific considerations
------------------------------------------------------------

11.1. Changing Instance Numbers

The unique identifier for a database instance used by Statspack is the
dbid and the instance_number.  When in a Real Application Clusters environment,
it is possible the instance_number may change between startups (either 
because the instance_number initialization parameter is set, or 
because the instances are started in a different order).

In this case, as Statspack uses the instance_number and the dbid to identify
the instance's snapshot preferences, it is important to note that this may 
inadvertently result in a different set of levels or thresholds being
used when snapshotting an instance.

There are three conditions which must be met for this to occur:
 - the instance numbers must have switched between startups
 - the DBA must have modified the default Statspack parameters used for
   at least one of the instances
 - the parameters used (e.g. thresholds and snapshot level) must not be 
   the same on all instances

Note that the only way the parameters will differ is if the parameters
have been explicitly modified by the DBA after installation, either by
saving the specified values or by using the modify_statspack_parameter 
procedure.

It is easy to check whether any of the Statspack snapshot parameters are 
different for the instances by querying the STATS$STATSPACK_PARAMETER table.

  NOTE:
  If you have changed the default Statspack parameters you may
  wish to avoid encountering this problem by hard-coding the instance_number
  initialization parameter for each of the instances of a Clustered
  database - this will avoid encountering this problem.
  For recommendations and issues with setting the instance_number 
  initialization parameter, please see the Real Application Clusters 
  documentation.


11.2. Real Application Clusters Specific Reports

sprepins.sql
  sprepins.sql can be run to query performance data for any instance which the 
  PERFSTAT schema contains.  The report will prompt for a dbid,
  instance_number and begin and end snap id's.

  This report can be used when importing data from another instance, or in a 
  Real Application Clusters environment to report on an instance which you are 
  not connected to.

  For more information on sprepins.sql, see the 'Running the instance report 
  when there are multiple instances' section of this document.

sprsqins.sql
    sprsqins.sql can be run to query SQL performance data for any instance 
    which the  PERFSTAT schema contains.  The report will prompt for a dbid,
    instance_number, begin and end snap id's, and hash value.

    This report can be used when importing data from another instance, or in a 
    Real Application Clusters environment to report on an instance which you 
    are not connected to.

    For more information on sprsqins.sql, see the 'Running the SQL report 
    when there are multiple instances' section of this document.


11.3 Real Application Clusters Specific Data

New Real Application Clusters specific data displayed in Statspack instance 
report:

- Page 2 of the Statspack report for a RAC instance displays RAC specific 
  derived statistics.
- RAC segment statistics 
- RAC-specific data for Library Cache and Dictionary Cache
- Global Enqueue Statistics from v$ges_statistics
- Global CR Served Statistics
- Global CURRENT Served Statistics
- Global Cache Transfer Statistics 


12.  Conflicts and differences compared to UTLBSTAT/UTLESTAT
------------------------------------------------------------

12.1. Running BSTAT/ESTAT in conjunction to Statspack

If you choose to run BSTAT/ESTAT in conjunction to Statspack, do not do 
run both as the same user, as there is a table name conflict - this table 
is stats$waitstat.


12.2. Differences between Statspack and BSTAT/ESTAT

Statspack considers a transaction to either finish with a commit or a
rollback, and so calculates the number of transactions thus:
  'user commits' + 'user rollbacks'

BSTAT/ESTAT considers a transaction to complete with a commit only, and
so assumes that transactions = 'user commits'

For this reason, comparing per transaction statistics between Statspack and
BSTAT/ESTAT may result in significantly different per transaction ratios.



13.  Removing the package
-------------------------

To deinstall the package, connect as a user with SYSDBA privilege and run 
the following script from SQL*Plus:  spdrop
  e.g.
      SQL>  connect / as sysdba
      SQL>  @spdrop

This script actually calls 2 other scripts:
      1.  spdtab  ->  Drops tables and public synonyms
      2.  spdusr  ->  Drops the user

Check each of the two output files produced (spdtab.lis, spdusr.lis) 
to ensure the package was completely deinstalled.



14.  Supplied Scripts Overview
------------------------------

Installation

  Must be run as a user with SYSDBA privilege
	spcreate.sql	->  Creates entire Statspack environment (calls 
   			    spcusr.sql, spctab.sql, spcpkg.sql)
  	spdrop.sql	->  Drops entire Statspack environment (calls 
			    spdtab.sql, spdusr.sql)

  Are run as a user with SYSDBA priv by the calling scripts (above)
	spdtab.sql	->  Drops Statspack tables
  	spdusr.sql	->  Drops the Statspack user (PERFSTAT)

  Are run as PERFSTAT by the calling scripts (above)
  	spcusr.sql	->  Creates the Statspack user (PERFSTAT)
  	spctab.sql	->  Creates Statspack tables
	spcpkg.sql	->  Creates the Statspack package


Reporting and Automation

  Must be run as PERFSTAT
	spreport.sql	->  Generates a Statspack Instance report
        sprepins.sql    ->  Generates a Statspack Instance report for the 
                            database and instance specified
        sprepsql.sql    ->  Generates a Statspack SQL report for the 
                            SQL Hash Value specified
        sprsqins.sql    ->  Generates a Statspack SQL report for the 
                            SQL Hash Value specified, for the database and
                            instance specified
	spauto.sql	->  Automates Statspack statistics collection
			    (using dbms_job)
        sprepcon.sql    ->  Script which configures SQL*Plus variables which
                            affect certain aspects of the Statspack instance
                            report spreport.sql  This script is automatically
                            called as a part of the Statspack instance
                            report.

Upgrading

  Must be run as SYSDBA
       spup92.sql       ->  Converts data from the 9.2 schema to the
                            newer 10.1 schema.  Backup the existing schema
                            before running the upgrade.  If upgrading from
                            Statspack 8.1.6, spup816.sql must be run, then
                            spup817.sql, then spup90.sql, then spup92.sql
       spup90.sql       ->  Converts data from the 9.0 schema to the
                            newer 9.2 schema.  Backup the existing schema
                            before running the upgrade.  If upgrading from
                            Statspack 8.1.6, spup816.sql must be run, then
                            spup817.sql, then spup90.sql
       spup817.sql      ->  Converts data from the 8.1.7 schema to the
                            newer 9.0 schema.  Backup the existing schema
                            before running the upgrade.   If upgrading from
                            Statspack 8.1.6, spup816.sql must be run, then
                            spup817.sql
       spup816.sql      ->  Converts data from the 8.1.6 schema to the
                            8.1.7 schema.  Backup the existing schema
                            before running the upgrade


Performance Data Maintenance

  Must be run as PERFSTAT
        sppurge.sql     ->  Purges a limited range of Snapshot Id's for 
                            a given database instance
        sptrunc.sql     ->  Truncates all Performance data in Statspack tables
                            WARNING - Do not use unless you wish to remove
                                      all data in the schema you are using.
                                      You may choose to export the data
                                      as a backup before using this script
        spuexp.par	->  An export parameter file supplied for exporting
			    the whole PERFSTAT user using Original Export.


Documentation

  Should be read by the DBA running the scripts
	spdoc.txt	->  This file contains instructions and
			    documentation on the STATSPACK package



15.  Limitations and Modifications
----------------------------------

15.1.  Limitations

  As the Statspack schema is updated to reflect the features in the
  latest Oracle releases, the schema may change; backward compatibility 
  is not guaranteed.


15.2.  Modifications

  All Statspack code is Oracle proprietary and must not be modified.  Any 
  modifications made to Statspack software will render the code and
  data captured thereafter unsupported; unsupported changes may result in 
  errors in data capture or reporting.  Instead, please request enhancements.


-------------------------------------------------------------------------
Categories: DBA Blogs

Installing Oracle Instant Client 18c RPM on Red Hat Linux 7.6 from Oracle public yum repository

Mon, 2018-12-31 11:15

In October 2018 Oracle Corp. has made available RPM to install Oracle Instant Client 18c on Linux: actually it has already been possible to install Oracle Instant CLient RPM that you could download from OTN (for example Oracle Instant Client 12.2.0.1 RPM for Linux). But you had to:

  • connect to OTN with your Oracle account
  • accept OTN License Agreement.
  • What is new with Oracle Instant Client 18c is that now you can install this RPM directly from Oracle public yum repositories without connecting to OTN with your Oracle account and without accepting the OTN License Agreement as detailed in Sergio Leunissen blog post.

    In this blog post I will document the steps I have run on Red Hat Linux 7.6 to install these RPMs.

    As usual I have run my tests on a minimal Red Hat Linux 7.6 virtual machine that has 4 GB of RAM (and 4GB of swap), one 40 GB disk and internet connection. This machine is registered in Red Hat Developer network:

    # subscription-manager list
    +-------------------------------------------+
        Installed Product Status
    +-------------------------------------------+
    Product Name:   Red Hat Enterprise Linux Server
    Product ID:     69
    Version:        7.6
    Arch:           x86_64
    Status:         Subscribed
    Status Details: 
    Starts:         08/14/2018
    Ends:           08/15/2019
    
    # yum repolist
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    repo id                                                                        repo name                                                                              status
    rhel-7-server-rpms/7Server/x86_64                                              Red Hat Enterprise Linux 7 Server (RPMs)                                               23 346
    repolist: 23 346
    

    I have first installed wget:

    # yum -y install wget
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    Resolving Dependencies
    --> Running transaction check
    ---> Package wget.x86_64 0:1.14-18.el7 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =====================================================================================================================================================
     Package                      Arch                           Version                                Repository                                  Size
    =====================================================================================================================================================
    Installing:
     wget                         x86_64                         1.14-18.el7                            rhel-7-server-rpms                         547 k
    
    Transaction Summary
    =====================================================================================================================================================
    Install  1 Package
    
    Total download size: 547 k
    Installed size: 2.0 M
    Downloading packages:
    wget-1.14-18.el7.x86_64.rpm                                                                                                   | 547 kB  00:00:01     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : wget-1.14-18.el7.x86_64                                                                                                           1/1 
      Verifying  : wget-1.14-18.el7.x86_64                                                                                                           1/1 
    
    Installed:
      wget.x86_64 0:1.14-18.el7                                                                                                                          
    
    Complete!
    

    I have installed yum-utils:

    # yum install -y yum-utils
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    Resolving Dependencies
    --> Running transaction check
    ---> Package yum-utils.noarch 0:1.1.31-50.el7 will be installed
    --> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-50.el7.noarch
    --> Running transaction check
    ---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
    --> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
    --> Running transaction check
    ---> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =====================================================================================================================================================
     Package                             Arch                        Version                               Repository                               Size
    =====================================================================================================================================================
    Installing:
     yum-utils                           noarch                      1.1.31-50.el7                         rhel-7-server-rpms                      121 k
    Installing for dependencies:
     python-chardet                      noarch                      2.2.1-1.el7_1                         rhel-7-server-rpms                      227 k
     python-kitchen                      noarch                      1.1.1-5.el7                           rhel-7-server-rpms                      266 k
    
    Transaction Summary
    =====================================================================================================================================================
    Install  1 Package (+2 Dependent packages)
    
    Total download size: 614 k
    Installed size: 2.8 M
    Downloading packages:
    (1/3): python-kitchen-1.1.1-5.el7.noarch.rpm                                                                                  | 266 kB  00:00:00     
    (2/3): python-chardet-2.2.1-1.el7_1.noarch.rpm                                                                                | 227 kB  00:00:01     
    (3/3): yum-utils-1.1.31-50.el7.noarch.rpm                                                                                     | 121 kB  00:00:00     
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                                388 kB/s | 614 kB  00:00:01     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : python-chardet-2.2.1-1.el7_1.noarch                                                                                               1/3 
      Installing : python-kitchen-1.1.1-5.el7.noarch                                                                                                 2/3 
      Installing : yum-utils-1.1.31-50.el7.noarch                                                                                                    3/3 
      Verifying  : python-chardet-2.2.1-1.el7_1.noarch                                                                                               1/3 
      Verifying  : python-kitchen-1.1.1-5.el7.noarch                                                                                                 2/3 
      Verifying  : yum-utils-1.1.31-50.el7.noarch                                                                                                    3/3 
    
    Installed:
      yum-utils.noarch 0:1.1.31-50.el7                                                                                                                   
    
    Dependency Installed:
      python-chardet.noarch 0:2.2.1-1.el7_1                                      python-kitchen.noarch 0:1.1.1-5.el7                                     
    
    Complete!
    

    I have downloaded Oracle Linux public yum repo file:

    # cd /etc/yum.repos.d/
    # wget http://yum.oracle.com/public-yum-ol7.repo
    --2018-12-24 17:08:21--  http://yum.oracle.com/public-yum-ol7.repo
    Resolving yum.oracle.com (yum.oracle.com)... 23.205.82.159
    Connecting to yum.oracle.com (yum.oracle.com)|23.205.82.159|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 15423 (15K) [text/plain]
    Saving to: ‘public-yum-ol7.repo’
    
    100%[===========================================================================================================>] 15,423      --.-K/s   in 0.01s   
    
    2018-12-24 17:08:22 (1.17 MB/s) - ‘public-yum-ol7.repo’ saved [15423/15423]
    

    I have enabled the Oracle Instant Client yum repository:

    # yum-config-manager --enable ol7_oracle_instantclient
    Loaded plugins: product-id, subscription-manager
    ========================================================== repo: ol7_oracle_instantclient ===========================================================
    [ol7_oracle_instantclient]
    async = True
    bandwidth = 0
    base_persistdir = /var/lib/yum/repos/x86_64/7Server
    baseurl = https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/
    cache = 0
    cachedir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient
    check_config_file_age = True
    compare_providers_priority = 80
    cost = 1000
    deltarpm_metadata_percentage = 100
    deltarpm_percentage = 
    enabled = 1
    enablegroups = True
    exclude = 
    failovermethod = priority
    ftp_disable_epsv = False
    gpgcadir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient/gpgcadir
    gpgcakey = 
    gpgcheck = True
    gpgdir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient/gpgdir
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    hdrdir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/headers
    http_caching = all
    includepkgs = 
    ip_resolve = 
    keepalive = True
    keepcache = False
    mddownloadpolicy = sqlite
    mdpolicy = group:small
    mediaid = 
    metadata_expire = 21600
    metadata_expire_filter = read-only:present
    metalink = 
    minrate = 0
    mirrorlist = 
    mirrorlist_expire = 86400
    name = Oracle Instant Client for Oracle Linux 7Server (x86_64)
    old_base_cache_dir = 
    password = 
    persistdir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient
    pkgdir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/packages
    proxy = False
    proxy_dict = 
    proxy_password = 
    proxy_username = 
    repo_gpgcheck = False
    retries = 10
    skip_if_unavailable = False
    ssl_check_cert_permissions = True
    sslcacert = 
    sslclientcert = 
    sslclientkey = 
    sslverify = True
    throttle = 0
    timeout = 30.0
    ui_id = ol7_oracle_instantclient/x86_64
    ui_repoid_vars = releasever,
       basearch
    username = 
    
    

    I have downloaded the required PGP key from Oracle yum repositories to avoid: GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle" :

    # wget http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    --2018-12-24 17:14:00--  http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7
    Resolving public-yum.oracle.com (public-yum.oracle.com)... 23.201.154.122
    Connecting to public-yum.oracle.com (public-yum.oracle.com)|23.201.154.122|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1011 [text/plain]
    Saving to: ‘/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle’
    
    100%[===========================================================================================================>] 1,011       --.-K/s   in 0s      
    
    2018-12-24 17:14:02 (80.2 MB/s) - ‘/etc/pki/rpm-gpg/RPM-GPG-KEY-oracle’ saved [1011/1011]
    

    I have installed 3 Oracle Instant Client RPM in order to be able to use SQL*Plus and SQL*Loader:

    # yum -y install oracle-instantclient18.3-basic.x86_64 oracle-instantclient18.3-sqlplus.x86_64 oracle-instantclient18.3-tools.x86_64
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    Resolving Dependencies
    --> Running transaction check
    ---> Package oracle-instantclient18.3-basic.x86_64 0:18.3.0.0.0-2 will be installed
    ---> Package oracle-instantclient18.3-sqlplus.x86_64 0:18.3.0.0.0-2 will be installed
    ---> Package oracle-instantclient18.3-tools.x86_64 0:18.3.0.0.0-2 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =====================================================================================================================================================
     Package                                          Arch                   Version                      Repository                                Size
    =====================================================================================================================================================
    Installing:
     oracle-instantclient18.3-basic                   x86_64                 18.3.0.0.0-2                 ol7_oracle_instantclient                  52 M
     oracle-instantclient18.3-sqlplus                 x86_64                 18.3.0.0.0-2                 ol7_oracle_instantclient                 703 k
     oracle-instantclient18.3-tools                   x86_64                 18.3.0.0.0-2                 ol7_oracle_instantclient                 936 k
    
    Transaction Summary
    =====================================================================================================================================================
    Install  3 Packages
    
    Total size: 54 M
    Installed size: 228 M
    Downloading packages:
    warning: /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/packages/oracle-instantclient18.3-sqlplus-18.3.0.0.0-2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    Importing GPG key 0xEC551F03:
     Userid     : "Oracle OSS group (Open Source Software group) "
     Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : oracle-instantclient18.3-basic-18.3.0.0.0-2.x86_64                                                                                1/3 
      Installing : oracle-instantclient18.3-sqlplus-18.3.0.0.0-2.x86_64                                                                              2/3 
      Installing : oracle-instantclient18.3-tools-18.3.0.0.0-2.x86_64                                                                                3/3 
      Verifying  : oracle-instantclient18.3-sqlplus-18.3.0.0.0-2.x86_64                                                                              1/3 
      Verifying  : oracle-instantclient18.3-basic-18.3.0.0.0-2.x86_64                                                                                2/3 
      Verifying  : oracle-instantclient18.3-tools-18.3.0.0.0-2.x86_64                                                                                3/3 
    
    Installed:
      oracle-instantclient18.3-basic.x86_64 0:18.3.0.0.0-2                     oracle-instantclient18.3-sqlplus.x86_64 0:18.3.0.0.0-2                    
      oracle-instantclient18.3-tools.x86_64 0:18.3.0.0.0-2                    
    
    Complete!
    

    I have checked Oracle Client target directories:

    # ls -al /usr/lib/oracle/18.3/client64/lib
    total 228772
    drwxr-xr-x. 3 root root      4096 Dec 31 17:10 .
    drwxr-xr-x. 4 root root        28 Dec 31 17:10 ..
    -rwxr-xr-x. 1 root root       342 Oct 20 02:39 glogin.sql
    -rwxr-xr-x. 1 root root   8348633 Oct 20 02:39 libclntshcore.so.18.1
    -rwxr-xr-x. 1 root root  77879027 Oct 20 02:39 libclntsh.so.18.1
    -rwxr-xr-x. 1 root root   3537979 Oct 20 02:39 libipc1.so
    -rwxr-xr-x. 1 root root    467468 Oct 20 02:39 libmql1.so
    -rwxr-xr-x. 1 root root     77405 Oct 20 02:39 libnfsodm18.so
    -rwxr-xr-x. 1 root root   6636088 Oct 20 02:39 libnnz18.so
    -rwxr-xr-x. 1 root root   2229347 Oct 20 02:39 libocci.so.18.1
    -rwxr-xr-x. 1 root root 126949719 Oct 20 02:39 libociei.so
    -rwxr-xr-x. 1 root root    160875 Oct 20 02:39 libocijdbc18.so
    -rwxr-xr-x. 1 root root    394835 Oct 20 02:39 libons.so
    -rwxr-xr-x. 1 root root    118171 Oct 20 02:39 liboramysql18.so
    -rwxr-xr-x. 1 root root   1655813 Oct 20 02:39 libsqlplusic.so
    -rwxr-xr-x. 1 root root   1616347 Oct 20 02:39 libsqlplus.so
    drwxr-xr-x. 3 root root        19 Dec 31 17:10 network
    -rw-r--r--. 1 root root   4109057 Oct 20 02:41 ojdbc8.jar
    -rw-r--r--. 1 root root     37519 Oct 20 02:41 xstreams.jar
    # ls -rtl /usr/lib/oracle/18.3/client64/bin
    # ls -al /usr/lib/oracle/18.3/client64/bin
    total 4548
    drwxr-xr-x. 2 root root     121 Dec 31 17:10 .
    drwxr-xr-x. 4 root root      28 Dec 31 17:10 ..
    -rwxr-xr-x. 1 root root   40227 Oct 20 02:40 adrci
    -rwxr-xr-x. 1 root root 1062611 Oct 20 02:43 exp
    -rwxr-xr-x. 1 root root  228252 Oct 20 02:43 expdp
    -rwxr-xr-x. 1 root root   57268 Oct 20 02:40 genezi
    -rwxr-xr-x. 1 root root  530557 Oct 20 02:43 imp
    -rwxr-xr-x. 1 root root  240274 Oct 20 02:43 impdp
    -rwxr-xr-x. 1 root root 1679005 Oct 20 02:43 sqlldr
    -rwxr-xr-x. 1 root root   22569 Oct 20 02:43 sqlplus
    -rwxr-xr-x. 1 root root  786154 Oct 20 02:43 wrc
    

    I have created a specific Linux account:

    # groupadd apps
    # useradd -g apps app
    

    I have added following remote host name in /etc/hosts:

    192.168.56.26	ol7defs1 ol7defs1.localdomain
    

    On ol7defs1, I have stopped firewall service:

    # systemctl stop firewalld
    

    On local host I have switched to “app” account to test SQL*Plus on a remote database instance:

    # su - app
    Last login: Mon Dec 24 17:04:45 CET 2018 on pts/0
    $ PATH=/usr/lib/oracle/18.3/client64/bin/:$PATH
    $ export LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client64/lib:$LD_LIBRARY_PATH
    $ sqlplus -v
    
    SQL*Plus: Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    
    $ sqlplus system/oracle@ol7defs1:1521/cdb
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Mon Dec 24 17:09:08 2018
    Version 18.3.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    Last Successful login time: Mon Dec 24 2018 16:08:26 +01:00
    
    Connected to:
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    
    SQL> column name format a10
    SQL> select name, con_id from v$containers;
    
    NAME	       CON_ID
    ---------- ----------
    CDB$ROOT	    1
    PDB$SEED	    2
    PDB		    3
    
    SQL> Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    $ 
    

    It is also possible to use tnsnames.ora aliases in connect strings with TNS_ADMIN environment variable.

    I have also disabled Oracle Linux 7 repositories in order to keep only the Red Hat one to avoid mixing Oracle Linux and Red Hat Linux packages:

    # yum repolist
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    repo id                                                    repo name                                                                                                  status
    ol7_UEKR5/x86_64                                           Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64)                              134
    ol7_latest/x86_64                                          Oracle Linux 7Server Latest (x86_64)                                                                       11 718
    ol7_oracle_instantclient/x86_64                            Oracle Instant Client for Oracle Linux 7Server (x86_64)                                                         7
    rhel-7-server-rpms/7Server/x86_64                          Red Hat Enterprise Linux 7 Server (RPMs)                                                                   23 346
    repolist: 35 205
    # yum-config-manager --disable ol7_oracle_instantclient
    Loaded plugins: product-id, subscription-manager
    ====================================================================== repo: ol7_oracle_instantclient ======================================================================
    [ol7_oracle_instantclient]
    async = True
    bandwidth = 0
    base_persistdir = /var/lib/yum/repos/x86_64/7Server
    baseurl = https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/
    cache = 0
    cachedir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient
    check_config_file_age = True
    compare_providers_priority = 80
    cost = 1000
    deltarpm_metadata_percentage = 100
    deltarpm_percentage = 
    enabled = 0
    enablegroups = True
    exclude = 
    failovermethod = priority
    ftp_disable_epsv = False
    gpgcadir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient/gpgcadir
    gpgcakey = 
    gpgcheck = True
    gpgdir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient/gpgdir
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    hdrdir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/headers
    http_caching = all
    includepkgs = 
    ip_resolve = 
    keepalive = True
    keepcache = False
    mddownloadpolicy = sqlite
    mdpolicy = group:small
    mediaid = 
    metadata_expire = 21600
    metadata_expire_filter = read-only:present
    metalink = 
    minrate = 0
    mirrorlist = 
    mirrorlist_expire = 86400
    name = Oracle Instant Client for Oracle Linux 7Server (x86_64)
    old_base_cache_dir = 
    password = 
    persistdir = /var/lib/yum/repos/x86_64/7Server/ol7_oracle_instantclient
    pkgdir = /var/cache/yum/x86_64/7Server/ol7_oracle_instantclient/packages
    proxy = False
    proxy_dict = 
    proxy_password = 
    proxy_username = 
    repo_gpgcheck = False
    retries = 10
    skip_if_unavailable = False
    ssl_check_cert_permissions = True
    sslcacert = 
    sslclientcert = 
    sslclientkey = 
    sslverify = True
    throttle = 0
    timeout = 30.0
    ui_id = ol7_oracle_instantclient/x86_64
    ui_repoid_vars = releasever,
       basearch
    username = 
    # yum-config-manager --disable ol7_latest       
    Loaded plugins: product-id, subscription-manager
    ============================================================================= repo: ol7_latest =============================================================================
    [ol7_latest]
    async = True
    bandwidth = 0
    base_persistdir = /var/lib/yum/repos/x86_64/7Server
    baseurl = https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/
    cache = 0
    cachedir = /var/cache/yum/x86_64/7Server/ol7_latest
    check_config_file_age = True
    compare_providers_priority = 80
    cost = 1000
    deltarpm_metadata_percentage = 100
    deltarpm_percentage = 
    enabled = 0
    enablegroups = True
    exclude = 
    failovermethod = priority
    ftp_disable_epsv = False
    gpgcadir = /var/lib/yum/repos/x86_64/7Server/ol7_latest/gpgcadir
    gpgcakey = 
    gpgcheck = True
    gpgdir = /var/lib/yum/repos/x86_64/7Server/ol7_latest/gpgdir
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    hdrdir = /var/cache/yum/x86_64/7Server/ol7_latest/headers
    http_caching = all
    includepkgs = 
    ip_resolve = 
    keepalive = True
    keepcache = False
    mddownloadpolicy = sqlite
    mdpolicy = group:small
    mediaid = 
    metadata_expire = 21600
    metadata_expire_filter = read-only:present
    metalink = 
    minrate = 0
    mirrorlist = 
    mirrorlist_expire = 86400
    name = Oracle Linux 7Server Latest (x86_64)
    old_base_cache_dir = 
    password = 
    persistdir = /var/lib/yum/repos/x86_64/7Server/ol7_latest
    pkgdir = /var/cache/yum/x86_64/7Server/ol7_latest/packages
    proxy = False
    proxy_dict = 
    proxy_password = 
    proxy_username = 
    repo_gpgcheck = False
    retries = 10
    skip_if_unavailable = False
    ssl_check_cert_permissions = True
    sslcacert = 
    sslclientcert = 
    sslclientkey = 
    sslverify = True
    throttle = 0
    timeout = 30.0
    ui_id = ol7_latest/x86_64
    ui_repoid_vars = releasever,
       basearch
    username = 
    
    # yum-config-manager --disable ol7_UEKR5       
    Loaded plugins: product-id, subscription-manager
    ============================================================================= repo: ol7_UEKR5 ==============================================================================
    [ol7_UEKR5]
    async = True
    bandwidth = 0
    base_persistdir = /var/lib/yum/repos/x86_64/7Server
    baseurl = https://yum.oracle.com/repo/OracleLinux/OL7/UEKR5/x86_64/
    cache = 0
    cachedir = /var/cache/yum/x86_64/7Server/ol7_UEKR5
    check_config_file_age = True
    compare_providers_priority = 80
    cost = 1000
    deltarpm_metadata_percentage = 100
    deltarpm_percentage = 
    enabled = 0
    enablegroups = True
    exclude = 
    failovermethod = priority
    ftp_disable_epsv = False
    gpgcadir = /var/lib/yum/repos/x86_64/7Server/ol7_UEKR5/gpgcadir
    gpgcakey = 
    gpgcheck = True
    gpgdir = /var/lib/yum/repos/x86_64/7Server/ol7_UEKR5/gpgdir
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    hdrdir = /var/cache/yum/x86_64/7Server/ol7_UEKR5/headers
    http_caching = all
    includepkgs = 
    ip_resolve = 
    keepalive = True
    keepcache = False
    mddownloadpolicy = sqlite
    mdpolicy = group:small
    mediaid = 
    metadata_expire = 21600
    metadata_expire_filter = read-only:present
    metalink = 
    minrate = 0
    mirrorlist = 
    mirrorlist_expire = 86400
    name = Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64)
    old_base_cache_dir = 
    password = 
    persistdir = /var/lib/yum/repos/x86_64/7Server/ol7_UEKR5
    pkgdir = /var/cache/yum/x86_64/7Server/ol7_UEKR5/packages
    proxy = False
    proxy_dict = 
    proxy_password = 
    proxy_username = 
    repo_gpgcheck = False
    retries = 10
    skip_if_unavailable = False
    ssl_check_cert_permissions = True
    sslcacert = 
    sslclientcert = 
    sslclientkey = 
    sslverify = True
    throttle = 0
    timeout = 30.0
    ui_id = ol7_UEKR5/x86_64
    ui_repoid_vars = releasever,
       basearch
    username = 
    
    # yum repolist
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    repo id                                                                        repo name                                                                              status
    rhel-7-server-rpms/7Server/x86_64                                              Red Hat Enterprise Linux 7 Server (RPMs)                                               23 346
    repolist: 23 346
    
    Categories: DBA Blogs

    Oracle database 18c installation with RPM on Oracle Linux

    Mon, 2018-12-24 07:30

    In October 2018 Oracle Corp. has released a RPM to install Oracle Database on Linux.

    In this article I am going to detail how I have installed this RPM and checked this RPM-based installation.

    As usual I have used a minimal Oracle Linux 7.6 virtual machine that has 4 GB of RAM (and 4 GB of swap space) with one single 40 GB disk.
    This machine is connected to internet to be able to access Oracle Linux public yum repository configured in /etc/yum.repos.d/public-yum-ol7.repo where only the 2 following repositories have flag enabled set to 1:

    [ol7_latest]
    name=Oracle Linux $releasever Latest ($basearch)
    baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpgcheck=1
    enabled=1
    
    [ol7_UEKR5]
    name=Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux $releasever ($basearch)
    baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/UEKR5/$basearch/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpgcheck=1
    enabled=1
    

    The detailed Oracle Linux is the following:

    $ cat /etc/os-release
    NAME="Oracle Linux Server"
    VERSION="7.6"
    ID="ol"
    VARIANT="Server"
    VARIANT_ID="server"
    VERSION_ID="7.6"
    PRETTY_NAME="Oracle Linux Server 7.6"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:oracle:linux:7:6:server"
    HOME_URL="https://linux.oracle.com/"
    BUG_REPORT_URL="https://bugzilla.oracle.com/"
    
    ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
    ORACLE_BUGZILLA_PRODUCT_VERSION=7.6
    ORACLE_SUPPORT_PRODUCT="Oracle Linux"
    ORACLE_SUPPORT_PRODUCT_VERSION=7.6
    

    Neither Oracle Database nor MySQL is installed:

    # id oracle
    id: oracle: no such user
    # id mysql
    id: mysql: no such user
    # 
    

    I have used Database Installation Guide for Linux for this blog post. I have downloaded RPM from OTN. Note that you cannot download this RPM from the Oracle public yum repositories unless you have a Unbreakable Linux Network (ULN) contract.

    RPM installation

    To install this RPM I have just run as root:

    # yum -y localinstall oracle-database-ee-18c-1.0-1.x86_64.rpm
    

    The generated output is here.

    Note that the preinstall RPM has been installed automatically thanks to following RPM dependency and default YUM configuration using Oracle public yum repositories:

    Processing Dependency: oracle-database-preinstall-18c for package: oracle-database-ee-18c-1.0-1.x86_64
    

    I have checked this Oracle database software installation with:

    # cat /etc/oraInst.loc 
    inventory_loc=/opt/oracle/oraInventory
    inst_group=oinstall
    # su - oracle
    Last login: mer. déc. 12 20:38:33 CET 2018
    su: warning: cannot change directory to /home/oracle: No such file or directory
    $ grep "HOME NAME" /opt/oracle/oraInventory/ContentsXML/inventory.xml 
    &ltHOME NAME="OraHome1" LOC="/opt/oracle/product/18c/dbhome_1" TYPE="O" IDX="1"/&gt
    $ export ORACLE_HOME=/opt/oracle/product/18c/dbhome_1
    $ $ORACLE_HOME/OPatch/opatch lsinv    
    Oracle Interim Patch Installer version 12.2.0.1.14
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /opt/oracle/product/18c/dbhome_1
    Central Inventory : /opt/oracle/oraInventory
       from           : /opt/oracle/product/18c/dbhome_1/oraInst.loc
    OPatch version    : 12.2.0.1.14
    OUI version       : 12.2.0.4.0
    Log file location : /opt/oracle/product/18c/dbhome_1/cfgtoollogs/opatch/opatch2018-12-12_20-45-51PM_1.log
    
    Lsinventory Output file location : /opt/oracle/product/18c/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-12-12_20-45-51PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: localhost
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Database 18c                                                  18.0.0.0.0
    There are 1 products installed in this Oracle Home.
    
    
    Interim patches (4) :
    
    Patch  27908644     : applied on Mon Oct 08 01:21:47 CEST 2018
    Unique Patch ID:  22153180
    Patch description:  "UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171"
       Created on 4 May 2018, 01:21:02 hrs PST8PDT
       Bugs fixed:
         27908644
    
    Patch  27923415     : applied on Mon Oct 08 01:19:18 CEST 2018
    Unique Patch ID:  22239273
    Patch description:  "OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)"
       Created on 15 Jul 2018, 10:33:22 hrs PST8PDT
       Bugs fixed:
         27304131, 27539876, 27952586, 27642235, 27636900, 27461740
    
    Patch  28090553     : applied on Mon Oct 08 01:17:51 CEST 2018
    Unique Patch ID:  22256940
    Patch description:  "OCW RELEASE UPDATE 18.3.0.0.0 (28090553)"
       Created on 12 Aug 2018, 23:01:26 hrs PST8PDT
       Bugs fixed:
         12816839, 18701017, 22734786, 23698980, 23840305, 25709124, 25724089
         26299684, 26313403, 26433972, 26527054, 26586174, 26587652, 26647619
         26827699, 26860285, 26882126, 26882316, 26943660, 26996813, 27012915
         27018734, 27032726, 27034318, 27040560, 27080748, 27086406, 27092991
         27098733, 27106915, 27114112, 27121566, 27133637, 27144533, 27153755
         27166715, 27174938, 27174948, 27177551, 27177852, 27182006, 27182064
         27184253, 27204476, 27212837, 27213140, 27220610, 27222423, 27222938
         27238077, 27238258, 27249544, 27252023, 27257509, 27263677, 27265816
         27267992, 27271876, 27274143, 27285557, 27299455, 27300007, 27302415
         27309182, 27314512, 27315159, 27320985, 27334353, 27338838, 27346984
         27358232, 27362190, 27370933, 27377219, 27378959, 27379846, 27379956
         27393421, 27398223, 27399499, 27399762, 27399985, 27401618, 27403244
         27404599, 27426277, 27428790, 27430219, 27430254, 27433163, 27452897
         27458829, 27465480, 27475272, 27481406, 27481765, 27492916, 27496806
         27503318, 27503413, 27508936, 27508984, 27513114, 27519708, 27526362
         27528204, 27532009, 27534289, 27560562, 27560735, 27573154, 27573408
         27574335, 27577122, 27579969, 27581484, 27593587, 27595801, 27600706
         27609819, 27625010, 27625050, 27627992, 27654039, 27657467, 27657920
         27668379, 27682288, 27691717, 27702244, 27703242, 27708711, 27714373
         27725967, 27731346, 27734470, 27735534, 27739957, 27740854, 27747407
         27748321, 27757979, 27766679, 27768034, 27778433, 27782464, 27783059
         27786669, 27786699, 27801774, 27811439, 27839732, 27850736, 27862636
         27864737, 27865439, 27889841, 27896388, 27897639, 27906509, 27931506
         27935826, 27941514, 27957892, 27978668, 27984314, 27993298, 28023410
         28025398, 28032758, 28039471, 28039953, 28045209, 28099592, 28109698
         28174926, 28182503, 28204423, 28240153
    
    Patch  28090523     : applied on Mon Oct 08 01:17:15 CEST 2018
    Unique Patch ID:  22329768
    Patch description:  "Database Release Update : 18.3.0.0.180717 (28090523)"
       Created on 14 Jul 2018, 00:03:50 hrs PST8PDT
       Bugs fixed:
         9062315, 13554903, 21547051, 21766220, 21806121, 23003564, 23310101
         24489904, 24689376, 24737581, 24925863, 25035594, 25035599, 25287072
         25348956, 25634405, 25726981, 25743479, 25824236, 25943740, 26226953
         26336101, 26423085, 26427905, 26450454, 26476244, 26598422, 26615291
         26646549, 26654411, 26731697, 26785169, 26792891, 26818960, 26822620
         26843558, 26843664, 26846077, 26894737, 26898279, 26928317, 26933599
         26956033, 26961415, 26966120, 26986173, 26992964, 27005278, 27026401
         27028251, 27030974, 27036408, 27038986, 27041253, 27044575, 27047831
         27053044, 27058530, 27060167, 27060859, 27061736, 27066451, 27066519
         27073066, 27086821, 27090765, 27101527, 27101652, 27110878, 27112686
         27119621, 27126666, 27128580, 27135647, 27143756, 27143882, 27147979
         27153641, 27155549, 27156355, 27163928, 27169796, 27181521, 27181537
         27189611, 27190851, 27193810, 27199245, 27208953, 27210038, 27210872
         27214085, 27215007, 27216224, 27221900, 27222121, 27222626, 27224987
         27226913, 27232983, 27233563, 27236052, 27236110, 27240246, 27240570
         27241221, 27241247, 27244337, 27244785, 27249215, 27250547, 27254851
         27258578, 27259386, 27259983, 27262650, 27262945, 27263276, 27263996
         27270197, 27274456, 27274536, 27275136, 27275776, 27282707, 27283029
         27283960, 27284499, 27285244, 27288230, 27292213, 27294480, 27301308
         27301568, 27302594, 27302681, 27302695, 27302711, 27302730, 27302777
         27302800, 27302960, 27304410, 27304936, 27305318, 27307868, 27310092
         27313687, 27314206, 27314390, 27318869, 27321179, 27321834, 27326204
         27329812, 27330158, 27330161, 27333658, 27333664, 27333693, 27334316
         27334648, 27335682, 27338912, 27338946, 27339115, 27339396, 27339483
         27339495, 27341036, 27345190, 27345231, 27345450, 27345498, 27346329
         27346644, 27346709, 27346949, 27347126, 27348081, 27348707, 27349393
         27352600, 27354783, 27356373, 27357773, 27358241, 27359178, 27359368
         27360126, 27364891, 27364916, 27364947, 27365139, 27365702, 27365993
         27367194, 27368850, 27372756, 27375260, 27375542, 27376871, 27378103
         27379233, 27381383, 27381656, 27384222, 27389352, 27392187, 27395404
         27395416, 27395794, 27396357, 27396365, 27396377, 27396624, 27396666
         27396672, 27396813, 27398080, 27398660, 27401637, 27405242, 27405696
         27410300, 27410595, 27412805, 27417186, 27420715, 27421101, 27422874
         27423251, 27425507, 27425622, 27426363, 27427805, 27430802, 27432338
         27432355, 27433870, 27434050, 27434193, 27434486, 27434974, 27435537
         27439835, 27441326, 27442041, 27444727, 27445330, 27445462, 27447452
         27447687, 27448162, 27450355, 27450400, 27450783, 27451049, 27451182
         27451187, 27451531, 27452760, 27453225, 27457666, 27457891, 27458164
         27459909, 27460675, 27467543, 27469329, 27471876, 27472969, 27473800
         27479358, 27483974, 27484556, 27486253, 27487795, 27489719, 27496224
         27496308, 27497950, 27498477, 27501327, 27501413, 27501465, 27502420
         27504190, 27505603, 27506774, 27508985, 27511196, 27512439, 27517818
         27518227, 27518310, 27520070, 27520900, 27522245, 27523368, 27523800
         27525909, 27532375, 27533819, 27534509, 27537472, 27544030, 27545630
         27547732, 27550341, 27551855, 27558557, 27558559, 27558861, 27560702
         27563629, 27563767, 27570318, 27577758, 27579353, 27580996, 27585755
         27585800, 27586810, 27586895, 27587672, 27591842, 27592466, 27593389
         27595973, 27599689, 27602091, 27602488, 27603841, 27604293, 27607805
         27608669, 27610269, 27613080, 27613247, 27615608, 27616657, 27617522
         27625274, 27625620, 27631506, 27634676, 27635508, 27644757, 27649707
         27652302, 27663370, 27664702, 27679488, 27679664, 27679806, 27679961
         27680162, 27680509, 27682151, 27688099, 27688692, 27690578, 27691809
         27692215, 27693713, 27697092, 27701795, 27705761, 27707544, 27709046
         27718914, 27719187, 27723002, 27726269, 27726780, 27732323, 27739006
         27740844, 27744211, 27745220, 27747869, 27748954, 27751006, 27753336
         27757567, 27772815, 27773602, 27774320, 27774539, 27779886, 27780562
         27782339, 27783289, 27786772, 27791223, 27797290, 27803665, 27807441
         27812560, 27812593, 27813267, 27815347, 27818871, 27832643, 27833369
         27834984, 27840386, 27847259, 27851757, 27861909, 27869339, 27873643
         27882176, 27892488, 27924147, 27926113, 27930478, 27934468, 27941896
         27945870, 27950708, 27952762, 27961746, 27964051, 27970265, 27971575
         27984028, 27989849, 27993289, 27994333, 27997875, 27999597, 28021205
         28022847, 28033429, 28057267, 28059199, 28072130, 28098865, 28106402
         28132287, 28169711, 28174827, 28184554, 28188330, 25929650, 28264172
    
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    $ $ORACLE_HOME/OPatch/opatch lspatches 
    27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
    27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
    28090553;OCW RELEASE UPDATE 18.3.0.0.0 (28090553)
    28090523;Database Release Update : 18.3.0.0.180717 (28090523)
    
    OPatch succeeded.
    
    Database creation

    I have also checked that I can create a database in silent mode with DBCA.

    I have created database directories for DB_CREATE_FILE_DEST and DB_RECOVERY_FILE_DEST initialization parameters with root account:

    # mkdir -p /u01/oradata
    # chown oracle:dba /u01/oradata
    # mkdir /u01/fra
    # chown oracle:dba /u01/fra    
    

    I have added host name in /etc/hosts:

    # tail -n 1 /etc/hosts
    192.168.56.26 ol7defs1 ol7defs1.localdomain
    

    I have also created missing home directory for Linux oracle user account:

    # mkdir /home/oracle
    # chown oracle:dba /home/oracle
    

    I have switched to oracle account to create a container database with following script:

    $ export ORACLE_HOME=/opt/oracle/product/18c/dbhome_1
    $ PATH=$ORACLE_HOME/bin:$PATH
    $ cat crdb.sh
    dbca -silent \
    -createDatabase \
    -templateName General_Purpose.dbc \
    -gdbName CDB \
    -sid CDB \
    -createAsContainerDatabase true \
    -numberOfPdbs 1 \
    -pdbName pdb \
    -pdbadminUsername pdba \
    -pdbadminPassword oracle \
    -SysPassword oracle \
    -SystemPassword oracle \
    -emConfiguration NONE \
    -storageType FS \
    -datafileDestination /u01/oradata \
    -recoveryAreaDestination /u01/fra \
    -recoveryAreaSize 3200  \
    -characterSet AL32UTF8 \
    -memoryPercentage 40 \
    -enableArchive true \
    -redoLogFileSize 100
    

    Running this script has generated following output:

    [WARNING] [DBT-06801] Specified Fast Recovery Area size (3,200 MB) is less than the recommended value.
       CAUSE: Fast Recovery Area size should at least be three times the database size (2,446 MB).
       ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
    [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06801] Specified Fast Recovery Area size (3,200 MB) is less than the recommended value.
       CAUSE: Fast Recovery Area size should at least be three times the database size (3,309 MB).
       ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
    Prepare for db operation
    8% complete
    Copying database files
    31% complete
    Creating and starting Oracle instance
    32% complete
    36% complete
    40% complete
    43% complete
    46% complete
    Completing Database Creation
    51% complete
    53% complete
    54% complete
    Creating Pluggable Databases
    58% complete
    77% complete
    Executing Post Configuration Actions
    100% complete
    Database creation complete. For details check the logfiles at:
     /opt/oracle/cfgtoollogs/dbca/CDB.
    Database Information:
    Global Database Name:CDB
    System Identifier(SID):CDB
    Look at the log file "/opt/oracle/cfgtoollogs/dbca/CDB/CDB.log" for further details.
    

    The detailed DBCA log file does not contain any error:

    [ 2018-12-12 20:57:39.703 CET ] [WARNING] [DBT-06801] Specified Fast Recovery Area size (3,200 MB) is less than the recommended value.
    [ 2018-12-12 20:57:43.184 CET ] [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
    [ 2018-12-12 20:57:43.184 CET ] [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
    [ 2018-12-12 20:57:43.185 CET ] [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
    [ 2018-12-12 20:57:43.390 CET ] [WARNING] [DBT-06801] Specified Fast Recovery Area size (3,200 MB) is less than the recommended value.
    [ 2018-12-12 20:57:43.987 CET ] Prepare for db operation
    DBCA_PROGRESS : 8%
    [ 2018-12-12 20:57:44.437 CET ] Copying database files
    DBCA_PROGRESS : 31%
    [ 2018-12-12 20:59:24.288 CET ] Creating and starting Oracle instance
    DBCA_PROGRESS : 32%
    DBCA_PROGRESS : 36%
    DBCA_PROGRESS : 40%
    DBCA_PROGRESS : 43%
    DBCA_PROGRESS : 46%
    [ 2018-12-12 21:08:31.968 CET ] Completing Database Creation
    DBCA_PROGRESS : 51%
    DBCA_PROGRESS : 53%
    DBCA_PROGRESS : 54%
    [ 2018-12-12 21:15:15.224 CET ] Creating Pluggable Databases
    DBCA_PROGRESS : 58%
    DBCA_PROGRESS : 77%
    [ 2018-12-12 21:16:04.273 CET ] Executing Post Configuration Actions
    DBCA_PROGRESS : 100%
    [ 2018-12-12 21:16:04.289 CET ] Database creation complete. For details check the logfiles at:
     /opt/oracle/cfgtoollogs/dbca/CDB.
    Database Information:
    Global Database Name:CDB
    System Identifier(SID):CDB
    
    Database and Oracle Net checks

    I have checked created database with:

    $ . oraenv
    ORACLE_SID = [oracle] ? CDB
    The Oracle base has been set to /opt/oracle
    $ sqlplus / as sysdba @chk.sql
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Wed Dec 12 21:21:43 2018
    Version 18.3.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    
    SQL> set linesize 140
    SQL> column status format a20
    SQL> column description format a60
    SQL> column action_time format a30
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    BANNER_FULL
    --------------------------------------------------------------------------------------------------------------------------------------------
    BANNER_LEGACY									     CON_ID
    -------------------------------------------------------------------------------- ----------
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production			  0
    
    
    SQL> select patch_id, status, description, action_time from dba_registry_sqlpatch;
    
      PATCH_ID STATUS		DESCRIPTION						     ACTION_TIME
    ---------- -------------------- ------------------------------------------------------------ ------------------------------
      28090523 SUCCESS		Database Release Update : 18.3.0.0.180717 (28090523)	     12-DEC-18 09.03.45.593024 PM
      27923415 SUCCESS		OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415) 	     12-DEC-18 09.03.45.629667 PM
    
    SQL> select name, cdb, log_mode from v$database;
    
    NAME	  CDB LOG_MODE
    --------- --- ------------
    CDB	  YES ARCHIVELOG
    
    SQL> show pdbs
    
        CON_ID CON_NAME			  OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
    	 2 PDB$SEED			  READ ONLY  NO
    	 3 PDB				  READ WRITE NO
    SQL> 
    

    I have started Oracle Net listener with:

    $ lsnrctl start
    
    LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 12-DEC-2018 21:49:43
    
    Copyright (c) 1991, 2018, Oracle.  All rights reserved.
    
    Starting /opt/oracle/product/18c/dbhome_1/bin/tnslsnr: please wait...
    
    TNSLSNR for Linux: Version 18.0.0.0.0 - Production
    Log messages written to /opt/oracle/diag/tnslsnr/ol7defs1/listener/alert/log.xml
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol7defs1)(PORT=1521)))
    
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production
    Start Date                12-DEC-2018 21:49:44
    Uptime                    0 days 0 hr. 0 min. 0 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Log File         /opt/oracle/diag/tnslsnr/ol7defs1/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol7defs1)(PORT=1521)))
    The listener supports no services
    The command completed successfully
    

    I have waited about 1 minute for automatic services registration and checked:

    $ lsnrctl status
    
    LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 12-DEC-2018 21:50:22
    
    Copyright (c) 1991, 2018, Oracle.  All rights reserved.
    
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production
    Start Date                12-DEC-2018 21:49:44
    Uptime                    0 days 0 hr. 0 min. 38 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Log File         /opt/oracle/diag/tnslsnr/ol7defs1/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ol7defs1)(PORT=1521)))
    Services Summary...
    Service "7cd9db2df86753a7e0531a38a8c0afb6" has 1 instance(s).
      Instance "CDB", status READY, has 1 handler(s) for this service...
    Service "CDB" has 1 instance(s).
      Instance "CDB", status READY, has 1 handler(s) for this service...
    Service "CDBXDB" has 1 instance(s).
      Instance "CDB", status READY, has 1 handler(s) for this service...
    Service "pdb" has 1 instance(s).
      Instance "CDB", status READY, has 1 handler(s) for this service...
    The command completed successfully
    

    I have checked Oracle Net connection with:

    $ sqlplus system/oracle@ol7defs1:1521/pdb
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Wed Dec 12 21:55:08 2018
    Version 18.3.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    Last Successful login time: Wed Dec 12 2018 21:52:30 +01:00
    
    Connected to:
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    
    SQL> SELECT SYS_CONTEXT ('USERENV', 'CON_NAME') FROM DUAL;
    
    SYS_CONTEXT('USERENV','CON_NAME')
    --------------------------------------------------------------------------------
    PDB
    
    SQL> 
    
    Summary

    According to Oracle documentation this is what the RPM-based installation performs:

  • preinstallation checks
  • database software extraction
  • ownership reassignement of the extracted software to the preconfigured user and groups
  • Oracle inventory maintenance
  • execution of all root operations required to configure the Oracle Database software for a single-instance Oracle Database creation and configuration.
  • Oracle documentation also states current limitations:

  • Patching Oracle Database software using RPMs is not supported. Please use the OPatch utility and follow the regular patching process to apply Oracle Database patches
  • An RPM-based Oracle Database installation is not available for Standard Edition 2. Standard Edition 2 support is planned for 19c
  • RPM-based database upgrades using rpm -Uvh is not supported. For Oracle Database upgrades, follow the regular upgrade process.
  • Categories: DBA Blogs

    How I Simplified Oracle Database 18c (Standard Edition 2) Installation on Red Hat Linux Entreprise 7.5 with Oracle Preinstallation RPM

    Wed, 2018-08-29 12:43

    Up to Oracle 12.2.0.1 it was not possible to use directly Oracle Database preinstallation RPM on Red Hat Linux Enterprise LInux (RHEL) because this RPM was replacing the Red Hat Linux kernel by the Unbreakable Entreprise Kernel(UEK): not sure this was intented if you decided to use RHEL instead of Oracle Linux.

    It was still possible to modify this RPM to remove the dependency on UEK and to install it as described in this blog post .

    Things have changed with Oracle 18c: it is now possible to use directlty Oracle Preinstallation on RHEL as documented in Oracle Database Installation Guide 18c for Linux.

    In this blog post I detail how I have installed Oracle 18c on RHEL 7.5 using the official Redhat distribution that I am again able to download from Red Hat using Red Hat Developer free license valid for one year.

    Operating system installation

    For this blog post I have created a VirtualBox virtual machine (VM) named rh7defs0 that has:

  • 4 GB of RAM
  • one 40 GB hard disk attached to SATA controller
  • 2 network interfaces (the first one attached to NAT and the second one attached to Host-Only Adapter).
  • When installing Red Hat 7 I have chosen in following order:

    1. English as installation process language

    2. Paris, France as time zone

    3. French as keyboard layout

    4. default disk partitioning with 4GB of swap

    5. rh7defs0.localdomain as hostname

    I have not modified software selection set to “minimal install” and I have also set root password.

    In this post # prompt means root account session and $ prompt means oracle account session.

    After the minimal operating system installation and machine reboot I have used system console to configure public network interface with:

    # nmcli connection add type ethernet con-name enp0s8 ifname enp0s8 ip4 192.168.56.14/24.
    

    At this step I have connected with ssh to configure the NAT network interface with:

    # nmcli connection add type ethernet con-name enp0s3 ifname enp0s3 ip4 10.0.2.15/8 gw4 10.0.2.2
    Warning: There is another connection with the name 'enp0s3'. Reference the connection by its uuid 'f43b8229-4939-4952-b794-da103e5168be'
    # ip addr
    1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:06:20:85 brd ff:ff:ff:ff:ff:ff
        inet 10.0.2.15/8 brd 10.255.255.255 scope global noprefixroute enp0s3
           valid_lft forever preferred_lft forever
        inet6 fe80::5b8e:9d1e:7d2e:5a42/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    3: enp0s8:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:00:04:75 brd ff:ff:ff:ff:ff:ff
        inet 192.168.56.14/24 brd 192.168.56.255 scope global noprefixroute enp0s8
           valid_lft forever preferred_lft forever
        inet6 fe80::7075:e445:f59f:87ad/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    

    I have also added my Internet Box IP address to /etc/resolv.conf and checked DNS:

    # cat /etc/resolv.conf
    search localdomain
    nameserver 192.168.1.254
    
    # ping www.redhat.com
    PING e3396.dscx.akamaiedge.net (104.124.219.53) 56(84) bytes of data.
    64 bytes from a104-124-219-53.deploy.static.akamaitechnologies.com (104.124.219.53): icmp_seq=1 ttl=63 time=39.2 ms
    64 bytes from a104-124-219-53.deploy.static.akamaitechnologies.com (104.124.219.53): icmp_seq=2 ttl=63 time=37.7 ms
    64 bytes from a104-124-219-53.deploy.static.akamaitechnologies.com (104.124.219.53): icmp_seq=3 ttl=63 time=38.6 ms
    64 bytes from a104-124-219-53.deploy.static.akamaitechnologies.com (104.124.219.53): icmp_seq=4 ttl=63 time=37.1 ms
    64 bytes from a104-124-219-53.deploy.static.akamaitechnologies.com (104.124.219.53): icmp_seq=5 ttl=63 time=36.4 ms
    ^C
    --- e3396.dscx.akamaiedge.net ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4009ms
    rtt min/avg/max/mdev = 36.438/37.852/39.266/1.042 ms
    

    I have run following steps to connect this VM to public Red Hat Satellite:

    # subscription-manager register
    # subscription-manager attach --auto
    

    I have checked that the VM has the right subscription status:

    # cat /etc/redhat-release 
    Red Hat Enterprise Linux Server release 7.5 (Maipo)
    # subscription-manager status       
    +-------------------------------------------+
       System Status Details
    +-------------------------------------------+
    Overall Status: Current
    
    # yum repolist
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    rhel-7-server-rpms                                       | 3.5 kB     00:00     
    (1/3): rhel-7-server-rpms/7Server/x86_64/group             | 855 kB   00:02     
    (2/3): rhel-7-server-rpms/7Server/x86_64/updateinfo        | 2.9 MB   00:05     
    (3/3): rhel-7-server-rpms/7Server/x86_64/primary_db        |  55 MB   00:42     
    repo id                           repo name                               status
    rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs 20 908
    repolist: 20 908
    
    Oracle Preinstallation RPM installation

    I have downloaded this RPM with:

    # yum -y install wget
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    Resolving Dependencies
    --> Running transaction check
    ---> Package wget.x86_64 0:1.14-15.el7_4.1 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ===========================================================================================================================
     Package               Arch                    Version                           Repository                           Size
    ===========================================================================================================================
    Installing:
     wget                  x86_64                  1.14-15.el7_4.1                   rhel-7-server-rpms                  547 k
    
    Transaction Summary
    ===========================================================================================================================
    Install  1 Package
    
    Total download size: 547 k
    Installed size: 2.0 M
    Downloading packages:
    warning: /var/cache/yum/x86_64/7Server/rhel-7-server-rpms/packages/wget-1.14-15.el7_4.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
    Public key for wget-1.14-15.el7_4.1.x86_64.rpm is not installed
    wget-1.14-15.el7_4.1.x86_64.rpm                                                                     | 547 kB  00:00:01     
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    Importing GPG key 0xFD431D51:
     Userid     : "Red Hat, Inc. (release key 2) "
     Fingerprint: 567e 347a d004 4ade 55ba 8a5f 199e 2f91 fd43 1d51
     Package    : redhat-release-server-7.5-8.el7.x86_64 (@anaconda/7.5)
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    Importing GPG key 0x2FA658E0:
     Userid     : "Red Hat, Inc. (auxiliary key) "
     Fingerprint: 43a6 e49c 4a38 f4be 9abf 2a53 4568 9c88 2fa6 58e0
     Package    : redhat-release-server-7.5-8.el7.x86_64 (@anaconda/7.5)
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : wget-1.14-15.el7_4.1.x86_64                                                                             1/1 
    rhel-7-server-rpms/7Server/x86_64/productid                                                         | 2.1 kB  00:00:00     
      Verifying  : wget-1.14-15.el7_4.1.x86_64                                                                             1/1 
    
    Installed:
      wget.x86_64 0:1.14-15.el7_4.1                                                                                            
    
    Complete!
    # wget http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
    --2018-08-24 19:45:18--  http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
    Resolving public-yum.oracle.com (public-yum.oracle.com)... 23.205.82.159
    Connecting to public-yum.oracle.com (public-yum.oracle.com)|23.205.82.159|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 18244 (18K) [application/x-rpm]
    Saving to: 'oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm'
    
    100%[=================================================================================>] 18 244      --.-K/s   in 0,02s   
    
    2018-08-24 19:45:21 (1,04 MB/s) - 'oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm' saved [18244/18244]
    

    To avoid following error when trying to install this RPM:

    Error: Package: oracle-database-preinstall-18c-1.0-1.el7.x86_64 (/oracle-database-preinstall-18c-1.0-1.el7.x86_64)
               Requires: compat-libstdc++-33
    **********************************************************************
    yum can be configured to try to resolve such errors by temporarily enabling
    disabled repos and searching for missing dependencies.
    To enable this functionality please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf
    **********************************************************************
    
    Error: Package: oracle-database-preinstall-18c-1.0-1.el7.x86_64 (/oracle-database-preinstall-18c-1.0-1.el7.x86_64)
               Requires: compat-libstdc++-33
     You could try using --skip-broken to work around the problem
     You could try running: rpm -Va --nofiles --nodigest
    

    I have modified /etc/yum/pluginconf.d/search-disabled-repos.conf as recommended by yum:

    # grep notify_only /etc/yum/pluginconf.d/search-disabled-repos.conf
    # With notify_only=1 this plugin does not modify yum's behaviour.
    # Setting notify_only to 0 will enable yum to try to automatically resolve
    notify_only=0
    

    I have restarted RPM installation with:

    # yum -y install oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm 
    

    This has taken several minutes because YUM was searching for compat-libstdc++-33 in a lot of YUM repositories:

    Error: Package: oracle-database-preinstall-18c-1.0-1.el7.x86_64 (/oracle-database-preinstall-18c-1.0-1.el7.x86_64)
               Requires: compat-libstdc++-33
    **********************************************************************
    Dependency resolving failed due to missing dependencies.
    Some repositories on your system are disabled, but yum can enable them
    and search for missing dependencies. This will require downloading
    metadata for disabled repositories and may take some time and traffic.
    **********************************************************************
    

    Eventually YUM has found it and managed to install it. You can find yum install log here.

    Oracle 18c Standard Edition 2 silent installation

    I have run following steps to install Oracle Database 18c Standard Edition 2 in silent mode:

    # mkdir -p /u01/db18c
    # mkdir -p /u01/base 
    # mkdir /u01/orainv
    # mkdir /stage
    # chown oracle:dba -R /u01
    # chown oracle:dba -R /stage
    

    I have switched to oracle account:

    $ cd /u01/db18c
    $ unzip /stage/LINUX.X64_180000_db_home.zip 
    ./runInstaller \
    -silent \
    -responseFile /u01/db18c/install/response/db_install.rsp \
       oracle.install.option=INSTALL_DB_SWONLY             \
       UNIX_GROUP_NAME=oinstall                            \
       INVENTORY_LOCATION=/u01/orainv                      \
       SELECTED_LANGUAGES=en                               \
       ORACLE_HOME=/u01/db18c                              \
       ORACLE_BASE=/u01/base                               \
       oracle.install.db.InstallEdition=SE2                \
       oracle.install.db.isCustomInstall=false             \
       oracle.install.db.OSDBA_GROUP=dba                   \
       oracle.install.db.OSBACKUPDBA_GROUP=dba             \
       oracle.install.db.OSDGDBA_GROUP=dba                 \
       oracle.install.db.OSKMDBA_GROUP=dba                 \
       oracle.install.db.OSRACDBA_GROUP=dba                \
       SECURITY_UPDATES_VIA_MYORACLESUPPORT=false          \
       DECLINE_SECURITY_UPDATES=true
    

    This has generated following output:

    Launching Oracle Database Setup Wizard...
    
    [WARNING] [INS-13014] Target environment does not meet some optional requirements.
       CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2018-08-24_08-14-14PM.log
       ACTION: Identify the list of failed prerequisite checks from the log: installActions2018-08-24_08-14-14PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
    The response file for this session can be found at:
     /u01/db18c/install/response/db_2018-08-24_08-14-14PM.rsp
    
    You can find the log of this install session at:
     /tmp/InstallActions2018-08-24_08-14-14PM/installActions2018-08-24_08-14-14PM.log
    
    As a root user, execute the following script(s):
    	1. /u01/orainv/orainstRoot.sh
    	2. /u01/db18c/root.sh
    
    Execute /u01/orainv/orainstRoot.sh on the following nodes: 
    [rh7defs0]
    Execute /u01/db18c/root.sh on the following nodes: 
    [rh7defs0]
    
    
    Successfully Setup Software with warning(s).
    Moved the install session logs to:
     /u01/orainv/logs/InstallActions2018-08-24_08-14-14PM
    

    I have ignored following failed prerequisites:

    INFO:  [Aug 24, 2018 8:14:43 PM] ------------------List of failed Tasks------------------
    INFO:  [Aug 24, 2018 8:14:43 PM] *********************************************
    INFO:  [Aug 24, 2018 8:14:43 PM] Physical Memory: This is a prerequisite condition to test whether the system has at least 8GB (8388608.0KB) of total physical memory.
    INFO:  [Aug 24, 2018 8:14:43 PM] Severity:IGNORABLE
    INFO:  [Aug 24, 2018 8:14:43 PM] OverallStatus:VERIFICATION_FAILED
    INFO:  [Aug 24, 2018 8:14:43 PM] *********************************************
    INFO:  [Aug 24, 2018 8:14:43 PM] Package: gcc-c++-4.8.2: This is a prerequisite condition to test whether the package "gcc-c++-4.8.2" is available on the system.
    INFO:  [Aug 24, 2018 8:14:43 PM] Severity:IGNORABLE
    INFO:  [Aug 24, 2018 8:14:43 PM] OverallStatus:VERIFICATION_FAILED
    INFO:  [Aug 24, 2018 8:14:43 PM] -----------------End of failed Tasks List----------------
    

    I have run as root:

    # /u01/orainv/orainstRoot.sh
    Changing permissions of /u01/orainv.
    Adding read,write permissions for group.
    Removing read,write,execute permissions for world.
    
    Changing groupname of /u01/orainv to oinstall.
    The execution of the script is complete.
    # /u01/db18c/root.sh
    # cat /u01/db18c/install/root_rh7defs0.localdomain_2018-08-24_20-17-18-230575231.log
    Performing root user operation.
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/db18c
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    
    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    Oracle Trace File Analyzer (TFA) is available at : /u01/db18c/suptools/tfa/release/tfa_home/bin/tfactl
    

    I have checked Oracle inventory with:

    $ export ORACLE_HOME=/u01/db18c
    $ PATH=$ORACLE_HOME/bin:$PATH
    $ $ORACLE_HOME/OPatch/opatch lsinv
    Oracle Interim Patch Installer version 12.2.0.1.14
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u01/db18c
    Central Inventory : /u01/orainv
       from           : /u01/db18c/oraInst.loc
    OPatch version    : 12.2.0.1.14
    OUI version       : 12.2.0.4.0
    Log file location : /u01/db18c/cfgtoollogs/opatch/opatch2018-08-24_20-20-09PM_1.log
    
    Lsinventory Output file location : /u01/db18c/cfgtoollogs/opatch/lsinv/lsinventory2018-08-24_20-20-09PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: localhost
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Database 18c                                                  18.0.0.0.0
    There are 1 products installed in this Oracle Home.
    
    
    Interim patches (4) :
    
    Patch  27908644     : applied on Wed Jul 18 19:44:11 CEST 2018
    Unique Patch ID:  22153180
    Patch description:  "UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171"
       Created on 4 May 2018, 01:21:02 hrs PST8PDT
       Bugs fixed:
         27908644
    
    Patch  27923415     : applied on Wed Jul 18 19:41:38 CEST 2018
    Unique Patch ID:  22239273
    Patch description:  "OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)"
       Created on 15 Jul 2018, 10:33:22 hrs PST8PDT
       Bugs fixed:
         27304131, 27539876, 27952586, 27642235, 27636900, 27461740
    
    Patch  28090553     : applied on Wed Jul 18 19:40:01 CEST 2018
    Unique Patch ID:  22256940
    Patch description:  "OCW RELEASE UPDATE 18.3.0.0.0 (28090553)"
       Created on 11 Jul 2018, 19:20:31 hrs PST8PDT
       Bugs fixed:
         12816839, 18701017, 22734786, 23698980, 23840305, 25709124, 25724089
         26299684, 26313403, 26433972, 26527054, 26586174, 26587652, 26647619
         26827699, 26860285, 26882126, 26882316, 26943660, 26996813, 27012915
         27018734, 27032726, 27034318, 27040560, 27080748, 27086406, 27092991
         27098733, 27106915, 27114112, 27121566, 27133637, 27144533, 27153755
         27166715, 27174938, 27174948, 27177551, 27177852, 27182006, 27182064
         27184253, 27204476, 27212837, 27213140, 27220610, 27222423, 27222938
         27238077, 27238258, 27249544, 27252023, 27257509, 27263677, 27265816
         27267992, 27271876, 27274143, 27285557, 27299455, 27300007, 27302415
         27309182, 27314512, 27315159, 27320985, 27334353, 27338838, 27346984
         27358232, 27362190, 27370933, 27377219, 27378959, 27379846, 27379956
         27393421, 27398223, 27399499, 27399762, 27399985, 27401618, 27403244
         27404599, 27426277, 27428790, 27430219, 27430254, 27433163, 27452897
         27458829, 27465480, 27475272, 27481406, 27481765, 27492916, 27496806
         27503318, 27503413, 27508936, 27508984, 27513114, 27519708, 27526362
         27528204, 27532009, 27534289, 27560562, 27560735, 27573154, 27573408
         27574335, 27577122, 27579969, 27581484, 27593587, 27595801, 27600706
         27609819, 27625010, 27625050, 27627992, 27654039, 27657467, 27657920
         27668379, 27682288, 27691717, 27702244, 27703242, 27708711, 27714373
         27725967, 27731346, 27734470, 27735534, 27739957, 27740854, 27747407
         27748321, 27757979, 27766679, 27768034, 27778433, 27782464, 27783059
         27786669, 27786699, 27801774, 27811439, 27839732, 27850736, 27862636
         27864737, 27865439, 27889841, 27896388, 27897639, 27906509, 27931506
         27935826, 27941514, 27957892, 27978668, 27984314, 27993298, 28023410
         28025398, 28032758, 28039471, 28039953, 28045209, 28099592, 28109698
         28174926, 28182503, 28204423, 28240153
    
    Patch  28090523     : applied on Wed Jul 18 19:39:24 CEST 2018
    Unique Patch ID:  22329768
    Patch description:  "Database Release Update : 18.3.0.0.180717 (28090523)"
       Created on 14 Jul 2018, 00:03:50 hrs PST8PDT
       Bugs fixed:
         9062315, 13554903, 21547051, 21766220, 21806121, 23003564, 23310101
         24489904, 24689376, 24737581, 24925863, 25035594, 25035599, 25287072
         25348956, 25634405, 25726981, 25743479, 25824236, 25943740, 26226953
         26336101, 26423085, 26427905, 26450454, 26476244, 26598422, 26615291
         26646549, 26654411, 26731697, 26785169, 26792891, 26818960, 26822620
         26843558, 26843664, 26846077, 26894737, 26898279, 26928317, 26933599
         26956033, 26961415, 26966120, 26986173, 26992964, 27005278, 27026401
         27028251, 27030974, 27036408, 27038986, 27041253, 27044575, 27047831
         27053044, 27058530, 27060167, 27060859, 27061736, 27066451, 27066519
         27073066, 27086821, 27090765, 27101527, 27101652, 27110878, 27112686
         27119621, 27126666, 27128580, 27135647, 27143756, 27143882, 27147979
         27153641, 27155549, 27156355, 27163928, 27169796, 27181521, 27181537
         27189611, 27190851, 27193810, 27199245, 27208953, 27210038, 27210872
         27214085, 27215007, 27216224, 27221900, 27222121, 27222626, 27224987
         27226913, 27232983, 27233563, 27236052, 27236110, 27240246, 27240570
         27241221, 27241247, 27244337, 27244785, 27249215, 27250547, 27254851
         27258578, 27259386, 27259983, 27262650, 27262945, 27263276, 27263996
         27270197, 27274456, 27274536, 27275136, 27275776, 27282707, 27283029
         27283960, 27284499, 27285244, 27288230, 27292213, 27294480, 27301308
         27301568, 27302594, 27302681, 27302695, 27302711, 27302730, 27302777
         27302800, 27302960, 27304410, 27304936, 27305318, 27307868, 27310092
         27313687, 27314206, 27314390, 27318869, 27321179, 27321834, 27326204
         27329812, 27330158, 27330161, 27333658, 27333664, 27333693, 27334316
         27334648, 27335682, 27338912, 27338946, 27339115, 27339396, 27339483
         27339495, 27341036, 27345190, 27345231, 27345450, 27345498, 27346329
         27346644, 27346709, 27346949, 27347126, 27348081, 27348707, 27349393
         27352600, 27354783, 27356373, 27357773, 27358241, 27359178, 27359368
         27360126, 27364891, 27364916, 27364947, 27365139, 27365702, 27365993
         27367194, 27368850, 27372756, 27375260, 27375542, 27376871, 27378103
         27379233, 27381383, 27381656, 27384222, 27389352, 27392187, 27395404
         27395416, 27395794, 27396357, 27396365, 27396377, 27396624, 27396666
         27396672, 27396813, 27398080, 27398660, 27401637, 27405242, 27405696
         27410300, 27410595, 27412805, 27417186, 27420715, 27421101, 27422874
         27423251, 27425507, 27425622, 27426363, 27427805, 27430802, 27432338
         27432355, 27433870, 27434050, 27434193, 27434486, 27434974, 27435537
         27439835, 27441326, 27442041, 27444727, 27445330, 27445462, 27447452
         27447687, 27448162, 27450355, 27450400, 27450783, 27451049, 27451182
         27451187, 27451531, 27452760, 27453225, 27457666, 27457891, 27458164
         27459909, 27460675, 27467543, 27469329, 27471876, 27472969, 27473800
         27479358, 27483974, 27484556, 27486253, 27487795, 27489719, 27496224
         27496308, 27497950, 27498477, 27501327, 27501413, 27501465, 27502420
         27504190, 27505603, 27506774, 27508985, 27511196, 27512439, 27517818
         27518227, 27518310, 27520070, 27520900, 27522245, 27523368, 27523800
         27525909, 27532375, 27533819, 27534509, 27537472, 27544030, 27545630
         27547732, 27550341, 27551855, 27558557, 27558559, 27558861, 27560702
         27563629, 27563767, 27570318, 27577758, 27579353, 27580996, 27585755
         27585800, 27586810, 27586895, 27587672, 27591842, 27592466, 27593389
         27595973, 27599689, 27602091, 27602488, 27603841, 27604293, 27607805
         27608669, 27610269, 27613080, 27613247, 27615608, 27616657, 27617522
         27625274, 27625620, 27631506, 27634676, 27635508, 27644757, 27649707
         27652302, 27663370, 27664702, 27679488, 27679664, 27679806, 27679961
         27680162, 27680509, 27682151, 27688099, 27688692, 27690578, 27691809
         27692215, 27693713, 27697092, 27701795, 27705761, 27707544, 27709046
         27718914, 27719187, 27723002, 27726269, 27726780, 27732323, 27739006
         27740844, 27744211, 27745220, 27747869, 27748954, 27751006, 27753336
         27757567, 27772815, 27773602, 27774320, 27774539, 27779886, 27780562
         27782339, 27783289, 27786772, 27791223, 27797290, 27803665, 27807441
         27812560, 27812593, 27813267, 27815347, 27818871, 27832643, 27833369
         27834984, 27840386, 27847259, 27851757, 27861909, 27869339, 27873643
         27882176, 27892488, 27924147, 27926113, 27930478, 27934468, 27941896
         27945870, 27950708, 27952762, 27961746, 27964051, 27970265, 27971575
         27984028, 27989849, 27993289, 27994333, 27997875, 27999597, 28021205
         28022847, 28033429, 28057267, 28059199, 28072130, 28098865, 28106402
         28132287, 28169711, 28174827, 28184554, 28188330, 25929650, 28264172
    
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    $ $ORACLE_HOME/OPatch/opatch lspatches
    27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
    27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
    28090553;OCW RELEASE UPDATE 18.3.0.0.0 (28090553)
    28090523;Database Release Update : 18.3.0.0.180717 (28090523)
    
    

    I have created a database with following steps:

    # mkdir /u01/oradata
    # chown oracle:dba /u01/oradata
    # mkdir /u01/fra
    # chown oracle:dba /u01/fra
    

    and:

    $ dbca -silent \
    -createDatabase \
    -templateName General_Purpose.dbc \
    -gdbName CDB \
    -sid CDB \
    -createAsContainerDatabase true \
    -numberOfPdbs 1 \
    -pdbName pdb \
    -pdbadminUsername pdba \
    -pdbadminPassword oracle \
    -SysPassword oracle \
    -SystemPassword oracle \
    -emConfiguration NONE \
    -storageType FS \
    -datafileDestination /u01/oradata \
    -recoveryAreaDestination /u01/fra \
    -recoveryAreaSize 3200  \
    -characterSet AL32UTF8 \
    -memoryPercentage 40 \
    -enableArchive true \
    -redoLogFileSize 100
    [WARNING] [DBT-06801] Specified Fast Recovery Area size (3,200 MB) is less than the recommended value.
       CAUSE: Fast Recovery Area size should at least be three times the database size (2,446 MB).
       ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
    [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06801] Specified Fast Recovery Area size (3,200 MB) is less than the recommended value.
       CAUSE: Fast Recovery Area size should at least be three times the database size (3,309 MB).
       ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
    Prepare for db operation
    8% complete
    Copying database files
    31% complete
    Creating and starting Oracle instance
    32% complete
    36% complete
    40% complete
    43% complete
    46% complete
    Completing Database Creation
    51% complete
    53% complete
    54% complete
    Creating Pluggable Databases
    58% complete
    77% complete
    Executing Post Configuration Actions
    100% complete
    Database creation complete. For details check the logfiles at:
     /u01/base/cfgtoollogs/dbca/CDB.
    Database Information:
    Global Database Name:CDB
    System Identifier(SID):CDB
    Look at the log file "/u01/base/cfgtoollogs/dbca/CDB/CDB.log" for further details.
    

    I have checked created database with:

    $ . oraenv
    ORACLE_SID = [oracle] ? CDB
    The Oracle base has been set to /u01/base
    $ sqlplus / as sysdba
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Fri Aug 24 20:47:52 2018
    Version 18.3.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 18c Standard Edition 2 Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    BANNER_FULL
    --------------------------------------------------------------------------------
    BANNER_LEGACY
    --------------------------------------------------------------------------------
        CON_ID
    ----------
    Oracle Database 18c Standard Edition 2 Release 18.0.0.0.0 - Production
    Oracle Database 18c Standard Edition 2 Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    Oracle Database 18c Standard Edition 2 Release 18.0.0.0.0 - Production
    	 0
    
    BANNER
    --------------------------------------------------------------------------------
    BANNER_FULL
    --------------------------------------------------------------------------------
    BANNER_LEGACY
    --------------------------------------------------------------------------------
        CON_ID
    ----------
    
    SQL> select name, cdb, log_mode from v$database;
    
    NAME	  CDB LOG_MODE
    --------- --- ------------
    CDB	  YES ARCHIVELOG
    
    SQL> show pdbs
    
        CON_ID CON_NAME			  OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
    	 2 PDB$SEED			  READ ONLY  NO
    	 3 PDB				  READ WRITE NO
    SQL> 
    
    SQL> select comp_name, status, version from dba_registry order by 1;
    
    COMP_NAME				 STATUS     VERSION
    ---------------------------------------- ---------- ------------------------------
    JServer JAVA Virtual Machine		 VALID	    18.0.0.0.0
    OLAP Analytic Workspace 		 OPTION OFF 18.0.0.0.0
    Oracle Database Catalog Views		 VALID	    18.0.0.0.0
    Oracle Database Java Packages		 VALID	    18.0.0.0.0
    Oracle Database Packages and Types	 VALID	    18.0.0.0.0
    Oracle Database Vault			 OPTION OFF 18.0.0.0.0
    Oracle Label Security			 OPTION OFF 18.0.0.0.0
    Oracle Multimedia			 VALID	    18.0.0.0.0
    Oracle OLAP API 			 OPTION OFF 18.0.0.0.0
    Oracle Real Application Clusters	 OPTION OFF 18.0.0.0.0
    Oracle Text				 VALID	    18.0.0.0.0
    
    COMP_NAME				 STATUS     VERSION
    ---------------------------------------- ---------- ------------------------------
    Oracle Workspace Manager		 VALID	    18.0.0.0.0
    Oracle XDK				 VALID	    18.0.0.0.0
    Oracle XML Database			 VALID	    18.0.0.0.0
    Spatial 				 OPTION OFF 18.0.0.0.0
    
    15 rows selected.
    
    

    I have added host name to /etc/hosts for Oracle Net with:

    # vi /etc/hosts
    # grep rh /etc/hosts
    192.168.56.14 rh7defs0 rh7defs0.localdomain
    # 
    

    I have started Oracle Net listener and waited about 1 minute for automatic registration of database instance:

    $ . oraenv
    ORACLE_SID = [oracle] ? CDB
    The Oracle base has been set to /u01/base
    $ lsnrctl start
    
    LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 27-AUG-2018 21:22:04
    
    Copyright (c) 1991, 2018, Oracle.  All rights reserved.
    
    Starting /u01/db18c/bin/tnslsnr: please wait...
    
    TNSLSNR for Linux: Version 18.0.0.0.0 - Production
    Log messages written to /u01/base/diag/tnslsnr/rh7defs0/listener/alert/log.xml
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rh7defs0)(PORT=1521)))
    
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production
    Start Date                27-AUG-2018 21:22:04
    Uptime                    0 days 0 hr. 0 min. 0 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Log File         /u01/base/diag/tnslsnr/rh7defs0/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rh7defs0)(PORT=1521)))
    The listener supports no services
    The command completed successfully
    $ lsnrctl status
    
    LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 27-AUG-2018 21:22:50
    
    Copyright (c) 1991, 2018, Oracle.  All rights reserved.
    
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production
    Start Date                27-AUG-2018 21:22:04
    Uptime                    0 days 0 hr. 0 min. 46 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Log File         /u01/base/diag/tnslsnr/rh7defs0/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rh7defs0)(PORT=1521)))
    Services Summary...
    Service "7433c9568a2d6255e055000000000001" has 1 instance(s).
      Instance "CDB", status READY, has 1 handler(s) for this service...
    Service "CDB" has 1 instance(s).
      Instance "CDB", status READY, has 1 handler(s) for this service...
    Service "CDBXDB" has 1 instance(s).
      Instance "CDB", status READY, has 1 handler(s) for this service...
    Service "pdb" has 1 instance(s).
      Instance "CDB", status READY, has 1 handler(s) for this service...
    The command completed successfully
    

    I have checked Oracle Net connection with:

    $ sqlplus system/oracle@rh7defs0:1521/CDB 
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Mon Aug 27 21:23:31 2018
    Version 18.3.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 18c Standard Edition 2 Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    
    SYSTEM@rh7defs0:1521/CDB>select host_name, instance_name from v$instance;
    
    HOST_NAME
    ----------------------------------------------------------------
    INSTANCE_NAME
    ----------------
    rh7defs0.localdomain
    CDB
    
    
    SYSTEM@rh7defs0:1521/CDB>
    

    Everything looks OK.

    Categories: DBA Blogs

    How to install Oracle RAC 18c in silent mode on Oracle Linux 7.5 with VirtualBox – Part 2

    Tue, 2018-07-31 00:19

    Both posts document how to install a 2-node Oracle RAC cluster with Oracle 18c on Oracle Linux 7.5 (OL7) with VirtualBox (VBOX).

    Part 1 details Oracle Linux installation and configuration and part 2 details Oracle software installation (Grid Infrastructure (GI), Oracle Database) and database creation.
    In this article GIMR stands for Grid Infrastructure Management Repository.

    Disclaimer: this is only an example that can be used to setup a lab or test system: it is not designed to be used for production purpose.

    Grid Infrastructure silent installation

    I have created ORACLE_BASE and ORACLE_HOME target directories on both nodes:

    # mkdir -p /u01/base
    # chown oracle:dba /u01/base
    # mkdir /u01/gi18c
    # chown oracle:oinstall /u01/gi18c
    # chmod -R 775 /u01 
    

    I have created /etc/oraInst.loc to define Oracle Inventory location on both nodes:

    # cat /etc/oraInst.loc
    inventory_loc=/u01/orainv
    inst_group=oinstall
    # mkdir  /u01/orainv
    # chown oracle:oinstall /u01/orainv
    

    I have unzipped GI media on first cluster node:

    $ cd /u01/gi18c
    $ unzip -q /stage/LINUX.X64_180000_grid_home.zip 
    

    I have installed cvuqdisk RPM on both nodes. I have run on ol7decn1:

    # rpm -iv /u01/gi18c/cv/rpm/cvuqdisk-1.0.10-1.rpm
    Preparing packages...
    cvuqdisk-1.0.10-1.x86_64
    

    I have run on ol7decn2:

    # scp root@ol7decn1:/u01/gi18c/cv/rpm/cvuqdisk-1.0.10-1.rpm .
    The authenticity of host 'ol7decn1 (192.168.56.138)' can't be established.
    ECDSA key fingerprint is SHA256:xo4lc6xkmEsFroCbIFcGUuWa2yuF7OUzPLVedKhk5dU.
    ECDSA key fingerprint is MD5:d2:ef:bc:d9:b7:2a:e5:1f:91:e5:78:42:1b:a5:6e:3a.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'ol7decn1,192.168.56.138' (ECDSA) to the list of known hosts.
    root@ol7decn1's password: 
    cvuqdisk-1.0.10-1.rpm                                                                             100% 8860     4.5MB/s   00:00    
    # rpm -iv cvuqdisk-1.0.10-1.rpm
    Preparing packages...
    cvuqdisk-1.0.10-1.x86_64
    # 
    

    I have labeled ASM disks for ASMFD on ol7decn1:

    # export ORACLE_HOME=/u01/gi18c
    # export ORACLE_BASE=/u01/base
    # /u01/gi18c/bin/asmcmd afd_label OCRVD /dev/sdb1 --init
    # /u01/gi18c/bin/asmcmd afd_label GIMR  /dev/sdc1 --init
    # /u01/gi18c/bin/asmcmd afd_label DATA  /dev/sdd1 --init
    # /u01/gi18c/bin/asmcmd afd_label RECO  /dev/sde1 --init
    

    In order to avoid following error when installing GI … :

    [FATAL] [INS-32250] ADR setup (diagsetup) tool failed. Check the install log for more details.
    *ADDITIONAL INFORMATION:*
     - DiagSetup-00010: Diag Setup Usage error: unable to perform create directory operation
     - DiagSetup-00010: Diag Setup Usage error: unable to perform create directory operation
     - Error creating ADR directory
     - DiagSetup-00010: Diag Setup Usage error: unable to perform create directory operation
     - oracle.diagfw.adr.diagsetup.DiagSetupException: DiagSetup-00010: Diag Setup Usage error: unable to perform create directory operation
     -  at oracle.diagfw.adr.diagsetup.DiagSetup.createAdrDir(DiagSetup.java:578)
     -  at oracle.diagfw.adr.diagsetup.DiagSetup.createDirsLocal(DiagSetup.java:418)
     -  at oracle.diagfw.adr.diagsetup.DiagSetup.createDirs(DiagSetup.java:329)
     -  at oracle.diagfw.adr.diagsetup.DiagSetup.executeMain(DiagSetup.java:297)
     -  at oracle.diagfw.adr.diagsetup.DiagSetup.main(DiagSetup.java:260)
     - DiagSetup-00010: Diag Setup Usage error: unable to perform create directory operation
     - oracle.diagfw.adr.diagsetup.DiagSetupException: DiagSetup-00010: Diag Setup Usage error: unable to perform create directory operation
     -  at oracle.diagfw.adr.diagsetup.DiagSetup.createDirs(DiagSetup.java:345)
     -  at oracle.diagfw.adr.diagsetup.DiagSetup.executeMain(DiagSetup.java:297)
     -  at oracle.diagfw.adr.diagsetup.DiagSetup.main(DiagSetup.java:260)
    

    … I have removed following directory created by asmcmd afd_label instructions:

    # rm -rf /u01/base/diag
    

    I have created following silent installation script for GI:

    
    cd /u01/gi18c
    DISTRIB=$(pwd)
    /u01/gi18c/gridSetup.sh -silent                              \
           -responseFile $DISTRIB/install/response/gridsetup.rsp   \
           inventory_location=/u01/orainv                          \
           selected_languages=en                                   \
           oracle.install.option=CRS_CONFIG                        \
           oracle_base=/u01/base/                                  \
           oracle.install.asm.OSDBA=dba                            \
           oracle.install.asm.OSOPER=dba                           \
           oracle.install.asm.OSASM=dba                            \
           oracle.install.crs.config.gpnp.scanName=ol7dec-scan.localdomain \
           oracle.install.crs.config.gpnp.scanPort=1521            \
           oracle.install.crs.config.clusterName=ol7decn           \
           oracle.install.crs.config.gpnp.configureGNS=false       \
           oracle.install.crs.config.clusterNodes=ol7decn1:ol7decn1-vip:HUB,ol7decn2:ol7decn2-vip:HUB \
           oracle.install.crs.config.networkInterfaceList=enp0s8:192.168.56.0:1,enp0s9:192.168.43.0:5 \
           oracle.install.crs.config.storageOption=FLEX_ASM_STORAGE \
           oracle.install.asm.configureGIMRDataDG=true             \
           oracle.install.crs.config.useIPMI=false                 \
           oracle.install.asm.SYSASMPassword=oracle                \
           oracle.install.asm.configureAFD=true                    \
           oracle.install.asm.storageOption=ASM                    \
           oracle.install.asm.diskGroup.diskDiscoveryString=/dev/sdb1,/dev/sdc1 \
           oracle.install.asm.diskGroup.name=OCRVD                 \
           oracle.install.asm.diskGroup.disks=/dev/sdb1            \
           oracle.install.asm.diskGroup.redundancy=EXTERNAL        \
           oracle.install.asm.monitorPassword=oracle               \
           oracle.install.asm.gimrDG.name=GIMR                     \
           oracle.install.asm.gimrDG.disks=/dev/sdc1               \
           oracle.install.asm.gimrDG.redundancy=EXTERNAL           
    

    The above script is using following variables defined in ./install/response/gridsetup.rsp response file:

    parameter name description inventory_location Directory where Oracle Inventory will be stored. Must match /etc/oraInst.loc contents. oracle.install.option Must be set to CRS_CONFIG for Grid Infrastructure for cluster. oracle.install.crs.config.gpnp.scanName Must be set to DNS alias for the 3 SCAN listener adresses. oracle.install.crs.config.gpnp.scanPort Must be to set to TCP port to be used by SCAN listener. oracle.install.crs.config.clusterName No dependency for this name. oracle.install.crs.config.gpnp.configureGNS Must be set to FALSE to not use Grid Naming Service (GNS). oracle.install.crs.config.clusterNodes Must be set to public-hostname:vip-hostname:HUB comma separated host name list (for STANDALONE cluster type). oracle.install.crs.config.networkInterfaceList Must be set to network-interface:network-interface-subnet:network-interface_type comma separated strings
    where network-interface_type must be set to 1 for public interface and to 5 for private interface (interconnect). oracle.install.crs.config.storageOption Set to FLEX_ASM_STORAGE for OCR and voting disk. oracle.install.asm.configureGIMRDataDG must be set to true to use a separate disk for GIMR database oracle.install.crs.config.useIPMI Must be set to FALSE to not use Intelligent Power Management Interface. oracle.install.asm.configureAFD must be set to TRUE to use ASMFD oracle.install.asm.SYSASMPassword Must be set to SYS password for ASM instance. oracle.install.asm.diskGroup.diskDiscoveryString Used to set ASM instance ASM_DISKSTRING parameter for OCR/voting disk disk group and GIMR disk group oracle.install.asm.diskGroup.name Name of ASM disk group used for OCR and voting disk oracle.install.asm.diskGroup.disks Comma separated ASM disk names list to be used for OCR and voting disk group. oracle.install.asm.diskGroup.redundancy Disk group redundancy used by above ASM disk group. oracle.install.asm.monitorPassword Must be set to ASMSNMP password for ASM instance. oracle.install.asm.gimrDG.name Name of ASM disk group used for GIMR database. oracle.install.asm.gimrDG.diskGroup.disks Comma separated ASM disk names list to be used for GIMR disk group. oracle.install.asm.gimrDG.diskGroup.redundancy Disk group redundancy used by GIMR disk group.

    Running this script has generated following output:

    Launching Oracle Grid Infrastructure Setup Wizard...
    
    [WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards.
       CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
       ACTION: Provide a password that conforms to the Oracle recommended standards.
    [WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards.
       CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
       ACTION: Provide a password that conforms to the Oracle recommended standards.
    [WARNING] [INS-41808] Possible invalid choice for OSASM Group.
       CAUSE: The name of the group you selected for the OSASM group is commonly used to grant other system privileges (For example: asmdba, asmoper, dba, oper).
       ACTION: Oracle recommends that you designate asmadmin as the OSASM group.
    [WARNING] [INS-41809] Possible invalid choice for OSDBA Group.
       CAUSE: The group name you selected as the OSDBA for ASM group is commonly used for Oracle Database administrator privileges.
       ACTION: Oracle recommends that you designate asmdba as the OSDBA for ASM group, and that the group should not be the same group as an Oracle Database OSDBA group.
    [WARNING] [INS-41810] Possible invalid choice for OSOPER Group.
       CAUSE: The group name you selected as the OSOPER for ASM group is commonly used for Oracle Database administrator privileges.
       ACTION: Oracle recommends that you designate asmoper as the OSOPER for ASM group, and that the group should not be the same group as an Oracle Database OSOPER group.
    [WARNING] [INS-41813] OSDBA for ASM, OSOPER for ASM, and OSASM are the same OS group.
       CAUSE: The group you selected for granting the OSDBA for ASM group for database access, and the OSOPER for ASM group for startup and shutdown of Oracle ASM, is the same group as the OSASM group, whose members have SYSASM privileges on Oracle ASM.
       ACTION: Choose different groups as the OSASM, OSDBA for ASM, and OSOPER for ASM groups.
    [WARNING] [INS-13014] Target environment does not meet some optional requirements.
       CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/orainv/logs/GridSetupActions2018-07-28_05-28-26PM/gridSetupActions2018-07-28_05-28-26PM.log
       ACTION: Identify the list of failed prerequisite checks from the log: /u01/orainv/logs/GridSetupActions2018-07-28_05-28-26PM/gridSetupActions2018-07-28_05-28-26PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
    The response file for this session can be found at:
     /u01/gi18c/install/response/grid_2018-07-28_05-28-26PM.rsp
    
    You can find the log of this install session at:
     /u01/orainv/logs/GridSetupActions2018-07-28_05-28-26PM/gridSetupActions2018-07-28_05-28-26PM.log
    OUI-10053:Unable to generate temporary script: /u01/oraInventory/orainstRoot.sh. Unable to continue install.
    
    As a root user, execute the following script(s):
    	1. /u01/orainv/orainstRoot.sh
    	2. /u01/gi18c/root.sh
    
    Execute /u01/orainv/orainstRoot.sh on the following nodes: 
    [ol7decn2]
    Execute /u01/gi18c/root.sh on the following nodes: 
    [ol7decn1, ol7decn2]
    
    Run the script on the local node first. After successful completion, you can start the script in parallel on all other nodes.
    
    Successfully Setup Software with warning(s).
    As install user, execute the following command to complete the configuration.
    

    I did not find any root cause for following error message which looks like a bug:

    OUI-10053:Unable to generate temporary script: /u01/oraInventory/orainstRoot.sh. Unable to continue install.
    

    I have ignored following failed prerequisites:

    INFO:  [Jul 28, 2018 5:00:37 PM] ------------------List of failed Tasks------------------
    INFO:  [Jul 28, 2018 5:00:37 PM] *********************************************
    INFO:  [Jul 28, 2018 5:00:37 PM] Physical Memory: This is a prerequisite condition to test whether the system has at least 8GB (8388608.0KB) of total physical memory.
    INFO:  [Jul 28, 2018 5:00:37 PM] Severity:IGNORABLE
    INFO:  [Jul 28, 2018 5:00:37 PM] OverallStatus:VERIFICATION_FAILED
    INFO:  [Jul 28, 2018 5:00:37 PM] -----------------End of failed Tasks List----------------
    

    On second cluster node I have run orainstRoot.sh:

    # /u01/orainv/orainstRoot.sh
    Changing permissions of /u01/orainv.
    Adding read,write permissions for group.
    Removing read,write,execute permissions for world.
    
    Changing groupname of /u01/orainv to oinstall.
    The execution of the script is complete.
    

    On first cluster node I have run root.sh:

    # /u01/gi18c/root.sh 
    Check /u01/gi18c/install/root_ol7decn1.localdomain_2018-07-28_17-46-43-041313489.log for the output of root script
    

    Corresponding log is:

    cat /u01/gi18c/install/root_ol7decn1.localdomain_2018-07-28_17-46-43-041313489.log
    Performing root user operation.
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/gi18c
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    
    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    Relinking oracle with rac_on option
    Using configuration parameter file: /u01/gi18c/crs/install/crsconfig_params
    The log of current session can be found at:
      /u01/base/crsdata/ol7decn1/crsconfig/rootcrs_ol7decn1_2018-07-28_05-46-55PM.log
    2018/07/28 17:47:16 CLSRSC-594: Executing installation step 1 of 20: 'SetupTFA'.
    2018/07/28 17:47:16 CLSRSC-4001: Installing Oracle Trace File Analyzer (TFA) Collector.
    2018/07/28 17:47:49 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
    2018/07/28 17:47:49 CLSRSC-594: Executing installation step 2 of 20: 'ValidateEnv'.
    2018/07/28 17:47:49 CLSRSC-363: User ignored prerequisites during installation
    2018/07/28 17:47:49 CLSRSC-594: Executing installation step 3 of 20: 'CheckFirstNode'.
    2018/07/28 17:47:51 CLSRSC-594: Executing installation step 4 of 20: 'GenSiteGUIDs'.
    2018/07/28 17:47:56 CLSRSC-594: Executing installation step 5 of 20: 'SaveParamFile'.
    2018/07/28 17:48:14 CLSRSC-594: Executing installation step 6 of 20: 'SetupOSD'.
    2018/07/28 17:48:14 CLSRSC-594: Executing installation step 7 of 20: 'CheckCRSConfig'.
    2018/07/28 17:48:14 CLSRSC-594: Executing installation step 8 of 20: 'SetupLocalGPNP'.
    2018/07/28 17:48:54 CLSRSC-594: Executing installation step 9 of 20: 'CreateRootCert'.
    2018/07/28 17:49:04 CLSRSC-594: Executing installation step 10 of 20: 'ConfigOLR'.
    2018/07/28 17:49:22 CLSRSC-594: Executing installation step 11 of 20: 'ConfigCHMOS'.
    2018/07/28 17:49:22 CLSRSC-594: Executing installation step 12 of 20: 'CreateOHASD'.
    2018/07/28 17:49:34 CLSRSC-594: Executing installation step 13 of 20: 'ConfigOHASD'.
    2018/07/28 17:49:34 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
    2018/07/28 17:50:59 CLSRSC-594: Executing installation step 14 of 20: 'InstallAFD'.
    2018/07/28 17:51:52 CLSRSC-594: Executing installation step 15 of 20: 'InstallACFS'.
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ol7decn1'
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ol7decn1' has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    CRS-4123: Oracle High Availability Services has been started.
    2018/07/28 17:52:52 CLSRSC-594: Executing installation step 16 of 20: 'InstallKA'.
    2018/07/28 17:53:01 CLSRSC-594: Executing installation step 17 of 20: 'InitConfig'.
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ol7decn1'
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ol7decn1' has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    CRS-4123: Oracle High Availability Services has been started.
    CRS-2672: Attempting to start 'ora.driver.afd' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.evmd' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.mdnsd' on 'ol7decn1'
    CRS-2676: Start of 'ora.driver.afd' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.cssdmonitor' on 'ol7decn1'
    CRS-2676: Start of 'ora.cssdmonitor' on 'ol7decn1' succeeded
    CRS-2676: Start of 'ora.mdnsd' on 'ol7decn1' succeeded
    CRS-2676: Start of 'ora.evmd' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.gpnpd' on 'ol7decn1'
    CRS-2676: Start of 'ora.gpnpd' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.gipcd' on 'ol7decn1'
    CRS-2676: Start of 'ora.gipcd' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.cssd' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.diskmon' on 'ol7decn1'
    CRS-2676: Start of 'ora.diskmon' on 'ol7decn1' succeeded
    CRS-2676: Start of 'ora.cssd' on 'ol7decn1' succeeded
    
    [INFO] [DBT-30161] Disk label(s) created successfully. Check /u01/base/cfgtoollogs/asmca/asmca-180728PM055408.log for details.
    [INFO] [DBT-30001] Disk groups created successfully. Check /u01/base/cfgtoollogs/asmca/asmca-180728PM055408.log for details.
    
    
    2018/07/28 17:55:25 CLSRSC-482: Running command: '/u01/gi18c/bin/ocrconfig -upgrade oracle oinstall'
    CRS-2672: Attempting to start 'ora.crf' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.storage' on 'ol7decn1'
    CRS-2676: Start of 'ora.storage' on 'ol7decn1' succeeded
    CRS-2676: Start of 'ora.crf' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.crsd' on 'ol7decn1'
    CRS-2676: Start of 'ora.crsd' on 'ol7decn1' succeeded
    CRS-4256: Updating the profile
    Successful addition of voting disk 79df663311604f1ebfe81344216c1d46.
    Successfully replaced voting disk group with +OCRVD.
    CRS-4256: Updating the profile
    CRS-4266: Voting file(s) successfully replaced
    ##  STATE    File Universal Id                File Name Disk group
    --  -----    -----------------                --------- ---------
     1. ONLINE   79df663311604f1ebfe81344216c1d46 (AFD:OCRVD) [OCRVD]
    Located 1 voting disk(s).
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ol7decn1'
    CRS-2673: Attempting to stop 'ora.crsd' on 'ol7decn1'
    CRS-2677: Stop of 'ora.crsd' on 'ol7decn1' succeeded
    CRS-2673: Attempting to stop 'ora.storage' on 'ol7decn1'
    CRS-2673: Attempting to stop 'ora.crf' on 'ol7decn1'
    CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'ol7decn1'
    CRS-2673: Attempting to stop 'ora.mdnsd' on 'ol7decn1'
    CRS-2677: Stop of 'ora.crf' on 'ol7decn1' succeeded
    CRS-2677: Stop of 'ora.storage' on 'ol7decn1' succeeded
    CRS-2673: Attempting to stop 'ora.asm' on 'ol7decn1'
    CRS-2677: Stop of 'ora.drivers.acfs' on 'ol7decn1' succeeded
    CRS-2677: Stop of 'ora.mdnsd' on 'ol7decn1' succeeded
    CRS-2677: Stop of 'ora.asm' on 'ol7decn1' succeeded
    CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'ol7decn1'
    CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'ol7decn1' succeeded
    CRS-2673: Attempting to stop 'ora.ctssd' on 'ol7decn1'
    CRS-2673: Attempting to stop 'ora.evmd' on 'ol7decn1'
    CRS-2677: Stop of 'ora.evmd' on 'ol7decn1' succeeded
    CRS-2677: Stop of 'ora.ctssd' on 'ol7decn1' succeeded
    CRS-2673: Attempting to stop 'ora.cssd' on 'ol7decn1'
    CRS-2677: Stop of 'ora.cssd' on 'ol7decn1' succeeded
    CRS-2673: Attempting to stop 'ora.driver.afd' on 'ol7decn1'
    CRS-2673: Attempting to stop 'ora.gipcd' on 'ol7decn1'
    CRS-2673: Attempting to stop 'ora.gpnpd' on 'ol7decn1'
    CRS-2677: Stop of 'ora.driver.afd' on 'ol7decn1' succeeded
    CRS-2677: Stop of 'ora.gpnpd' on 'ol7decn1' succeeded
    CRS-2677: Stop of 'ora.gipcd' on 'ol7decn1' succeeded
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ol7decn1' has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    2018/07/28 17:59:38 CLSRSC-594: Executing installation step 18 of 20: 'StartCluster'.
    CRS-4123: Starting Oracle High Availability Services-managed resources
    CRS-2672: Attempting to start 'ora.evmd' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.mdnsd' on 'ol7decn1'
    CRS-2676: Start of 'ora.evmd' on 'ol7decn1' succeeded
    CRS-2676: Start of 'ora.mdnsd' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.gpnpd' on 'ol7decn1'
    CRS-2676: Start of 'ora.gpnpd' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.gipcd' on 'ol7decn1'
    CRS-2676: Start of 'ora.gipcd' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.cssdmonitor' on 'ol7decn1'
    CRS-2676: Start of 'ora.cssdmonitor' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.crf' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.cssd' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.diskmon' on 'ol7decn1'
    CRS-2676: Start of 'ora.diskmon' on 'ol7decn1' succeeded
    CRS-2676: Start of 'ora.crf' on 'ol7decn1' succeeded
    CRS-2676: Start of 'ora.cssd' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.ctssd' on 'ol7decn1'
    CRS-2676: Start of 'ora.ctssd' on 'ol7decn1' succeeded
    CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.asm' on 'ol7decn1'
    CRS-2676: Start of 'ora.asm' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.storage' on 'ol7decn1'
    CRS-2676: Start of 'ora.storage' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.crsd' on 'ol7decn1'
    CRS-2676: Start of 'ora.crsd' on 'ol7decn1' succeeded
    CRS-6023: Starting Oracle Cluster Ready Services-managed resources
    CRS-6017: Processing resource auto-start for servers: ol7decn1
    CRS-6016: Resource auto-start has completed for server ol7decn1
    CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources
    CRS-4123: Oracle High Availability Services has been started.
    2018/07/28 18:02:51 CLSRSC-343: Successfully started Oracle Clusterware stack
    2018/07/28 18:02:51 CLSRSC-594: Executing installation step 19 of 20: 'ConfigNode'.
    CRS-2672: Attempting to start 'ora.ASMNET1LSNR_ASM.lsnr' on 'ol7decn1'
    CRS-2676: Start of 'ora.ASMNET1LSNR_ASM.lsnr' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.asm' on 'ol7decn1'
    CRS-2676: Start of 'ora.asm' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.OCRVD.dg' on 'ol7decn1'
    CRS-2676: Start of 'ora.OCRVD.dg' on 'ol7decn1' succeeded
    2018/07/28 18:05:23 CLSRSC-594: Executing installation step 20 of 20: 'PostConfig'.
    
    [INFO] [DBT-30161] Disk label(s) created successfully. Check /u01/base/cfgtoollogs/asmca/asmca-180728PM060527.log for details.
    [INFO] [DBT-30001] Disk groups created successfully. Check /u01/base/cfgtoollogs/asmca/asmca-180728PM060527.log for details.
    
    
    2018/07/28 18:08:45 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
    

    I have checked cluster resources with:

    $ export ORACLE_SID=+ASM1
    $ PATH=/u01/gi18c/bin:$PATH
    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.ASMNET1LSNR_ASM.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
    ora.GIMR.GHCHKPT.advm
                   OFFLINE OFFLINE      ol7decn1                 STABLE
    ora.GIMR.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
    ora.OCRVD.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
    ora.gimr.ghchkpt.acfs
                   OFFLINE OFFLINE      ol7decn1                 volume /opt/oracle/r
                                                                 hp_images/chkbase is
                                                                 unmounted,STABLE
    ora.helper
                   OFFLINE OFFLINE      ol7decn1                 STABLE
    ora.net1.network
                   ONLINE  ONLINE       ol7decn1                 STABLE
    ora.ons
                   ONLINE  ONLINE       ol7decn1                 STABLE
    ora.proxy_advm
                   OFFLINE OFFLINE      ol7decn1                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.LISTENER_SCAN1.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.LISTENER_SCAN2.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.LISTENER_SCAN3.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.MGMTLSNR
          1        OFFLINE OFFLINE                               STABLE
    ora.asm
          1        ONLINE  ONLINE       ol7decn1                 Started,STABLE
          2        OFFLINE OFFLINE                               STABLE
          3        OFFLINE OFFLINE                               STABLE
    ora.cvu
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.ol7decn1.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.qosmserver
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.rhpserver
          1        OFFLINE OFFLINE                               STABLE
    ora.scan1.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.scan2.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.scan3.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    --------------------------------------------------------------------------------
    

    I have run root.sh on second cluster node:

    # /u01/gi18c/root.sh 
    Check /u01/gi18c/install/root_ol7decn2.localdomain_2018-07-28_18-27-02-937964448.log for the output of root script
    

    Corresponding log is:

    Performing root user operation.
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/gi18c
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    
    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    Relinking oracle with rac_on option
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
    	LANGUAGE = (unset),
    	LC_ALL = (unset),
    	LC_PAPER = "fr_FR.UTF-8",
    	LC_MONETARY = "fr_FR.UTF-8",
    	LC_NUMERIC = "fr_FR.UTF-8",
    	LC_MEASUREMENT = "fr_FR.UTF-8",
    	LC_TIME = "fr_FR.UTF-8",
    	LANG = "en_EN"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
    Using configuration parameter file: /u01/gi18c/crs/install/crsconfig_params
    The log of current session can be found at:
      /u01/base/crsdata/ol7decn2/crsconfig/rootcrs_ol7decn2_2018-07-28_06-27-39PM.log
    2018/07/28 18:27:46 CLSRSC-594: Executing installation step 1 of 20: 'SetupTFA'.
    2018/07/28 18:27:46 CLSRSC-4001: Installing Oracle Trace File Analyzer (TFA) Collector.
    2018/07/28 18:28:28 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
    2018/07/28 18:28:28 CLSRSC-594: Executing installation step 2 of 20: 'ValidateEnv'.
    2018/07/28 18:28:28 CLSRSC-363: User ignored prerequisites during installation
    2018/07/28 18:28:28 CLSRSC-594: Executing installation step 3 of 20: 'CheckFirstNode'.
    2018/07/28 18:28:30 CLSRSC-594: Executing installation step 4 of 20: 'GenSiteGUIDs'.
    2018/07/28 18:28:30 CLSRSC-594: Executing installation step 5 of 20: 'SaveParamFile'.
    2018/07/28 18:28:33 CLSRSC-594: Executing installation step 6 of 20: 'SetupOSD'.
    2018/07/28 18:28:33 CLSRSC-594: Executing installation step 7 of 20: 'CheckCRSConfig'.
    2018/07/28 18:28:34 CLSRSC-594: Executing installation step 8 of 20: 'SetupLocalGPNP'.
    2018/07/28 18:28:35 CLSRSC-594: Executing installation step 9 of 20: 'CreateRootCert'.
    2018/07/28 18:28:35 CLSRSC-594: Executing installation step 10 of 20: 'ConfigOLR'.
    2018/07/28 18:28:38 CLSRSC-594: Executing installation step 11 of 20: 'ConfigCHMOS'.
    2018/07/28 18:28:38 CLSRSC-594: Executing installation step 12 of 20: 'CreateOHASD'.
    2018/07/28 18:28:39 CLSRSC-594: Executing installation step 13 of 20: 'ConfigOHASD'.
    2018/07/28 18:28:40 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
    2018/07/28 18:29:52 CLSRSC-594: Executing installation step 14 of 20: 'InstallAFD'.
    2018/07/28 18:30:33 CLSRSC-594: Executing installation step 15 of 20: 'InstallACFS'.
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ol7decn2'
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ol7decn2' has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    CRS-4123: Oracle High Availability Services has been started.
    2018/07/28 18:31:28 CLSRSC-594: Executing installation step 16 of 20: 'InstallKA'.
    2018/07/28 18:31:30 CLSRSC-594: Executing installation step 17 of 20: 'InitConfig'.
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ol7decn2'
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ol7decn2' has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    CRS-4123: Oracle High Availability Services has been started.
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ol7decn2'
    CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'ol7decn2'
    CRS-2677: Stop of 'ora.drivers.acfs' on 'ol7decn2' succeeded
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ol7decn2' has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    2018/07/28 18:31:43 CLSRSC-594: Executing installation step 18 of 20: 'StartCluster'.
    CRS-4123: Starting Oracle High Availability Services-managed resources
    CRS-2672: Attempting to start 'ora.evmd' on 'ol7decn2'
    CRS-2672: Attempting to start 'ora.mdnsd' on 'ol7decn2'
    CRS-2676: Start of 'ora.evmd' on 'ol7decn2' succeeded
    CRS-2676: Start of 'ora.mdnsd' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.gpnpd' on 'ol7decn2'
    CRS-2676: Start of 'ora.gpnpd' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.gipcd' on 'ol7decn2'
    CRS-2676: Start of 'ora.gipcd' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.cssdmonitor' on 'ol7decn2'
    CRS-2676: Start of 'ora.cssdmonitor' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.crf' on 'ol7decn2'
    CRS-2672: Attempting to start 'ora.cssd' on 'ol7decn2'
    CRS-2672: Attempting to start 'ora.diskmon' on 'ol7decn2'
    CRS-2676: Start of 'ora.diskmon' on 'ol7decn2' succeeded
    CRS-2676: Start of 'ora.crf' on 'ol7decn2' succeeded
    CRS-2676: Start of 'ora.cssd' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'ol7decn2'
    CRS-2672: Attempting to start 'ora.ctssd' on 'ol7decn2'
    CRS-2676: Start of 'ora.ctssd' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.crsd' on 'ol7decn2'
    CRS-2676: Start of 'ora.crsd' on 'ol7decn2' succeeded
    CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.asm' on 'ol7decn2'
    CRS-2676: Start of 'ora.asm' on 'ol7decn2' succeeded
    CRS-6017: Processing resource auto-start for servers: ol7decn2
    CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.ons' on 'ol7decn2'
    CRS-2672: Attempting to start 'ora.ASMNET1LSNR_ASM.lsnr' on 'ol7decn2'
    CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'ol7decn1' succeeded
    CRS-2673: Attempting to stop 'ora.scan1.vip' on 'ol7decn1'
    CRS-2677: Stop of 'ora.scan1.vip' on 'ol7decn1' succeeded
    CRS-2672: Attempting to start 'ora.scan1.vip' on 'ol7decn2'
    CRS-2676: Start of 'ora.ASMNET1LSNR_ASM.lsnr' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.asm' on 'ol7decn2'
    CRS-2676: Start of 'ora.scan1.vip' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'ol7decn2'
    CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'ol7decn2' succeeded
    CRS-2676: Start of 'ora.ons' on 'ol7decn2' succeeded
    CRS-2676: Start of 'ora.asm' on 'ol7decn2' succeeded
    CRS-2672: Attempting to start 'ora.proxy_advm' on 'ol7decn1'
    CRS-2672: Attempting to start 'ora.proxy_advm' on 'ol7decn2'
    CRS-2676: Start of 'ora.proxy_advm' on 'ol7decn1' succeeded
    CRS-2676: Start of 'ora.proxy_advm' on 'ol7decn2' succeeded
    CRS-6016: Resource auto-start has completed for server ol7decn2
    CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources
    CRS-4123: Oracle High Availability Services has been started.
    2018/07/28 18:34:41 CLSRSC-343: Successfully started Oracle Clusterware stack
    2018/07/28 18:34:41 CLSRSC-594: Executing installation step 19 of 20: 'ConfigNode'.
    2018/07/28 18:35:02 CLSRSC-594: Executing installation step 20 of 20: 'PostConfig'.
    2018/07/28 18:35:35 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
    

    I have checked cluster resources:

    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.ASMNET1LSNR_ASM.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.GIMR.GHCHKPT.advm
                   OFFLINE OFFLINE      ol7decn1                 STABLE
                   OFFLINE OFFLINE      ol7decn2                 STABLE
    ora.GIMR.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.OCRVD.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.gimr.ghchkpt.acfs
                   OFFLINE OFFLINE      ol7decn1                 volume /opt/oracle/r
                                                                 hp_images/chkbase is
                                                                 unmounted,STABLE
                   OFFLINE OFFLINE      ol7decn2                 STABLE
    ora.helper
                   OFFLINE OFFLINE      ol7decn1                 STABLE
                   OFFLINE OFFLINE      ol7decn2                 IDLE,STABLE
    ora.net1.network
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.ons
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.proxy_advm
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.LISTENER_SCAN1.lsnr
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.LISTENER_SCAN2.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.LISTENER_SCAN3.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.MGMTLSNR
          1        OFFLINE OFFLINE                               STABLE
    ora.asm
          1        ONLINE  ONLINE       ol7decn1                 Started,STABLE
          2        ONLINE  ONLINE       ol7decn2                 Started,STABLE
          3        OFFLINE OFFLINE                               STABLE
    ora.cvu
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.ol7decn1.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.ol7decn2.vip
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.qosmserver
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.rhpserver
          1        OFFLINE OFFLINE                               STABLE
    ora.scan1.vip
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.scan2.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.scan3.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    --------------------------------------------------------------------------------
    

    I have checked ASMFD disks:

    $ export ORACLE_BASE=/u01/base
    $ asmcmd afd_lsdsk
    --------------------------------------------------------------------------------
    Label                     Filtering   Path
    ================================================================================
    GIMR                        ENABLED   /dev/sdc1
    OCRVD                       ENABLED   /dev/sdb1
    

    I have run the last GI configuration script with oracle user account:

    set -x
    cd /u01/gi18c
    DISTRIB=$(pwd)
    /u01/gi18c/gridSetup.sh -silent -executeConfigTools            \
           -responseFile $DISTRIB/install/response/gridsetup.rsp   \
           inventory_location=/u01/orainv                          \
           selected_languages=en                                   \
           oracle.install.option=CRS_CONFIG                        \
           oracle_base=/u01/base/                                  \
           oracle.install.asm.OSDBA=dba                            \
           oracle.install.asm.OSOPER=dba                           \
           oracle.install.asm.OSASM=dba                            \
           oracle.install.crs.config.gpnp.scanName=ol7dec-scan.localdomain \
           oracle.install.crs.config.gpnp.scanPort=1521            \
           oracle.install.crs.config.clusterName=ol7decn           \
           oracle.install.crs.config.gpnp.configureGNS=false       \
           oracle.install.crs.config.clusterNodes=ol7decn1:ol7decn1-vip:HUB,ol7decn2:ol7decn2-vip:HUB \
           oracle.install.crs.config.networkInterfaceList=enp0s8:192.168.56.0:1,enp0s9:192.168.43.0:5 \
           oracle.install.crs.config.storageOption=FLEX_ASM_STORAGE \
           oracle.install.asm.configureGIMRDataDG=true             \
           oracle.install.crs.config.useIPMI=false                 \
           oracle.install.asm.SYSASMPassword=oracle                \
           oracle.install.asm.configureAFD=true                    \
           oracle.install.asm.storageOption=ASM                    \
           oracle.install.asm.diskGroup.diskDiscoveryString=/dev/sdb1,/dev/sdc1 \
           oracle.install.asm.diskGroup.name=OCRVD                 \
           oracle.install.asm.diskGroup.disks=/dev/sdb1            \
           oracle.install.asm.diskGroup.redundancy=EXTERNAL        \
           oracle.install.asm.monitorPassword=oracle               \
           oracle.install.asm.gimrDG.name=GIMR                     \
           oracle.install.asm.gimrDG.disks=/dev/sdc1               \
           oracle.install.asm.gimrDG.redundancy=EXTERNAL           
    

    Running this script has generated following output:

    Launching Oracle Grid Infrastructure Setup Wizard...
    
    You can find the logs of this session at:
    /u01/orainv/logs/GridSetupActions2018-07-28_06-48-32PM
    
    Successfully Configured Software.
    

    I have checked cluster resources with:

    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.ASMNET1LSNR_ASM.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.GIMR.GHCHKPT.advm
                   OFFLINE OFFLINE      ol7decn1                 STABLE
                   OFFLINE OFFLINE      ol7decn2                 STABLE
    ora.GIMR.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.OCRVD.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.chad
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.gimr.ghchkpt.acfs
                   OFFLINE OFFLINE      ol7decn1                 volume /opt/oracle/r
                                                                 hp_images/chkbase is
                                                                 unmounted,STABLE
                   OFFLINE OFFLINE      ol7decn2                 STABLE
    ora.helper
                   OFFLINE OFFLINE      ol7decn1                 STABLE
                   OFFLINE OFFLINE      ol7decn2                 IDLE,STABLE
    ora.net1.network
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.ons
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.proxy_advm
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.LISTENER_SCAN1.lsnr
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.LISTENER_SCAN2.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.LISTENER_SCAN3.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.MGMTLSNR
          1        ONLINE  ONLINE       ol7decn1                 169.254.26.6 192.168
                                                                 .43.138,STABLE
    ora.asm
          1        ONLINE  ONLINE       ol7decn1                 Started,STABLE
          2        ONLINE  ONLINE       ol7decn2                 Started,STABLE
          3        OFFLINE OFFLINE                               STABLE
    ora.cvu
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.mgmtdb
          1        ONLINE  ONLINE       ol7decn1                 Open,STABLE
    ora.ol7decn1.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.ol7decn2.vip
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.qosmserver
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.rhpserver
          1        OFFLINE OFFLINE                               STABLE
    ora.scan1.vip
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.scan2.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.scan3.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    --------------------------------------------------------------------------------
    

    Note that GIMR database (ora.mgmtdb resource) is now created and started.

    I have checked OCR:

    $ ocrcheck
    Status of Oracle Cluster Registry is as follows :
    	 Version                  :          4
    	 Total space (kbytes)     :     491684
    	 Used space (kbytes)      :      84888
    	 Available space (kbytes) :     406796
    	 ID                       : 1283070023
    	 Device/File Name         :     +OCRVD
                                        Device/File integrity check succeeded
    
                                        Device/File not configured
    
                                        Device/File not configured
    
                                        Device/File not configured
    
                                        Device/File not configured
    
    	 Cluster registry integrity check succeeded
    
    	 Logical corruption check bypassed due to non-privileged user
    

    I have checked voting disk:

    $ crsctl query css votedisk
    ##  STATE    File Universal Id                File Name Disk group
    --  -----    -----------------                --------- ---------
     1. ONLINE   79df663311604f1ebfe81344216c1d46 (AFD:OCRVD) [OCRVD]
    Located 1 voting disk(s).
    

    I have checked ASM disk groups:

     asmcmd lsdg
    State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
    MOUNTED  EXTERN  N         512             512   4096  1048576     40959    15761                0           15761              0             N  GIMR/
    MOUNTED  EXTERN  N         512             512   4096  1048576      2047     1748                0            1748              0             Y  OCRVD/
    

    I have checked GIMR resource:

    $ srvctl config mgmtdb
    Database unique name: _mgmtdb
    Database name: 
    Oracle home: 
    Oracle user: oracle
    Spfile: +GIMR/_MGMTDB/PARAMETERFILE/spfile.270.982696243
    Password file: 
    Domain: 
    Start options: open
    Stop options: immediate
    Database role: PRIMARY
    Management policy: AUTOMATIC
    Type: Management
    PDB name: GIMR_DSCREP_10
    PDB service: GIMR_DSCREP_10
    Cluster name: ol7decn
    Database instance: -MGMTDB
    

    I have checked GI patch level with:

    $ crsctl query crs softwareversion
    Oracle Clusterware version on node [ol7decn1] is [18.0.0.0.0]
    $ $ORACLE_HOME/OPatch/opatch lspatches
    27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
    27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
    28256701;TOMCAT RELEASE UPDATE 18.3.0.0.0 (28256701)
    28090564;DBWLM RELEASE UPDATE 18.3.0.0.0 (28090564)
    28090557;ACFS RELEASE UPDATE 18.3.0.0.0 (28090557)
    28090553;OCW RELEASE UPDATE 18.3.0.0.0 (28090553)
    28090523;Database Release Update : 18.3.0.0.180717 (28090523)
    
    OPatch succeeded.
    $ 
    

    I have added ASM instance names in /etc/oratab because GI installation has not done it on both nodes.
    On ol7decn1:

    +ASM1:/u01/gi18c:N
    

    On ol7decn2:

    +ASM2:/u01/gi18c:N
    
    Oracle Database silent installation

    I have created Oracle Home directory on both nodes:

    # mkdir /u01/db18c
    # chown oracle:dba /u01/db18c
    

    I have unzipped media file:

    $ cd /u01/db18c
    $ unzip -q /stage/LINUX.X64_180000_db_home.zip 
    

    On first node I have run following script:

    $ cd /u01/db18c 
    export DISTRIB=`pwd`
    ./runInstaller -silent \
    -responseFile $DISTRIB/install/response/db_install.rsp \
    oracle.install.option=INSTALL_DB_SWONLY             \
    oracle.install.db.CLUSTER_NODES=ol7decn1,ol7decn2   \
    UNIX_GROUP_NAME=oinstall                            \
    SELECTED_LANGUAGES=en                               \
    ORACLE_HOME=/u01/db18c                              \
    ORACLE_BASE=/u01/base                               \
    oracle.install.db.InstallEdition=EE                 \
    oracle.install.db.isCustomInstall=false             \
    oracle.install.db.OSDBA_GROUP=dba                   \
    oracle.install.db.OSBACKUPDBA_GROUP=dba             \
    oracle.install.db.OSDGDBA_GROUP=dba                 \
    oracle.install.db.OSKMDBA_GROUP=dba                 \
    oracle.install.db.OSRACDBA_GROUP=dba                \
    SECURITY_UPDATES_VIA_MYORACLESUPPORT=false          \
    DECLINE_SECURITY_UPDATES=true                       \
    -waitForCompletion
    

    I have ignored following warnings:

    INFO:  [Jul 30, 2018 6:37:48 AM] ------------------List of failed Tasks------------------
    INFO:  [Jul 30, 2018 6:37:48 AM] *********************************************
    INFO:  [Jul 30, 2018 6:37:48 AM] Physical Memory: This is a prerequisite condition to test whether the system has at least 8GB (8388608.0KB) of total physical memory.
    INFO:  [Jul 30, 2018 6:37:48 AM] Severity:IGNORABLE
    INFO:  [Jul 30, 2018 6:37:48 AM] OverallStatus:VERIFICATION_FAILED
    INFO:  [Jul 30, 2018 6:37:48 AM] *********************************************
    INFO:  [Jul 30, 2018 6:37:48 AM] Oracle base: /u01/base: This task verifies the writability of the Oracle base /u01/base
    INFO:  [Jul 30, 2018 6:37:48 AM] Severity:CRITICAL
    INFO:  [Jul 30, 2018 6:37:48 AM] OverallStatus:WARNING
    INFO:  [Jul 30, 2018 6:37:48 AM] *********************************************
    INFO:  [Jul 30, 2018 6:37:48 AM] '/u01/base':
    INFO:  [Jul 30, 2018 6:37:48 AM] Severity:CRITICAL
    INFO:  [Jul 30, 2018 6:37:48 AM] OverallStatus:WARNING
    INFO:  [Jul 30, 2018 6:37:48 AM] -----------------End of failed Tasks List----------------
    

    Running this script has produced following output:

    Launching Oracle Database Setup Wizard...
    
    [WARNING] [INS-13014] Target environment does not meet some optional requirements.
       CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/orainv/logs/InstallActions2018-07-30_06-33-01AM/installActions2018-07-30_06-33-01AM.log
       ACTION: Identify the list of failed prerequisite checks from the log: /u01/orainv/logs/InstallActions2018-07-30_06-33-01AM/installActions2018-07-30_06-33-01AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
    The response file for this session can be found at:
     /u01/db18c/install/response/db_2018-07-30_06-33-01AM.rsp
    
    You can find the log of this install session at:
     /u01/orainv/logs/InstallActions2018-07-30_06-33-01AM/installActions2018-07-30_06-33-01AM.log
    
    As a root user, execute the following script(s):
    	1. /u01/db18c/root.sh
    
    Execute /u01/db18c/root.sh on the following nodes: 
    [ol7decn1, ol7decn2]
    
    
    Successfully Setup Software with warning(s).
    

    I have run root.sh on first node …:

    # /u01/db18c/root.sh
    Check /u01/db18c/install/root_ol7decn1.localdomain_2018-07-30_07-04-22-677276940.log for the output of root script
    # cat /u01/db18c/install/root_ol7decn1.localdomain_2018-07-30_07-04-22-677276940.log
    Performing root user operation.
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/db18c
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    # 
    

    … and on second node:

    # /u01/db18c/root.sh
    Check /u01/db18c/install/root_ol7decn2.localdomain_2018-07-30_07-04-47-261594066.log for the output of root script
    # cat /u01/db18c/install/root_ol7decn2.localdomain_2018-07-30_07-04-47-261594066.log
    Performing root user operation.
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/db18c
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    # 
    

    I have checked patch level on first node:

    $ export ORACLE_HOME=/u01/db18c
    $ export PATH=$ORACLE_HOME/bin:$PATH
    $ sqlplus -v
    
    SQL*Plus: Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    
    $ $ORACLE_HOME/OPatch/opatch lspatches
    27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
    27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
    28090553;OCW RELEASE UPDATE 18.3.0.0.0 (28090553)
    28090523;Database Release Update : 18.3.0.0.180717 (28090523)
    
    OPatch succeeded.
    
    Fast Recovery Area (FRA) and database group disk creation

    I have first modified ASMFD to discover the 2 additional disks:

    $ asmcmd afd_dsget
    AFD discovery string: /dev/sdb1,/dev/sdc1
    $ asmcmd afd_dsset '/dev/sd*'
    $ asmcmd afd_dsget
    AFD discovery string: /dev/sd*
    

    I have checked that ASMFD is now able to see all ASM disks:

    $ asmcmd afd_lsdsk               
    --------------------------------------------------------------------------------
    Label                     Filtering   Path
    ================================================================================
    DATA                        ENABLED   /dev/sdd1
    GIMR                        ENABLED   /dev/sdc1
    OCRVD                       ENABLED   /dev/sdb1
    RECO                        ENABLED   /dev/sde1
    $ 
    

    I have also modified ASMFD configuration on second node to make sure ASM disks are usable on both cluster nodes:

    $ asmcmd afd_scan  
    $ asmcmd afd_lsdsk
    --------------------------------------------------------------------------------
    Label                     Filtering   Path
    ================================================================================
    DATA                        ENABLED   /dev/sdd1
    GIMR                        ENABLED   /dev/sdc1
    OCRVD                       ENABLED   /dev/sdb1
    RECO                        ENABLED   /dev/sde1
    $ 
    

    I have created new ASM disk groups with:

    $ . oraenv
    ORACLE_SID = [+ASM1] ? +ASM1
    The Oracle base remains unchanged with value /u01/base
    $ sqlplus / as sysasm
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Mon Jul 30 22:06:41 2018
    Version 18.3.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    
    SYS@+ASM1>select name, label, path, header_status from v$asm_disk;
    
    NAME	   LABEL      PATH		   HEADER_STATU
    ---------- ---------- -------------------- ------------
    	   DATA       AFD:DATA		   PROVISIONED
    	   RECO       AFD:RECO		   PROVISIONED
    OCRVD	   OCRVD      AFD:OCRVD 	   MEMBER
    GIMR	   GIMR       AFD:GIMR		   MEMBER
    
    SYS@+ASM1>create diskgroup DATA external redundancy disk 'AFD:DATA';
    
    Diskgroup created.
    
    SYS@+ASM1>create diskgroup RECO external redundancy disk 'AFD:RECO';
    
    Diskgroup created.
    

    I have started disk groups on second cluster node:

    $ srvctl start diskgroup -diskgroup DATA -n ol7decn2
    $ srvctl start diskgroup -diskgroup RECO -n ol7decn2
    

    I have checked that both disk group resources have been added to OCR:

    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.ASMNET1LSNR_ASM.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.DATA.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.GIMR.GHCHKPT.advm
                   OFFLINE OFFLINE      ol7decn1                 STABLE
                   OFFLINE OFFLINE      ol7decn2                 STABLE
    ora.GIMR.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.OCRVD.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.RECO.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.chad
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.gimr.ghchkpt.acfs
                   OFFLINE OFFLINE      ol7decn1                 STABLE
                   OFFLINE OFFLINE      ol7decn2                 STABLE
    ora.helper
                   OFFLINE OFFLINE      ol7decn1                 IDLE,STABLE
                   OFFLINE OFFLINE      ol7decn2                 IDLE,STABLE
    ora.net1.network
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.ons
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.proxy_advm
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.LISTENER_SCAN1.lsnr
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.LISTENER_SCAN2.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.LISTENER_SCAN3.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.MGMTLSNR
          1        ONLINE  ONLINE       ol7decn1                 169.254.26.6 192.168
                                                                 .43.138,STABLE
    ora.asm
          1        ONLINE  ONLINE       ol7decn1                 Started,STABLE
          2        ONLINE  ONLINE       ol7decn2                 Started,STABLE
          3        OFFLINE OFFLINE                               STABLE
    ora.cvu
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.mgmtdb
          1        ONLINE  ONLINE       ol7decn1                 Open,STABLE
    ora.ol7decn1.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.ol7decn2.vip
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.qosmserver
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.rhpserver
          1        OFFLINE OFFLINE                               STABLE
    ora.scan1.vip
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.scan2.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.scan3.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    --------------------------------------------------------------------------------
    

    I have changed DATA disk group compatibility to make sure that I can create a 18c database and avoid following error:

    [FATAL] [DBT-05802] Creating password file on diskgroup (DATA) would fail since it requires compatible.asm of version (12.1.0.0.0) or higher. Current compatible.asm version is '11.2.0.2.0'.
    ACTION: Choose a diskgroup with correct value for compatible.asm attribute.
    

    I have run:

    $ sqlplus / as sysasm
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Mon Jul 30 20:27:18 2018
    Version 18.3.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    
    SYS@+ASM1>alter diskgroup DATA set attribute 'compatible.asm'='12.1.0.0';
    
    Diskgroup altered.
    
    
    RAC database creation

    I have created a RAC database with following script:

    /u01/db18c/bin/dbca \
     -silent \
     -nodelist ol7decn1,ol7decn2 \
     -createDatabase \
     -templateName General_Purpose.dbc   \
     -gdbName CDBRAC \
     -createAsContainerDatabase true \
     -numberOfPdbs 1 \
     -pdbName pdb \
     -pdbadminUsername pdba \
     -pdbadminPassword oracle \
     -SysPassword oracle \
     -SystemPassword oracle \
     -emConfiguration NONE \
     -storageType ASM \
     -asmSysPassword oracle \
     -diskGroupName DATA \
     -characterSet AL32UTF8 \
     -totalMemory 1024 \
     -recoveryGroupName RECO 
    

    This script has printed following output:

    WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    Prepare for db operation
    7% complete
    Copying database files
    27% complete
    Creating and starting Oracle instance
    28% complete
    31% complete
    35% complete
    37% complete
    40% complete
    Creating cluster database views
    41% complete
    53% complete
    Completing Database Creation
    57% complete
    59% complete
    60% complete
    Creating Pluggable Databases
    64% complete
    80% complete
    Executing Post Configuration Actions
    100% complete
    Database creation complete. For details check the logfiles at:
     /u01/base/cfgtoollogs/dbca/CDBRAC.
    Database Information:
    Global Database Name:CDBRAC
    System Identifier(SID) Prefix:CDBRAC
    Look at the log file "/u01/base/cfgtoollogs/dbca/CDBRAC/CDBRAC.log" for further details.
    

    I have fixed /etc/oratab on both nodes to add missing instance names.
    On first node:

    $ tail -n 1 /etc/oratab
    CDBRAC1:/u01/db18c:N
    $ 
    

    On second node:

    $ tail -n 1 /etc/oratab
    CDBRAC2:/u01/db18c:N
    $ 
    

    I have connected to database instance and run some checks:

    SYS@CDBRAC2>select name, cdb from v$database;
    
    NAME	  CDB
    --------- ---
    CDBRAC	  YES
    
    SYS@CDBRAC2>show pdbs
    
        CON_ID CON_NAME			  OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
    	 2 PDB$SEED			  READ ONLY  NO
    	 3 PDB				  READ WRITE NO
    SYS@CDBRAC2>select comp_name, version, status from dba_registry;
    
    COMP_NAME				 VERSION	      STATUS
    ---------------------------------------- -------------------- ----------
    Oracle Database Catalog Views		 18.0.0.0.0	      VALID
    Oracle Database Packages and Types	 18.0.0.0.0	      VALID
    Oracle Real Application Clusters	 18.0.0.0.0	      VALID
    JServer JAVA Virtual Machine		 18.0.0.0.0	      VALID
    Oracle XDK				 18.0.0.0.0	      VALID
    Oracle Database Java Packages		 18.0.0.0.0	      VALID
    OLAP Analytic Workspace 		 18.0.0.0.0	      VALID
    Oracle XML Database			 18.0.0.0.0	      VALID
    Oracle Workspace Manager		 18.0.0.0.0	      VALID
    Oracle Text				 18.0.0.0.0	      VALID
    Oracle Multimedia			 18.0.0.0.0	      VALID
    
    COMP_NAME				 VERSION	      STATUS
    ---------------------------------------- -------------------- ----------
    Spatial 				 18.0.0.0.0	      VALID
    Oracle OLAP API 			 18.0.0.0.0	      VALID
    Oracle Label Security			 18.0.0.0.0	      VALID
    Oracle Database Vault			 18.0.0.0.0	      VALID
    
    15 rows selected.
    
    SYS@CDBRAC2>select patch_id, action, description, status, action_time from dba_registry_sqlpatch;
    
      PATCH_ID ACTION	   DESCRIPTION							STATUS	   ACTION_TIME
    ---------- --------------- ------------------------------------------------------------ ---------- ------------------------------
      28090523 APPLY	   Database Release Update : 18.3.0.0.180717 (28090523) 	SUCCESS    30-JUL-18 08.55.00.839070 PM
      27923415 APPLY	   OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)		SUCCESS    30-JUL-18 08.55.00.843547 PM
    
    SYS@CDBRAC2>
    
    

    I have checked database configuration in OCR:

    $ srvctl config database -d CDBRAC
    Database unique name: CDBRAC
    Database name: CDBRAC
    Oracle home: /u01/db18c
    Oracle user: oracle
    Spfile: +DATA/CDBRAC/PARAMETERFILE/spfile.272.982876093
    Password file: +DATA/CDBRAC/PASSWORD/pwdcdbrac.256.982874473
    Domain: 
    Start options: open
    Stop options: immediate
    Database role: PRIMARY
    Management policy: AUTOMATIC
    Server pools: 
    Disk Groups: RECO,DATA
    Mount point paths: 
    Services: 
    Type: RAC
    Start concurrency: 
    Stop concurrency: 
    OSDBA group: dba
    OSOPER group: oper
    Database instances: CDBRAC1,CDBRAC2
    Configured nodes: ol7decn1,ol7decn2
    CSS critical: no
    CPU count: 0
    Memory target: 0
    Maximum memory: 0
    Default network number for database services: 
    Database is administrator managed
    

    I have also checked that crsctl displays now all resources including the new database:

    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.ASMNET1LSNR_ASM.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.DATA.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.GIMR.GHCHKPT.advm
                   OFFLINE OFFLINE      ol7decn1                 STABLE
                   OFFLINE OFFLINE      ol7decn2                 STABLE
    ora.GIMR.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.OCRVD.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.RECO.dg
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.chad
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.gimr.ghchkpt.acfs
                   OFFLINE OFFLINE      ol7decn1                 STABLE
                   OFFLINE OFFLINE      ol7decn2                 STABLE
    ora.helper
                   OFFLINE OFFLINE      ol7decn1                 IDLE,STABLE
                   OFFLINE OFFLINE      ol7decn2                 IDLE,STABLE
    ora.net1.network
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.ons
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    ora.proxy_advm
                   ONLINE  ONLINE       ol7decn1                 STABLE
                   ONLINE  ONLINE       ol7decn2                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.LISTENER_SCAN1.lsnr
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.LISTENER_SCAN2.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.LISTENER_SCAN3.lsnr
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.MGMTLSNR
          1        ONLINE  ONLINE       ol7decn1                 169.254.26.6 192.168
                                                                 .43.138,STABLE
    ora.asm
          1        ONLINE  ONLINE       ol7decn1                 Started,STABLE
          2        ONLINE  ONLINE       ol7decn2                 Started,STABLE
          3        OFFLINE OFFLINE                               STABLE
    ora.cdbrac.db
          1        ONLINE  ONLINE       ol7decn1                 Open,HOME=/u01/db18c
                                                                 ,STABLE
          2        ONLINE  ONLINE       ol7decn2                 Open,HOME=/u01/db18c
                                                                 ,STABLE
    ora.cvu
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.mgmtdb
          1        ONLINE  ONLINE       ol7decn1                 Open,STABLE
    ora.ol7decn1.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.ol7decn2.vip
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.qosmserver
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.rhpserver
          1        OFFLINE OFFLINE                               STABLE
    ora.scan1.vip
          1        ONLINE  ONLINE       ol7decn2                 STABLE
    ora.scan2.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    ora.scan3.vip
          1        ONLINE  ONLINE       ol7decn1                 STABLE
    --------------------------------------------------------------------------------
    $ 
    

    The 2-node RAC 18c cluster is now ready.

    Conclusion

    Comparing with a 12.2.0.1 installation, it is now possible to create directly GIMR database in a dedicated disk group.

    I note new default local cluster resources and currently not really documented:

    – ora.GIMR.GHCHKPT.advm

    – ora.gimr.ghchkpt.acfs

    – ora.proxy_advm

    – ora.helper

    I note also one new cluster resource: ora.rhpserver.

    In general I find installations elapsted time quite slow, possibly due to many unexpected short lived depmod processes using a lot of CPU …

    Categories: DBA Blogs

    How to install Oracle RAC 18c in silent mode on Oracle Linux 7.5 with VirtualBox – Part 1

    Sun, 2018-07-29 14:04

    Both posts document how to install a 2-node Oracle RAC cluster with Oracle 18c on Oracle Linux 7.5 (OL7) with VirtualBox.

    Part 1 details Linux installation and configuration and part 2 details Oracle software installation (Grid Infrastructure + Oracle Database) and database creation.

    Disclaimer: this is only an example that can be used to setup a lab or test system: it is not designed to be used for production purpose.

    Overview

    Each RAC node must:

  • have access to shared storage to be used by the RAC database because a RAC database is a shared everything database.
  • have network connectivity with a dedicated private network (also named RAC interconnect) to other cluster nodes.
  • The cluster should have also 3 differents virtual IP adresses (VIP) to be used only by the SCAN listener: this single name should be resolved by 3 differents adresses.

    The following table gives the SCAN network configuration used for this installation:

    SCAN VIP 1 VIP 2 VIP 3 ol7dec-scan 192.168.56.148 192.168.56.149 192.168.56.150

    A 2-node Oracle RAC cluster needs actually 3 machines (if you dedicate DNS server to a different virtual machine (VM)):

  • 2 cluster nodes that are hosting the 2 database instances of the single RAC database
  • another machine to host a Domain Name System (DNS) for the SCAN listener VIPs.
  • One of the very first thing to do is to choose hostnames and network IP addresses.

    The following table gives the cluster network configuration needed for this Oracle installation:

    ol7dns03: DNS server ol7decn1: RAC node 1 ol7decn2: RAC node 2 network interface NAT 10.0.2.15 10.0.2.15 10.0.2.15 enp0s3 Public IP 192.168.56.143 192.168.56.138 192.168.56.139 enp0s8 Private IP N/A 192.168.43.138 192.168.43.139 enp0s9 Virtual IP (VIP) N/A 192.168.56.246 192.168.56.247 assigned by OUI

    Note that Oracle Universal Installer (OUI) will assign network interface for cluster node virtual IP address (VIP) during Grid Infrastructure installation.

    The NAT interface is only needed to be able to connect to Oracle YUM servers to download RPM packages: strictly speaking it is not direclty required by Oracle software installation (Grid Infrastructure or Oracle Database).

    The main steps of this system/network/storage installation and configuration part are the following:

    1. configure DNS server machine

    2. configure first cluster node with shared storage

    3. clone first cluster node to second cluster node

    4. install Oracle 18c preinstallation RPM on both nodes and configure passwordless ssh

    5. run Cluster Verification Utility (CLUVFY) to make sure both cluster nodes are ready for Oracle sofware installation.

    All commands with ‘#” prompt must be entered with root user account while all command with ‘$’ prompt must be entered with oracle user account.

    DNS machine configuration

    I have created first VBOX VM with following configuration(this VM is running Oracle Linux 7 (OL7)):
    RAM: 1 GB

  • one 12 GB hardisk attached to SATA controller
  • 2 network interfaces (the first one attached to NAT and the second one attached to Host-Only Adapter)
  • When installing Oracle Linux 7 I have chosen in following order:

    1. the right timezone for my country (Paris, France)

    2. the right keyboard for my host system (French)

    3. Infrastructure Server for “Base Environment” and DNS Name Server for “Add-Ons For Selected Environment”

    4. Automatic configure partitioning in Installation Destination

    5. to set only hostname to ol7dns03.localdomain (no network configuration)

    6. to set root password.

    After OL7 installation and VM reboot, I have used system console to configure public network interface:

    # nmcli connection add type ethernet con-name enp0s8 ifname enp0s8 ip4 192.168.56.143/24
    

    Now I can connect to ol7dns02 using SSH and check network configuration:

    # ip addr
    1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:d6:99:79 brd ff:ff:ff:ff:ff:ff
    3: enp0s8:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:8e:18:3a brd ff:ff:ff:ff:ff:ff
        inet 192.168.56.143/24 brd 192.168.56.255 scope global noprefixroute enp0s8
           valid_lft forever preferred_lft forever
        inet6 fe80::17e4:6618:27f8:9a76/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    # 
    

    I have configured NAT network interface with (10.0.2.15 is the related IP address and 10.0.2.2 the related gateway IP address):

    # nmcli connection add type ethernet con-name enp0s3 ifname enp0s3 ip4 10.0.2.15/8 gw4 10.0.2.2
    Connection 'enp0s3' (6818d165-506a-40d6-95c3-e2077a79f974) successfully added.
    

    I have added my internet box IP address to /etc/resolv.conf:

    # cat /etc/resolv.conf 
    nameserver 192.168.1.254
    

    I have checked that I have internet access from ol7dns03:

    # ping -c 1 www.oracle.com
    PING e870.dscx.akamaiedge.net (104.93.247.134) 56(84) bytes of data.
    64 bytes from a104-93-247-134.deploy.static.akamaitechnologies.com (104.93.247.134): icmp_seq=1 ttl=63 time=33.1 ms
    
    --- e870.dscx.akamaiedge.net ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 33.104/33.104/33.104/0.000 ms
    

    This OL7 installation is using about 1.3 GB of disk space:

    # df -h
    Filesystem           Size  Used Avail Use% Mounted on
    devtmpfs             476M     0  476M   0% /dev
    tmpfs                496M     0  496M   0% /dev/shm
    tmpfs                496M  6.8M  489M   2% /run
    tmpfs                496M     0  496M   0% /sys/fs/cgroup
    /dev/mapper/ol-root  9.8G  1.4G  8.5G  14% /
    /dev/sda1           1014M  169M  846M  17% /boot
    tmpfs                100M     0  100M   0% /run/user/0
    
    DNS configuration

    DNS server is not configured by default:

    # systemctl status named
    ● named.service - Berkeley Internet Name Domain (DNS)
       Loaded: loaded (/usr/lib/systemd/system/named.service; disabled; vendor preset: disabled)
       Active: inactive (dead
    

    Here is my /etc/named.conf:

    # cat named.conf
    //
    // named.conf
    //
    // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
    // server as a caching only nameserver (as a localhost DNS resolver only).
    //
    // See /usr/share/doc/bind*/sample/ for example named configuration files.
    //
    // See the BIND Administrator's Reference Manual (ARM) for details about the
    // configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html
    
    options {
    	listen-on port 53 { 127.0.0.1;192.168.56.143; };
    	listen-on-v6 port 53 { ::1; };
    	directory 	"/var/named";
    	dump-file 	"/var/named/data/cache_dump.db";
    	statistics-file "/var/named/data/named_stats.txt";
    	memstatistics-file "/var/named/data/named_mem_stats.txt";
    	allow-query     { localhost; };
    
    	/* 
    	 - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
    	 - If you are building a RECURSIVE (caching) DNS server, you need to enable 
    	   recursion. 
    	 - If your recursive DNS server has a public IP address, you MUST enable access 
    	   control to limit queries to your legitimate users. Failing to do so will
    	   cause your server to become part of large scale DNS amplification 
    	   attacks. Implementing BCP38 within your network would greatly
    	   reduce such attack surface 
    	*/
    	recursion yes;
    
    	dnssec-enable yes;
    	dnssec-validation yes;
    
    	/* Path to ISC DLV key */
    	bindkeys-file "/etc/named.iscdlv.key";
    
    	managed-keys-directory "/var/named/dynamic";
    
    	pid-file "/run/named/named.pid";
    	session-keyfile "/run/named/session.key";
    };
    
    logging {
            channel default_debug {
                    file "data/named.run";
                    severity dynamic;
            };
    };
    
    zone "localdomain." IN {
            type master;
            file "localdomain.zone";
            allow-update { none; };
            allow-query { any; };
    };
    
    zone "56.168.192.in-addr.arpa." IN {
            type master;
            file "56.168.192.in-addr.arpa";
            allow-update { none; };
    };
    
    zone "." IN {
    	type hint;
    	file "named.ca";
    };
    
    include "/etc/named.rfc1912.zones";
    include "/etc/named.root.key";
    
    

    Note that I have added the following sections to default /etc/named.conf for localdomain.com:

    zone "localdomain." IN {
            type master;
            file "localdomain.zone";
            allow-update { none; };
            allow-query { any; };
    };
    
    
    zone "56.168.192.in-addr.arpa." IN {
            type master;
            file "56.168.192.in-addr.arpa";
            allow-update { none; };
    };
    

    and I have added VM IP 192.168.56.143 address to:

    listen-on port 53 { 127.0.0.1;192.168.56.143; };
    

    I have created the file /var/named/localdomain.zone which contains:

  • the 3 IP adresses for the SCAN listener (rh7ttc-scan)
  • each cluster node public IP address (ol7decn1 and ol7decn2)
  • 
    # cat localdomain.zone 
    $TTL    86400
    @               IN SOA  localhost root.localhost (
                                            42              ; serial (d. adams)
                                            3H              ; refresh
                                            15M             ; retry
                                            1W              ; expiry
                                            1D )            ; minimum
                    IN NS           localhost
    localhost       IN A            127.0.0.1
    ol7dec-scan     IN A    192.168.56.148 
    ol7dec-scan     IN A    192.168.56.149
    ol7dec-scan     IN A    192.168.56.150
    ol7decn1        IN A    192.168.56.138
    ol7decn2        IN A    192.168.56.139
    #
    

    I have also created /var/named/56.168.192.in-addr.arpa:

    # cat 56.168.192.in-addr.arpa
    $ORIGIN 56.168.192.in-addr.arpa.
    $TTL 1H
    @       IN      SOA     d12.localdomain.     d12.localdomain. (      2
                                                    3H
                                                    1H
                                                    1W
                                                    1H )
    56.168.192.in-addr.arpa.         IN NS      d12.localdomain.
    
    148    IN PTR  ol7dec-scan.localdomain.
    149    IN PTR  ol7dec-scan.localdomain.
    150    IN PTR  ol7dec-scan.localdomain.
    138    IN PTR  ol7decn1.localdomain.
    139    IN PTR  ol7decn2.localdomain.
    

    I have started named service with:

    # systemctl status named
    ● named.service - Berkeley Internet Name Domain (DNS)
       Loaded: loaded (/usr/lib/systemd/system/named.service; disabled; vendor preset: disabled)
       Active: active (running) since Sat 2018-07-14 18:44:36 CEST; 6s ago
      Process: 29241 ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS (code=exited, status=0/SUCCESS)
      Process: 29238 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (code=exited, status=0/SUCCESS)
     Main PID: 29244 (named)
       CGroup: /system.slice/named.service
               └─29244 /usr/sbin/named -u named -c /etc/named.conf
    
    Jul 14 18:44:36 ol7dns03.localdomain named[29244]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
    Jul 14 18:44:36 ol7dns03.localdomain named[29244]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
    Jul 14 18:44:36 ol7dns03.localdomain named[29244]: zone 56.168.192.in-addr.arpa/IN: loaded serial 2
    Jul 14 18:44:36 ol7dns03.localdomain named[29244]: zone localhost/IN: loaded serial 0
    Jul 14 18:44:36 ol7dns03.localdomain named[29244]: zone localdomain/IN: loaded serial 42
    Jul 14 18:44:36 ol7dns03.localdomain named[29244]: all zones loaded
    Jul 14 18:44:36 ol7dns03.localdomain named[29244]: running
    Jul 14 18:44:36 ol7dns03.localdomain systemd[1]: Started Berkeley Internet Name Domain (DNS).
    Jul 14 18:44:36 ol7dns03.localdomain named[29244]: error (network unreachable) resolving './DNSKEY/IN': 2001:503:ba3e::2:30#53
    Jul 14 18:44:36 ol7dns03.localdomain named[29244]: error (network unreachable) resolving './NS/IN': 2001:503:ba3e::2:30#53
    

    I have tested that DNS is working locally after modifying /etc/resolv.conf:

    # cat /etc/resolv.conf
    search localdomain
    nameserver 192.168.56.143
    nameserver 192.168.1.254
    
    # nslookup ol7dec-scan
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.148
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.150
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.149
    
    # nslookup ol7decn1   
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7decn1.localdomain
    Address: 192.168.56.138
    
    # nslookup ol7decn2
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7decn2.localdomain
    Address: 192.168.56.139
    
    #
    

    I have enabled automatic named service start by Linux boot with:

    # systemctl is-enabled named
    disabled
    # systemctl enable named
    Created symlink from /etc/systemd/system/multi-user.target.wants/named.service to /usr/lib/systemd/system/named.service.
    # 
    

    And I have tested that after VM reboot …

    # systemctl reboot
    

    … named service has been automatically restarted:

    # systemctl  status named
    ● named.service - Berkeley Internet Name Domain (DNS)
       Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
       Active: active (running) since Sat 2018-07-14 18:47:48 CEST; 14s ago
      Process: 1125 ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS (code=exited, status=0/SUCCESS)
      Process: 1093 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (code=exited, status=0/SUCCESS)
     Main PID: 1141 (named)
       CGroup: /system.slice/named.service
               └─1141 /usr/sbin/named -u named -c /etc/named.conf
    
    Jul 14 18:47:48 ol7dns03.localdomain named[1141]: zone 0.in-addr.arpa/IN: loaded serial 0
    Jul 14 18:47:48 ol7dns03.localdomain named[1141]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
    Jul 14 18:47:48 ol7dns03.localdomain named[1141]: zone 56.168.192.in-addr.arpa/IN: loaded serial 2
    Jul 14 18:47:48 ol7dns03.localdomain named[1141]: zone localhost/IN: loaded serial 0
    Jul 14 18:47:48 ol7dns03.localdomain named[1141]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
    Jul 14 18:47:48 ol7dns03.localdomain named[1141]: zone localhost.localdomain/IN: loaded serial 0
    Jul 14 18:47:48 ol7dns03.localdomain named[1141]: zone localdomain/IN: loaded serial 42
    Jul 14 18:47:48 ol7dns03.localdomain named[1141]: all zones loaded
    Jul 14 18:47:48 ol7dns03.localdomain systemd[1]: Started Berkeley Internet Name Domain (DNS).
    Jul 14 18:47:48 ol7dns03.localdomain named[1141]: running
    # nslookup ol7dec-scan
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.150
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.149
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.148
    
    

    I have also disabled some firewall settings for ol7dns03 so that cluster nodes will be able to query DNS:

    # firewall-cmd --zone=public --add-port=53/tcp --add-port=53/udp
    success
    # firewall-cmd --permanent --zone=public --add-port=53/tcp --add-port=53/udp
    success
    # 
    
    Oracle RAC cluster node configuration

    I have created first cluster node VM with following configuration:

  • RAM: 8 GB
  • one 40 GB hardisk attached to SATA controller
  • 3 network interfaces (the first one attached to NAT and the second and third one attached to Host-Only Adapter)
  • When installing OL7 I have chosen in the following order:

    1. English as installation language

    2. the right timezone for my country (Paris, France)

    3. the right keyboard for my host system (French)

    4. manual partitioning only to set / file system size to 30 GB and swap space size to 8 GB

    6. to only set hostname to ol7decn1.localdomain (no network configuration)

    7. to set root password.

    I have left Software Selection to default value “minimal installation”.

    After OL7 installation and VM reboot, I have used system console to configure public network interface:

    #  nmcli connection add type ethernet con-name enp0s8 ifname enp0s8 ip4 192.168.56.138/24
    

    Now I connect with ssh to ol7decn1 and check network confoguration:

    # ip addr
    1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:31:3d:db brd ff:ff:ff:ff:ff:ff
    3: enp0s8:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:34:9d:cb brd ff:ff:ff:ff:ff:ff
        inet 192.168.56.138/24 brd 192.168.56.255 scope global noprefixroute enp0s8
           valid_lft forever preferred_lft forever
        inet6 fe80::ff11:58c8:a1ae:b6e0/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    4: enp0s9:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:4a:e5:1a brd ff:ff:ff:ff:ff:ff
    

    I have configured NAT network interface with 10.0.2.15 as IP address and 10.0.2.2 as related gateway IP address:

    # nmcli connection add type ethernet con-name enp0s3 ifname enp0s3 ip4 10.0.2.15/8 gw4 10.0.2.2
    Connection 'enp0s3' (1971852d-ee58-48c1-a247-518d2dbf75aa) successfully added.
    

    I have also configured third network interface for the RAC interconnect:

    #  nmcli connection add type ethernet con-name enp0s9 ifname enp0s9 ip4 192.168.43.138/24
    Warning: There is another connection with the name 'enp0s9'. Reference the connection by its uuid 'ed848ab9-5f78-4c0f-a629-2aaac20287c2'
    Connection 'enp0s9' (ed848ab9-5f78-4c0f-a629-2aaac20287c2) successfully added.
    

    I have checked with ip command the current network configuration:

    # ip addr
    1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:31:3d:db brd ff:ff:ff:ff:ff:ff
        inet 10.0.2.15/8 brd 10.255.255.255 scope global noprefixroute enp0s3
           valid_lft forever preferred_lft forever
        inet6 fe80::29ab:3073:bbe8:acd/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    3: enp0s8:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:34:9d:cb brd ff:ff:ff:ff:ff:ff
        inet 192.168.56.138/24 brd 192.168.56.255 scope global noprefixroute enp0s8
           valid_lft forever preferred_lft forever
        inet6 fe80::ff11:58c8:a1ae:b6e0/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    4: enp0s9:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:4a:e5:1a brd ff:ff:ff:ff:ff:ff
        inet 192.168.43.138/24 brd 192.168.43.255 scope global noprefixroute enp0s9
           valid_lft forever preferred_lft forever
        inet6 fe80::905d:a529:4f0b:78ef/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    #
    

    I have modified /etc/resolv.conf for DNS server and internet access:

    nameserver 192.168.56.143
    search localdomain
    nameserver 192.168.1.254
    

    I have checked internet access:

    # ping -c 1 www.oracle.com
    PING e870.dscx.akamaiedge.net (104.85.40.158) 56(84) bytes of data.
    64 bytes from a104-85-40-158.deploy.static.akamaitechnologies.com (104.85.40.158): icmp_seq=1 ttl=63 time=33.2 ms
    
    --- e870.dscx.akamaiedge.net ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 33.222/33.222/33.222/0.000 ms
    

    I have installed bind-utils package for nslookup:

    # yum install bind-utils
    Failed to set locale, defaulting to C
    Loaded plugins: ulninfo
    ol7_UEKR4                                                | 1.2 kB     00:00     
    ol7_latest                                               | 1.4 kB     00:00     
    (1/5): ol7_UEKR4/x86_64/updateinfo                         | 196 kB   00:01     
    (2/5): ol7_latest/x86_64/updateinfo                        | 518 kB   00:01     
    (3/5): ol7_latest/x86_64/group                             | 659 kB   00:02     
    (4/5): ol7_latest/x86_64/primary                           | 5.8 MB   00:07     
    (5/5): ol7_UEKR4/x86_64/primary                            |  39 MB   00:32     
    ol7_UEKR4                                                               711/711
    ol7_latest                                                            8151/8151
    Resolving Dependencies
    --> Running transaction check
    ---> Package bind-utils.x86_64 32:9.9.4-61.el7 will be installed
    --> Processing Dependency: bind-libs = 32:9.9.4-61.el7 for package: 32:bind-utils-9.9.4-61.el7.x86_64
    --> Processing Dependency: libisccc.so.90()(64bit) for package: 32:bind-utils-9.9.4-61.el7.x86_64
    --> Processing Dependency: liblwres.so.90()(64bit) for package: 32:bind-utils-9.9.4-61.el7.x86_64
    --> Processing Dependency: libbind9.so.90()(64bit) for package: 32:bind-utils-9.9.4-61.el7.x86_64
    --> Processing Dependency: libisc.so.95()(64bit) for package: 32:bind-utils-9.9.4-61.el7.x86_64
    --> Processing Dependency: libdns.so.100()(64bit) for package: 32:bind-utils-9.9.4-61.el7.x86_64
    --> Processing Dependency: libisccfg.so.90()(64bit) for package: 32:bind-utils-9.9.4-61.el7.x86_64
    --> Running transaction check
    ---> Package bind-libs.x86_64 32:9.9.4-61.el7 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================
     Package           Arch          Version                Repository         Size
    ================================================================================
    Installing:
     bind-utils        x86_64        32:9.9.4-61.el7        ol7_latest        204 k
    Installing for dependencies:
     bind-libs         x86_64        32:9.9.4-61.el7        ol7_latest        1.0 M
    
    Transaction Summary
    ================================================================================
    Install  1 Package (+1 Dependent package)
    
    Total download size: 1.2 M
    Installed size: 3.0 M
    Is this ok [y/d/N]: y
    Downloading packages:
    warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/bind-utils-9.9.4-61.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
    Public key for bind-utils-9.9.4-61.el7.x86_64.rpm is not installed
    (1/2): bind-utils-9.9.4-61.el7.x86_64.rpm                  | 204 kB   00:00     
    (2/2): bind-libs-9.9.4-61.el7.x86_64.rpm                   | 1.0 MB   00:01     
    --------------------------------------------------------------------------------
    Total                                              847 kB/s | 1.2 MB  00:01     
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    Importing GPG key 0xEC551F03:
     Userid     : "Oracle OSS group (Open Source Software group) "
     Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
     Package    : 7:oraclelinux-release-7.5-1.0.3.el7.x86_64 (@anaconda/7.5)
     From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    Is this ok [y/N]: y
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : 32:bind-libs-9.9.4-61.el7.x86_64                             1/2 
      Installing : 32:bind-utils-9.9.4-61.el7.x86_64                            2/2 
      Verifying  : 32:bind-utils-9.9.4-61.el7.x86_64                            1/2 
      Verifying  : 32:bind-libs-9.9.4-61.el7.x86_64                             2/2 
    
    Installed:
      bind-utils.x86_64 32:9.9.4-61.el7                                             
    
    Dependency Installed:
      bind-libs.x86_64 32:9.9.4-61.el7                                              
    
    Complete!
    

    I have modified /etc/resolv.conf:

    # cat /etc/resolv.conf
    nameserver 192.168.56.143
    search localdomain
    nameserver 192.168.1.254
    

    I have checked DNS:

    # nslookup ol7dec-scan
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.148
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.149
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.150
    
    # 
    
    # nslookup ol7decn1
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7decn1.localdomain
    Address: 192.168.56.138
    
    # nslookup ol7decn2
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7decn2.localdomain
    Address: 192.168.56.139
    
    # ip route
    default via 10.0.2.2 dev enp0s3 proto static metric 101 
    10.0.0.0/8 dev enp0s3 proto kernel scope link src 10.0.2.15 metric 101 
    192.168.43.0/24 dev enp0s9 proto kernel scope link src 192.168.43.138 metric 102 
    192.168.56.0/24 dev enp0s8 proto kernel scope link src 192.168.56.138 metric 100 
    # 
    

    I have updated /etc/hosts with both cluster nodes IP addresses:

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    #
    # Public
    192.168.56.138 ol7decn1 ol7decn1.localdomain
    192.168.56.139 ol7decn2 ol7decn2.localdomain
    # Private
    192.168.43.138 ol7decn1-priv ol7decn1-priv.localdomain
    192.168.43.139 ol7decn2-priv ol7decn2-priv.localdomain
    # VIP
    192.168.56.246 ol7decn1-vip ol7decn1-vip.localdomain^M
    192.168.56.247 ol7decn2-vip ol7decn2-vip.localdomain^M
    #
    192.168.56.148 ol7de-scan.localdomain
    192.168.56.149 ol7de-scan.localdomain
    192.168.56.150 ol7de-scan.localdomain
    #
    
    Shared storage configuration

    I have decided to use ASM Filter Driver (ASMFD) to manage ASM disk devices.

    Even if I currently have only one cluster node I can start to configure shared storage because configuration will be kept by cloning first cluster node VM to second cluster node VM.

    On my host system, I have created 4 virtual disks for 4 ASM disk groups:

  • one for OCR and voting disk (2 GB)
  • one for the Grid Infrastructure Management Repository (GIMR) database mandatory (40 GB)
  • one for databases files (40 GB)
  • one for the fast recovery area (FRA – 20 GB)
  • $ vboxmanage createhd --filename /mnt/wdz/vm/ol7decn1.ol7decn2.sata.1.vdi --size=2048 -format=VDI --variant=fixed
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Medium created. UUID: 8cbfb2a8-e92d-4dc0-bb42-e7984a365160
    $ vboxmanage createhd --filename /mnt/wdz/vm/ol7decn1.ol7decn2.sata.2.vdi --size=40960 -format=VDI --variant=fixed
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Medium created. UUID: c11b8d7f-d5a3-4089-9014-bec5c14a6145
    $ vboxmanage createhd --filename /mnt/wdz/vm/ol7decn1.ol7decn2.sata.3.vdi --size=40960 -format=VDI --variant=fixed
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Medium created. UUID: 55e9d135-466e-4422-b4d1-c0399ebf79db
    $ vboxmanage createhd --filename /mnt/wdz/vm/ol7decn1.ol7decn2.sata.4.vdi --size=20480 -format=VDI --variant=fixed
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Medium created. UUID: 3f119c92-6095-43f0-9a18-d288f428f907
    

    I have shutdown ol7decn1 VM and run following commands to attach the virtual disks and make them shareable:

    $ vboxmanage controlvm ol7decn1 poweroff
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    $ vboxmanage storageattach ol7decn1 --storagectl "SATA" --port 1 --device 0 --type hdd --medium /mnt/wdz/vm/ol7decn1.ol7decn2.sata.1.vdi
    $ vboxmanage storageattach ol7decn1 --storagectl "SATA" --port 2 --device 0 --type hdd --medium /mnt/wdz/vm/ol7decn1.ol7decn2.sata.2.vdi
    $ vboxmanage storageattach ol7decn1 --storagectl "SATA" --port 3 --device 0 --type hdd --medium /mnt/wdz/vm/ol7decn1.ol7decn2.sata.3.vdi
    $ vboxmanage storageattach ol7decn1 --storagectl "SATA" --port 4 --device 0 --type hdd --medium /mnt/wdz/vm/ol7decn1.ol7decn2.sata.4.vdi
    
    $ vboxmanage modifyhd /mnt/wdz/vm/ol7decn1.ol7decn2.sata.1.vdi -type shareable
    $ vboxmanage modifyhd /mnt/wdz/vm/ol7decn1.ol7decn2.sata.2.vdi -type shareable
    $ vboxmanage modifyhd /mnt/wdz/vm/ol7decn1.ol7decn2.sata.3.vdi -type shareable
    $ vboxmanage modifyhd /mnt/wdz/vm/ol7decn1.ol7decn2.sata.4.vdi -type shareable
     
    

    I have restarted ol7decn1 VM …

    $ vboxmanage startvm ol7decn1 
    Waiting for VM "ol7decn1" to power on...
    VM "ol7decn1" has been successfully started.
    

    … and created a single partition on each disk:

    # fdisk /dev/sdb
    Welcome to fdisk (util-linux 2.23.2).
    
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0xe9ec650a.
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p): 
    Using default response p
    Partition number (1-4, default 1): 
    First sector (2048-4194303, default 2048): 
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-4194303, default 4194303): 
    Using default value 4194303
    Partition 1 of type Linux and of size 2 GiB is set
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    # fdisk /dev/sdc
    Welcome to fdisk (util-linux 2.23.2).
    
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0xa47c41e8.
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p): 
    Using default response p
    Partition number (1-4, default 1): 
    First sector (2048-83886079, default 2048): 
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-83886079, default 83886079): 
    Using default value 83886079
    Partition 1 of type Linux and of size 40 GiB is set
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    # fdisk /dev/sdd
    Welcome to fdisk (util-linux 2.23.2).
    
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0x40f31e60.
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p): 
    Using default response p
    Partition number (1-4, default 1): 
    First sector (2048-83886079, default 2048): 
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-83886079, default 83886079): 
    Using default value 83886079
    Partition 1 of type Linux and of size 40 GiB is set
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    # fdisk /dev/sde
    Welcome to fdisk (util-linux 2.23.2).
    
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0x44bce253.
    
    Command (m for help): n
    Partition type:
       p   primary (0 primary, 0 extended, 4 free)
       e   extended
    Select (default p):  
    Using default response p
    Partition number (1-4, default 1): 
    First sector (2048-41943039, default 2048): 
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): 
    Using default value 41943039
    Partition 1 of type Linux and of size 20 GiB is set
    
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
    
    # lsblk
    NAME                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda                    8:0    0   40G  0 disk 
    |-sda1                 8:1    0    1G  0 part /boot
    `-sda2                 8:2    0   38G  0 part 
      |-ol_ol7decn1-root 249:0    0   30G  0 lvm  /
      `-ol_ol7decn1-swap 249:1    0    8G  0 lvm  [SWAP]
    sdb                    8:16   0    2G  0 disk 
    `-sdb1                 8:17   0    2G  0 part 
    sdc                    8:32   0   40G  0 disk 
    `-sdc1                 8:33   0   40G  0 part 
    sdd                    8:48   0   40G  0 disk 
    `-sdd1                 8:49   0   40G  0 part 
    sde                    8:64   0   20G  0 disk 
    `-sde1                 8:65   0   20G  0 part 
    sr0                   11:0    1 1024M  0 rom  
    

    I have retrieved SCSI unique identifiers for the 4 disks:

    # /lib/udev/scsi_id -g -u -d /dev/sdb
    1ATA_VBOX_HARDDISK_VB8cbfb2a8-6051364a
    # /lib/udev/scsi_id -g -u -d /dev/sdc
    1ATA_VBOX_HARDDISK_VBc11b8d7f-45614ac1
    # /lib/udev/scsi_id -g -u -d /dev/sdd
    1ATA_VBOX_HARDDISK_VB55e9d135-db79bf9e
    # /lib/udev/scsi_id -g -u -d /dev/sde
    1ATA_VBOX_HARDDISK_VB3f119c92-07f928f4
    # 
    

    I have created UDEV script /etc/udev/rules.d/99-oracle-asmdevices.rules (because ASMFD will be used udev does not create new device names: this will be managed by ASMFD):

    # cat /etc/udev/rules.d/99-oracle-asmdevices.rules
    KERNEL=="sd?1", OWNER="oracle", GROUP="dba", MODE="0660", PROGRAM="/lib/udev/scsi_id -g -u /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB8cbfb2a8-6051364a"
    KERNEL=="sd?1", OWNER="oracle", GROUP="dba", MODE="0660", PROGRAM="/lib/udev/scsi_id -g -u /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBc11b8d7f-45614ac1"
    KERNEL=="sd?1", OWNER="oracle", GROUP="dba", MODE="0660", PROGRAM="/lib/udev/scsi_id -g -u /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB55e9d135-db79bf9e"
    KERNEL=="sd?1", OWNER="oracle", GROUP="dba", MODE="0660", PROGRAM="/lib/udev/scsi_id -g -u /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VB3f119c92-07f928f4"
    

    I have rebooted …:

    # systemctl reboot
    

    … and checked disk device names:

    # ls -al /dev/sd*
    brw-rw----. 1 root disk 8,  0 Jul 15 10:50 /dev/sda
    brw-rw----. 1 root disk 8,  1 Jul 15 10:50 /dev/sda1
    brw-rw----. 1 root disk 8,  2 Jul 15 10:50 /dev/sda2
    brw-rw----. 1 root disk 8, 16 Jul 15 10:50 /dev/sdb
    brw-rw----. 1 root root 8, 17 Jul 15 10:50 /dev/sdb1
    brw-rw----. 1 root disk 8, 32 Jul 15 10:50 /dev/sdc
    brw-rw----. 1 root root 8, 33 Jul 15 10:50 /dev/sdc1
    brw-rw----. 1 root disk 8, 48 Jul 15 10:50 /dev/sdd
    brw-rw----. 1 root root 8, 49 Jul 15 10:50 /dev/sdd1
    brw-rw----. 1 root disk 8, 64 Jul 15 10:50 /dev/sde
    brw-rw----. 1 root root 8, 65 Jul 15 10:50 /dev/sde1
    
    Clone first cluster node to second cluster node

    I have shutdown ol7decn1 and I have first cloned ol7decn1 system disk:

    $ vboxmanage controlvm ol7decn1 poweroff
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    $  vboxmanage clonehd  /mnt/wdz/vm/ol7decn1.vdi.sata.0.vdi /mnt/wdz/vm/ol7decn2.vdi.sata.0.vdi
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Clone medium created in format 'VDI'. UUID: 05b9cae1-b69d-41ef-bf19-dcd14ffe979a
    

    Using VBOX GUI I have created a new VM named ol7decn2 using ol7decn2.sata.0.vdi as system disk.

    I have set the same properties for ol7decn2 as for ol7decn1:

  • RAM: 8GB
  • 3 network interfaces (the first one attached to NAT and the second and third one attached to Host-Only Adapter).
  • I have attached the 4 shared disks to ol7decn2:

    $ vboxmanage storageattach  ol7decn2 --storagectl "SATA" --port 1 --device 0 --type hdd --medium /mnt/wdz/vm/ol7decn1.ol7decn2.sata.1.vdi  --mtype shareable
    $ vboxmanage storageattach  ol7decn2 --storagectl "SATA" --port 2 --device 0 --type hdd --medium /mnt/wdz/vm/ol7decn1.ol7decn2.sata.2.vdi  --mtype shareable
    $ vboxmanage storageattach  ol7decn2 --storagectl "SATA" --port 3 --device 0 --type hdd --medium /mnt/wdz/vm/ol7decn1.ol7decn2.sata.3.vdi  --mtype shareable
    $ vboxmanage storageattach  ol7decn2 --storagectl "SATA" --port 4 --device 0 --type hdd --medium /mnt/wdz/vm/ol7decn1.ol7decn2.sata.4.vdi  --mtype shareable
    $ 
    

    I have started ol7decn2 and from the console modified the hostname:

    # cat /etc/hostname
    ol7decn2.localdomain
    #
    

    From the console I have reconfigured the public network interface and the interconnect network interface:

    # nmcli con del enp0s8
    # nmcli connection add type ethernet con-name enp0s8 ifname enp0s8 ip4 192.168.56.139/24
    # nmcli con del enp0s9
    # nmcli connection add type ethernet con-name enp0s9 ifname enp0s9 ip4 192.168.43.139/24
    

    Now I can connect with SSH and check network configuration:

    # ip addr
    1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:97:01:43 brd ff:ff:ff:ff:ff:ff
        inet 10.0.2.15/8 brd 10.255.255.255 scope global noprefixroute enp0s3
           valid_lft forever preferred_lft forever
        inet6 fe80::29ab:3073:bbe8:acd/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    3: enp0s8:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:21:c2:65 brd ff:ff:ff:ff:ff:ff
        inet 192.168.56.139/24 brd 192.168.56.255 scope global noprefixroute enp0s8
           valid_lft forever preferred_lft forever
        inet6 fe80::bef4:a06f:aacb:d0ad/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    4: enp0s9:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:bc:d0:50 brd ff:ff:ff:ff:ff:ff
        inet 192.168.43.139/24 brd 192.168.43.255 scope global noprefixroute enp0s9
           valid_lft forever preferred_lft forever
        inet6 fe80::a745:1d47:77de:b3bb/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    # nmcli dev status
    DEVICE  TYPE      STATE      CONNECTION 
    enp0s3  ethernet  connected  enp0s3     
    enp0s8  ethernet  connected  enp0s8     
    enp0s9  ethernet  connected  enp0s9     
    lo      loopback  unmanaged  --         
    

    Note that there is no need to reconfigure the NAT network interface.

    I have rebooted ol7decn2 …

    # systemctl reboot
    

    … and checked that network interfaces are up and that DNS is OK:

    1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default 
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: enp0s3:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:97:01:43 brd ff:ff:ff:ff:ff:ff
        inet 10.0.2.15/8 brd 10.255.255.255 scope global noprefixroute enp0s3
           valid_lft forever preferred_lft forever
        inet6 fe80::29ab:3073:bbe8:acd/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    3: enp0s8:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:21:c2:65 brd ff:ff:ff:ff:ff:ff
        inet 192.168.56.139/24 brd 192.168.56.255 scope global noprefixroute enp0s8
           valid_lft forever preferred_lft forever
        inet6 fe80::bef4:a06f:aacb:d0ad/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    4: enp0s9:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 08:00:27:bc:d0:50 brd ff:ff:ff:ff:ff:ff
        inet 192.168.43.139/24 brd 192.168.43.255 scope global noprefixroute enp0s9
           valid_lft forever preferred_lft forever
        inet6 fe80::a745:1d47:77de:b3bb/64 scope link noprefixroute 
           valid_lft forever preferred_lft forever
    # ip route
    default via 10.0.2.2 dev enp0s3 proto static metric 100 
    10.0.0.0/8 dev enp0s3 proto kernel scope link src 10.0.2.15 metric 100 
    192.168.43.0/24 dev enp0s9 proto kernel scope link src 192.168.43.139 metric 102 
    192.168.56.0/24 dev enp0s8 proto kernel scope link src 192.168.56.139 metric 101 
    # nslookup ol7dec-scan
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.149
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.150
    Name:	ol7dec-scan.localdomain
    Address: 192.168.56.148
    # nslookup ol7decn1
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7decn1.localdomain
    Address: 192.168.56.138
    
    # nslookup ol7decn2
    Server:		192.168.56.143
    Address:	192.168.56.143#53
    
    Name:	ol7decn2.localdomain
    Address: 192.168.56.139
    
    preinstallation RPM installation and SSH configuration

    On both nodes I have enabled ol7_u5_base YUM repository for 18c preinstallation RPM in /etc/yum.repos.d/public-yum-ol7.repo:

    [ol7_u5_base]
    name=Oracle Linux $releasever Update 5 installation media copy ($basearch)
    baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/5/base/$basearch/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpgcheck=1
    enabled=1
    

    On both nodes I have installed the 18c preinstallation RPM with root account:

    # yum install -y oracle-database-preinstall-18c
    

    I have configured passwordless ssh between the 2 cluster nodes for oracle account.

    First I have set oracle password on both nodes (note that oracle account has been created by the preinstallation RPM):

    # id oracle
    uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
    # passwd oracle
    Changing password for user oracle.
    New password:
    BAD PASSWORD: The password is shorter than 8 characters
    Retype new password:
    passwd: all authentication tokens updated successfully.
    #
    

    I have run with oracle account on first cluster node:

    $ ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/oracle/.ssh/id_rsa): 
    Created directory '/home/oracle/.ssh'.
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/oracle/.ssh/id_rsa.
    Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
    The key fingerprint is:
    SHA256:EMJjdVtnyc5qyYwg6+9D76QTy3qzIxQZim40S9cxa3s oracle@ol7decn1.localdomain
    The key's randomart image is:
    +---[RSA 2048]----+
    |   ...o . ..o.   |
    |    =+ o o oo    |
    | . o.+= .  o     |
    |.+..++..    o    |
    |+ + .+..S+ o     |
    | +  o.oE. *      |
    |.  o o.+..       |
    |    o Oo.        |
    |    .*=B.        |
    +----[SHA256]-----+
    $ ssh-copy-id ol7decn2
    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"
    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    oracle@ol7decn2's password: 
    
    Number of key(s) added: 1
    
    Now try logging into the machine, with:   "ssh 'ol7decn2'"
    and check to make sure that only the key(s) you wanted were added.
    
    

    I have run with oracle account on cluster node 2 ol7decn2:

    $ ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/oracle/.ssh/id_rsa): 
    Created directory '/home/oracle/.ssh'.
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/oracle/.ssh/id_rsa.
    Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
    The key fingerprint is:
    SHA256:WLm1YGfQA4vx9JgCZIVTl+d/6Z/Llnl7PaDfAbJi1DY oracle@ol7decn2.localdomain
    The key's randomart image is:
    +---[RSA 2048]----+
    |   .+++ =+       |
    |   .o. *.B+      |
    |     .o Xo=.     |
    |       = *o.     |
    |      . S..E . . |
    |        . . =.+  |
    |         o ..o..+|
    |        . ..  +=*|
    |            ...BB|
    +----[SHA256]-----+
    $ ssh-copy-id ol7decn1
    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"
    The authenticity of host 'ol7decn1 (192.168.56.138)' can't be established.
    ECDSA key fingerprint is SHA256:xo4lc6xkmEsFroCbIFcGUuWa2yuF7OUzPLVedKhk5dU.
    ECDSA key fingerprint is MD5:d2:ef:bc:d9:b7:2a:e5:1f:91:e5:78:42:1b:a5:6e:3a.
    Are you sure you want to continue connecting (yes/no)? yes
    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    oracle@ol7decn1's password: 
    
    Number of key(s) added: 1
    
    Now try logging into the machine, with:   "ssh 'ol7decn1'"
    and check to make sure that only the key(s) you wanted were added.
    

    I have checked that I can connect to each remote node without password.

    From ol7decn1 to ol7decn2:

    $ ssh ol7decn2
    Last failed login: Sat Jul 28 15:22:39 CEST 2018 from ol7decn1 on ssh:notty
    There was 1 failed login attempt since the last successful login.
    Last login: Sat Jul 28 15:19:27 2018
    $ logout
    Connection to ol7decn2 closed.
    

    From ol7decn2 to ol7decn1:

    $ ssh ol7decn1
    Last login: Sat Jul 28 15:21:09 2018
    $ logout
    Connection to ol7decn1 closed.
    

    I have also enabled passwordless ssh on each node with local ssh connection (i.e. from ol7decn1 to ol7decn1 and from ol7decn2 to ol7decn2):

    $ ssh-copy-id ol7decn1
    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"
    The authenticity of host 'ol7decn1 (192.168.56.138)' can't be established.
    ECDSA key fingerprint is SHA256:xo4lc6xkmEsFroCbIFcGUuWa2yuF7OUzPLVedKhk5dU.
    ECDSA key fingerprint is MD5:d2:ef:bc:d9:b7:2a:e5:1f:91:e5:78:42:1b:a5:6e:3a.
    Are you sure you want to continue connecting (yes/no)? yes
    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    oracle@ol7decn1's password: 
    
    Number of key(s) added: 1
    
    Now try logging into the machine, with:   "ssh 'ol7decn1'"
    and check to make sure that only the key(s) you wanted were added.
    

    and:

    $ ssh-copy-id ol7decn2
    /bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"
    The authenticity of host 'ol7decn2 (192.168.56.139)' can't be established.
    ECDSA key fingerprint is SHA256:xo4lc6xkmEsFroCbIFcGUuWa2yuF7OUzPLVedKhk5dU.
    ECDSA key fingerprint is MD5:d2:ef:bc:d9:b7:2a:e5:1f:91:e5:78:42:1b:a5:6e:3a.
    Are you sure you want to continue connecting (yes/no)? yes
    /bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    oracle@ol7decn2's password: 
    
    Number of key(s) added: 1
    
    Now try logging into the machine, with:   "ssh 'ol7decn2'"
    and check to make sure that only the key(s) you wanted were added.
    

    I have checked that I connect locally on each node without password:

    $ ssh ol7decn1 hostname
    ol7decn1.localdomain
    

    and:

    $ ssh ol7decn2 hostname
    ol7decn2.localdomain
    
    CLUVFY step

    I have uploaded Grid Infrastructure 18c media to first cluster node after creating /stage directory:

    # mkdir /stage
    # chown oracle:dba /stage
    

    I have run with oracle account:

    $ cd /stage
    $ unzip LINUX.X64_180000_grid_home.zip 
    

    I have run CLUVFY :

    ./runcluvfy.sh stage -pre crsinst -n "ol7decn1,ol7decn2"
    
    ERROR: 
    PRVG-10467 : The default Oracle Inventory group could not be determined.
    
    Verifying Physical Memory ...FAILED (PRVF-7530)
    Verifying Available Physical Memory ...PASSED
    Verifying Swap Size ...PASSED
    Verifying Free Space: ol7decn2:/usr,ol7decn2:/var,ol7decn2:/etc,ol7decn2:/sbin,ol7decn2:/tmp ...PASSED
    Verifying Free Space: ol7decn1:/usr,ol7decn1:/var,ol7decn1:/etc,ol7decn1:/sbin,ol7decn1:/tmp ...PASSED
    Verifying User Existence: oracle ...
      Verifying Users With Same UID: 54321 ...PASSED
    Verifying User Existence: oracle ...PASSED
    Verifying Group Existence: asmadmin ...FAILED (PRVG-10461)
    Verifying Group Existence: asmdba ...FAILED (PRVG-10461)
    Verifying Group Membership: asmadmin ...FAILED (PRVG-10460)
    Verifying Group Membership: asmdba ...FAILED (PRVG-10460)
    Verifying Run Level ...PASSED
    Verifying Hard Limit: maximum open file descriptors ...PASSED
    Verifying Soft Limit: maximum open file descriptors ...PASSED
    Verifying Hard Limit: maximum user processes ...PASSED
    Verifying Soft Limit: maximum user processes ...PASSED
    Verifying Soft Limit: maximum stack size ...PASSED
    Verifying Architecture ...PASSED
    Verifying OS Kernel Version ...PASSED
    Verifying OS Kernel Parameter: semmsl ...PASSED
    Verifying OS Kernel Parameter: semmns ...PASSED
    Verifying OS Kernel Parameter: semopm ...PASSED
    Verifying OS Kernel Parameter: semmni ...PASSED
    Verifying OS Kernel Parameter: shmmax ...PASSED
    Verifying OS Kernel Parameter: shmmni ...PASSED
    Verifying OS Kernel Parameter: shmall ...PASSED
    Verifying OS Kernel Parameter: file-max ...PASSED
    Verifying OS Kernel Parameter: ip_local_port_range ...PASSED
    Verifying OS Kernel Parameter: rmem_default ...PASSED
    Verifying OS Kernel Parameter: rmem_max ...PASSED
    Verifying OS Kernel Parameter: wmem_default ...PASSED
    Verifying OS Kernel Parameter: wmem_max ...PASSED
    Verifying OS Kernel Parameter: aio-max-nr ...PASSED
    Verifying OS Kernel Parameter: panic_on_oops ...PASSED
    Verifying Package: binutils-2.23.52.0.1 ...PASSED
    Verifying Package: compat-libcap1-1.10 ...PASSED
    Verifying Package: libgcc-4.8.2 (x86_64) ...PASSED
    Verifying Package: libstdc++-4.8.2 (x86_64) ...PASSED
    Verifying Package: libstdc++-devel-4.8.2 (x86_64) ...PASSED
    Verifying Package: sysstat-10.1.5 ...PASSED
    Verifying Package: ksh ...PASSED
    Verifying Package: make-3.82 ...PASSED
    Verifying Package: glibc-2.17 (x86_64) ...PASSED
    Verifying Package: glibc-devel-2.17 (x86_64) ...PASSED
    Verifying Package: libaio-0.3.109 (x86_64) ...PASSED
    Verifying Package: libaio-devel-0.3.109 (x86_64) ...PASSED
    Verifying Package: nfs-utils-1.2.3-15 ...PASSED
    Verifying Package: smartmontools-6.2-4 ...PASSED
    Verifying Package: net-tools-2.0-0.17 ...PASSED
    Verifying Port Availability for component "Oracle Notification Service (ONS)" ...PASSED
    Verifying Port Availability for component "Oracle Cluster Synchronization Services (CSSD)" ...PASSED
    Verifying Users With Same UID: 0 ...PASSED
    Verifying Current Group ID ...PASSED
    Verifying Root user consistency ...PASSED
    Verifying Package: cvuqdisk-1.0.10-1 ...FAILED (PRVG-11550)
    Verifying Host name ...PASSED
    Verifying Node Connectivity ...
      Verifying Hosts File ...PASSED
      Verifying Check that maximum (MTU) size packet goes through subnet ...PASSED
      Verifying subnet mask consistency for subnet "10.0.0.0" ...PASSED
      Verifying subnet mask consistency for subnet "192.168.56.0" ...PASSED
      Verifying subnet mask consistency for subnet "192.168.43.0" ...PASSED
    Verifying Node Connectivity ...FAILED (PRVG-1172, PRVG-11067, PRVG-11095)
    Verifying Multicast or broadcast check ...PASSED
    Verifying Network Time Protocol (NTP) ...
      Verifying '/etc/ntp.conf' ...PASSED
      Verifying '/etc/chrony.conf' ...PASSED
      Verifying '/var/run/ntpd.pid' ...PASSED
      Verifying '/var/run/chronyd.pid' ...PASSED
    Verifying Network Time Protocol (NTP) ...PASSED
    Verifying Same core file name pattern ...PASSED
    Verifying User Mask ...PASSED
    Verifying User Not In Group "root": oracle ...PASSED
    Verifying Time zone consistency ...PASSED
    Verifying Time offset between nodes ...PASSED
    Verifying resolv.conf Integrity ...FAILED (PRVG-10048)
    Verifying DNS/NIS name service ...PASSED
    Verifying Domain Sockets ...PASSED
    Verifying /boot mount ...PASSED
    Verifying Daemon "avahi-daemon" not configured and running ...PASSED
    Verifying Daemon "proxyt" not configured and running ...PASSED
    Verifying User Equivalence ...PASSED
    Verifying /dev/shm mounted as temporary file system ...PASSED
    Verifying File system mount options for path /var ...PASSED
    Verifying zeroconf check ...PASSED
    Verifying ASM Filter Driver configuration ...PASSED
    
    Pre-check for cluster services setup was unsuccessful on all the nodes. 
    
    
    Failures were encountered during execution of CVU verification request "stage -pre crsinst".
    
    Verifying Physical Memory ...FAILED
    ol7decn2: PRVF-7530 : Sufficient physical memory is not available on node
              "ol7decn2" [Required physical memory = 8GB (8388608.0KB)]
    
    ol7decn1: PRVF-7530 : Sufficient physical memory is not available on node
              "ol7decn1" [Required physical memory = 8GB (8388608.0KB)]
    
    Verifying Group Existence: asmadmin ...FAILED
    ol7decn2: PRVG-10461 : Group "asmadmin" selected for privileges "OSASM" does
              not exist on node "ol7decn2".
    
    ol7decn1: PRVG-10461 : Group "asmadmin" selected for privileges "OSASM" does
              not exist on node "ol7decn1".
    
    Verifying Group Existence: asmdba ...FAILED
    ol7decn2: PRVG-10461 : Group "asmdba" selected for privileges "OSDBA" does not
              exist on node "ol7decn2".
    
    ol7decn1: PRVG-10461 : Group "asmdba" selected for privileges "OSDBA" does not
              exist on node "ol7decn1".
    
    Verifying Group Membership: asmadmin ...FAILED
    ol7decn2: PRVG-10460 : User "oracle" does not belong to group "asmadmin"
              selected for privileges "OSASM" on node "ol7decn2".
    
    ol7decn1: PRVG-10460 : User "oracle" does not belong to group "asmadmin"
              selected for privileges "OSASM" on node "ol7decn1".
    
    Verifying Group Membership: asmdba ...FAILED
    ol7decn2: PRVG-10460 : User "oracle" does not belong to group "asmdba" selected
              for privileges "OSDBA" on node "ol7decn2".
    
    ol7decn1: PRVG-10460 : User "oracle" does not belong to group "asmdba" selected
              for privileges "OSDBA" on node "ol7decn1".
    
    Verifying Package: cvuqdisk-1.0.10-1 ...FAILED
    ol7decn2: PRVG-11550 : Package "cvuqdisk" is missing on node "ol7decn2"
    
    ol7decn1: PRVG-11550 : Package "cvuqdisk" is missing on node "ol7decn1"
    
    Verifying Node Connectivity ...FAILED
    PRVG-1172 : The IP address "10.0.2.15" is on multiple interfaces "enp0s3" on
    nodes "ol7decn2,ol7decn1"
    
    ol7decn2: PRVG-11067 : TCP connectivity from node "ol7decn2": "10.0.2.15" to
              node "ol7decn2": "10.0.2.15" failed.
              PRVG-11095 : The TCP system call "connect" failed with error "111"
              while executing exectask on node "ol7decn2"
              Connection refused
    ol7decn2: PRVG-11067 : TCP connectivity from node "ol7decn2": "10.0.2.15" to
              node "ol7decn1": "10.0.2.15" failed.
              PRVG-11095 : The TCP system call "connect" failed with error "111"
              while executing exectask on node "ol7decn2"
              Connection refused
    
    Verifying resolv.conf Integrity ...FAILED
    ol7decn2: PRVG-10048 : Name "ol7decn2" was not resolved to an address of the
              specified type by name servers o"192.168.1.254".
    
    ol7decn1: PRVG-10048 : Name "ol7decn1" was not resolved to an address of the
              specified type by name servers o"192.168.1.254".
    
    
    CVU operation performed:      stage -pre crsinst
    Date:                         Jul 28, 2018 3:48:26 PM
    CVU home:                     /stage/
    User:                         oracle
    $
    

    I have ignored all warnings.

    The 2 cluster nodes are now ready for Grid Infrastructure installation.

    Categories: DBA Blogs

    Oracle Database 18c silent installation and database creation on Oracle Linux

    Mon, 2018-07-23 16:59

    Today 23rd of July 2018 Oracle Corp. has released Oracle 18c for Linux on OTN.

    Silent Oracle Database installation

    This is my first 18c installation on a new Oracle Linux 7.5 virtual machine (VM) using a minimal Linux installation:

    # cat /etc/redhat-release 
    Red Hat Enterprise Linux Server release 7.5 (Maipo)
    # cat /etc/os-release 
    NAME="Oracle Linux Server"
    VERSION="7.5"
    ID="ol"
    VERSION_ID="7.5"
    PRETTY_NAME="Oracle Linux Server 7.5"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:oracle:linux:7:5:server"
    HOME_URL="https://linux.oracle.com/"
    BUG_REPORT_URL="https://bugzilla.oracle.com/"
    
    ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
    ORACLE_BUGZILLA_PRODUCT_VERSION=7.5
    ORACLE_SUPPORT_PRODUCT="Oracle Linux"
    ORACLE_SUPPORT_PRODUCT_VERSION=7.5
    # 
    

    This VM has 4 GB of RMAN (and 4 GB of swap space), one single 40 GB disk and is connected to internet to be able to access Oracle Linux public yum repository.

    I have enabled in /etc/yum.repos.d/public-yum-ol7.repo:

    [ol7_u5_base]
    name=Oracle Linux $releasever Update 5 installation media copy ($basearch)
    baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/5/base/$basearch/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
    gpgcheck=1
    enabled=1
    

    I have checked YUM repositories with:

    # yum repolist                     
    Loaded plugins: ulninfo
    ol7_UEKR4/x86_64/primary                                       |  40 MB  00:00:51     
    ol7_UEKR4                                                                     732/732
    ol7_latest                                                                  8173/8173
    ol7_u5_base                                                                 7278/7278
    repo id            repo name                                                    status
    ol7_UEKR4/x86_64   Latest Unbreakable Enterprise Kernel Release 4 for Oracle Li   732
    ol7_latest/x86_64  Oracle Linux 7Server Latest (x86_64)                         8 173
    ol7_u5_base/x86_64 Oracle Linux 7Server Update 5 installation media copy (x86_6 7 278
    repolist: 16 183
    

    I have checked that Oracle 18c preinstallation RPM is available:

    # yum info *preinstall* | grep Name 
    Name        : oracle-database-preinstall-18c
    Name        : oracle-database-server-12cR2-preinstall
    Name        : oracle-rdbms-server-11gR2-preinstall
    Name        : oracle-rdbms-server-12cR1-preinstall
    

    I have installed 18c preinstallation RPM to ease Oracle installation using Internet connection. I have connected as root and run:

    # yum -y install  oracle-database-preinstall-18c
    

    Note that preinstallation RPM has also created oracle account:

    # id oracle
    uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
    

    I have downloaded from OTN Oracle 18c installation media:

    $ ls -rtl
    total 4457668
    -rw-r--r--. 1 oracle oinstall 4564649047 Jul 23 21:54 LINUX.X64_180000_db_home.zip
    

    I have created a target Oracle Home directrory with root account:

    # mkdir -p /u01/db18c
    # chown oracle:dba /u01/db18c
    

    I have unzipped installation media into this directory:

    $ cd /u01/db18c
    $ unzip /stage/LINUX.X64_180000_db_home.zip 
    

    I have created Oracle Base and Oracle Inventory directories with root account:

    # mkdir /u01/base
    # chown oracle:dba /u01/base
    # mkdir /u01/orainv
    # chown oracle:dba /orainv
    

    I have run following script from /u01/db18c/ with oracle account:

    ./runInstaller \
    -silent \
    -responseFile /u01/db18c/install/response/db_install.rsp \
       oracle.install.option=INSTALL_DB_SWONLY             \
       UNIX_GROUP_NAME=oinstall                            \
       INVENTORY_LOCATION=/u01/orainv                      \
       SELECTED_LANGUAGES=en                               \
       ORACLE_HOME=/u01/db18c                              \
       ORACLE_BASE=/u01/base                               \
       oracle.install.db.InstallEdition=EE                 \
       oracle.install.db.isCustomInstall=false             \
       oracle.install.db.OSDBA_GROUP=dba                   \
       oracle.install.db.OSBACKUPDBA_GROUP=dba             \
       oracle.install.db.OSDGDBA_GROUP=dba                 \
       oracle.install.db.OSKMDBA_GROUP=dba                 \
       oracle.install.db.OSRACDBA_GROUP=dba                \
       SECURITY_UPDATES_VIA_MYORACLESUPPORT=false          \
       DECLINE_SECURITY_UPDATES=true
    

    Running the script has generated following output:

    Launching Oracle Database Setup Wizard...
    
    [WARNING] [INS-13014] Target environment does not meet some optional requirements.
       CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2018-07-23_10-22-54PM.log
       ACTION: Identify the list of failed prerequisite checks from the log: installActions2018-07-23_10-22-54PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
    The response file for this session can be found at:
     /u01/db18c/install/response/db_2018-07-23_10-22-54PM.rsp
    
    You can find the log of this install session at:
     /tmp/InstallActions2018-07-23_10-22-54PM/installActions2018-07-23_10-22-54PM.log
    
    As a root user, execute the following script(s):
    	1. /u01/orainv/orainstRoot.sh
    	2. /u01/db18c/root.sh
    
    Execute /u01/orainv/orainstRoot.sh on the following nodes: 
    [ol7defs0]
    Execute /u01/db18c/root.sh on the following nodes: 
    [ol7defs0]
    
    
    Successfully Setup Software with warning(s).
    Moved the install session logs to:
     /u01/orainv/logs/InstallActions2018-07-23_10-22-54PM
    

    I have ignored following warning:

    INFO:  [Jul 23, 2018 10:23:12 PM] ------------------List of failed Tasks------------------
    INFO:  [Jul 23, 2018 10:23:12 PM] *********************************************
    INFO:  [Jul 23, 2018 10:23:12 PM] Physical Memory: This is a prerequisite condition to test whether the system has at least 8GB (8388608.0KB) of total physical memory.
    INFO:  [Jul 23, 2018 10:23:12 PM] Severity:IGNORABLE
    INFO:  [Jul 23, 2018 10:23:12 PM] OverallStatus:VERIFICATION_FAILED
    INFO:  [Jul 23, 2018 10:23:12 PM] -----------------End of failed Tasks List----------------
    

    I have run with user root:

    # /u01/orainv/orainstRoot.sh
    Changing permissions of /u01/orainv.
    Adding read,write permissions for group.
    Removing read,write,execute permissions for world.
    
    Changing groupname of /u01/orainv to oinstall.
    The execution of the script is complete.
    # /u01/db18c/root.sh
    Check /u01/db18c/install/root_ol7defs0_2018-07-23_22-31-41-412574476.log for the output of root script
    # cat /u01/db18c/install/root_ol7defs0_2018-07-23_22-31-41-412574476.log
    Performing root user operation.
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/db18c
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    
    Creating /etc/oratab file...
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    Oracle Trace File Analyzer (TFA) is available at : /u01/db18c/suptools/tfa/release/tfa_home/bin/tfactl 
    

    I have checked detailed Oracle Database version:

    $ export ORACLE_HOME=/u01/db18c
    $ export PATH=$ORACLE_HOME/bin:$PATH
    $ $ORACLE_HOME/OPatch/opatch lsinv
    Oracle Interim Patch Installer version 12.2.0.1.14
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u01/db18c
    Central Inventory : /u01/orainv
       from           : /u01/db18c/oraInst.loc
    OPatch version    : 12.2.0.1.14
    OUI version       : 12.2.0.4.0
    Log file location : /u01/db18c/cfgtoollogs/opatch/opatch2018-07-23_22-35-16PM_1.log
    
    Lsinventory Output file location : /u01/db18c/cfgtoollogs/opatch/lsinv/lsinventory2018-07-23_22-35-16PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: ol7defs0
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Database 18c                                                  18.0.0.0.0
    There are 1 products installed in this Oracle Home.
    
    
    Interim patches (4) :
    
    Patch  27908644     : applied on Wed Jul 18 19:44:11 CEST 2018
    Unique Patch ID:  22153180
    Patch description:  "UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171"
       Created on 4 May 2018, 01:21:02 hrs PST8PDT
       Bugs fixed:
         27908644
    
    Patch  27923415     : applied on Wed Jul 18 19:41:38 CEST 2018
    Unique Patch ID:  22239273
    Patch description:  "OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)"
       Created on 15 Jul 2018, 10:33:22 hrs PST8PDT
       Bugs fixed:
         27304131, 27539876, 27952586, 27642235, 27636900, 27461740
    
    Patch  28090553     : applied on Wed Jul 18 19:40:01 CEST 2018
    Unique Patch ID:  22256940
    Patch description:  "OCW RELEASE UPDATE 18.3.0.0.0 (28090553)"
       Created on 11 Jul 2018, 19:20:31 hrs PST8PDT
       Bugs fixed:
         12816839, 18701017, 22734786, 23698980, 23840305, 25709124, 25724089
         26299684, 26313403, 26433972, 26527054, 26586174, 26587652, 26647619
         26827699, 26860285, 26882126, 26882316, 26943660, 26996813, 27012915
         27018734, 27032726, 27034318, 27040560, 27080748, 27086406, 27092991
         27098733, 27106915, 27114112, 27121566, 27133637, 27144533, 27153755
         27166715, 27174938, 27174948, 27177551, 27177852, 27182006, 27182064
         27184253, 27204476, 27212837, 27213140, 27220610, 27222423, 27222938
         27238077, 27238258, 27249544, 27252023, 27257509, 27263677, 27265816
         27267992, 27271876, 27274143, 27285557, 27299455, 27300007, 27302415
         27309182, 27314512, 27315159, 27320985, 27334353, 27338838, 27346984
         27358232, 27362190, 27370933, 27377219, 27378959, 27379846, 27379956
         27393421, 27398223, 27399499, 27399762, 27399985, 27401618, 27403244
         27404599, 27426277, 27428790, 27430219, 27430254, 27433163, 27452897
         27458829, 27465480, 27475272, 27481406, 27481765, 27492916, 27496806
         27503318, 27503413, 27508936, 27508984, 27513114, 27519708, 27526362
         27528204, 27532009, 27534289, 27560562, 27560735, 27573154, 27573408
         27574335, 27577122, 27579969, 27581484, 27593587, 27595801, 27600706
         27609819, 27625010, 27625050, 27627992, 27654039, 27657467, 27657920
         27668379, 27682288, 27691717, 27702244, 27703242, 27708711, 27714373
         27725967, 27731346, 27734470, 27735534, 27739957, 27740854, 27747407
         27748321, 27757979, 27766679, 27768034, 27778433, 27782464, 27783059
         27786669, 27786699, 27801774, 27811439, 27839732, 27850736, 27862636
         27864737, 27865439, 27889841, 27896388, 27897639, 27906509, 27931506
         27935826, 27941514, 27957892, 27978668, 27984314, 27993298, 28023410
         28025398, 28032758, 28039471, 28039953, 28045209, 28099592, 28109698
         28174926, 28182503, 28204423, 28240153
    
    Patch  28090523     : applied on Wed Jul 18 19:39:24 CEST 2018
    Unique Patch ID:  22329768
    Patch description:  "Database Release Update : 18.3.0.0.180717 (28090523)"
       Created on 14 Jul 2018, 00:03:50 hrs PST8PDT
       Bugs fixed:
         9062315, 13554903, 21547051, 21766220, 21806121, 23003564, 23310101
         24489904, 24689376, 24737581, 24925863, 25035594, 25035599, 25287072
         25348956, 25634405, 25726981, 25743479, 25824236, 25943740, 26226953
         26336101, 26423085, 26427905, 26450454, 26476244, 26598422, 26615291
         26646549, 26654411, 26731697, 26785169, 26792891, 26818960, 26822620
         26843558, 26843664, 26846077, 26894737, 26898279, 26928317, 26933599
         26956033, 26961415, 26966120, 26986173, 26992964, 27005278, 27026401
         27028251, 27030974, 27036408, 27038986, 27041253, 27044575, 27047831
         27053044, 27058530, 27060167, 27060859, 27061736, 27066451, 27066519
         27073066, 27086821, 27090765, 27101527, 27101652, 27110878, 27112686
         27119621, 27126666, 27128580, 27135647, 27143756, 27143882, 27147979
         27153641, 27155549, 27156355, 27163928, 27169796, 27181521, 27181537
         27189611, 27190851, 27193810, 27199245, 27208953, 27210038, 27210872
         27214085, 27215007, 27216224, 27221900, 27222121, 27222626, 27224987
         27226913, 27232983, 27233563, 27236052, 27236110, 27240246, 27240570
         27241221, 27241247, 27244337, 27244785, 27249215, 27250547, 27254851
         27258578, 27259386, 27259983, 27262650, 27262945, 27263276, 27263996
         27270197, 27274456, 27274536, 27275136, 27275776, 27282707, 27283029
         27283960, 27284499, 27285244, 27288230, 27292213, 27294480, 27301308
         27301568, 27302594, 27302681, 27302695, 27302711, 27302730, 27302777
         27302800, 27302960, 27304410, 27304936, 27305318, 27307868, 27310092
         27313687, 27314206, 27314390, 27318869, 27321179, 27321834, 27326204
         27329812, 27330158, 27330161, 27333658, 27333664, 27333693, 27334316
         27334648, 27335682, 27338912, 27338946, 27339115, 27339396, 27339483
         27339495, 27341036, 27345190, 27345231, 27345450, 27345498, 27346329
         27346644, 27346709, 27346949, 27347126, 27348081, 27348707, 27349393
         27352600, 27354783, 27356373, 27357773, 27358241, 27359178, 27359368
         27360126, 27364891, 27364916, 27364947, 27365139, 27365702, 27365993
         27367194, 27368850, 27372756, 27375260, 27375542, 27376871, 27378103
         27379233, 27381383, 27381656, 27384222, 27389352, 27392187, 27395404
         27395416, 27395794, 27396357, 27396365, 27396377, 27396624, 27396666
         27396672, 27396813, 27398080, 27398660, 27401637, 27405242, 27405696
         27410300, 27410595, 27412805, 27417186, 27420715, 27421101, 27422874
         27423251, 27425507, 27425622, 27426363, 27427805, 27430802, 27432338
         27432355, 27433870, 27434050, 27434193, 27434486, 27434974, 27435537
         27439835, 27441326, 27442041, 27444727, 27445330, 27445462, 27447452
         27447687, 27448162, 27450355, 27450400, 27450783, 27451049, 27451182
         27451187, 27451531, 27452760, 27453225, 27457666, 27457891, 27458164
         27459909, 27460675, 27467543, 27469329, 27471876, 27472969, 27473800
         27479358, 27483974, 27484556, 27486253, 27487795, 27489719, 27496224
         27496308, 27497950, 27498477, 27501327, 27501413, 27501465, 27502420
         27504190, 27505603, 27506774, 27508985, 27511196, 27512439, 27517818
         27518227, 27518310, 27520070, 27520900, 27522245, 27523368, 27523800
         27525909, 27532375, 27533819, 27534509, 27537472, 27544030, 27545630
         27547732, 27550341, 27551855, 27558557, 27558559, 27558861, 27560702
         27563629, 27563767, 27570318, 27577758, 27579353, 27580996, 27585755
         27585800, 27586810, 27586895, 27587672, 27591842, 27592466, 27593389
         27595973, 27599689, 27602091, 27602488, 27603841, 27604293, 27607805
         27608669, 27610269, 27613080, 27613247, 27615608, 27616657, 27617522
         27625274, 27625620, 27631506, 27634676, 27635508, 27644757, 27649707
         27652302, 27663370, 27664702, 27679488, 27679664, 27679806, 27679961
         27680162, 27680509, 27682151, 27688099, 27688692, 27690578, 27691809
         27692215, 27693713, 27697092, 27701795, 27705761, 27707544, 27709046
         27718914, 27719187, 27723002, 27726269, 27726780, 27732323, 27739006
         27740844, 27744211, 27745220, 27747869, 27748954, 27751006, 27753336
         27757567, 27772815, 27773602, 27774320, 27774539, 27779886, 27780562
         27782339, 27783289, 27786772, 27791223, 27797290, 27803665, 27807441
         27812560, 27812593, 27813267, 27815347, 27818871, 27832643, 27833369
         27834984, 27840386, 27847259, 27851757, 27861909, 27869339, 27873643
         27882176, 27892488, 27924147, 27926113, 27930478, 27934468, 27941896
         27945870, 27950708, 27952762, 27961746, 27964051, 27970265, 27971575
         27984028, 27989849, 27993289, 27994333, 27997875, 27999597, 28021205
         28022847, 28033429, 28057267, 28059199, 28072130, 28098865, 28106402
         28132287, 28169711, 28174827, 28184554, 28188330, 25929650, 28264172
    
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    $ $ORACLE_HOME/OPatch/opatch lspatches
    27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
    27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
    28090553;OCW RELEASE UPDATE 18.3.0.0.0 (28090553)
    28090523;Database Release Update : 18.3.0.0.180717 (28090523)
    
    OPatch succeeded.
    

    So this 18c version has some of the July 2018 release updates (180717 = 17-JUL-2018).

    I have also checked SQL*Plus banner:

    $ sqlplus -v
    
    SQL*Plus: Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    $ 
    
    Silent database creation

    I have created directories for databases with root account:

    # mkdir /u01/oradata
    # chown oracle:dba /u01/oradata
    # mkdir /u01/fra
    # chown oracle:dba /u01/fra
    

    I have used following script to create a container database named CDB with one pluggable database:

    dbca -silent \
    -createDatabase \
    -templateName General_Purpose.dbc \
    -gdbName CDB \
    -sid CDB \
    -createAsContainerDatabase true \
    -numberOfPdbs 1 \
    -pdbName pdb \
    -pdbadminUsername pdba \
    -pdbadminPassword oracle \
    -SysPassword oracle \
    -SystemPassword oracle \
    -emConfiguration NONE \
    -storageType FS \
    -datafileDestination /u01/oradata \
    -recoveryAreaDestination /u01/fra \
    -recoveryAreaSize 3200  \
    -characterSet AL32UTF8 \
    -memoryPercentage 40 \
    -enableArchive true \
    -redoLogFileSize 100
    

    Output is:

    WARNING] [DBT-06801] Specified Fast Recovery Area size (3,200 MB) is less than the recommended value.
       CAUSE: Fast Recovery Area size should at least be three times the database size (2,446 MB).
       ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
    [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06801] Specified Fast Recovery Area size (3,200 MB) is less than the recommended value.
       CAUSE: Fast Recovery Area size should at least be three times the database size (3,309 MB).
       ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
    Prepare for db operation
    8% complete
    Copying database files
    31% complete
    Creating and starting Oracle instance
    32% complete
    36% complete
    40% complete
    43% complete
    46% complete
    Completing Database Creation
    51% complete
    53% complete
    54% complete
    Creating Pluggable Databases
    58% complete
    77% complete
    Executing Post Configuration Actions
    100% complete
    Database creation complete. For details check the logfiles at:
     /u01/base/cfgtoollogs/dbca/CDB.
    Database Information:
    Global Database Name:CDB
    System Identifier(SID):CDB
    Look at the log file "/u01/base/cfgtoollogs/dbca/CDB/CDB.log" for further details.
    

    I have checked created database with:

    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    BANNER_FULL
    --------------------------------------------------------------------------------
    BANNER_LEGACY
    --------------------------------------------------------------------------------
        CON_ID
    ----------
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    	 0
    
    BANNER
    --------------------------------------------------------------------------------
    BANNER_FULL
    --------------------------------------------------------------------------------
    BANNER_LEGACY
    --------------------------------------------------------------------------------
        CON_ID
    ----------
    
    SQL> select patch_id, status, description, action_time from dba_registry_sqlpatch;
    
      PATCH_ID STATUS		     DESCRIPTION								      ACTION_TIME
    ---------- ------------------------- -------------------------------------------------------------------------------- ------------------------------
      28090523 SUCCESS		     Database Release Update : 18.3.0.0.180717 (28090523)			      23-JUL-18 10.57.56.127734 PM
      27923415 SUCCESS		     OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)				      23-JUL-18 10.57.56.142065 PM
    
    SQL> select name, cdb, log_mode from v$database;
    
    NAME	  CDB LOG_MODE
    --------- --- ------------
    CDB	  YES ARCHIVELOG
    
    SQL> show pdbs
    
        CON_ID CON_NAME			  OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
    	 2 PDB$SEED			  READ ONLY  NO
    	 3 PDB				  READ WRITE NO
    
    

    I have used following script to create a non-container database named NCDB with:

    dbca -silent \
    -createDatabase \
    -templateName General_Purpose.dbc \
    -gdbName NCDB \
    -sid NCDB \
    -createAsContainerDatabase false \
    -SysPassword oracle \
    -SystemPassword oracle \
    -emConfiguration NONE \
    -storageType FS \
    -datafileDestination /u01/oradata \
    -recoveryAreaDestination /u01/fra \
    -recoveryAreaSize 3200  \
    -characterSet AL32UTF8 \
    -memoryPercentage 40 \
    -enableArchive true \
    -redoLogFileSize 100 
    

    Output is:

    [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
       CAUSE: 
    a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
    b.The password entered is a keyword that Oracle does not recommend to be used as password
       ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
    [WARNING] [DBT-06801] Specified Fast Recovery Area size (3,200 MB) is less than the recommended value.
       CAUSE: Fast Recovery Area size should at least be three times the database size (2,402 MB).
       ACTION: Specify Fast Recovery Area Size to be at least three times the database size.
    Prepare for db operation
    10% complete
    Copying database files
    40% complete
    Creating and starting Oracle instance
    42% complete
    46% complete
    50% complete
    54% complete
    60% complete
    Completing Database Creation
    66% complete
    69% complete
    70% complete
    Executing Post Configuration Actions
    100% complete
    Database creation complete. For details check the logfiles at:
     /u01/base/cfgtoollogs/dbca/NCDB.
    Database Information:
    Global Database Name:NCDB
    System Identifier(SID):NCDB
    Look at the log file "/u01/base/cfgtoollogs/dbca/NCDB/NCDB.log" for further details.
    

    I have checked created database with:

    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    BANNER_FULL
    --------------------------------------------------------------------------------
    BANNER_LEGACY
    --------------------------------------------------------------------------------
        CON_ID
    ----------
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.3.0.0.0
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    	 0
    
    BANNER
    --------------------------------------------------------------------------------
    BANNER_FULL
    --------------------------------------------------------------------------------
    BANNER_LEGACY
    --------------------------------------------------------------------------------
        CON_ID
    ----------
    
    SQL> select patch_id, status, description, action_time from dba_registry_sqlpatch;
    
      PATCH_ID STATUS		     DESCRIPTION								      ACTION_TIME
    ---------- ------------------------- -------------------------------------------------------------------------------- ------------------------------
      28090523 SUCCESS		     Database Release Update : 18.3.0.0.180717 (28090523)			      23-JUL-18 11.33.28.278762 PM
      27923415 SUCCESS		     OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)				      23-JUL-18 11.33.28.325217 PM
    
    SQL> select name, cdb, log_mode from v$database;
    
    NAME	  CDB LOG_MODE
    --------- --- ------------
    NCDB	  NO  ARCHIVELOG
    
    SQL> show pdbs
    SQL> 
    
    Conclusion

    As documented Oracle Database 18c installation is now image based like Grid Infrastructure 12.2.0.1: response file and parameters for software installation and database creation are very similar to Oracle 12.2.0.1.

    Oracle Corp. has decided to release on OTN a patched version: this is something new for a new release (it was possible to have patched versions but only in preinstalled VMs like the Hands-On Lab for Upgrade).

    However at the time of writing I have not found the announced RPM to install Oracle 18c on Linux.

    Categories: DBA Blogs

    Patching Grid Infrastructure (Oracle Restart) 12.2.0.1 on Linux

    Sat, 2018-06-30 07:55

    Oracle Corp. has released on OTN an interim patch for Grid Infrastructure 12.2.0.1 on Linux. This patch is a fix needed for Oracle RAC in docker. In this blog article I am not going to install Oracle in docker but I am only going to install this interim patch in following Oracle Restart configuration:

  • Oracle Linux 7.3
  • Oracle Grid Infrastructure (GI) 12.2.0.1
  • Oracle Database 12.2.0.1
  • Grid Infrastructure owner is the same as Oracle Database owner (oracle account).
  • I have used patch README.html instructions when possible.

    Step 1: check opatch version

    In GI environment I have run:

    $ $ORACLE_HOME/OPatch/opatch version
    OPatch Version: 12.2.0.1.6
    
    OPatch succeeded.
    

    Patch README says that OPatch 12.2.0.1.5 is needed: so this is OK.

    However patch README says also that emocmrsp is needed to create an OCM response file but there is no emocmrsp binary GI Home:

    $ ls -al $ORACLE_HOME/OPatch/ocm
    total 4
    drwxr-xr-x.  2 oracle oinstall   24 Jan 26  2017 .
    drwxr-xr-x. 12 oracle oinstall 4096 Jan 26  2017 ..
    -rw-r--r--.  1 oracle oinstall    0 Jun 15  2016 generic.zip
    $ find $ORACLE_HOME -name emocmrsp
    $
    
    Step 2: check GI Home inventory
    $ $ORACLE_HOME/OPatch/opatch lsinventory -oh $ORACLE_HOME
    Oracle Interim Patch Installer version 12.2.0.1.6
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    Oracle Home       : /u01/gi12201
    Central Inventory : /u01/orainv
       from           : /u01/gi12201/oraInst.loc
    OPatch version    : 12.2.0.1.6
    OUI version       : 12.2.0.1.4
    Log file location : /u01/gi12201/cfgtoollogs/opatch/opatch2018-06-30_13-00-50PM_1.log
    
    Lsinventory Output file location : /u01/gi12201/cfgtoollogs/opatch/lsinv/lsinventory2018-06-30_13-00-50PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: ol7ttsa0
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Grid Infrastructure 12c                                       12.2.0.1.0
    There are 1 products installed in this Oracle Home.
    
    
    There are no Interim patches installed in this Oracle Home.
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    $ 
    
    Step 3: unzip patch

    I have unzipped patch zip file in /stage directory:

    $ unzip p27383741_122010_Linux-x86-64.zip 
    
    Step 4: check patch conflict

    I have sitchwed to user root (to avoid OPATCHAUTO-72046 error messages):

    # /u01/gi12201/OPatch/opatchauto apply /stage/27383741/27383741/ -analyze
    
    System initialization log file is /u01/gi12201/cfgtoollogs/opatchautodb/systemconfig2018-06-30_01-19-36PM.log.
    
    Session log file is /u01/gi12201/cfgtoollogs/opatchauto/opatchauto2018-06-30_01-19-41PM.log
    The id for this session is 76WA
    [init:init] Executing OPatchAutoBinaryAction action on home /u01/db12201
    
    Executing OPatch prereq operations to verify patch applicability on SIDB Home........
    
    [init:init] OPatchAutoBinaryAction action completed on home /u01/db12201 successfully
    [init:init] Executing SIDBPrereqAction action on home /u01/db12201
    
    Executing prereq operations before applying on SIDB Home........
    
    [init:init] SIDBPrereqAction action completed on home /u01/db12201 successfully
    [init:init] Executing OPatchAutoBinaryAction action on home /u01/gi12201
    
    Executing OPatch prereq operations to verify patch applicability on SIHA Home........
    
    [init:init] OPatchAutoBinaryAction action completed on home /u01/gi12201 successfully
    [init:init] Executing SIHAPrereqAction action on home /u01/gi12201
    
    Executing prereq operations before applying on SIHA Home........
    
    [init:init] SIHAPrereqAction action completed on home /u01/gi12201 successfully
    OPatchAuto successful.
    
    --------------------------------Summary--------------------------------
    
    Analysis for applying patches has completed successfully:
    
    Host:ol7ttsa0
    SIDB Home:/u01/db12201
    
    
    ==Following patches were SUCCESSFULLY analyzed to be applied:
    
    Patch: /stage/27383741/27383741/
    Log: /u01/db12201/cfgtoollogs/opatchauto/core/opatch/opatch2018-06-30_13-19-47PM_1.log
    
    
    Host:ol7ttsa0
    SIHA Home:/u01/gi12201
    
    
    ==Following patches were SUCCESSFULLY analyzed to be applied:
    
    Patch: /stage/27383741/27383741/
    Log: /u01/gi12201/cfgtoollogs/opatchauto/core/opatch/opatch2018-06-30_13-20-15PM_1.log
    
    
    #
    
    Step 5: apply the patch

    In the same root session I have just run (without any setting for ORACLE_HOME or GRID_HOME):

    # /u01/gi12201/OPatch/opatchauto apply /stage/27383741 
    
    System initialization log file is /u01/gi12201/cfgtoollogs/opatchautodb/systemconfig2018-06-30_01-23-52PM.log.
    
    Session log file is /u01/gi12201/cfgtoollogs/opatchauto/opatchauto2018-06-30_01-23-56PM.log
    The id for this session is 2GYB
    [init:init] Executing OPatchAutoBinaryAction action on home /u01/db12201
    
    Executing OPatch prereq operations to verify patch applicability on SIDB Home........
    
    [init:init] OPatchAutoBinaryAction action completed on home /u01/db12201 successfully
    [init:init] Executing SIDBPrereqAction action on home /u01/db12201
    
    Executing prereq operations before applying on SIDB Home........
    
    [init:init] SIDBPrereqAction action completed on home /u01/db12201 successfully
    [init:init] Executing OPatchAutoBinaryAction action on home /u01/gi12201
    
    Executing OPatch prereq operations to verify patch applicability on SIHA Home........
    
    [init:init] OPatchAutoBinaryAction action completed on home /u01/gi12201 successfully
    [init:init] Executing SIHAPrereqAction action on home /u01/gi12201
    
    Executing prereq operations before applying on SIHA Home........
    
    [init:init] SIHAPrereqAction action completed on home /u01/gi12201 successfully
    [shutdown:prepare-shutdown] Executing SIDBPrepareShutDownAction action on home /u01/db12201
    
    Preparing SIDB Home to bring down database service........
    
    [shutdown:prepare-shutdown] SIDBPrepareShutDownAction action completed on home /u01/db12201 successfully
    [shutdown:shutdown] Executing SIDBShutDownAction action on home /u01/db12201
    
    Stopping the database service on SIDB Home for patching........
    
    Following database is been stopped and will be restarted later during the session: db0
    
    [shutdown:shutdown] SIDBShutDownAction action completed on home /u01/db12201 successfully
    [shutdown:shutdown] Executing SIHAShutDownAction action on home /u01/gi12201
    
    Performing prepatch operations on SIHA Home........
    
    Prepatch operation log file location: /u01/base/crsdata/ol7ttsa0/crsconfig/hapatch_2018-06-30_01-25-18PM.log 
    
    [shutdown:shutdown] SIHAShutDownAction action completed on home /u01/gi12201 successfully
    [offline:binary-patching] Executing OPatchAutoBinaryAction action on home /u01/db12201
    
    Start applying binary patches on SIDB Home........
    
    [offline:binary-patching] OPatchAutoBinaryAction action completed on home /u01/db12201 successfully
    [offline:binary-patching] Executing OPatchAutoBinaryAction action on home /u01/gi12201
    
    Start applying binary patches on SIHA Home........
    
    [offline:binary-patching] OPatchAutoBinaryAction action completed on home /u01/gi12201 successfully
    [startup:startup] Executing SIHAStartupAction action on home /u01/gi12201
    
    Performing postpatch operations on SIHA Home........
    
    Postpatch operation log file location: /u01/base/crsdata/ol7ttsa0/crsconfig/hapatch_2018-06-30_01-27-55PM.log 
    
    [startup:startup] SIHAStartupAction action completed on home /u01/gi12201 successfully
    [startup:startup] Executing SIDBStartupAction action on home /u01/db12201
    
    Starting the database service on SIDB Home........
    
    [startup:startup] SIDBStartupAction action completed on home /u01/db12201 successfully
    [startup:finalize] Executing SIDBFinalizeStartAction action on home /u01/db12201
    
    No step execution required.........
    
    [startup:finalize] SIDBFinalizeStartAction action completed on home /u01/db12201 successfully
    [online:product-patching] Executing SIDBOnlineAction action on home /u01/db12201
    
    Trying to apply SQL patches on SIDB Home.
    
    [online:product-patching] SIDBOnlineAction action completed on home /u01/db12201 successfully
    [finalize:finalize] Executing OracleHomeLSInventoryGrepAction action on home /u01/gi12201
    
    Verifying patches applied on SIHA Home.
    
    [finalize:finalize] OracleHomeLSInventoryGrepAction action completed on home /u01/gi12201 successfully
    [finalize:finalize] Executing OracleHomeLSInventoryGrepAction action on home /u01/db12201
    
    Verifying patches applied on SIDB Home.
    
    [finalize:finalize] OracleHomeLSInventoryGrepAction action completed on home /u01/db12201 successfully
    OPatchAuto successful.
    
    --------------------------------Summary--------------------------------
    
    Patching is completed successfully. Please find the summary as follows:
    
    Host:ol7ttsa0
    SIDB Home:/u01/db12201
    Summary:
    
    ==Following patches were SUCCESSFULLY applied:
    
    Patch: /stage/27383741/27383741
    Log: /u01/db12201/cfgtoollogs/opatchauto/core/opatch/opatch2018-06-30_13-25-36PM_1.log
    
    
    Host:ol7ttsa0
    SIHA Home:/u01/gi12201
    Summary:
    
    ==Following patches were SUCCESSFULLY applied:
    
    Patch: /stage/27383741/27383741
    Log: /u01/gi12201/cfgtoollogs/opatchauto/core/opatch/opatch2018-06-30_13-26-15PM_1.log
    
    # 
    
    Step 6: check that patch has been applied

    I have checked that GI is up and running:

    $ . oraenv
    ORACLE_SID = [oracle] ? +ASM 
    The Oracle base has been set to /u01/base
    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
                   ONLINE  ONLINE       ol7ttsa0                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol7ttsa0                 STABLE
    ora.RECO.dg
                   ONLINE  ONLINE       ol7ttsa0                 STABLE
    ora.asm
                   ONLINE  ONLINE       ol7ttsa0                 Started,STABLE
    ora.ons
                   OFFLINE OFFLINE      ol7ttsa0                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.cssd
          1        ONLINE  ONLINE       ol7ttsa0                 STABLE
    ora.db0.db
          1        ONLINE  ONLINE       ol7ttsa0                 Open,HOME=/u01/db122
                                                                 01,STABLE
    ora.diskmon
          1        OFFLINE OFFLINE                               STABLE
    ora.evmd
          1        ONLINE  ONLINE       ol7ttsa0                 STABLE
    --------------------------------------------------------------------------------
    $ 
    

    I have checked that patch has been applied to GI Home:

    $ $ORACLE_HOME/OPatch/opatch lsinventory -oh $ORACLE_HOME
    Oracle Interim Patch Installer version 12.2.0.1.6
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u01/gi12201
    Central Inventory : /u01/orainv
       from           : /u01/gi12201/oraInst.loc
    OPatch version    : 12.2.0.1.6
    OUI version       : 12.2.0.1.4
    Log file location : /u01/gi12201/cfgtoollogs/opatch/opatch2018-06-30_13-30-35PM_1.log
    
    Lsinventory Output file location : /u01/gi12201/cfgtoollogs/opatch/lsinv/lsinventory2018-06-30_13-30-35PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: ol7ttsa0
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Grid Infrastructure 12c                                       12.2.0.1.0
    There are 1 products installed in this Oracle Home.
    
    
    Interim patches (1) :
    
    Patch  27383741     : applied on Sat Jun 30 13:27:43 CEST 2018
    Unique Patch ID:  21873823
    Patch description:  "OCW Interim patch for 27383741"
       Created on 18 Jan 2018, 17:32:26 hrs PST8PDT
       Bugs fixed:
         25970667, 27187009
    
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    $
    

    I have checked that patch has been applied to Database Home:

    $ . oraenv
    ORACLE_SID = [+ASM] ? DB0
    The Oracle base has been changed from /u01/base to /u01/oracle
    $ $ORACLE_HOME/OPatch/opatch lsinventory -oh $ORACLE_HOME
    Oracle Interim Patch Installer version 12.2.0.1.6
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u01/db12201
    Central Inventory : /u01/orainv
       from           : /u01/db12201/oraInst.loc
    OPatch version    : 12.2.0.1.6
    OUI version       : 12.2.0.1.4
    Log file location : /u01/db12201/cfgtoollogs/opatch/opatch2018-06-30_13-30-54PM_1.log
    
    Lsinventory Output file location : /u01/db12201/cfgtoollogs/opatch/lsinv/lsinventory2018-06-30_13-30-54PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: ol7ttsa0
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Database 12c                                                  12.2.0.1.0
    There are 1 products installed in this Oracle Home.
    
    
    Interim patches (1) :
    
    Patch  27383741     : applied on Sat Jun 30 13:26:07 CEST 2018
    Unique Patch ID:  21873823
    Patch description:  "OCW Interim patch for 27383741"
       Created on 18 Jan 2018, 17:32:26 hrs PST8PDT
       Bugs fixed:
         25970667, 27187009
    
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    $ 
    

    I have checked if patch has been applied to database:

    OPS$ORACLE@DB0>set linesize 120
    OPS$ORACLE@DB0>column action_time format a15
    OPS$ORACLE@DB0>column action format a10
    OPS$ORACLE@DB0>column version format a12
    OPS$ORACLE@DB0>column description format a50
    OPS$ORACLE@DB0>column comp_name format a40
    OPS$ORACLE@DB0>select name, cdb from v$database;
    
    NAME	  CDB
    --------- ---
    DB0	  NO
    
    OPS$ORACLE@DB0>select to_char(action_time,'DD-MON-YYYY') as action_time_2, patch_id, patch_uid, action, version,  description
      2  from dba_registry_sqlpatch
      3  order by action_time;
    
    no rows selected
    
    OPS$ORACLE@DB0>
    

    This interim patch has not been applied to the database.

    I have also checked that patch is displayed in database instance alert log;

    ==========================================================
    Dumping current patch information
    ===========================================================
    Patch Id: 27383741
    Patch Description: OCW Interim patch for 27383741
    Patch Apply Time: 2018-06-30T13:26:07+02:00
    Bugs Fixed: 25970667,27187009
    ===========================================================
    

    I have also checked that patch is displayed in ASM instance alert log:

    ============================================================
    NOTE: PatchLevel of this instance 1812918032
    ============================================================
    Dumping list of patches:
    ============================================================
    27383741
    ============================================================
    

    I have also checked that GI has been stopped and restarted during patching in $ORACLE_BASE/diag/crs/ol7ttsa0/crs/trace/alert.log:

    2018-06-30 13:25:22.293 [OCSSD(3367)]CRS-1603: CSSD on node ol7ttsa0 has been shut down.
    2018-06-30 13:25:23.622 [OCSSD(3367)]CRS-1660: The CSS daemon shutdown has completed
    2018-06-30 13:25:23.622 [OCSSD(3367)]CRS-8504: Oracle Clusterware OCSSD process with operating system process ID 3367 is exiting
    2018-06-30 13:28:04.361 [CLSECHO(13356)]ACFS-9500: Location of Oracle Home is '/u01/gi12201' as determined from the internal configuration data
    2018-06-30 13:28:05.539 [CLSECHO(13702)]ACFS-9300: ADVM/ACFS distribution files found.
    2018-06-30 13:28:05.853 [CLSECHO(13726)]ACFS-9119: Driver oracleacfs.ko failed to unload.
    2018-06-30 13:28:05.930 [CLSECHO(13750)]ACFS-9427: Failed to unload ADVM/ACFS drivers. A system reboot is recommended.
    2018-06-30 13:28:06.089 [CLSCFG(13807)]CRS-1810: Node-specific configuration for node ol7ttsa0 in Oracle Local Registry was patched to patch level 1812918032.
    2018-06-30 13:28:10.327 [OHASD(13827)]CRS-8500: Oracle Clusterware OHASD process is starting with operating system process ID 13827
    2018-06-30 13:28:10.331 [OHASD(13827)]CRS-0714: Oracle Clusterware Release 12.2.0.1.0.
    2018-06-30 13:28:10.347 [OHASD(13827)]CRS-2112: The OLR service started on node ol7ttsa0.
    2018-06-30 13:28:10.364 [OHASD(13827)]CRS-1301: Oracle High Availability Service started on node ol7ttsa0.
    2018-06-30 13:28:10.634 [CSSDAGENT(13893)]CRS-8500: Oracle Clusterware CSSDAGENT process is starting with operating system process ID 13893
    2018-06-30 13:28:10.665 [ORAAGENT(13890)]CRS-8500: Oracle Clusterware ORAAGENT process is starting with operating system process ID 13890
    2018-06-30 13:28:10.780 [ORAROOTAGENT(13898)]CRS-8500: Oracle Clusterware ORAROOTAGENT process is starting with operating system process ID 13898
    2018-06-30 13:28:11.200 [ORAAGENT(13947)]CRS-8500: Oracle Clusterware ORAAGENT process is starting with operating system process ID 13947
    2018-06-30 13:28:11.360 [EVMD(13971)]CRS-8500: Oracle Clusterware EVMD process is starting with operating system process ID 13971
    2018-06-30 13:28:15.868 [CSSDAGENT(14098)]CRS-8500: Oracle Clusterware CSSDAGENT process is starting with operating system process ID 14098
    2018-06-30 13:28:15.911 [ORAROOTAGENT(14101)]CRS-8500: Oracle Clusterware ORAROOTAGENT process is starting with operating system process ID 14101
    2018-06-30 13:28:16.019 [OCSSD(14130)]CRS-8500: Oracle Clusterware OCSSD process is starting with operating system process ID 14130
    2018-06-30 13:28:17.031 [OCSSD(14130)]CRS-1713: CSSD daemon is started in hub mode
    2018-06-30 13:28:25.628 [OCSSD(14130)]CRS-1601: CSSD Reconfiguration complete. Active nodes are ol7ttsa0 .
    2018-06-30 13:28:29.146 [OCSSD(14130)]CRS-1720: Cluster Synchronization Services daemon (CSSD) is ready for operation.
    

    I have ignored ACFS-9119 and ACFS-9427 messages because I don’t use ACFS any more on this node.

    Patch 27383741 has been successfully installed in this Oracle Restart environment.

    Categories: DBA Blogs

    Oracle Instant Client 18.1.0.0 silent installation on Oracle Linux 7.5

    Wed, 2018-05-09 15:53

    Oracle Corp. has just released Oracle Client 18c Release 1 for Linux on OTN. I have not read any official statement about this release which is unexpected: Oracle 18c has only been released in Oracle Cloud and for on-premises engineered systems (Exadata and ODA). General availability for Oracle 18c is scheduled for July 2018 according to My Oracle Support.

    In this blog post I will document how to install Oracle Instant Client on Oracle Linux 7.5 .

    Oracle Instant Client is a small package that you generally install either with a RPM or just unzip in a target directory.

    The configuration I have used is the following:

    # cat /etc/os-release 
    NAME="Oracle Linux Server"
    VERSION="7.5"
    ID="ol"
    VERSION_ID="7.5"
    PRETTY_NAME="Oracle Linux Server 7.5"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:oracle:linux:7:5:server"
    HOME_URL="https://linux.oracle.com/"
    BUG_REPORT_URL="https://bugzilla.oracle.com/"
    
    ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
    ORACLE_BUGZILLA_PRODUCT_VERSION=7.5
    ORACLE_SUPPORT_PRODUCT="Oracle Linux"
    ORACLE_SUPPORT_PRODUCT_VERSION=7.5
    # uname -a
    Linux ol7dns02.localdomain 4.1.12-124.14.5.el7uek.x86_64 #2 SMP Fri May 4 15:26:53 PDT 2018 x86_64 x86_64 x86_64 GNU/Linux
    

    This is a minimal Oracle Linux installation (no Oracle Database, no MySQL, no gcc):

    # cat /etc/oraInst.loc
    cat: /etc/oraInst.loc: No such file or directory
    # id oracle
    id: oracle: no such user
    # id mysql
    id: mysql: no such user
    # yum info gcc
    Failed to set locale, defaulting to C
    Loaded plugins: langpacks, ulninfo
    Available Packages
    Name        : gcc
    Arch        : x86_64
    Version     : 4.8.5
    Release     : 28.0.1.el7
    Size        : 16 M
    Repo        : ol7_latest/x86_64
    Summary     : Various compilers (C, C++, Objective-C, Java, ...)
    URL         : http://gcc.gnu.org
    License     : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
    Description : The gcc package contains the GNU Compiler Collection version 4.8.
                : You'll need this package in order to compile C code.
    

    I have not found any preinstallation RPM for Oracle 18c in Oracle public yum servers:

     
    # yum info *preinstall*
    Failed to set locale, defaulting to C
    Loaded plugins: langpacks, ulninfo
    Available Packages
    Name        : oracle-database-server-12cR2-preinstall
    Arch        : x86_64
    Version     : 1.0
    Release     : 3.el7
    Size        : 19 k
    Repo        : ol7_latest/x86_64
    Summary     : Sets the system for Oracle Database single instance and Real Application Cluster install for Oracle Linux 7
    License     : GPLv2
    Description : The Oracle Preinstallation RPM package installs software packages and sets system parameters required for Oracle Database single instance and Oracle
                : Real Application Clusters installations for Oracle Linux Release 7 Files affected: /etc/sysctl.conf, /boot/grub/menu.lst OR /boot/grub2/grub.cfg
                : Files added: /etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf
    
    Name        : oracle-rdbms-server-11gR2-preinstall
    Arch        : x86_64
    Version     : 1.0
    Release     : 5.el7
    Size        : 21 k
    Repo        : ol7_latest/x86_64
    Summary     : Sets the system for Oracle single instance and Real Application Cluster install for Oracle Linux 7
    License     : GPLv2
    Description : The Oracle Preinstallation RPM package installs software packages and sets system parameters required for Oracle Database single instance and Oracle
                : Real Application Clusters installations for Oracle Linux Release 7 Files affected: /etc/sysctl.conf, /etc/security/limits.conf, /boot/grub/menu.lst or
                : /boot/grub2/grub.cfg.
    
    Name        : oracle-rdbms-server-12cR1-preinstall
    Arch        : x86_64
    Version     : 1.0
    Release     : 6.el7
    Size        : 20 k
    Repo        : ol7_latest/x86_64
    Summary     : Sets the system for Oracle Database single instance and Real Application Cluster install for Oracle Linux 7
    License     : GPLv2
    Description : The Oracle Preinstallation RPM package installs software packages and sets system parameters required for Oracle Database single instance and Oracle
                : Real Application Clusters installations for Oracle Linux Release 7 Files affected: /etc/sysctl.conf, /boot/grub/menu.lst OR /boot/grub2/grub.cfg
                : Files added: /etc/security/limits.d/oracle-rdbms-server-12cR1-preinstall.conf
    

    I have decided to install the 12.2.0.1 preinstallation RPM:

    # yum -y install oracle-database-server-12cR2-preinstall
    

    I have decided to install Oracle Instant Client in /opt so I have changed ownership to oracle account (that has been created by preinstallation RPM):

    # chown oracle:dba /opt
    

    I have switched to oracle account, downloaded and unzipped installation media:

    $ unzip LINUX.X64_181000_client.zip 
    

    I have run following script:

    rm -rf /opt/oraInventory/logs
    rm -rf /tmp/OraInstall*
    cd client
    DISTRIB=`pwd`
    ./runInstaller -silent \
     -responseFile $DISTRIB//response/client_install.rsp   \
       oracle.install.client.installType=InstantClient     \
       SELECTED_LANGUAGES=en                               \
       ORACLE_HOME=/opt/oc18100                            \
       INVENTORY_LOCATION=/opt/oraInventory                \
       UNIX_GROUP_NAME=dba                                 \
       waitForCompletion=true
    

    Runnning this script has generated following output:

    Starting Oracle Universal Installer...
    
    Checking Temp space: must be greater than 415 MB.   Actual 4334 MB    Passed
    Checking swap space: must be greater than 150 MB.   Actual 1218 MB    Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-05-09_09-07-02PM. Please wait ...
       [WARNING] [INS-13014] Target environment does not meet some optional requirements.
       CAUSE: Some of the optional prerequisites are not met. See logs for details. /opt/oraInventory/logs/installActions2018-05-09_09-07-02PM.log
       ACTION: Identify the list of failed prerequisite checks from the log: /opt/oraInventory/logs/installActions2018-05-09_09-07-02PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
    The response file for this session can be found at:
     /opt/oc18100/install/response/client_2018-05-09_09-07-02PM.rsp
    
    You can find the log of this install session at:
     /opt/oraInventory/logs/installActions2018-05-09_09-07-02PM.log
    The installation of Oracle Client 18c was successful.
    Please check '/opt/oraInventory/logs/silentInstall2018-05-09_09-07-02PM.log' for more details.
    Successfully Setup Software with warning(s).
    

    I have ignored following warning:

    INFO: ------------------List of failed Tasks------------------
    INFO: *********************************************
    INFO: Swap Size: This is a prerequisite condition to test whether sufficient total swap space is available on the system.
    INFO: Severity:IGNORABLE
    INFO: OverallStatus:VERIFICATION_FAILED
    INFO: -----------------End of failed Tasks List----------------
    

    I have set following environment variables (note that Oracle Instant Client does not use ORACLE_HOME):

    export PATH=/opt/oc18100:$PATH
    export LD_LIBRARY_PATH=/opt/oc18100:$LD_LIBRARY_PATH
    

    I have tested Oracle Instant Client with Easy Connect naming method:

    $ sqlplus system/xxx@192.168.1.10:1521/XE
    
    SQL*Plus: Release 18.0.0.0.0 Production on Wed May 9 21:10:43 2018
    Version 18.1.0.0.0
    
    Copyright (c) 1982, 2017, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
    
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE	11.2.0.2.0	Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    
    SQL> 
    

    This 18.1 Oracle Client installation has following executables: sqlplus, sqlldr, exp/imp, expdp/impdp but tnsping and rman are missing.
    We have an Oracle Inventory but we have no opatch executable:

    $ ls -al /opt/oraInventory/ContentsXML/inventory.xml
    -rw-rw----. 1 oracle oinstall 455 May  9 21:07 /opt/oraInventory/ContentsXML/inventory.xml
    $ find /opt/oc18100/ -name 'opatch*'
    /opt/oc18100/inventory/Scripts/ext/jlib/opatch.jar
    /opt/oc18100/inventory/Scripts/ext/jlib/opatchsdk.jar
    

    The directory size is quite small compared to the “full” client:

    $ du -sm /opt/oc18100
    313	/opt/oc18100
    
    Conclusion

    This Oracle Client 18c release works but does not look comprehensive:

  • no separate Oracle Instant Client zip file and no Instant Client RPM
  • no RPM for Oracle Client although it has been announced.
  • the documentation has no “Changes in this Release for Oracle Database” section but has a section on database character set not really useful for client installation.
  • Categories: DBA Blogs

    Oracle Client 12.2.0.1 silent installation on Oracle Linux 7.4 (with Pro*C verification)

    Sat, 2018-03-17 13:18

    This post documents how to install Oracle Client 12.2.0.1 on Oracle Linux 7.4.

    I have checked official installation documentation: Database Client Installation Guide on Linux but I have not found information about the different installation types that can you find in the OUI response file:

    #             The following choices are available. The value should contain
    #             only one of these choices.
    #               - InstantClient
    #               - Administrator
    #               - Runtime
    #               - Custom
    

    The configuration I have used is the following:

    # cat /etc/os-release 
    NAME="Oracle Linux Server"
    VERSION="7.4"
    ID="ol"
    VERSION_ID="7.4"
    PRETTY_NAME="Oracle Linux Server 7.4"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:oracle:linux:7:4:server"
    HOME_URL="https://linux.oracle.com/"
    BUG_REPORT_URL="https://bugzilla.oracle.com/"
    
    ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
    ORACLE_BUGZILLA_PRODUCT_VERSION=7.4
    ORACLE_SUPPORT_PRODUCT="Oracle Linux"
    ORACLE_SUPPORT_PRODUCT_VERSION=7.4
    

    This machine is a minimal Oracle Linux installation: it has no existing Oracle Database software (not even MySQL or even gcc):

    # cat /etc/oraInst.loc
    cat: /etc/oraInst.loc: No such file or directory
    # id oracle
    id: oracle: no such user
    # id mysql
    id: mysql: no such user
    # yum info gcc
    Loaded plugins: ulninfo
    Available Packages
    Name        : gcc
    Arch        : x86_64
    Version     : 4.8.5
    Release     : 16.0.3.el7_4.2
    Size        : 16 M
    Repo        : ol7_latest/x86_64
    Summary     : Various compilers (C, C++, Objective-C, Java, ...)
    URL         : http://gcc.gnu.org
    License     : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
    Description : The gcc package contains the GNU Compiler Collection version 4.8.
                : You'll need this package in order to compile C code.
    
    # 
    

    I have decided to make installation easier by using the pre-installation RPM because it is available on Oracle Linux:

    # yum -y install oracle-database-server-12cR2-preinstall
    

    RPM full installation log is here.

    I have created the required directories for ORACLE_HOME, ORACLE_BASE and Oracle inventory:

    # mkdir /opt/oc12201
    # chown oracle:dba /opt/oc12201
    # mkdir /opt/base
    # chown oracle:dba /opt/base
    # mkdir /opt/oraInventory
    # chown oracle:oinstall /opt/oraInventory
    

    I have switched to oracle user account (that has been created by the preinstallation RPM), downloaded and unzipped the Oracle Client installation media:

    $ unzip linuxx64_12201_client.zip
    

    I have run following script to install Oracle Client in “Admininistrator” installation type because I want to test Pro*C feature:

    set -x
    cd client
    DISTRIB=`pwd`
    ./runInstaller -silent \
     -responseFile $DISTRIB//response/client_install.rsp   \
       oracle.install.client.installType=Administrator     \
       UNIX_GROUP_NAME=dba                                 \
       INVENTORY_LOCATION=/opt/oraInventory                \
       SELECTED_LANGUAGES=en                               \
       ORACLE_HOME=/opt/oc12201                            \
       ORACLE_BASE=/opt/base                               \
       waitForCompletion=true
    

    Running this script has generated following output:

    ++ cd client
    +++ pwd
    ++ DISTRIB=/home/oracle/stage/client
    ++ ./runInstaller -silent -responseFile /home/oracle/stage/client//response/client_install.rsp oracle.install.client.installType=Administrator UNIX_GROUP_NAME=dba INVENTORY_LOCATION=/opt/oraInventory SELECTED_LANGUAGES=en ORACLE_HOME=/opt/oc12201 ORACLE_BASE=/opt/base waitForCompletion=true
    Starting Oracle Universal Installer...
    
    Checking Temp space: must be greater than 415 MB.   Actual 5091 MB    Passed
    Checking swap space: must be greater than 150 MB.   Actual 1227 MB    Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-03-16_08-21-59PM. Please wait ...
    [WARNING] [INS-32018] The selected Oracle home is outside of Oracle base.
       ACTION: Oracle recommends installing Oracle software within the Oracle base directory. Adjust the Oracle home or Oracle base accordingly.
    [WARNING] [INS-13014] Target environment does not meet some optional requirements.
       CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2018-03-16_08-21-59PM.log
       ACTION: Identify the list of failed prerequisite checks from the log: installActions2018-03-16_08-21-59PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
    You can find the log of this install session at:
     /opt/oraInventory/logs/installActions2018-03-16_08-21-59PM.log
    The installation of Oracle Client 12c was successful.
    Please check '/opt/oraInventory/logs/silentInstall2018-03-16_08-21-59PM.log' for more details.
    
    As a root user, execute the following script(s):
    	1. /opt/oraInventory/orainstRoot.sh
    
    
    
    Successfully Setup Software.
    

    I have ignored following failed prerequisites:

    INFO: INFO: ------------------List of failed Tasks------------------
    INFO: INFO: *********************************************
    INFO: INFO: Swap Size: This is a prerequisite condition to test whether sufficient total swap space is available on the system.
    INFO: INFO: Severity:IGNORABLE
    INFO: INFO: OverallStatus:VERIFICATION_FAILED
    INFO: INFO: -----------------End of failed Tasks List----------------
    

    I have run root.sh:

    # /opt/oraInventory/orainstRoot.sh
    Changing permissions of /opt/oraInventory.
    Adding read,write permissions for group.
    Removing read,write,execute permissions for world.
    
    Changing groupname of /opt/oraInventory to dba.
    The execution of the script is complete.
    # 
    

    I have checked this Oracle Client installation:

    $ export ORACLE_HOME=/opt/oc12201
    $ PATH=$ORACLE_HOME/bin:$PATH
    $ which sqlplus
    /opt/oc12201/bin/sqlplus
    $ sqlplus -v
    
    SQL*Plus: Release 12.2.0.1.0 Production
    
    $ $ORACLE_HOME/OPatch/opatch lsinv
    Oracle Interim Patch Installer version 12.2.0.1.6
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /opt/oc12201
    Central Inventory : /opt/oraInventory
       from           : /opt/oc12201/oraInst.loc
    OPatch version    : 12.2.0.1.6
    OUI version       : 12.2.0.1.4
    Log file location : /opt/oc12201/cfgtoollogs/opatch/opatch2018-03-16_20-35-12PM_1.log
    
    Lsinventory Output file location : /opt/oc12201/cfgtoollogs/opatch/lsinv/lsinventory2018-03-16_20-35-12PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: localhost
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Client 12c                                                    12.2.0.1.0
    There are 1 products installed in this Oracle Home.
    
    
    There are no Interim patches installed in this Oracle Home.
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    $ cat /etc/oraInst.loc 
    inventory_loc=/opt/oraInventory
    inst_group=dba
    $ 
    

    I have also checked “proc” executable:

    $ proc
    proc: error while loading shared libraries: libclntsh.so.12.1: cannot open shared object file: No such file or directory
    $ echo $LD_LIBRARY_PATH
    
    $ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
    $ proc
    
    Pro*C/C++: Release 12.2.0.1.0 - Production on Fri Mar 16 20:37:39 2018
    
    Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.
    
    System default option values taken from: /opt/oc12201/precomp/admin/pcscfg.cfg
    
    Option Name    Current Value  Description
    -------------------------------------------------------------------------------
    auto_connect   no             Allow automatic connection to ops$ account
    char_map       charz          Mapping of character arrays and strings
    close_on_commitno             Close all cursors on COMMIT
    cmax           100            CMAX Value for connection pool
    cmin           2              CMIN Value for connection pool
    cincr          1              CINCR Value for connection pool
    ctimeout       0              CTIMEOUT Value for connection pool
    cnowait        0              CNOWAIT Value for connection pool
    common_parser  no             Parse using Common SQL Front End
    code           kr_c           The type of code to be generated
    comp_charset   multi_byte     The character set type the C compiler supports
    config         default        Override system configuration file with another
    cpool          no             Support connection pooling
    cpp_suffix     *none*         Override the default C++ filename suffix
    db2_array      no             Support DB2 array insert/select syntax
    dbms           native         v6/v7/v8 compatibility mode
    def_sqlcode    no             Generate '#define SQLCODE sqlca.sqlcode' macro
    define         __x86_64__     Define a preprocessor symbol
                   *none*                                                           
    duration       transaction    Set pin duration for objects in the cache
    dynamic        oracle         Specify Oracle or ANSI Dynamic SQL Semantics
    errors         yes            Whether error messages are sent to the terminal
    errtype        *none*         Name of the list file for intype file errors
    events         no             Support publish-subscribe event notifications
    fips           none           FIPS flagging of ANSI noncompliant usage
    header         *none*         Specify file extension for Precompiled Headers
    hold_cursor    no             Control holding of cursors in the cursor cache
    implicit_svpt  no             Implicit savepoint prior to buffered insert
    iname          *none*         The name of the input file
    include        *none*         Directory paths for included files
    intype         *none*         The name of the input file for type information
    lines          no             Add #line directives to the generated code
    lname          *none*         Override default list file name
    ltype          short          The amount of data generated in the list file
    maxliteral     1024           Maximum length of a generated string literal
    maxopencursors 10             Maximum number of cached open cursors
    max_row_insert 0              Maximum number of rows to buffer on insert
    mode           oracle         Code conformance to Oracle or ANSI rules
    memforprefetch 0              Prefetch memory limit in bytes
    native_types   no             Support for native float/double
    nls_char       *none*         Specify National Language character variables
    nls_local      no             Control how NLS character semantics are done
    objects        yes            Support object types
    oname          *none*         The name of the output file
    oraca          no             Control the use of the ORACA
    outline        no             Category in which Outlines are created 
                                  [yes/no/]
    outlnprefix    *none*         Outline name prefix
    pagelen        80             The page length of the list file
    parse          full           Control which non-SQL code is parsed
    plan_baseline  no             Module Name of the Plan Baseline 
                                  [/yes/no]
    plan_enabled   yes            Enable or Disable a manually created Plan 
                                  Baseline 
    plan_fixed     yes            Set the Plan Baseline to be fixed or non-fixed
    plan_prefix    none           Prefix name for the Plan Baseline 
                                  [/none]
    plan_run       no             If Yes, create Plan Baselines in the Database
    prefetch       1              Number of rows pre-fetched at cursor OPEN time
    release_cursor no             Control release of cursors from cursor cache
    runoutline     no             If yes, create Outlines in the Database
    select_error   yes            Control flagging of select errors
    sqlcheck       syntax         Amount of compile-time SQL checking
    stmt_cache     0              Size of statement cache
    sys_include    /usr/lib64/gcc/Directory where system header files are found
                   /usr/lib/gcc/x86_64-redhat-linux/4.4.4/include                   
                   /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include                   
                   /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include                   
                   /usr/include                                                     
                   $ORACLE_HOME/precomp/public                                      
    threads        no             Indicates a multi-threaded application
    trim_password  no             If yes, remove leading and trailing spaces from 
                                  password
    type_code      oracle         Use Oracle or ANSI type codes for Dynamic SQL
    unsafe_null    no             Allow a NULL fetch without indicator variable
    userid         *none*         A user name or password [@dbname] connect 
                                  string
    utf16_charset  nchar_charset  The character set form used by UTF16 variables
    varchar        no             Allow the use of implicit VARCHAR structures
    version        recent         Which version of an object is to be returned
    PCC-F-02135, CMD-LINE:  User asked for help
    $ 
    
    Installing Oracle Examples

    To test Pro*C I have also downloaded, unzipped and installed Oracle Examples:

    $ unzip linuxx64_12201_examples.zip
    

    I have used following script to install Oracle Examples:

    cd examples
    DISTRIB=`pwd`
    ./runInstaller -silent \
     -responseFile $DISTRIB/response/demos_install.rsp   \
       UNIX_GROUP_NAME=dba                               \
       SELECTED_LANGUAGES=en                             \
       ORACLE_HOME=/opt/oc12201                          \
       ORACLE_BASE=/opt/base                             \
       waitForCompletion=true
    

    Running this script has generated following output:

    Starting Oracle Universal Installer...
    
    Checking Temp space: must be greater than 415 MB.   Actual 2404 MB    Passed
    Checking swap space: must be greater than 150 MB.   Actual 1226 MB    Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-03-16_08-55-22PM. Please wait ...
    [WARNING] [INS-32018] The selected Oracle home is outside of Oracle base.
       ACTION: Oracle recommends installing Oracle software within the Oracle base directory. Adjust the Oracle home or Oracle base accordingly.
    [WARNING] [INS-13014] Target environment does not meet some optional requirements.
       CAUSE: Some of the optional prerequisites are not met. See logs for details. /opt/oraInventory/logs/installActions2018-03-16_08-55-22PM.log
       ACTION: Identify the list of failed prerequisite checks from the log: /opt/oraInventory/logs/installActions2018-03-16_08-55-22PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
    You can find the log of this install session at:
     /opt/oraInventory/logs/installActions2018-03-16_08-55-22PM.log
    The installation of Oracle Database 12c Examples was successful.
    Please check '/opt/oraInventory/logs/silentInstall2018-03-16_08-55-22PM.log' for more details.
    Successfully Setup Software.
    
    
    

    I have ignored above warnings and checked that Oracle Examples installation is registered in Oracle Inventory:

    $ $ORACLE_HOME/OPatch/opatch lsinv
    Oracle Interim Patch Installer version 12.2.0.1.6
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /opt/oc12201
    Central Inventory : /opt/oraInventory
       from           : /opt/oc12201/oraInst.loc
    OPatch version    : 12.2.0.1.6
    OUI version       : 12.2.0.1.4
    Log file location : /opt/oc12201/cfgtoollogs/opatch/opatch2018-03-16_20-57-33PM_1.log
    
    Lsinventory Output file location : /opt/oc12201/cfgtoollogs/opatch/lsinv/lsinventory2018-03-16_20-57-33PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: localhost
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (2): 
    
    Oracle Client 12c                                                    12.2.0.1.0
    Oracle Database 12c Examples                                         12.2.0.1.0
    There are 2 products installed in this Oracle Home.
    
    
    There are no Interim patches installed in this Oracle Home.
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    $ 
    
    Testing Pro*C

    I have installed gcc:

    # yum -y install gcc
    Loaded plugins: ulninfo
    Resolving Dependencies
    --> Running transaction check
    ---> Package gcc.x86_64 0:4.8.5-16.0.3.el7_4.2 will be installed
    --> Processing Dependency: cpp = 4.8.5-16.0.3.el7_4.2 for package: gcc-4.8.5-16.0.3.el7_4.2.x86_64
    --> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-16.0.3.el7_4.2.x86_64
    --> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-16.0.3.el7_4.2.x86_64
    --> Running transaction check
    ---> Package cpp.x86_64 0:4.8.5-16.0.3.el7_4.2 will be installed
    ---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
    ---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ======================================================================================================================================================================================
     Package                                Arch                                   Version                                               Repository                                  Size
    ======================================================================================================================================================================================
    Installing:
     gcc                                    x86_64                                 4.8.5-16.0.3.el7_4.2                                  ol7_latest                                  16 M
    Installing for dependencies:
     cpp                                    x86_64                                 4.8.5-16.0.3.el7_4.2                                  ol7_latest                                 5.9 M
     libmpc                                 x86_64                                 1.0.1-3.el7                                           ol7_latest                                  49 k
     mpfr                                   x86_64                                 3.1.1-4.el7                                           ol7_latest                                 198 k
    
    Transaction Summary
    ======================================================================================================================================================================================
    Install  1 Package (+3 Dependent packages)
    
    Total download size: 22 M
    Installed size: 53 M
    Downloading packages:
    (1/4): cpp-4.8.5-16.0.3.el7_4.2.x86_64.rpm                                                                                                                     | 5.9 MB  00:00:09     
    (2/4): libmpc-1.0.1-3.el7.x86_64.rpm                                                                                                                           |  49 kB  00:00:00     
    (3/4): mpfr-3.1.1-4.el7.x86_64.rpm                                                                                                                             | 198 kB  00:00:00     
    (4/4): gcc-4.8.5-16.0.3.el7_4.2.x86_64.rpm                                                                                                                     |  16 MB  00:00:18     
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Total                                                                                                                                                 1.2 MB/s |  22 MB  00:00:18     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : mpfr-3.1.1-4.el7.x86_64                                                                                                                                            1/4 
      Installing : libmpc-1.0.1-3.el7.x86_64                                                                                                                                          2/4 
      Installing : cpp-4.8.5-16.0.3.el7_4.2.x86_64                                                                                                                                    3/4 
      Installing : gcc-4.8.5-16.0.3.el7_4.2.x86_64                                                                                                                                    4/4 
      Verifying  : cpp-4.8.5-16.0.3.el7_4.2.x86_64                                                                                                                                    1/4 
      Verifying  : mpfr-3.1.1-4.el7.x86_64                                                                                                                                            2/4 
      Verifying  : gcc-4.8.5-16.0.3.el7_4.2.x86_64                                                                                                                                    3/4 
      Verifying  : libmpc-1.0.1-3.el7.x86_64                                                                                                                                          4/4 
    
    Installed:
      gcc.x86_64 0:4.8.5-16.0.3.el7_4.2                                                                                                                                                   
    
    Dependency Installed:
      cpp.x86_64 0:4.8.5-16.0.3.el7_4.2                                libmpc.x86_64 0:1.0.1-3.el7                                mpfr.x86_64 0:3.1.1-4.el7                               
    
    Complete!
    # 
    

    I have added to /home/oracle/.bash_profile:

    export ORACLE_HOME=/opt/oc12201
    export PATH=$ORACLE_HOME/bin:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    

    I have adapted pcscfg.cfg file to search in the right include directories:

    $ cat /opt/oc12201/precomp/admin/pcscfg.cfg
    sys_include=($ORACLE_HOME/precomp/public,/usr/include,/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include)
    ltype=short
    define=__x86_64__
    

    I have compiled a demo program sample10.pc that works like a mini SQL*Plus from Oracle Examples:

    $ cd $ORACLE_HOME/precomp/demo/proc
    $ make -f demo_proc.mk sample10
    make -f /opt/oc12201/precomp/demo/proc/demo_proc.mk OBJS=sample10.o EXE=sample10 build
    make[1]: Entering directory `/opt/oc12201/precomp/demo/proc'
    make -f /opt/oc12201/precomp/demo/proc/demo_proc.mk PROCFLAGS="" PCCSRC=sample10 I_SYM=include= pc1
    make[2]: Entering directory `/opt/oc12201/precomp/demo/proc'
    proc  iname=sample10 include=. include=/opt/oc12201/precomp/public include=/opt/oc12201/rdbms/public include=/opt/oc12201/rdbms/demo include=/opt/oc12201/plsql/public include=/opt/oc12201/network/public
    
    Pro*C/C++: Release 12.2.0.1.0 - Production on Fri Mar 16 21:46:47 2018
    
    Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.
    
    System default option values taken from: /opt/oc12201/precomp/admin/pcscfg.cfg
    
    make[2]: Leaving directory `/opt/oc12201/precomp/demo/proc'
    /usr/bin/gcc  -O3  -trigraphs -fPIC -DPRECOMP -I. -I/opt/oc12201/precomp/public -I/opt/oc12201/rdbms/public -I/opt/oc12201/rdbms/demo -I/opt/oc12201/plsql/public -I/opt/oc12201/network/public -DLINUX -DORAX86_64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -DLONG_IS_64 -DSS_64BIT_SERVER -DCOMP_DIR="" -DLDAP_CM     -m64 -c sample10.c
    /usr/bin/gcc -m64 -o sample10 sample10.o -L/opt/oc12201/lib/ -lclntsh -lclntshcore `cat /opt/oc12201/lib/ldflags`   `cat /opt/oc12201/lib/sysliblist` -ldl -lm  
    make[1]: Leaving directory `/opt/oc12201/precomp/demo/proc'
    $ 
    

    I have set TWO_TASK environment variable to use an Easy Connect string to an existing 12.2.0.1 database (it looks like you must use TWO_TASK which seems to indicate that code is quite old).

    I have run sample10 with:

    $ export TWO_TASK=rh7ttfs0:1521/CDB
    $ ./sample10
    
    username: system
    password: manager
    
    Connected to ORACLE as user system.
    
    SQL> select instance_name, host_name from v$instance;
    
    INSTANCE_NAME    HOST_NAME                      
    
    CDB              rh7ttfs0.localdomain                                             
    
    
    1 row processed.
    
    SQL> exit
    
    Have a good day!
    
    $ 
    

    Oracle Client including Pro*C installation is OK.

    PS: here is sample10.c which is the C source file generated by Proc*C: it contains very old comments up to 1984 and reference to VAX:

    /***************************************************************
    *      The SQLDA descriptor definition                         *
    *--------------------------------------------------------------*
    *      VAX/3B Version                                          *
    *                                                              *
    * Copyright (c) 1987, 2011, Oracle and/or its affiliates. All rights reserved. 
    ***************************************************************/
    
    Categories: DBA Blogs

    ASM free disk space in high redundancy disk groups

    Sun, 2018-02-25 09:05

    ASM free disk space is easy to understand if you use only disk group with external redundancy. ASM 12.2. documentation says:


    The values in the TOTAL_MB and FREE_MB columns best describe space usage when you do not configure Oracle ASM mirroring, that is, when you use external redundancy.


    But if you start to work with normal redundancy disk groups or high redundancy disk groups it gets more complicated.

    In this blog post I am going to give an example based on a high redundancy disk group of 5 disks of 5.8 GB.

    Configuration used

    I have created HRDATA high redundancy disk group with following SQL statement (high redundancy means 3-way mirroring) with:

    create diskgroup HRDATA high redundancy disk '/dev/asm-disk3' disk '/dev/asm-disk4' disk '/dev/asm-disk5' disk '/dev/asm-disk6' disk '/dev/asm-disk7';
    

    Note that I did not explicitely created any failure group: this means that by default each disk is its own failure group.

    I have used following Grid Infrastructure and Oracle Database configuration:

    $ $ORACLE_HOME/OPatch/opatch lsinv
    Oracle Interim Patch Installer version 12.2.0.1.6
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u01/gi12201
    Central Inventory : /u01/orainv
       from           : /u01/gi12201/oraInst.loc
    OPatch version    : 12.2.0.1.6
    OUI version       : 12.2.0.1.4
    Log file location : /u01/gi12201/cfgtoollogs/opatch/opatch2018-02-05_19-58-16PM_1.log
    
    Lsinventory Output file location : /u01/gi12201/cfgtoollogs/opatch/lsinv/lsinventory2018-02-05_19-58-16PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: ol7ttsa1
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Grid Infrastructure 12c                                       12.2.0.1.0
    There are 1 products installed in this Oracle Home.
    
    
    There are no Interim patches installed in this Oracle Home.
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.HRDATA.dg
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.RECO.dg
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.asm
                   ONLINE  ONLINE       ol7ttsa1                 Started,STABLE
    ora.ons
                   OFFLINE OFFLINE      ol7ttsa1                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.cssd
          1        ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.db1.db
          1        ONLINE  ONLINE       ol7ttsa1                 Open,HOME=/u01/db122
                                                                 01,STABLE
    ora.diskmon
          1        OFFLINE OFFLINE                               STABLE
    ora.evmd
          1        ONLINE  ONLINE       ol7ttsa1                 STABLE
    --------------------------------------------------------------------------------
    $ . oraenv
    ORACLE_SID = [+ASM] ? DB1
    The Oracle base has been changed from /u01/base to /u01/oracle
    $ $ORACLE_HOME/OPatch/opatch lsinv
    Oracle Interim Patch Installer version 12.2.0.1.6
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u01/db12201
    Central Inventory : /u01/orainv
       from           : /u01/db12201/oraInst.loc
    OPatch version    : 12.2.0.1.6
    OUI version       : 12.2.0.1.4
    Log file location : /u01/db12201/cfgtoollogs/opatch/opatch2018-02-25_10-01-55AM_1.log
    
    Lsinventory Output file location : /u01/db12201/cfgtoollogs/opatch/lsinv/lsinventory2018-02-25_10-01-55AM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: ol7ttsa1
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Database 12c                                                  12.2.0.1.0
    There are 1 products installed in this Oracle Home.
    
    
    There are no Interim patches installed in this Oracle Home.
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    

    Here is the ASM disk configuration (I don’t know why Redund columns is set to UNKNOWN):

    $ lsdsk -G HRDATA -k
    Total_MB  Free_MB  OS_MB  Name         Failgroup    Site_Name  Site_GUID                         Site_Status  Failgroup_Type  Library  Label  Failgroup_Label  Site_Label  UDID  Product  Redund   Path
        5799     5764   5799  HRDATA_0000  HRDATA_0000             00000000000000000000000000000000               REGULAR         System                                                      UNKNOWN  /dev/asm-disk3
        5799     5762   5799  HRDATA_0001  HRDATA_0001             00000000000000000000000000000000               REGULAR         System                                                      UNKNOWN  /dev/asm-disk4
        5799     5762   5799  HRDATA_0002  HRDATA_0002             00000000000000000000000000000000               REGULAR         System                                                      UNKNOWN  /dev/asm-disk5
        5799     5760   5799  HRDATA_0003  HRDATA_0003             00000000000000000000000000000000               REGULAR         System                                                      UNKNOWN  /dev/asm-disk6
        5799     5763   5799  HRDATA_0004  HRDATA_0004             00000000000000000000000000000000               REGULAR         System                                                      UNKNOWN  /dev/asm-disk7
    

    I have checked disk space information with:

    $  asmcmd lsdg HRDATA
    State    Type  Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
    MOUNTED  HIGH  N         512             512   4096  1048576     28995    28811            11598            5737              0             N  HRDATA/
    

    Note that in asmcmd lsdg output Total_MB and Free_MB don’t take redundancy into account: the 5 disk sizes have been added to give these numbers. However this is not the case with Usable_file_MB: according to this column we have only 5.7 GB disk space available: that means more or less the size of a single disk.

    ASM 12.2 documentation says that Req_mir_free_MB is the
    Amount of space that must be available in the disk group to restore full redundancy after the most severe failure that can be tolerated by the disk group
    and that Usable_file_MB is the Amount of free space, adjusted for mirroring, that is available for new files.

    What is the maximum disk space that can be used in this 5-disk diskgroup ?

    I have tried:

    SYS@DB1>create tablespace HRTS datafile '+HRDATA' size 9596M;
    create tablespace HRTS datafile '+HRDATA' size 9596M
    *
    ERROR at line 1:
    ORA-01119: error in creating database file '+HRDATA'
    ORA-17502: ksfdcre:4 Failed to create file +HRDATA
    ORA-15041: diskgroup "HRDATA" space exhausted
    
    
    SYS@DB1>create tablespace HRTS datafile '+HRDATA' size 9595M;
    create tablespace HRTS datafile '+HRDATA' size 9595M
    *
    ERROR at line 1:
    ORA-01119: error in creating database file '+HRDATA'
    ORA-17502: ksfdcre:4 Failed to create file +HRDATA
    ORA-15041: diskgroup "HRDATA" space exhausted
    
    SYS@DB1>create tablespace HRTS datafile '+HRDATA' size 9594M;
    
    Tablespace created.
    
    SYS@DB1>
    

    I have checked disk space information:

    $ asmcmd lsdg HRDATA
    State    Type  Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
    MOUNTED  HIGH  N         512             512   4096  1048576     28995       23            11598           -3858              0             N  HRDATA/
    

    Note hat Usable_file_MB is now negative and that Free_MB is close to zero MB.

    I have checked file level redundancy with:

    SYS@+ASM>select ad.name as dg_name, af.file_number, af.type, af.redundancy, af.redundancy_lowered
      2  from v$asm_file af, v$asm_diskgroup ad
      3  where af.group_number = ad.group_number and ad.name='HRDATA';
    
    DG_NAME    FILE_NUMBER TYPE			      REDUNDANCY      REDUNDANCY_LOWERED
    ---------- ----------- ------------------------------ --------------- --------------------
    HRDATA		   262 DATAFILE 		      HIGH	      U
    
    SYS@+ASM>
    

    At this step I cannot drop any disk:

    SYS@+ASM>alter diskgroup HRDATA drop disk HRDATA_0000;
    alter diskgroup HRDATA drop disk HRDATA_0000
    *
    ERROR at line 1:
    ORA-15032: not all alterations performed
    ORA-15250: insufficient diskgroup space for rebalance completion
    
    
    SYS@+ASM>
    

    I have dropped tablespace:

    SYS@DB1>drop tablespace HRTS;
    
    Tablespace dropped.
    

    I have created a smaller tablespace that is also bigger than 1 disk:

    SYS@DB1>create tablespace HRTS datafile '+HRDATA' size 6000M;
    
    Tablespace created.
    
    SYS@DB1>
    

    At this step I have following ASM disk space:

    $ asmcmd lsdg HRDATA
    State    Type  Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
    MOUNTED  HIGH  N         512             512   4096  1048576     28995    10805            11598            -264              0             N  HRDATA/
    

    I could only drop one disk:

    SYS@+ASM>alter diskgroup HRDATA drop disk HRDATA_0000, HRDATA_0001;
    alter diskgroup HRDATA drop disk HRDATA_0000, HRDATA_0001
    *
    ERROR at line 1:
    ORA-15032: not all alterations performed
    ORA-15250: insufficient diskgroup space for rebalance completion
    
    
    SYS@+ASM>alter diskgroup HRDATA drop disk HRDATA_0000;
    
    Diskgroup altered.
    
    SYS@+ASM>
    

    I have checked ASM disk group space with:

    $ asmcmd lsdg HRDATA
    State    Type  Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
    MOUNTED  HIGH  N         512             512   4096  1048576     23196     5008             5799            -263              0             N  HRDATA/
    

    To go back to initial configuration, I have dropped the tablespace:

    SYS@DB1>drop tablespace HRTS;
    
    Tablespace dropped.
    
    SYS@DB1>
    

    And I have added the disk previously dropped:

    SYS@+ASM> alter diskgroup HRDATA add disk '/dev/asm-disk3';
    
    Diskgroup altered.
    
    SYS@+ASM>
    
    What is the most severe failure that can be tolerated by this 5 disk diskgroup ?

    Now the diskgroup is empty. I have tried to drop 3 disks, 2 disks and 1 disk:

    SYS@+ASM>alter diskgroup HRDATA drop disk HRDATA_0000, HRDATA_0001, HRDATA_0002, HRDATA_0003;
    alter diskgroup HRDATA drop disk HRDATA_0000, HRDATA_0001, HRDATA_0002, HRDATA_0003
    *
    ERROR at line 1:
    ORA-15067: command or option incompatible with diskgroup redundancy
    
    
    SYS@+ASM>alter diskgroup HRDATA drop disk HRDATA_0000, HRDATA_0001, HRDATA_0002;
    alter diskgroup HRDATA drop disk HRDATA_0000, HRDATA_0001, HRDATA_0002
    *
    ERROR at line 1:
    ORA-15067: command or option incompatible with diskgroup redundancy
    
    
    SYS@+ASM>alter diskgroup HRDATA drop disk HRDATA_0000, HRDATA_0001;
    
    Diskgroup altered.
    
    SYS@+ASM>
    

    The most severe failure that can be tolerated is failure of 2 disks in this 5 disk diskgroup. This matches what ASM 12.2 documentation says:
    For five or more failure groups, two disk failures are tolerated.

    I have checked ASM free disk space:

    $ asmcmd lsdg HRDATA
    State    Type  Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
    MOUNTED  HIGH  N         512             512   4096  1048576     17397    17217                0            5739              0             N  HRDATA/
    

    Note that Free_MB has changed but Usable_file_MB has not changed (considering a 2 MB difference as not significant).

    I have checked that in this 3-disk diskgroup configuration the maximum disk space that can be used is 5737M:

    SYS@DB1>create tablespace HRTS datafile '+HRDATA' size 5738M
    *
    ERROR at line 1:
    ORA-01119: error in creating database file '+HRDATA'
    ORA-17502: ksfdcre:4 Failed to create file +HRDATA
    ORA-15041: diskgroup "HRDATA" space exhausted
    
    
    SYS@DB1>create tablespace HRTS datafile '+HRDATA' size 5737M
    
    Tablespace created.
    
    SYS@DB1>
    

    This is expected because the disk group has only 3 disks with 3-way redudancy.

    I have checked ASM disk space:

    $ asmcmd lsdg HRDATA
    State    Type  Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
    MOUNTED  HIGH  N         512             512   4096  1048576     17397        0                0               0              0             N  HRDATA/
    

    I have checked file level redundancy:

    SYS@+ASM>select ad.name as dg_name, af.file_number, af.type, af.redundancy, af.redundancy_lowered
      2  from v$asm_file af, v$asm_diskgroup ad
      3  where af.group_number = ad.group_number and ad.name='HRDATA';
    
    DG_NAME    FILE_NUMBER TYPE			      REDUNDANCY      REDUNDANCY_LOWERED
    ---------- ----------- ------------------------------ --------------- --------------------
    HRDATA		   262 DATAFILE 		      HIGH	      U
    
    SYS@+ASM>
    
    Conclusion

    According to these tests, the maximum disk space that can be used in a high redundancy disk group is roughly one third of the total disk space: this is expected due to the 3-way redundancy that is implemented by ASM. However using this maximum disk capacity has an impact on the most severe disk failure that can be tolerated: the total number of disks that can be lost can go from 2 to 1 and even to 0.

    ASM 12.2 documentation gives more detailed information about disk group capacity (including reduced redundancy cases that I have not tested).

    Categories: DBA Blogs

    ASM File System (ACFS) resources in Oracle Restart 12.2.0.1

    Mon, 2018-01-29 00:22

    ACFS is neither an Oracle 12.2 new feature nor an Oracle 12.1 new feature: it is actually an Oracle 11.2 new feature.

    ACFS stands for ASM Cluster File System. Oracle Restart (also knowns as single node Grid Infrastructure) is not a cluster solution, it is a software layer to manage resources like ASM disk groups, Oracle Net listeners and database instances on a single machine. How does ACFS work with Oracle Restart ? Oracle Restart does support ACFS however Oracle Restart does not take into account ACFS resources.

    Note that ACFS is layered on ASM through the Oracle ADVM interface.

    In this blog article I intend to show how to code Linux scripts to do what Oracle Restart does not do for ACFS.

    Linux, Oracle and device configuration used

    For this blog post I have used:

    $ cat /etc/os-release 
    NAME="Oracle Linux Server"
    VERSION="7.3"
    ID="ol"
    VERSION_ID="7.3"
    PRETTY_NAME="Oracle Linux Server 7.3"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:oracle:linux:7:3:server"
    HOME_URL="https://linux.oracle.com/"
    BUG_REPORT_URL="https://bugzilla.oracle.com/"
    
    ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
    ORACLE_BUGZILLA_PRODUCT_VERSION=7.3
    ORACLE_SUPPORT_PRODUCT="Oracle Linux"
    ORACLE_SUPPORT_PRODUCT_VERSION=7.3
    
    $ $ORACLE_HOME/OPatch/opatch lsinv
    Oracle Interim Patch Installer version 12.2.0.1.6
    Copyright (c) 2018, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /u01/gi12201
    Central Inventory : /u01/orainv
       from           : /u01/gi12201/oraInst.loc
    OPatch version    : 12.2.0.1.6
    OUI version       : 12.2.0.1.4
    Log file location : /u01/gi12201/cfgtoollogs/opatch/opatch2018-01-27_17-51-43PM_1.log
    
    Lsinventory Output file location : /u01/gi12201/cfgtoollogs/opatch/lsinv/lsinventory2018-01-27_17-51-43PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: ol7ttsa1
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1): 
    
    Oracle Grid Infrastructure 12c                                       12.2.0.1.0
    There are 1 products installed in this Oracle Home.
    
    
    There are no Interim patches installed in this Oracle Home.
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    
    
    $ cat /etc/udev/rules.d/99-oracle-asmdevices.rules 
    KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBfa23f4a6-da11d28e", SYMLINK+="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"
    KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="1ATA_VBOX_HARDDISK_VBcfa5c59e-15ba04c4", SYMLINK+="asm-disk2", OWNER="oracle", GROUP="dba", MODE="0660" 
    $ sqlplus / as sysdba
    
    SQL*Plus: Release 12.2.0.1.0 Production on Sat Jan 27 17:53:46 2018
    
    Copyright (c) 1982, 2016, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
    
    SYS@+ASM>column path format a20
    SYS@+ASM>select name, path from v$asm_disk;
    
    NAME			       PATH
    ------------------------------ --------------------
    DATA_0000		       /dev/asm-disk1
    RECO_0000		       /dev/asm-disk2
    
    SYS@+ASM>
    

    Note that neither ASMLib nor ASM FD are used to manage ASM disks.

    Commands with # prompt have been with run with Linux root account and commands with $ prompt have been run with Linux oracle account.

    On this machine I have 2 ASM disk groups and 1 database:

    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.RECO.dg
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.asm
                   ONLINE  ONLINE       ol7ttsa1                 Started,STABLE
    ora.ons
                   OFFLINE OFFLINE      ol7ttsa1                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.cssd
          1        ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.db1.db
          1        ONLINE  ONLINE       ol7ttsa1                 Open,HOME=/u01/db122
                                                                 01,STABLE
    ora.diskmon
          1        OFFLINE OFFLINE                               STABLE
    ora.evmd
          1        ONLINE  ONLINE       ol7ttsa1                 STABLE
    --------------------------------------------------------------------------------
    
    First ACFS configuration

    First I have run acfsload to load into Linux kernel Oracle modules needed by ACFS:

    # . oraenv
    ORACLE_SID = [root] ? +ASM
    The Oracle base has been set to /u01/base
    [root@ol7ttsa1 ~]# which acfsload
    /u01/gi12201/bin/acfsload
    [root@ol7ttsa1 ~]# acfsload start
    ACFS-9391: Checking for existing ADVM/ACFS installation.
    ACFS-9392: Validating ADVM/ACFS installation files for operating system.
    ACFS-9393: Verifying ASM Administrator setup.
    ACFS-9308: Loading installed ADVM/ACFS drivers.
    ACFS-9154: Loading 'oracleoks.ko' driver.
    ACFS-9154: Loading 'oracleadvm.ko' driver.
    ACFS-9154: Loading 'oracleacfs.ko' driver.
    ACFS-9327: Verifying ADVM/ACFS devices.
    ACFS-9156: Detecting control device '/dev/asm/.asm_ctl_spec'.
    ACFS-9156: Detecting control device '/dev/ofsctl'.
    ACFS-9322: completed
    [root@ol7ttsa1 ~]# lsmod | grep pra
    [root@ol7ttsa1 ~]# lsmod | grep ora
    oracleacfs           4616192  0 
    oracleadvm            782336  0 
    oracleoks             655360  2 oracleacfs,oracleadvm
    

    I have created an ASM volume:

    $ . oraenv
    ORACLE_SID = [oracle] ? +ASM
    The Oracle base has been set to /u01/base
    $ asmcmd volcreate -G data -s 10G volume1
    $ asmcmd volinfo -G data volume1
    Diskgroup Name: DATA
    
    	 Volume Name: VOLUME1
    	 Volume Device: /dev/asm/volume1-405
    	 State: ENABLED
    	 Size (MB): 10240
    	 Resize Unit (MB): 64
    	 Redundancy: UNPROT
    	 Stripe Columns: 8
    	 Stripe Width (K): 1024
    	 Usage: 
    	 Mountpath: 
    

    I have created an ACFS file system:

    $ /sbin/mkfs -t acfs /dev/asm/volume1-405
    mkfs.acfs: version                   = 12.2.0.1.0
    mkfs.acfs: on-disk version           = 46.0
    mkfs.acfs: volume                    = /dev/asm/volume1-405
    mkfs.acfs: volume size               = 10737418240  (  10.00 GB )
    mkfs.acfs: Format complete.
    

    I have mounted this volume as an ACFS file system:

    # mkdir -p /acfsmounts/acfs1
    [root@ol7ttsa1 ~]# chown oracle:dba /acfsmounts/acfs1
    [root@ol7ttsa1 ~]# mount -t acfs /dev/asm/volume1-405 /acfsmounts/acfs1
    [root@ol7ttsa1 ~]# df -h /acfsmounts/acfs1
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/asm/volume1-405   10G  265M  9.8G   3% /acfsmounts/acfs1
    

    I have checked lsblk output:

    $ lsblk 
    NAME            MAJ:MIN    RM  SIZE RO TYPE MOUNTPOINT
    sda               8:0       0   40G  0 disk 
    ├─sda1            8:1       0    1G  0 part /boot
    └─sda2            8:2       0   39G  0 part 
      ├─ol-root     251:0       0 35.1G  0 lvm  /
      └─ol-swap     251:1       0  3.9G  0 lvm  [SWAP]
    sdb               8:16      0   40G  0 disk 
    └─sdb1            8:17      0   40G  0 part 
    sdc               8:32      0   10G  0 disk 
    └─sdc1            8:33      0   10G  0 part 
    sr0              11:0       1 1024M  0 rom  
    asm!volume1-405 250:207361  0   10G  0 disk /acfsmounts/acfs1
    

    I have rebooted the machine:

    # systemctl reboot
    Connection to ol7ttsa1 closed by remote host.
    Connection to ol7ttsa1 closed.
    

    I have checked that Oracle Restart looks OK:

    -------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.RECO.dg
                   ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.asm
                   ONLINE  ONLINE       ol7ttsa1                 Started,STABLE
    ora.ons
                   OFFLINE OFFLINE      ol7ttsa1                 STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.cssd
          1        ONLINE  ONLINE       ol7ttsa1                 STABLE
    ora.db1.db
          1        ONLINE  ONLINE       ol7ttsa1                 Open,HOME=/u01/db122
                                                                 01,STABLE
    ora.diskmon
          1        OFFLINE OFFLINE                               STABLE
    ora.evmd
          1        ONLINE  ONLINE       ol7ttsa1                 STABLE
    --------------------------------------------------------------------------------
    

    I have checked that ACFS file system is missing:

    $ df 
    Filesystem          1K-blocks     Used Available Use% Mounted on
    devtmpfs              1871592        0   1871592   0% /dev
    tmpfs                 1891012   659456   1231556  35% /dev/shm
    tmpfs                 1891012     8568   1882444   1% /run
    tmpfs                 1891012        0   1891012   0% /sys/fs/cgroup
    /dev/mapper/ol-root  36805060 28218948   8586112  77% /
    /dev/sda1             1038336   176476    861860  17% /boot
    tmpfs                  378204        0    378204   0% /run/user/54321
    tmpfs                  378204        0    378204   0% /run/user/0
    $ 
    

    I have checked that no ACFS Linux modules have been loaded:

    $ lsmod | grep ora
    $ 
    

    I have tried to mount the ACFS file system:

    # mount -t acfs /dev/asm/volume1-405 /acfsmounts/acfs1
    mount.acfs: CLSU-00100: operating system function: open64 failed with error data: 2
    mount.acfs: CLSU-00101: operating system error message: No such file or directory
    mount.acfs: CLSU-00103: error location: OOF_1
    mount.acfs: CLSU-00104: additional error information: open64 (/dev/ofsctl)
    mount.acfs: ACFS-00502: Failed to communicate with the ACFS driver.  Verify the ACFS driver has been loaded.
    

    To fix this I have first reloaded ACFS drivers:

    # . oraenv
    ORACLE_SID = [root] ? +ASM
    The Oracle base has been set to /u01/base
    # acfsload start
    ACFS-9391: Checking for existing ADVM/ACFS installation.
    ACFS-9392: Validating ADVM/ACFS installation files for operating system.
    ACFS-9393: Verifying ASM Administrator setup.
    ACFS-9308: Loading installed ADVM/ACFS drivers.
    ACFS-9154: Loading 'oracleoks.ko' driver.
    ACFS-9154: Loading 'oracleadvm.ko' driver.
    ACFS-9154: Loading 'oracleacfs.ko' driver.
    ACFS-9327: Verifying ADVM/ACFS devices.
    ACFS-9156: Detecting control device '/dev/asm/.asm_ctl_spec'.
    ACFS-9156: Detecting control device '/dev/ofsctl'.
    ACFS-9322: completed
    

    I have checked the status of the ASM volume:

    $ asmcmd volinfo -G data volume1
    Diskgroup Name: DATA
    
    	 Volume Name: VOLUME1
    	 Volume Device: UNKNOWN
    	 State: DISABLED
    	 Size (MB): 10240
    	 Resize Unit (MB): 64
    	 Redundancy: UNPROT
    	 Stripe Columns: 8
    	 Stripe Width (K): 1024
    	 Usage: ACFS
    	 Mountpath: /acfsmounts/acfs1 
    

    The ASM volume does exist but is disabled.

    I have tried to enable the ASM volume:

    $ asmcmd volenable -G data volume1
    $ asmcmd volinfo -G data volume1
    Diskgroup Name: DATA
    
    	 Volume Name: VOLUME1
    	 Volume Device: /dev/asm/volume1-405
    	 State: ENABLED
    	 Size (MB): 10240
    	 Resize Unit (MB): 64
    	 Redundancy: UNPROT
    	 Stripe Columns: 8
    	 Stripe Width (K): 1024
    	 Usage: ACFS
    	 Mountpath: /acfsmounts/acfs1 
     
    

    I have noted that enabling the volume triggers the device file creation:

    $ ls -al /dev/asm/volume1-405 
    brwxrwx---. 1 root dba 250, 207361 Jan 27 18:13 /dev/asm/volume1-405
    

    However at this point it is not possible to mount related ACFS file system (and I don’t know why):

    # mount -t acfs /dev/asm/volume1-405 /acfsmounts/acfs1/
    mount.acfs: CLSU-00100: operating system function: open64 failed with error data: 1
    mount.acfs: CLSU-00101: operating system error message: Operation not permitted
    mount.acfs: CLSU-00103: error location: OOF_1
    mount.acfs: CLSU-00104: additional error information: open64 (/dev/asm/volume1-405)
    mount.acfs: ACFS-02017: Failed to open volume /dev/asm/volume1-405. Verify the volume exists.
    
    Using systemctl scripts to manage ACFS resources

    Here is the systemctl script to start Oracle Restart:

    # cat oracle-ohasd.service
    # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
    #
    # Oracle OHASD startup
    
    [Unit]
    Description=Oracle High Availability Services
    After=syslog.target network-online.target remote-fs.target
    
    [Service]
    ExecStart=/etc/init.d/init.ohasd run &gt/dev/null 2&gt&1 &lt/dev/null
    ExecStop=/etc/init.d/init.ohasd stop &gt/dev/null 2&gt&1 &lt/dev/null
    TimeoutStopSec=60min
    Type=simple
    Restart=always
    
    # Do not kill any processes except init.ohasd after ExecStop, unless the
    # stop command times out.
    KillMode=process
    SendSIGKILL=yes
    
    [Install]
    WantedBy=multi-user.target graphical.target
    
    Step 1: create a systemctl script to run acfsload

    In /etc/systemd/system I have created a script named acfsload.service:

    [Unit]
    After=syslog.target 
    Before=oracle-ohasd.service
    
    [Service]
    ExecStart=/u01/gi12201/bin/acfsload start -s
    
    [Install]
    WantedBy=default.target
    

    I have enabled it with:

    # systemctl daemon-reload
    # systemctl enable acfsload.service
    Created symlink from /etc/systemd/system/default.target.wants/acfsload.service to /etc/systemd/system/acfsload.service.
    
    Step 2: create a systemctl script to enable the ASM volume to be used by ACFS

    In /etc/systemd/system I have created a script named oracle-acfsvolenable.service:

    [Unit]
    Requires=oracle-ohasd.service
    After=oracle-ohasd.service
    
    [Service]
    ExecStart=/home/oracle/scripts/acfsvolenable.sh
    
    [Install]
    WantedBy=default.target
    

    I have enabled it:

    # systemctl daemon-reload
    # systemctl enable oracle-acfsvolenable.service
    Created symlink from /etc/systemd/system/default.target.wants/oracle-oracle-acfsvolenable.service to /etc/systemd/system/oracle-acfsvolenable.service.
    

    I have coded acfsvolenable.sh:

    #!/bin/sh
    #
    # acfsvolenable.sh
    #
    # -----------------------------------------------------------
    # wait for ASM instance 
    while [ 1 ]
    do
     ASM_OK=$(ps -eaf | grep asm_pmon | grep -v grep | wc -l)
     if [ $ASM_OK -eq 1 ]
     then
       break
     fi
     sleep 1
    done
    echo "ASM instance ready."
    #
    su - oracle -c /home/oracle/scripts/acfsvolenable_asgiowner.sh
    

    I have given executable privilege:

    # chmod u+x /home/oracle/scripts/acfsvolenable.sh
    

    I have also coded acfsvolenable_asgiowner.sh: it must be a separate script because it must not be run by root but as Grid Infrastructure software owner (in my case this is oracle Linux account):

    #!/bin/sh
    #
    # acfsvolenable_asgiowner.sh
    #
    # must be run with Grid Infrastructure owner
    #
    DGN=DATA
    VN=volume1
    export ORAENV_ASK=NO
    export ORACLE_SID=+ASM
    . oraenv 
    asmcmd volenable -G $DGN $VN 
    RC=$?
    if [ $? -eq  0 ]
    then
     echo "In diskgroup $DGN volume $VN enabled."
    else
     echo "failed to enable in diskgroup $DGN volume $VN."
    fi
    exit $RC
    

    I have changed ownership and privileges for this script:

    # chown oracle:dba /home/oracle/scripts/acfsvolenable_asgiowner.sh
    # chmod u+x /home/oracle/scripts/acfsvolenable_asgiowner.sh
    
    Step 3: create the systemctl script to mount the ASM volume

    I have coded oracle-acfsmount.service:

    [Unit]
    Requires=oracle-acfsvolenable.service
    After=oracle-acfsvolenable.service 
    
    [Service]
    ExecStart=/home/oracle/scripts/acfsmount.sh
    
    [Install]
    WantedBy=default.target
    

    I have run:

    # systemctl daemon-reload
    # systemctl enable oracle-acfsmount.service
    Created symlink from /etc/systemd/system/default.target.wants/oracle-acfsmount.service to /etc/systemd/system/oracle-acfsmount.service.
    

    I have coded acfsmount.sh:

    #!/bin/sh
    #
    # acfsmount.sh
    #
    # must be run with root account
    #
    # ---------------------------------------------------
    # wait for acfsvolenable.sh
    #
    BD=/dev/asm/volume1-405
    while [ 1 ]
    do
     if [ -b $BD ]
     then
      break
     fi
     sleep 1
    done 
    echo "$BD ready."
    mount -t acfs $BD /acfsmounts/acfs1 
    

    I have given executable privilege for this script:

    chmod u+x /home/oracle/scripts/acfsmount.sh
    

    To test my scripts I have rebooted my Linux machine with:

    # systemctl reboot
    

    I have checked related syslog messages:

    Jan 27 19:02:27 ol7ttsa1 logger: exec /u01/gi12201/perl/bin/perl -I/u01/gi12201/perl/lib /u01/gi12201/bin/crswrapexece.pl /u01/gi12201/crs/install/s_crsconfig_ol7ttsa1_env.txt /u01/gi12201/bin/ohasd.bin "reboot"
    Jan 27 19:02:27 ol7ttsa1 systemd: Started Postfix Mail Transport Agent.
    Jan 27 19:02:27 ol7ttsa1 systemd: Reached target Multi-User System.
    Jan 27 19:02:27 ol7ttsa1 systemd: Starting Multi-User System.
    Jan 27 19:02:27 ol7ttsa1 systemd: Starting Update UTMP about System Runlevel Changes...
    Jan 27 19:02:27 ol7ttsa1 systemd: Started Update UTMP about System Runlevel Changes.
    Jan 27 19:02:30 ol7ttsa1 kdumpctl: kexec: loaded kdump kernel
    Jan 27 19:02:30 ol7ttsa1 kdumpctl: Starting kdump: [OK]
    Jan 27 19:02:30 ol7ttsa1 systemd: Started Crash recovery kernel arming.
    Jan 27 19:02:30 ol7ttsa1 systemd: Startup finished in 402ms (kernel) + 2.864s (initrd) + 12.067s (userspace) = 15.335s.
    Jan 27 19:02:37 ol7ttsa1 su: (to oracle) root on none
    Jan 27 19:02:37 ol7ttsa1 systemd: Started Session c3 of user oracle.
    Jan 27 19:02:37 ol7ttsa1 systemd: Starting Session c3 of user oracle.
    Jan 27 19:02:37 ol7ttsa1 journal: Oracle Clusterware: 2018-01-27 19:02:37.823#012[(1340)]CRS-8500:Oracle Clusterware OHASD process is starting with operating system process ID 1340
    Jan 27 19:02:37 ol7ttsa1 clsecho: /etc/init.d/init.ohasd: Writing 1340 to oracle-ohasd tasks
    Jan 27 19:02:37 ol7ttsa1 init.ohasd: /etc/init.d/init.ohasd: Writing 1340 to oracle-ohasd tasks
    Jan 27 19:02:58 ol7ttsa1 acfsvolenable.sh: ASM instance ready.
    Jan 27 19:02:58 ol7ttsa1 su: (to oracle) root on none
    Jan 27 19:02:58 ol7ttsa1 systemd: Started Session c4 of user oracle.
    Jan 27 19:02:58 ol7ttsa1 systemd: Starting Session c4 of user oracle.
    Jan 27 19:02:58 ol7ttsa1 acfsvolenable.sh: The Oracle base has been set to /u01/base
    Jan 27 19:02:59 ol7ttsa1 kernel: asm_rbal_+asm: sending ioctl 2285 to a partition!
    Jan 27 19:02:59 ol7ttsa1 kernel: asm_rbal_+asm: sending ioctl 2285 to a partition!
    Jan 27 19:02:59 ol7ttsa1 kernel: asm_rbal_+asm: sending ioctl 2285 to a partition!
    Jan 27 19:02:59 ol7ttsa1 kernel: asm_rbal_+asm: sending ioctl 2285 to a partition!
    Jan 27 19:03:05 ol7ttsa1 acfsmount.sh: /dev/asm/volume1-405 ready.
    Jan 27 19:03:06 ol7ttsa1 acfsvolenable.sh: In diskgroup DATA volume volume1 enabled.
    Jan 27 19:03:11 ol7ttsa1 kernel: ora_rbal_db1: sending ioctl 2285 to a partition!
    Jan 27 19:03:11 ol7ttsa1 kernel: ora_rbal_db1: sending ioctl 2285 to a partition!
    Jan 27 19:03:52 ol7ttsa1 systemd: Created slice user-0.slice.
    Jan 27 19:03:52 ol7ttsa1 systemd: Starting user-0.slice.
    Jan 27 19:03:52 ol7ttsa1 systemd: Started Session 1 of user root.
    Jan 27 19:03:52 ol7ttsa1 systemd-logind: New session 1 of user root.
    Jan 27 19:03:52 ol7ttsa1 systemd: Starting Session 1 of user root.
    

    Even if acfsmount.sh seems to be completed before acfsvolenable.sh, I don’t think this is the case.

    I have checked that df shows that the ACFS file system is now automatically mounted:

    Filesystem           1K-blocks     Used Available Use% Mounted on
    devtmpfs               1871592        0   1871592   0% /dev
    tmpfs                  1891012   659456   1231556  35% /dev/shm
    tmpfs                  1891012     8780   1882232   1% /run
    tmpfs                  1891012        0   1891012   0% /sys/fs/cgroup
    /dev/mapper/ol-root   36805060 28545272   8259788  78% /
    /dev/sda1              1038336   176476    861860  17% /boot
    tmpfs                   378204        0    378204   0% /run/user/54321
    /dev/asm/volume1-405  10485760   271356  10214404   3% /acfsmounts/acfs1
    tmpfs                   378204        0    378204   0% /run/user/0
    

    This shows that it is possible to use Linux shell scripts to manage ACFS resources for Oracle Restart.

    Categories: DBA Blogs

    Upgrading Grid Infrastructure (Oracle Restart) on Linux from 12.1.0.2 to 12.2.0.1 in silent mode

    Sat, 2017-12-23 10:44

    The system configuration used is Oracle Linux 6.8 64-bit: this a single machine running Oracle Grid Infrastructure (GI): this is an Oracle Restart installation and not a RAC cluster.

    The documentation I have used is chapter 11 Upgrading Grid Infrastructure of Oracle Grid Infrastructure Installation and Upgrade Guide for Linux 12c Release 2 (12.2) for Linux.

    All shell script steps have been run with oracle account which is GI software owner (and also Oracle Database software owner) unless otherwise stated.

    Upload Grid Infrastructure 12.2.0.1 media

    First I have created the target directory for GI 12.2:

    $ mkdir -p /u01/app/12.2.0.1/grid
    

    I have extracted GI media into this directory:

    $ cd /u01/app/12.2.0.1/grid
    $ pwd
    /u01/app/12.2.0.1/grid
    $ hostname
    ol6twsa.localdomain
    $ id
    uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
    $ unzip -q /tmp/linuxx64_12201_grid_home.zip
    $
    
    CLUVFY

    I have tried to run CLUVFY tool but I always got some strange error:

    $ ./runcluvfy.sh stage -pre crsinst -upgrade -src_crshome /u01/app/12.1.0.2/grid -dest_crshome /u01/app/12.2.0.1/grid -dest_version 12.2.0.1 -fixup -verbose
    
    ERROR: 
    Parse error:   'crs' is an invalid argument  Brief usage:   crsctl query has releaseversion     
    Lists the Oracle Clusterware release version    crsctl query has softwareversion    
    Lists the version of Oracle Clusterware software installed on the local node    crsctl query has releasepatch      L
    ists the Oracle Clusterware release patch level    crsctl query has softwarepatch      
    Lists the patch level of Oracle Clusterware software installed on the local host  
    For complete usage, use:     crsctl [-h | --help]  
    For detailed help on each command and object and its options use:     crsctl command object -h  For example, crsctl relocate resource -h
    
    ERROR: 
    Parse error:   'crs' is an invalid argument  Brief usage:   crsctl query has releaseversion     
    Lists the Oracle Clusterware release version    crsctl query has softwareversion     
    Lists the version of Oracle Clusterware software installed on the local node    crsctl query has releasepatch      
    Lists the Oracle Clusterware release patch level    crsctl query has softwarepatch      
    Lists the patch level of Oracle Clusterware software installed on the local host  
    For complete usage, use:     crsctl [-h | --help]  
    For detailed help on each command and object and its options use:     crsctl command  object -h  For example, crsctl relocate resource -h
    PRVG-0712 : Cannot upgrade: Oracle Clusterware stack not running on this node.
    
    Verification cannot proceed
    

    I have commented in .bash_profile ORACLE_HOME and ORACLE_BASE settings:

    $ tail  ~/.bash_profile
    
    PATH=$PATH:$HOME/bin
    
    export PATH
    export SQLPATH=/home/oracle/scripts
    export EDITOR=
    
    # for GI upgrade
    #export ORACLE_HOME=/u01/app/12.1.0.2/db
    #export ORACLE_BASE=/u01/app/oracle
    
    Upgrade response file

    I have created an upgrade response file using install/response/gridsetup.rsp template:

    $ diff upgrade.rsp ./install/response/gridsetup.rsp 
    60c60
    < INVENTORY_LOCATION=/u01/app/oracle/oraInventory
    ---
    > INVENTORY_LOCATION=
    74c74
    < oracle.install.option=UPGRADE
    ---
    > oracle.install.option=
    79c79
    < ORACLE_BASE=/u01/app/oracle
    ---
    > ORACLE_BASE=
    95c95
    < oracle.install.asm.OSDBA=dba
    ---
    > oracle.install.asm.OSDBA=
    108c108
    < oracle.install.asm.OSASM=dba
    ---
    > oracle.install.asm.OSASM=
    

    I have made sure to have about 24 GB free disk space for /u01 to avoid following error:

    [WARNING] [INS-30100] Insufficient disk space on the selected location (/u01/app/12.2.0.1/grid).
       CAUSE: Specified location is on a volume without enough disk space on nodes: [ol6twsa].
       ACTION: Choose a location that has enough space (minimum of 7,065MB) or free up space on the existing volume.
    
    Running gridSetup.sh in upgrade mode

    I have created following script to upgrade GI in silent mode:

    #!/bin/sh
    unset ORACLE_HOME
    unset ORACLE_BASE
    unset ORACLE_SID
    unset ORA_CRS_HOME
    ./gridSetup.sh -silent -responseFile upgrade.rsp
    

    But I could not run it:

    Launching Oracle Grid Infrastructure Setup Wizard...
    
    [WARNING] [INS-40436] Installer has detected an earlier version of Oracle Automatic Storage Management (ASM) Instance configured. Before proceeding with the upgrade you must shutdown all Oracle Databases that are using Oracle ASM for storage.
    
    You may ignore this message and continue with the upgrade, if the database(s) are already in shutdown state.
    [WARNING] [INS-41808] Possible invalid choice for OSASM Group.
       CAUSE: The name of the group you selected for the OSASM group is commonly used to grant other system privileges (For example: asmdba, asmoper, dba, oper).
       ACTION: Oracle recommends that you designate asmadmin as the OSASM group.
    [WARNING] [INS-41809] Possible invalid choice for OSDBA Group.
       CAUSE: The group name you selected as the OSDBA for ASM group is commonly used for Oracle Database administrator privileges.
       ACTION: Oracle recommends that you designate asmdba as the OSDBA for ASM group, and that the group should not be the same group as an Oracle Database OSDBA group.
    [WARNING] [INS-41812] OSDBA and OSASM are the same OS group.
       CAUSE: The chosen values for OSDBA group and the chosen value for OSASM group are the same.
       ACTION: Select an OS group that is unique for ASM administrators. The OSASM group should not be the same as the OS groups that grant privileges for Oracle ASM access, or for database administration.
    [WARNING] [INS-32056] The specified Oracle Base contains the existing Central Inventory location: /u01/app/oracle/oraInventory.
       ACTION: Oracle recommends that the Central Inventory location is outside the Oracle Base directory. Specify a different location for the Oracle Base.
    [WARNING] [INS-32018] The selected Oracle home is outside of Oracle base.
       ACTION: Oracle recommends installing Oracle software within the Oracle base directory. Adjust the Oracle home or Oracle base accordingly.
    [FATAL] [INS-13019] Some mandatory prerequisites are not met. These prerequisites cannot be ignored.
       ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oracle/oraInventory/logs/GridSetupActions2017-12-23_02-55-43PM/gridSetupActions2017-12-23_02-55-43PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
    

    List of failed tasks were:

    INFO:  [Dec 23, 2017 2:56:09 PM] ------------------List of failed Tasks------------------
    INFO:  [Dec 23, 2017 2:56:09 PM] *********************************************
    INFO:  [Dec 23, 2017 2:56:09 PM] Physical Memory: This is a prerequisite condition to test whether the system has at least 8GB (8388608.0KB) of total physical memory.
    INFO:  [Dec 23, 2017 2:56:09 PM] Severity:IGNORABLE
    INFO:  [Dec 23, 2017 2:56:09 PM] OverallStatus:VERIFICATION_FAILED
    INFO:  [Dec 23, 2017 2:56:09 PM] *********************************************
    INFO:  [Dec 23, 2017 2:56:09 PM] Oracle patch:21255373: This test checks that the Oracle patch "21255373" has been applied in home "/u01/app/12.1.0.2/grid".
    INFO:  [Dec 23, 2017 2:56:09 PM] Severity:FATAL
    INFO:  [Dec 23, 2017 2:56:09 PM] OverallStatus:VERIFICATION_FAILED
    INFO:  [Dec 23, 2017 2:56:09 PM] *********************************************
    INFO:  [Dec 23, 2017 2:56:09 PM] Package: cvuqdisk-1.0.10-1: This is a prerequisite condition to test whether the package "cvuqdisk-1.0.10-1" is available on the system.
    INFO:  [Dec 23, 2017 2:56:09 PM] Severity:IGNORABLE
    INFO:  [Dec 23, 2017 2:56:09 PM] OverallStatus:VERIFICATION_FAILED
    INFO:  [Dec 23, 2017 2:56:09 PM] -----------------End of failed Tasks List----------------
    SEVERE:  [Dec 23, 2017 2:56:09 PM] [FATAL] [INS-13019] Some mandatory prerequisites are not met. These prerequisites cannot be ignored.
       ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oracle/oraInventory/logs/GridSetupActions2017-12-23_02-55-43PM/gridSetup
    

    I decided to not install patch 21255373 and run with -skipPrereqs option:

    #!/bin/sh
    unset ORACLE_HOME
    unset ORACLE_BASE
    unset ORACLE_SID
    unset ORA_CRS_HOME
    ./gridSetup.sh -silent -responseFile upgrade.rsp -skipPrereqs
    

    To avoid:

    SEVERE:/u01/app/12.2.0.1/grid/inventory/Scripts/upgrade.rsp (No such file or directory)
    [FATAL] /u01/app/12.2.0.1/grid/inventory/Scripts/upgrade.rsp (No such file or directory)
    

    I had to copy my response file to /u01/app/12.2.0.1/grid/inventory/Scripts directory.

    This worked better:

    ./su.sh
    Launching Oracle Grid Infrastructure Setup Wizard...
    
    [WARNING] [INS-40436] Installer has detected an earlier version of Oracle Automatic Storage Management (ASM) Instance configured. Before proceeding with the upgrade you must shutdown all Oracle Databases that are using Oracle ASM for storage.
    
    You may ignore this message and continue with the upgrade, if the database(s) are already in shutdown state.
    [WARNING] [INS-41808] Possible invalid choice for OSASM Group.
       CAUSE: The name of the group you selected for the OSASM group is commonly used to grant other system privileges (For example: asmdba, asmoper, dba, oper).
       ACTION: Oracle recommends that you designate asmadmin as the OSASM group.
    [WARNING] [INS-41809] Possible invalid choice for OSDBA Group.
       CAUSE: The group name you selected as the OSDBA for ASM group is commonly used for Oracle Database administrator privileges.
       ACTION: Oracle recommends that you designate asmdba as the OSDBA for ASM group, and that the group should not be the same group as an Oracle Database OSDBA group.
    [WARNING] [INS-41812] OSDBA and OSASM are the same OS group.
       CAUSE: The chosen values for OSDBA group and the chosen value for OSASM group are the same.
       ACTION: Select an OS group that is unique for ASM administrators. The OSASM group should not be the same as the OS groups that grant privileges for Oracle ASM access, or for database administration.
    [WARNING] [INS-32056] The specified Oracle Base contains the existing Central Inventory location: /u01/app/oracle/oraInventory.
       ACTION: Oracle recommends that the Central Inventory location is outside the Oracle Base directory. Specify a different location for the Oracle Base.
    [WARNING] [INS-32018] The selected Oracle home is outside of Oracle base.
       ACTION: Oracle recommends installing Oracle software within the Oracle base directory. Adjust the Oracle home or Oracle base accordingly.
    You can find the log of this install session at:
     /u01/app/oracle/oraInventory/logs/GridSetupActions2017-12-23_03-01-31PM/gridSetupActions2017-12-23_03-01-31PM.log
    
    As a root user, execute the following script(s):
    	1. /u01/app/12.2.0.1/grid/rootupgrade.sh
    
    Execute /u01/app/12.2.0.1/grid/rootupgrade.sh on the following nodes: 
    [ol6twsa]
    
    
    
    Successfully Setup Software.
    As install user, execute the following command to complete the configuration.
    	/u01/app/12.2.0.1/grid/gridSetup.sh -executeConfigTools -responseFile upgrade.rsp [-silent]
    
    rootupgrade.sh

    With root user account I have run:

    # env | grep ORA
    ORACLE_HOME=/u01/app/12.1.0.2/grid
    # unset ORACLE_HOME
    # echo $PATH
    /u01/app/12.1.0.2/grid/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
    # PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
    # /u01/app/12.2.0.1/grid/rootupgrade.sh
    Check /u01/app/12.2.0.1/grid/install/root_ol6twsa.localdomain_2017-12-23_15-04-35-377767968.log for the output of root script
    # 
    

    Log file was OK:

    # cat /u01/app/12.2.0.1/grid/install/root_ol6twsa.localdomain_2017-12-23_15-04-35-377767968.log
    Performing root user operation.
    
    The following environment variables are set as:
        ORACLE_OWNER= oracle
        ORACLE_HOME=  /u01/app/12.2.0.1/grid
       Copying dbhome to /usr/local/bin ...
       Copying oraenv to /usr/local/bin ...
       Copying coraenv to /usr/local/bin ...
    
    Entries will be added to the /etc/oratab file as needed by
    Database Configuration Assistant when a database is created
    Finished running generic part of root script.
    Now product-specific root actions will be performed.
    Using configuration parameter file: /u01/app/12.2.0.1/grid/crs/install/crsconfig_params
    The log of current session can be found at:
      /u01/app/oracle/crsdata/ol6twsa/crsconfig/roothas_2017-12-23_03-04-36PM.log
    2017/12/23 15:04:37 CLSRSC-363: User ignored prerequisites during installation
    
    ASM has been upgraded and started successfully.
    
    Creating OCR keys for user 'oracle', privgrp 'oinstall'..
    Operation successful.
    LOCAL ONLY MODE 
    Successfully accumulated necessary OCR keys.
    Creating OCR keys for user 'root', privgrp 'root'..
    Operation successful.
    CRS-4664: Node ol6twsa successfully pinned.
    2017/12/23 15:05:37 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.conf'
    CRS-4123: Oracle High Availability Services has been started.
    
    2017/12/23 15:09:44 CLSRSC-482: Running command: 'srvctl upgrade model -s 12.1.0.2.0 -d 12.2.0.1.0 -p first'
    2017/12/23 15:09:45 CLSRSC-482: Running command: 'srvctl upgrade model -s 12.1.0.2.0 -d 12.2.0.1.0 -p last'
    
    ol6twsa     2017/12/23 15:09:47     /u01/app/12.2.0.1/grid/cdata/ol6twsa/backup_20171223_150947.olr     0     
    
    ol6twsa     2014/07/24 21:04:10     /u01/app/12.1.0.2/grid/cdata/ol6twsa/backup_20140724_210410.olr     0     
    
    ol6twsa     2013/07/11 07:03:26     /u01/app/12.1.0/grid/cdata/ol6twsa/backup_20130711_070326.olr     -     
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'ol6twsa'
    CRS-2673: Attempting to stop 'ora.evmd' on 'ol6twsa'
    CRS-2677: Stop of 'ora.evmd' on 'ol6twsa' succeeded
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'ol6twsa' has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    CRS-4123: Oracle High Availability Services has been started.
    2017/12/23 15:10:39 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
    
    executeConfigTools step

    I run last script:

    $ /u01/app/12.2.0.1/grid/gridSetup.sh -executeConfigTools -responseFile upgrade.rsp -silent
    Launching Oracle Grid Infrastructure Setup Wizard...
    
    You can find the logs of this session at:
    /u01/app/oracle/oraInventory/logs/GridSetupActions2017-12-23_03-14-02PM
    
    /tmp/GridSetupActions2017-12-23_03-14-02PM/upgrade.rsp (No such file or directory)
    SEVERE:Abnormal program termination. An internal error has occured. Please provide the following files to Oracle Support : 
    
    "/u01/app/oracle/oraInventory/logs/installActions2017-12-23_03-14-02PM.log"
    "Unknown"
    "Unknown"
    [WARNING] [INS-10016] Installer failed to update the cluster related details, for this Oracle home, in the inventory on all/some of the nodes
       ACTION: You may chose to retry the operation, without continuing further. Alternatively you can refer to information given below and manually execute the mentioned commands on the failed nodes now or later to update the inventory.
    
    Successfully Configured Software.
    

    Something failed but it is not clear what:

    $ cat /u01/app/oracle/oraInventory/logs/installActions2017-12-23_03-14-02PM.log
    INFO: Environment Variables: 
    
    INFO: 	ORACLE_HOME = /u01/app/12.2.0.1/grid
    
    INFO: 	PATH = /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
    
    INFO: 	CLASSPATH = 
    
    INFO: Username:oracle
    
    INFO: Creating a new Install area Control for this inventory session with new  access level  2
    
    INFO: Install area Control created with access level  2
    
    INFO: Ending the inventory Session 
    INFO: config-context initialized
    INFO: 
     The Runconfig command constructed is /u01/app/12.2.0.1/grid/oui/bin/runConfig.sh ORACLE_HOME=/u01/app/12.2.0.1/grid MODE=perform ACTION=configure RERUN=true $*
    INFO: Since the option is to overwrite the existing /u01/app/12.2.0.1/grid/cfgtoollogs/configToolAllCommands file, backing it up
    INFO: The backed up file name is /u01/app/12.2.0.1/grid/cfgtoollogs/configToolAllCommands.bak.1
    INFO: Done processing command line arguments
    SEVERE: Abnormal program termination. An internal error has occured. Please provide the following files to Oracle Support : 
    
    "/u01/app/oracle/oraInventory/logs/installActions2017-12-23_03-14-02PM.log"
    "Unknown"
    "Unknown"
    INFO: Alert Handler not registered, using Super class functionality
    INFO: Alert Handler not registered, using Super class functionality
    INFO: User Selected: Yes/OK
    
    INFO: 'UpdateNodeList' was successful.
    INFO: Environment Variables: 
    
    INFO: 	ORACLE_HOME = /u01/app/12.2.0.1/grid
    
    INFO: 	PATH = /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
    
    INFO: 	CLASSPATH = 
    
    INFO: Username:oracle
    
    
    ASM disk compatibility issue

    I checked resources:

    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
                   ONLINE  ONLINE       ol6twsa                  STABLE
    ora.FRA.dg
                   ONLINE  OFFLINE      ol6twsa                  STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol6twsa                  STABLE
    ora.asm
                   ONLINE  ONLINE       ol6twsa                  Started,STABLE
    ora.ons
                   OFFLINE OFFLINE      ol6twsa                  STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.cdb.db
          1        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                                 ABLE
    ora.cssd
          1        ONLINE  ONLINE       ol6twsa                  STABLE
    ora.diskmon
          1        OFFLINE OFFLINE                               STABLE
    ora.evmd
          1        ONLINE  ONLINE       ol6twsa            
    

    I noticed that FRA disk group was offline but I could not restart it:

    $ srvctl start dg -diskgroup FRA
    PRCR-1079 : Failed to start resource ora.FRA.dg
    CRS-5017: The resource action "ora.FRA.dg start" encountered the following error: 
    ORA-15032: not all alterations performed
    ORA-59303: The attribute compatible.asm (10.1.0.0.0) of the diskgroup being mounted should be 11.2.0.2.0 or higher.
    ORA-15221: ASM operation requires compatible.asm of 11.1.0.0.0 or higher
    . For details refer to "(:CLSN00107:)" in "/u01/app/oracle/diag/crs/ol6twsa/crs/trace/ohasd_oraagent_oracle.trc".
    
    CRS-2674: Start of 'ora.FRA.dg' on 'ol6twsa' failed
    

    I could not fix this issue with SQL statement:

    SQL> select name, compatibility, database_compatibility from v$asm_diskgroup;
    
    NAME
    ------------------------------
    COMPATIBILITY
    ------------------------------------------------------------
    DATABASE_COMPATIBILITY
    ------------------------------------------------------------
    FRA
    0.0.0.0.0
    0.0.0.0.0
    
    DATA
    12.1.0.0.0
    10.1.0.0.0
    
    NAME
    ------------------------------
    COMPATIBILITY
    ------------------------------------------------------------
    DATABASE_COMPATIBILITY
    ------------------------------------------------------------
    
    
    SQL> alter diskgroup FRA set attribute 'compatible.asm'='12.1.0.0.0';
    alter diskgroup FRA set attribute 'compatible.asm'='12.1.0.0.0'
    *
    ERROR at line 1:
    ORA-15032: not all alterations performed
    ORA-15001: diskgroup "FRA" does not exist or is not mounted
    
    
    SQL> alter diskgroup FRA mount;
    alter diskgroup FRA mount
    *
    ERROR at line 1:
    ORA-15032: not all alterations performed
    ORA-59303: The attribute compatible.asm (10.1.0.0.0) of the diskgroup being
    mounted should be 11.2.0.2.0 or higher.
    ORA-15221: ASM operation requires compatible.asm of 11.1.0.0.0 or higher
    
    
    SQL> alter diskgroup FRA set attribute 'compatible.asm'='12.1.0.0.0';
    alter diskgroup FRA set attribute 'compatible.asm'='12.1.0.0.0'
    *
    ERROR at line 1:
    ORA-15032: not all alterations performed
    ORA-15001: diskgroup "FRA" does not exist or is not mounted
    
    
    SQL> alter diskgroup FRA set attribute 'compatible.db'='10.1';
    alter diskgroup FRA set attribute 'compatible.db'='10.1'
    *
    ERROR at line 1:
    ORA-15032: not all alterations performed
    ORA-15001: diskgroup "FRA" does not exist or is not mounted
    
    Using mount restrict mode to change disk group compatibility

    I managed to update disk group attributes with asmcmd:

    ASMCMD> mount --restrict FRA
    ASMCMD> setattr -G FRA compatible.asm 11.2.0.2.0
    ASMCMD> setattr -G FRA compatible.rdbms 11.2.0.0.0
    ASMCMD> umount FRA
    ASMCMD> mount FRA
    ASMCMD> 
    

    At this step it looked OK:

    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
                   ONLINE  ONLINE       ol6twsa                  STABLE
    ora.FRA.dg
                   ONLINE  ONLINE       ol6twsa                  STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol6twsa                  STABLE
    ora.asm
                   ONLINE  ONLINE       ol6twsa                  Started,STABLE
    ora.ons
                   OFFLINE OFFLINE      ol6twsa                  STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.cdb.db
          1        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                                 ABLE
    ora.cssd
          1        ONLINE  ONLINE       ol6twsa                  STABLE
    ora.diskmon
          1        OFFLINE OFFLINE                               STABLE
    ora.evmd
          1        ONLINE  ONLINE       ol6twsa                  STABLE
    --------------------------------------------------------------------------------
    

    I run last upgrade script:

    $ /u01/app/12.2.0.1/grid/gridSetup.sh -executeConfigTools -responseFile upgrade.rsp -silent
    Launching Oracle Grid Infrastructure Setup Wizard...
    
    You can find the logs of this session at:
    /u01/app/oracle/oraInventory/logs/GridSetupActions2017-12-23_03-52-48PM
    
    Successfully Configured Software.
    

    Now everything looked OK.

    I could start database instance:

    $ . oraenv
    ORACLE_SID = [+ASM] ? CDB
    The Oracle base remains unchanged with value /u01/app/oracle
    $ srvctl start database -d CDB
    $ . oraenv
    ORACLE_SID = [oracle] ? +ASM
    The Oracle base has been set to /u01/app/oracle
    $ crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details       
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.DATA.dg
                   ONLINE  ONLINE       ol6twsa                  STABLE
    ora.FRA.dg
                   ONLINE  ONLINE       ol6twsa                  STABLE
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       ol6twsa                  STABLE
    ora.asm
                   ONLINE  ONLINE       ol6twsa                  Started,STABLE
    ora.ons
                   OFFLINE OFFLINE      ol6twsa                  STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.cdb.db
          1        ONLINE  ONLINE       ol6twsa                  Open,HOME=/u01/app/1
                                                                 2.1.0.2/db,STABLE
    ora.cssd
          1        ONLINE  ONLINE       ol6twsa                  STABLE
    ora.diskmon
          1        OFFLINE OFFLINE                               STABLE
    ora.evmd
          1        ONLINE  ONLINE       ol6twsa                  STABLE
    --------------------------------------------------------------------------------
    
    Conclusion

    Upgrade was not so easy because:

  • CLUVFY was not running in my environment
  • I did not patch Grid Infrastructure
  • MOS says that ASM disk compatibility issue is reported by CVU …
  • ASMCMD mount restrict mode has allowed to fix ASM disk compatibility issue.
  • This is my test environment.

    In production GI should be patched with a recent patch set update or bundle patch,
    CVU should be working and ASM compatibility configuration should be double checked.

    Categories: DBA Blogs

    Installing and Using Oracle 12.2.0.1 Hands-On Lab “Upgrade/Migrate/Consolidate to Oracle 12c” (HOL) Virtual Machine (and Fixing TNS-01168)

    Tue, 2017-11-14 02:49

    In March 2017 Oracle Corp. has made available the new Hands On Lab (HOL) virtual machine (VM) for Oracle Database 12.2.0.1. You can download it from here.

    In this blog post I mainly want to show how you can install this VM on CentOS 7 using command line and what exactly you can find in this VM.

    I have also used VirtualBox 5.1.22 on CentOS 7.4.

    $ vboxmanage --version
    5.1.22r115126
    
    VM installation

    I have first downloaded all zip files (about 19 GB): this has taken about 6 hours using my personal Internet connexion:

    $ du -sh /home/pierre/Downloads/Upgrade_HOL_12201.*0*
    1.9G	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.001
    1.9G	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.002
    1.9G	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.003
    1.9G	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.004
    1.9G	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.005
    1.9G	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.006
    1.9G	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.007
    1.9G	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.008
    1.9G	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.009
    816M	/home/pierre/Downloads/Upgrade_HOL_12201.ova.7z.010
    

    To be able to rebuild the single zip file I have first installed 7-Zip as root:

    # yum install p7zip
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
     * base: ftp.ciril.fr
     * epel: mirror.freethought-internet.co.uk
     * extras: ftp.ciril.fr
     * nux-dextop: li.nux.ro
     * updates: ftp.ciril.fr
    Resolving Dependencies
    --> Running transaction check
    ---> Package p7zip.x86_64 0:16.02-2.el7 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================
     Package         Arch             Version                  Repository      Size
    ================================================================================
    Installing:
     p7zip           x86_64           16.02-2.el7              epel           651 k
    
    Transaction Summary
    ================================================================================
    Install  1 Package
    
    Total download size: 651 k
    Installed size: 1.9 M
    Is this ok [y/d/N]: y
    Downloading packages:
    p7zip-16.02-2.el7.x86_64.rpm                               | 651 kB   00:01     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : p7zip-16.02-2.el7.x86_64                                     1/1 
      Verifying  : p7zip-16.02-2.el7.x86_64                                     1/1 
    
    Installed:
      p7zip.x86_64 0:16.02-2.el7                                                    
    
    Complete!
    # 7za 
    
    7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
    p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (306A9),ASM,AES-NI)
    
    Usage: 7za  [...]  [...]
           []
    
    
      a : Add files to archive
      b : Benchmark
      d : Delete files from archive
      e : Extract files from archive (without using directory names)
      h : Calculate hash values for files
      i : Show information about supported formats
      l : List contents of archive
      rn : Rename files in archive
      t : Test integrity of archive
      u : Update files to archive
      x : eXtract files with full paths
    
    
      -- : Stop switches parsing
      -ai[r[-|0]]{@listfile|!wildcard} : Include archives
      -ax[r[-|0]]{@listfile|!wildcard} : eXclude archives
      -ao{a|s|t|u} : set Overwrite mode
      -an : disable archive_name field
      -bb[0-3] : set output log level
      -bd : disable progress indicator
      -bs{o|e|p}{0|1|2} : set output stream for output/error/progress line
      -bt : show execution time statistics
      -i[r[-|0]]{@listfile|!wildcard} : Include filenames
      -m{Parameters} : set compression Method
        -mmt[N] : set number of CPU threads
      -o{Directory} : set Output directory
      -p{Password} : set Password
      -r[-|0] : Recurse subdirectories
      -sa{a|e|s} : set Archive name mode
      -scc{UTF-8|WIN|DOS} : set charset for for console input/output
      -scs{UTF-8|UTF-16LE|UTF-16BE|WIN|DOS|{id}} : set charset for list files
      -scrc[CRC32|CRC64|SHA1|SHA256|*] : set hash function for x, e, h commands
      -sdel : delete files after compression
      -seml[.] : send archive by email
      -sfx[{name}] : Create SFX archive
      -si[{name}] : read data from stdin
      -slp : set Large Pages mode
      -slt : show technical information for l (List) command
      -snh : store hard links as links
      -snl : store symbolic links as links
      -sni : store NT security information
      -sns[-] : store NTFS alternate streams
      -so : write data to stdout
      -spd : disable wildcard matching for file names
      -spe : eliminate duplication of root folder for extract command
      -spf : use fully qualified file paths
      -ssc[-] : set sensitive case mode
      -ssw : compress shared files
      -stl : set archive timestamp from the most recently modified file
      -stm{HexMask} : set CPU thread affinity mask (hexadecimal number)
      -stx{Type} : exclude archive type
      -t{Type} : Set type of archive
      -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName] : Update options
      -v{Size}[b|k|m|g] : Create volumes
      -w[{path}] : assign Work directory. Empty path means a temporary directory
      -x[r[-|0]]{@listfile|!wildcard} : eXclude filenames
      -y : assume Yes on all queries
    

    I have built the single zip file with following script:

    #!/bin/sh
    #
    F=Upgrade_HOL_12201.ova.7z
    rm -f $F
    for f in Upgrade_HOL_12201.ova.7z.*
    do
      echo cat $f ...
      cat  $f >> $F
      echo ... done
    done
    

    I have checked the single zip file with:

    $ 7za l Upgrade_HOL_12201.ova.7z
    
    7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
    p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (306A9),ASM,AES-NI)
    
    Scanning the drive for archives:
    1 file, 18854947848 bytes (18 GiB)
    
    Listing archive: Upgrade_HOL_12201.ova.7z
    
    --
    Path = Upgrade_HOL_12201.ova.7z
    Type = 7z
    Physical Size = 18854947848
    Headers Size = 146
    Method = LZMA2:26
    Solid = -
    Blocks = 1
    
       Date      Time    Attr         Size   Compressed  Name
    ------------------- ----- ------------ ------------  ------------------------
    2017-03-19 18:47:55 ....A  20071627264  18854947702  Upgrade_HOL_12201.ova
    ------------------- ----- ------------ ------------  ------------------------
    2017-03-19 18:47:55        20071627264  18854947702  1 files
    

    I have extracted the single zip file with:

    $ 7za x Upgrade_HOL_12201.ova.7z
    
    7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
    p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (306A9),ASM,AES-NI)
    
    Scanning the drive for archives:
    1 file, 18854947848 bytes (18 GiB)
    
    Extracting archive: Upgrade_HOL_12201.ova.7z
    --
    Path = Upgrade_HOL_12201.ova.7z
    Type = 7z
    Physical Size = 18854947848
    Headers Size = 146
    Method = LZMA2:26
    Solid = -
    Blocks = 1
    
    Everything is Ok            
    
    Size:       20071627264
    Compressed: 18854947848
    

    I have created VirtualBox VM from .ova file with following script:

    #!/bin/sh
    VMDIR=/mnt/wd10b8/vm
    vboxmanage import $VMDIR/Upgrade_HOL_12201.ova \
    --vsys 0 --unit 15 --disk $VMDIR/disk1.vmdk \
    --vsys 0 --unit 16 --disk $VMDIR/disk2.vmdk \
    --vsys 0 --unit 17 --disk $VMDIR/disk3.vmdk \
    --vsys 0 --unit 18 --disk $VMDIR/disk4.vmdk \
    --vsys 0 --unit 19 --disk $VMDIR/disk5.vmdk \
    --eula accept
    

    Running this script has taken about 30 minutes and generated following output:

    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Interpreting /mnt/wd10b8/vm/HOL2/Upgrade_HOL_12201.ova...
    OK.
    Disks:
      vmdisk2	107374182400	-1	http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized	Oracle Database Upgrade HOL 12.2-disk1.vmdk	-1	-1	
    
    Virtual system 0:
     0: Suggested OS type: "Oracle_64"
        (change with "--vsys 0 --ostype "; use "list ostypes" to list all possible values)
     1: Suggested VM name "Oracle Database Upgrade HOL 12.2"
        (change with "--vsys 0 --vmname ")
     2: Product (ignored): Oracle Database
     3: Vendor (ignored): Oracle America, Inc.
     4: Version (ignored): 12.2.0.1
     5: ProductUrl (ignored): www.oracle.com/database
     6: VendorUrl (ignored): www.oracle.com
     7: Description "Hands-on Lab Environment for upgrade and migration to Oracle Database 12.2.0.1"
        (change with "--vsys 0 --description ")
     8: End-user license agreement (accepted)
     9: Number of CPUs: 2
        (change with "--vsys 0 --cpus ")
    10: Guest memory: 6000 MB
        (change with "--vsys 0 --memory ")
    11: Sound card (appliance expects "", can change on import)
        (disable with "--vsys 0 --unit 11 --ignore")
    12: USB controller
        (disable with "--vsys 0 --unit 12 --ignore")
    13: Network adapter: orig NAT, config 3, extra slot=0;type=NAT
    14: CD-ROM
        (disable with "--vsys 0 --unit 14 --ignore")
    15: IDE controller, type PIIX4
        (disable with "--vsys 0 --unit 15 --ignore")
    16: IDE controller, type PIIX4
        (disable with "--vsys 0 --unit 16 --ignore")
    17: SATA controller, type AHCI
        (disable with "--vsys 0 --unit 17 --ignore")
    18: Hard disk image: source image=Oracle Database Upgrade HOL 12.2-disk1.vmdk, target path=/mnt/wd10b8/vm/HOL2/disk4.vmdk, controller=17;channel=0
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    Successfully imported the appliance.
    

    Note that there is only virtual disk but it has the same name as the previous HOL VM.

    The virtual disk size is 50 GB:

    $ ls -al /mnt/wd10b8/vm/HOL2
    total 71298824
    drwxrwxrwx. 1 root root           0 Nov 11 11:35 .
    drwxrwxrwx. 1 root root       20480 Nov 11 11:34 ..
    -rwxrwxrwx. 1 root root 52944437248 Nov 11 13:50 disk4.vmdk
    -rwxrwxrwx. 1 root root 20071627264 Nov 11 11:21 Upgrade_HOL_12201.ova
    $ du -sh /mnt/wd10b8/vm/HOL2/disk4.vmdk 
    50G	/mnt/wd10b8/vm/HOL2/disk4.vmdk
    

    To avoid following VM startup error:

    VBoxManage: error: Implementation of the USB 2.0 controller not found!
    VBoxManage: error: Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings.
    VBoxManage: error: Note! This error could also mean that an incompatible version of the 'Oracle VM VirtualBox Extension Pack' is installed (VERR_NOT_FOUND)
    VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
    

    I have disabled USB 2 with:

    $ vboxmanage modifyvm "Oracle Database Upgrade HOL 12.2" --usbehci off
    

    Full VM configuration is:

    $ vboxmanage showvminfo "Oracle Database Upgrade HOL 12.2"
    Name:            Oracle Database Upgrade HOL 12.2
    Groups:          /
    Guest OS:        Oracle (64-bit)
    UUID:            22476b0c-8d05-4213-9565-44ce6789a2f8
    Config file:     /mnt/seagate/documents/vbox/Oracle Database Upgrade HOL 12.2/Oracle Database Upgrade HOL 12.2.vbox
    Snapshot folder: /mnt/seagate/documents/vbox/Oracle Database Upgrade HOL 12.2/Snapshots
    Log folder:      /mnt/seagate/documents/vbox/Oracle Database Upgrade HOL 12.2/Logs
    Hardware UUID:   22476b0c-8d05-4213-9565-44ce6789a2f8
    Memory size:     6000MB
    Page Fusion:     off
    VRAM size:       64MB
    CPU exec cap:    100%
    HPET:            off
    Chipset:         piix3
    Firmware:        BIOS
    Number of CPUs:  2
    PAE:             on
    Long Mode:       on
    Triple Fault Reset: off
    APIC:            on
    X2APIC:          off
    CPUID Portability Level: 0
    CPUID overrides: None
    Boot menu mode:  message and menu
    Boot Device (1): Floppy
    Boot Device (2): DVD
    Boot Device (3): HardDisk
    Boot Device (4): Not Assigned
    ACPI:            on
    IOAPIC:          on
    BIOS APIC mode:  APIC
    Time offset:     0ms
    RTC:             UTC
    Hardw. virt.ext: on
    Nested Paging:   on
    Large Pages:     on
    VT-x VPID:       on
    VT-x unr. exec.: on
    Paravirt. Provider: Legacy
    Effective Paravirt. Provider: None
    State:           running (since 2017-11-11T11:49:24.815000000)
    Monitor count:   1
    3D Acceleration: off
    2D Video Acceleration: off
    Teleporter Enabled: off
    Teleporter Port: 0
    Teleporter Address: 
    Teleporter Password: 
    Tracing Enabled: off
    Allow Tracing to Access VM: off
    Tracing Configuration: 
    Autostart Enabled: off
    Autostart Delay: 0
    Default Frontend: 
    Storage Controller Name (0):            IDE
    Storage Controller Type (0):            PIIX4
    Storage Controller Instance Number (0): 0
    Storage Controller Max Port Count (0):  2
    Storage Controller Port Count (0):      2
    Storage Controller Bootable (0):        on
    Storage Controller Name (1):            SATA
    Storage Controller Type (1):            IntelAhci
    Storage Controller Instance Number (1): 0
    Storage Controller Max Port Count (1):  30
    Storage Controller Port Count (1):      1
    Storage Controller Bootable (1):        on
    IDE (0, 1): Empty
    SATA (0, 0): /mnt/wd10b8/vm/HOL2/disk4.vmdk (UUID: 7abc2c14-8031-4952-abf6-124a6d3b3942)
    NIC 1:           MAC: 08002736DC9F, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
    NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
    NIC 2:           disabled
    NIC 3:           disabled
    NIC 4:           disabled
    NIC 5:           disabled
    NIC 6:           disabled
    NIC 7:           disabled
    NIC 8:           disabled
    Pointing Device: PS/2 Mouse
    Keyboard Device: PS/2 Keyboard
    UART 1:          disabled
    UART 2:          disabled
    UART 3:          disabled
    UART 4:          disabled
    LPT 1:           disabled
    LPT 2:           disabled
    Audio:           enabled (Driver: Null, Controller: AC97, Codec: STAC9700)
    Clipboard Mode:  Bidirectional
    Drag and drop Mode: disabled
    Session name:    GUI/Qt
    Video mode:      1024x768x32 at 0,0 enabled
    VRDE:            enabled (Address 0.0.0.0, Ports 3389, MultiConn: off, ReuseSingleConn: off, Authentication type: null)
    Video redirection: disabled
    USB:             enabled
    EHCI:            disabled
    XHCI:            disabled
    
    USB Device Filters:
    
    
    
    Available remote USB devices:
    
    
    
    Currently Attached USB Devices:
    
    
    
    Bandwidth groups:  
    
    Shared folders:  
    
    Name: 'TEMP', Host path: '/Users/mdietric/TEMP' (machine mapping), writable
    
    VRDE Connection:    not active
    Clients so far:     0
    
    Video capturing:    not active
    Capture screens:    0
    Capture file:       /mnt/seagate/documents/vbox/Oracle Database Upgrade HOL 12.2/Oracle Database Upgrade HOL 12.2.webm
    Capture dimensions: 1024x768
    Capture rate:       512 kbps
    Capture FPS:        25
    
    Description:
    Hands-on Lab Environment for upgrade and migration to Oracle Database 12.2.0.1
    Guest:
    
    Configured memory balloon size:      0 MB
    OS type:                             Linux26_64
    Additions run level:                 2
    Additions version:                   5.1.10 r112026
    
    
    Guest Facilities:
    
    Facility "VirtualBox Base Driver": active/running (last update: 2017/11/11 11:49:41 UTC)
    Facility "VirtualBox System Service": active/running (last update: 2017/11/11 11:49:49 UTC)
    Facility "Seamless Mode": active/running (last update: 2017/11/11 11:49:41 UTC)
    Facility "Graphics Mode": active/running (last update: 2017/11/11 11:49:41 UTC)
    
    Inside The VM

    I have started VM with:

    $ vboxmanage startvm "Oracle Database Upgrade HOL 12.2"
    Waiting for VM "Oracle Database Upgrade HOL 12.2" to power on...
    VM "Oracle Database Upgrade HOL 12.2" has been successfully started.
    

    VM starts with X Window enabled and to login was difficult because VM default keyboard layout is English and on host system I have a French keyboard (all passwords are set to ‘oracle’). To make sure French keyboard settings are permanent I have used GUI System/Preferences/Keyboard/Layouts to remove German layout, to add French layout
    and to made French layout default one (updating /etc/sysconfig/keyboard did not help).

    OS used is:

    $ cat /etc/os-release 
    NAME="Oracle Linux Server" 
    VERSION="6.8" 
    ID="ol" 
    VERSION_ID="6.8" 
    PRETTY_NAME="Oracle Linux Server 6.8" 
    ANSI_COLOR="0;31" 
    CPE_NAME="cpe:/o:oracle:linux:6:8:server"
    HOME_URL="https://linux.oracle.com/" 
    BUG_REPORT_URL="https://bugzilla.oracle.com/" 
    
    ORACLE_BUGZILLA_PRODUCT="Oracle Linux 6" 
    ORACLE_BUGZILLA_PRODUCT_VERSION=6.8 
    ORACLE_SUPPORT_PRODUCT="Oracle Linux" 
    ORACLE_SUPPORT_PRODUCT_VERSION=6.8
    

    On this VM following Oracle Database versions are installed (however inventory.xml shows that 12.1.0.2 is also installed):

    $ tail -n 4 /etc/oratab
    #
    UPGR:/u01/app/oracle/product/11.2.0.4:Y
    FTEX:/u01/app/oracle/product/11.2.0.4:N
    CDB2:/u01/app/oracle/product/12.2.0.1:N
    $ 
    

    Let’s check the detailed versions with opatch:

    $ . oraenv
    ORACLE_SID = [CDB2] ? UPGR
    The Oracle base remains unchanged with value /u01/app/oracle
    $ $ORACLE_HOME/OPatch/opatch lspatches
    24006111;Database Patch Set Update : 11.2.0.4.161018 (24006111)
    
    OPatch succeeded.
    $ export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2
    $ PATH=$ORACLE_HOME/bin:$PATH
    $ $ORACLE_HOME/OPatch/opatch lspatches
    24340679;DATABASE BUNDLE PATCH: 12.1.0.2.161018 (24340679)
    
    OPatch succeeded.
    $ . oraenv
    ORACLE_SID = [UPGR] ? CDB2
    The Oracle base remains unchanged with value /u01/app/oracle
    $ $ORACLE_HOME/OPatch/opatch lspatches
    There are no Interim patches installed in this Oracle Home "/u01/app/oracle/product/12.2.0.1".
    
    OPatch succeeded.
    
    Customizing VM configuration

    On Linux I prefer to work with SSH using command line mode instead of a graphical desktop.
    I have stopped VM and add added network interface:

    $ vboxmanage modifyvm "Oracle Database Upgrade HOL 12.2" --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 "VirtualBox Host-Only Ethernet Adapter"
    

    I have chosen 192.168.56.44 static IP address for this VM and created /etc/sysconfig/network-scripts/ifcfg-eth2:

    # Intel Corporation 82540EM Gigabit Ethernet Controller
    DEVICE=eth2
    BOOTPROTO=static
    ONBOOT=yes
    HWADDR=08:00:27:55:b5:ba
    IPADDR=192.168.56.44
    

    I have rebooted VM and I have been able to use ssh to login to this VM.

    To get rid of TEMP errors at VM startup I have run from host system:

    $ vboxmanage sharedfolder remove "Oracle Database Upgrade HOL 12.2" --name TEMP
    

    I have also changed guest host name:

    # cat /etc/hosts
    127.0.0.1   hol2 localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    # cat /etc/sysconfig/network
    NETWORKING=yes
    HOSTNAME=hol2.localdomain
    # oracle-rdbms-server-11gR2-preinstall : Add NOZEROCONF=yes
    NOZEROCONF=yes
    

    To start UPGR database instance you need to start listener because this machine is neither using Oracle Restart nor has automatic start scripts for listener and database instances.

    But I could not start Oracle 12.2.0.1 listener:

    $  which lsnrctl
    /u01/app/oracle/product/12.2.0.1/bin/lsnrctl
    $ lsnrctl start
    
    LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 14-NOV-2017 08:04:30
    
    Copyright (c) 1991, 2016, Oracle.  All rights reserved.
    
    Starting /u01/app/oracle/product/12.2.0.1/bin/tnslsnr: please wait...
    
    TNSLSNR for Linux: Version 12.2.0.1.0 - Production
    System parameter file is /u01/app/oracle/product/12.2.0.1/network/admin/listener.ora
    Log messages written to /u01/app/oracle/diag/tnslsnr/hol2/listener/alert/log.xml
    TNS-01168: Cannot allocate memory
    
    Listener failed to start. See the error message(s) above...
    
    $ oerr tns 1168$ oerr tns 1168
    01168, 00000, "Cannot allocate memory"
    // *Cause:  Sufficient memory could not be allocated to perform the desired
    // activity.
    // *Action:  Either free some resource for TNS, or add more memory to the
    // machine. For further details, turn on tracing and reexecute the operation.
    

    But initial RAM configuration is 6 GB, is it really a memory issue ?

    $ free
                 total       used       free     shared    buffers     cached
    Mem:       5965368     526940    5438428       1312      39840     304040
    -/+ buffers/cache:     183060    5782308
    Swap:      5980156          0    5980156
    

    I modified listener.ora and enabled listener trace:

    $ cat listener.ora
    # listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0.1/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = hol2 )(PORT = 1521))
        )
      )
    TRACE_LEVEL_LISTENER=16 
    

    I found following errors in trace file:

    2017-11-14 08:29:43.481 : nlad_aand:entry
    2017-11-14 08:29:43.481 : nlad_ind:entry
    2017-11-14 08:29:43.481 : snlinGetAddrInfo:entry
    2017-11-14 08:29:43.481 : snlinGetAddrInfo:getaddrinfo() failed with error -2
    2017-11-14 08:29:43.481 : snlinGetAddrInfo:exit
    2017-11-14 08:29:43.481 : nlad_ind:exit
    2017-11-14 08:29:43.481 : nlad_pr:Result: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hol2)(PORT=1521)))
    2017-11-14 08:29:43.481 : nlad_pr:descr list processing seeing ndown
    2017-11-14 08:29:43.481 : nlad_pr: node 1
    2017-11-14 08:29:43.481 : nlad_aand:entry
    2017-11-14 08:29:43.481 : nlad_ind:entry
    2017-11-14 08:29:43.481 : snlinGetAddrInfo:entry
    2017-11-14 08:29:43.481 : snlinGetAddrInfo:getaddrinfo() failed with error -2
    2017-11-14 08:29:43.481 : snlinGetAddrInfo:exit
    2017-11-14 08:29:43.481 : nlad_ind:exit
    2017-11-14 08:29:43.481 : nlad_pr:Result: (DESCRIPTION_LIST=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hol2)(PORT=1521))))
    2017-11-14 08:29:43.481 : nladini:entry
    2017-11-14 08:29:43.481 : nladini:exit
    2017-11-14 08:29:43.481 : nladget:entry
    2017-11-14 08:29:43.481 : nladget:exit
    2017-11-14 08:29:43.481 : nsgllsn:LSNDSC==>(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hol2)(PORT=1521)))
    2017-11-14 08:29:43.481 : nsglhcrt:entry
    2017-11-14 08:29:43.481 : snlinGetAddrInfo:entry
    2017-11-14 08:29:43.572 : snlinGetAddrInfo:getaddrinfo() failed with error -2
    2017-11-14 08:29:43.572 : snlinGetAddrInfo:exit
    2017-11-14 08:29:43.573 : nsglhcrt:exit
    2017-11-14 08:29:43.573 : nsglma:Reporting the following error stack:
    

    I modified /etc/hosts to add “localdomain” suffix to “hol2” host name:

    $ cat /etc/hosts
    192.168.56.44 hol2 hol2.localdomain
    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    $ 
    

    And I managed to start Oracle Net listener 12.2.0.1:

    $ lsnrctl start
    
    LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 14-NOV-2017 08:34:28
    
    Copyright (c) 1991, 2016, Oracle.  All rights reserved.
    
    Starting /u01/app/oracle/product/12.2.0.1/bin/tnslsnr: please wait...
    
    TNSLSNR for Linux: Version 12.2.0.1.0 - Production
    System parameter file is /u01/app/oracle/product/12.2.0.1/network/admin/listener.ora
    Log messages written to /u01/app/oracle/diag/tnslsnr/hol2/listener/alert/log.xml
    Trace information written to /u01/app/oracle/diag/tnslsnr/hol2/listener/trace/ora_4597_140666770329920.trc
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hol2)(PORT=1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
    Start Date                14-NOV-2017 08:34:28
    Uptime                    0 days 0 hr. 0 min. 1 sec
    Trace Level               support
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/12.2.0.1/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/diag/tnslsnr/hol2/listener/alert/log.xml
    Listener Trace File       /u01/app/oracle/diag/tnslsnr/hol2/listener/trace/ora_4597_140666770329920.trc
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
    The listener supports no services
    The command completed successfully
    

    I have checked database versions using dictionary views.

    For UPGR:

    SQL> column action_time format a15
    SQL> column action format a10
    SQL> column namespace format a10
    SQL> column version format a10
    SQL> column comments format a20
    SQL> select name from v$database;
    
    NAME
    ---------
    UPGR
    
    SQL> select to_char(action_time,'DD-MON-YYYY') as action_time_2, action, namespace, version,  comments
      2  from dba_registry_history
      3  order by action_time;
    
    ACTION_TIME_2	     ACTION	NAMESPACE  VERSION    COMMENTS
    -------------------- ---------- ---------- ---------- --------------------
    01-JUL-2016	     APPLY	SERVER	   11.2.0.4   PSU 11.2.0.4.160419
    21-OCT-2016	     APPLY	SERVER	   11.2.0.4   PSU 11.2.0.4.161018
    
    SQL>
    

    For CDB2:

    SQL> set linesize 120
    SQL> column action_time format a15
    SQL> column action format a10
    SQL> column version format a10
    SQL> column description format a50
    SQL> select name from v$database;
    
    NAME
    ---------
    CDB2
    
    SQL> select to_char(action_time,'DD-MON-YYYY') as action_time_2, patch_id, patch_uid, action, version,	description
      2  from dba_registry_sqlpatch;
    
    no rows selected
    
    SQL>
    

    I have created a 12.1.0.2 database with following script:

    set -x
    dbca \
     -silent \
     -createDatabase \
     -templateName General_Purpose.dbc   \
     -gdbName TEST \
     -SysPassword oracle \
     -SystemPassword oracle \
     -emConfiguration NONE \
     -datafileDestination /u02/oradata\
     -characterSet AL32UTF8 \
     -totalMemory 1024 \
     -recoveryAreaDestination /u01/app/oracle/fast_recovery_ area 
    

    I have checked database version with:

    $ . oraenv
    ORACLE_SID = [CDB2] ? TEST
    The Oracle base remains unchanged with value /u01/app/oracle
    [oracle@hol2 scripts]$ sqlplus / as sysdba @lv2
    
    SQL*Plus: Release 12.1.0.2.0 Production on Tue Nov 14 09:33:34 2017
    
    Copyright (c) 1982, 2014, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
    With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    
    SQL> set linesize 120
    SQL> column action_time format a15
    SQL> column action format a10
    SQL> column version format a10
    SQL> column description format a50
    SQL> select name from v$database;
    
    NAME
    ---------
    TEST
    
    SQL> select to_char(action_time,'DD-MON-YYYY') as action_time_2, patch_id, patch_uid, action, version,	description
      2  from dba_registry_sqlpatch;
    
    no rows selected
    

    I have run datapatch manually because DBCA has not run it:

    $ $ORACLE_HOME/OPatch/datapatch -verbose
    SQL Patching tool version 12.1.0.2.0 on Tue Nov 14 09:35:16 2017
    Copyright (c) 2016, Oracle.  All rights reserved.
    
    Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_9320_2017_11_14_09_35_16/sqlpatch_invocation.log
    
    Connecting to database...OK
    Bootstrapping registry and package to current versions...done
    Determining current state...done
    
    Current state of SQL patches:
    Bundle series DBBP:
      ID 161018 in the binary registry and not installed in the SQL registry
    
    Adding patches to installation queue and performing prereq checks...
    Installation queue:
      Nothing to roll back
      The following patches will be applied:
        24340679 (DATABASE BUNDLE PATCH: 12.1.0.2.161018 (24340679))
    
    Installing patches...
    Patch installation complete.  Total patches installed: 1
    
    Validating logfiles...
    Patch 24340679 apply: SUCCESS
      logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/24340679/20646358/24340679_apply_TEST_2017Nov14_09_35_28.log (no errors)
    SQL Patching tool complete on Tue Nov 14 09:36:53 2017
    

    I have checked again database version:

    SQL> set linesize 120
    SQL> column action_time format a15
    SQL> column action format a10
    SQL> column version format a10
    SQL> column description format a50
    SQL> select name from v$database;
    
    NAME
    ---------
    TEST
    
    SQL> select to_char(action_time,'DD-MON-YYYY') as action_time_2, patch_id, patch_uid, action, version,	description
      2  from dba_registry_sqlpatch;
    
    ACTION_TIME_2	       PATCH_ID  PATCH_UID ACTION     VERSION	 DESCRIPTION
    -------------------- ---------- ---------- ---------- ---------- --------------------------------------------------
    14-NOV-2017	       24340679   20646358 APPLY      12.1.0.2	 DATABASE BUNDLE PATCH: 12.1.0.2.161018 (24340679)
    
    SQL> 
    

    Here is a summary of detailed Oracle Database installations:

    Oracle Database Home patch set PSU/BP interim patch
    /u01/app/oracle/product/11.2.0.4 11.2.0.4 11.2.0.4.161018 none /u01/app/oracle/product/12.1.0.2 12.1.0.2 12.1.0.2.161018 none /u01/app/oracle/product/12.2.0.1 12.2.0.1 none none

    This shows that 11.2.0.4 and 12.1.0.2 have been updated with respect to 2015 HOL VM.

    Note that I have ignored following errors when connecting with oracle account:

    mount: only root can do that
    mount: only root can do that
    

    and following errors when connecting with root account:

    /sbin/mount.vboxsf: mounting failed with the error: Protocol error
    /sbin/mount.vboxsf: mounting failed with the error: Protocol error
    
    Categories: DBA Blogs