Zurück

Non-Interactive Oracle Patch Installation 

Silent Install of an Oracle Patch

You can perform a non-interactive (or "silent") installation of Oracle8i products and patches by supplying the Oracle Universal Installer with a response file. The Installer uses the variables and values contained in this text file to provide answers to some or all of the Installer's user prompts. If you include responses for all of the Installer's prompts in the response file, you can run a silent installation that displays no graphical output.

Example: Patch from Oracle 8.1.7.0 to 8.1.7.1 in Silent Mode

You will need to edit the response file to suit your environment.

  • Unpack the patch (e.g. p1746764_8171_SOLARIS.zip)

unzip p1746764_8171_SOLARIS.zip
tar xvf 8171b_solaris_32_patchset.tar

In this case, two subdirectories response and stage are created. Go to the response directory and edit the response file (e.g. 8171b.rsp)

  • Edit the response file

Note, that you must enter the values in double quotas ( " " ). Here is an example for a response file, where only the edited parameters are shown.

UNIX_GROUP_NAME="dba"
FROM_LOCATION="/app/akadia/stage/products.jar"
FROM_LOCATION_CD_LABEL=""
NEXT_SESSION_RESPONSE=""
ORACLE_HOME="/opt/oracle/product/8.1.7"

The complete response file can be found here.

  • Stop all Oracle Processes (Database, Listener)

Make sure, that no Processes belonging to the user Oracle still running

svrmgrl
connect sys/... as sysdba
shutdown immediate

lsnrctl
stop <Listener-Name>

ps -ef | grep "oracle"
kill -9 xxx

  • Start the Installer in Silent Mode

To perform a completely silent installation or configuration session, use the -silent parameter. In silent mode, the DISPLAY environment variable must still be set

DISPLAY=192.168.138.23:0.0
export DISPLAY
cd /opt/oracle/product/oui/install
./runInstaller -silent -responseFile /app/response/8171b.rsp

The success or failure of the installation is logged in the silentInstall.log file. If an Oracle Inventory exists on your system, then the silentInstall.log file is created there. Otherwise, it is created in the oraInventory_location/logs/ directory. The detailed results of the non-interactive installation session are found in the oraInventory_location/logs/installActions.log file.

  • Check Log Files

cd /opt/oracle/product/oraInventory/logs
tail -f installActions.log
tail -f oraInstall.err
tail -f oraInstall.out
cat silentInstall.log

silentInstall2001-05-31_09-43-15-AM.log
The installation of Oracle 8i Patch Set was successful.

  • Postmigration (Start Oracle in RESTRICTED MODE)

    svrmgrl
    connect internal
    STARTUP RESTRICT

    SPOOL revoke_restricted_session;
    SELECT 'REVOKE restricted session FROM ' 
            || username || ';' FROM dba_users
            WHERE username NOT IN ('SYS','SYSTEM');
    SPOOL OFF;
    @revoke_restricted_session.log;

    ALTER SYSTEM ENABLE RESTRICTED SESSION;

    Run the postmigration scripts

    @$ORACLE_HOME/rdbms/admin/catalog.sql
    @$ORACLE_HOME/rdbms/admin/catproc.sql

    You may execute additional scripts, e.g.

    # Run all sql scripts for replication option
    @$ORACLE_HOME/rdbms/admin/catrep.sql

    # Collect I/O per table (actually object) statistics by
    # statistical sampling

    @$ORACLE_HOME/rdbms/admin/catio.sql

    # This package creates a table into which references to
    # the chained rows for an IOT (Index-Only-Table) can be
    # placed using the ANALYZE command.

    @$ORACLE_HOME/rdbms/admin/dbmsiotc.sql

    # Wrap Package which creates IOTs (Index-Only-Table)
    @$ORACLE_HOME/rdbms/admin/prvtiotc.plb

    # This package allows you to display the sizes of objects
    # in the shared pool, and mark them for keeping or
    # unkeeping in order to reduce memory fragmentation.

    @$ORACLE_HOME/rdbms/admin/dbmspool.sql

    # Creates the default table for storing the output
    # of the ANALYZE LIST CHAINED ROWS command
    @$ORACLE_HOME/rdbms/admin/utlchain.sql

    # Creates the EXCEPTION table
    @$ORACLE_HOME/rdbms/admin/utlexcpt.sql

    # Grant public access to all views used by TKPROF
    # with verbose=y option

    @$ORACLE_HOME/rdbms/admin/utltkprf.sql

    # Create table PLAN_TABLE that is used by the EXPLAIN PLAN
    # statement. The explain statement requires the presence
    # of this table in order to store the descriptions of
    # the row sources.

    @$ORACLE_HOME/rdbms/admin/utlxplan.sql

    # Create performance tuning views
    @$ORACLE_HOME/rdbms/admin/catperf.sql

    # Create v7 style export/import views against the v8 RDBMS
    # so that EXP/IMP v7 can be used to read out data in a
    # v8 RDBMS. These views are necessary if you want to export
    # from Oracle8 and import in an Oracle7 database.

    @$ORACLE_HOME/rdbms/admin/catexp7.sql

    # Create views of oracle locks
    @$ORACLE_HOME/rdbms/admin/catblock.sql

    # Print out the lock wait-for graph in a tree 
    # structured fashion

    @$ORACLE_HOME/rdbms/admin/utllockt.sql

    # Creates the default table for storing the output of the
    # analyze validate command on a partitioned table

    @$ORACLE_HOME/rdbms/admin/utlvalid.sql

    # PL/SQL Package of utility routines for raw datatypes
    @$ORACLE_HOME/rdbms/admin/utlraw.sql
    @$ORACLE_HOME/rdbms/admin/prvtrawb.plb

    # Contains the PL/SQL interface to the cryptographic toolkit
    @$ORACLE_HOME/rdbms/admin/dbmsoctk.sql
    @$ORACLE_HOME/rdbms/admin/prvtoctk.plb

    # This package provides a built-in random number
    # generator. It is faster than generators written in PL/SQL
    # because it calls Oracle's internal random number
    # generator.

    @$ORACLE_HOME/rdbms/admin/dbmsrand.sql

    # DBMS package specification for Oracle8 Large Object
    # This package provides routines for operations on BLOB
    # and CLOB datatypes.
    @$ORACLE_HOME/rdbms/admin/dbmslob.sql

    # Procedures for instrumenting database applications
    # DBMS_APPLICATION_INFO package spec.

    @$ORACLE_HOME/rdbms/admin/dbmsapin.sql

    # Run obfuscation toolkit script.
    @$ORACLE_HOME/rdbms/admin/catobtk.sql

    # Create Heterogeneous Services data dictionary objects.
    @$ORACLE_HOME/rdbms/admin/caths.sql

    # Stored procedures for Oracle Trace server
    @$ORACLE_HOME/rdbms/admin/otrcsvr.sql

    # Oracle8i Profiler for PL/SQL
    # Profilers are helpful tools to investigate programs and
    # identify slow program parts and bottle necks. Furthermore
    # you can determine which procedure, function or any other
    # code part is executed how many times. To be able to use
    # the DBMS_PROFILER package you have to install once for
    # your database the following packages. Do this as user SYS

    @$ORACLE_HOME/rdbms/admin/profload.sql
    @$ORACLE_HOME/rdbms/admin/proftab.sql
    @$ORACLE_HOME/rdbms/admin/dbmspbp.sql
    @$ORACLE_HOME/rdbms/admin/prvtpbp.plb

    Recompiling Invalid PL/SQL Modules

    The utlrp.sql script recompiles all existing PL/SQL modules that were previously in an INVALID state, such as packages, procedures, types, etc. These actions are optional; however, they ensure that the cost of recompilation is incurred during installation rather than in the future

    @$ORACLE_HOME/rdbms/admin/utlrp.sql

    Now, you can shutdown and restart the database again

    ALTER SYSTEM DISABLE RESTRICTED SESSION;
    SHUTDOWN IMMEDIATE
    STARTUP

Check if Java Environment must be rebuild

To determine whether Java has previously been loaded into the database:
invoke SQL*Plus (sqlplus), connect as internal and run the following:

SQL> describe dbms_java

If the result is:

ERROR:
ORA-04043: object dbms_java does not exist

then java has not previously been loaded in the database. If the result is a long package description, then java has previously been loaded in the database.

If Java has previously been loaded into the database, invoke SQL*Plus (sqlplus), connect as internal and run the following scripts which are located in $ORACLE_HOME/javavm/install ( Note: If Java has not previously been loaded into the database, you can skip this step):

cd $ORACLE_HOME/javavm/install
sqlplus sys/...
@load_jis.sql
@jisja.sql
@initjsp.sql
@jspja.sql 

First time Installation in Silent Mode

If you will perform the first installation of Oracle products on a system with Oracle Universal Installer running in silent mode, you must manually create the oraInst.loc file. this file specifies the directory where the installer creates the inventory of Oracle products installed on the system.

To create the oraInst.loc file, Log in as the root user

$ su

If it does not already exist on your system, you must create the /var/opt/oracle directory.

# mkdir /var/opt/oracle

Change to the /var/opt/oracle directory.

# cd /var/opt/oracle

Using a text editor, create a file called oraInst.loc with the following two lines of content:

inventory_loc=/opt/oracle/product/oraInventory
inst_group=

Set inventory_loc to ORACLE_BASE/oraInventory.
Include, but do not set, inst_group= on the second line.