Friday, 27 September 2019

Manual Single database upgrade



imp pain FROMUSER=WMC TOUSER=WMC FILE=td46562_dev_exp.dmp log=dev_td46562_imp.log  feedback=10000 ignore=Y
create or replace directory dpump as '/backup/CH130522_2_aug/TestDB1/export';
grant read,write on directory dpump to public;

select sum(bytes/1024*1024*124) from dba_segments;

select sum(bytes)/1024/1024/1024 "Total DB size in GB"  from dba_data_files;
select sum(bytes/1024/1024/1024) tbspc_gb from dba_temp_files;


expdp \'/ as sysdba \'  dumpfile=dpump_TestDB1_01aug.DMP logfile=dpump_TestDB1_01aug.log directory=dpump full=y parallel=4
expdp \'/ as sysdba \'  dumpfile=dpump_obi01dev_1aug.DMP logfile=dpump_obi01dev_1aug.log directory=DATA_PUMP_DIR full=y parallel=4

expdp system/Summer_2011  dumpfile=expdp_GCRSTMR5.DMP logfile=expdp_GCRSTMR5_full.log directory=dppump_dir full=y estimate=statistics


nohup expdp \'/ as sysdba \' directory=dpump schemas=ADAPTIVDATALOAD dumpfile=STDB0001_ADAPTIVDATALOAD_25OCT2012.dmp logfile=STDB0001_ADAPTIVDATALOAD_25OCT2012.log &

nohup expdp \'/ as sysdba \' directory=dpump schemas=ADAPTIVDATALOAD dumpfile=STDB0001_ADAPTIVDATALOAD_25OCT2012.dmp logfile=STDB0001_ADAPTIVDATALOAD_25OCT2012.log &

expdp system directory=EXP_DP2 dumpfile=INC000006658485_23feb_1.dmp,INC000006658485_23feb_2.dmp logfile =INC000006658485_23feb.log schemas =eeevs01 job_name =INC000006658485_23feb_12_new3


Directory created

set pagesize 1000
set linesize 120
column directory_name format a25
column directory_path format a70
select directory_name directory_name, directory_path directory_path from dba_directories order by directory_name
/

1)  take running database snap with database onwer and Go to the change folder and take below prerequisit
        spool invalid_obj_before_CPUJul2014_crd01dev.log;
        set linesize 200 
        select * from v$instance
        /
        select sysdate from dual;
/
        select r.comp_name,r.version,r.status from dba_registry r;
        col object_name for a30;
        select owner,object_name,status from dba_objects where status !='VALID';
        SELECT * FROM registry$history where bundle_series like 'CPU%';
        spool off

b-inventory backup


Server:TestDB2:/home/oracle/Patch/CH129614 $cp -pr /oracle/oraInventory/*                               mkdir oracle_inventry
Server:TestDB2:/home/oracle/Patch/CH129614 $cd oracle _inventry
Server:TestDB2:/home/oracle/Patch/CH129614/oracle_inventry $cp -pr /oracle/oraInventory/* .
cp: /oracle/oraInventory/logs/OPatch2014-04-03_02-16-16-PM.log: Permission denied
Server:TestDB2:/home/oracle/Patch/CH129614/oracle_inventry $ls lrt   -lrt



Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/OPatch $$ORACLE_HOME/OPatch/opatch lsinventory -details >d_inventory_CRD01DEV_30Jul2014.log
or

$ORACLE_HOME/OPatch/opatch lsinventory >inventory_CRD01DEV_30Jul2014.log

 alter database backup controlfile to trace as '/backup/CH130522_2_aug/FUS06DEV/ctl_CRD01DEV_02Aug2014.trc';
 take the backup of spfile
create pfile='/backup/CH130522_2_aug/FUS06DEV/PFILE_FUS06DEV_02Aug2014.ora' from spfile;



2) take the backup of binary and database after the stoping the database.
    make the directory with change no and take the backup of home directory as below
  a) tar -cvf HOME_TestDB1_112010.tar /oracle/product/TestDB1/11.2.0.1 -Home backup
    
     tar -cvf HOME_fus07dev_2aug.tar /oracle/product/fus07dev/11.2.0.4
      tar -cvf HOME_TestDB1_2aug.tar /oracle/product/TestDB1/11.2.0.1
  tar -cvf HOME_obi02dev_2aug.tar /oracle/product/obi02dev/11.2.0.4

  b) full database backup.
     select NAME  from v$controlfile;
     select FILE_NAME from dba_temp_files
     select  name from v$datafile;
     select  MEMBER from   v$logfile;


2.1.3 Validation of Oracle Inventory
Before beginning patch application, check the consistency of inventory information for GI home and each database home to be patched. Run the following command as respective Oracle home owner to check
the consistency.
$ <ORACLE_HOME>/OPatch/opatch lsinventory -detail -oh <ORACLE_HOME>


3) unzip july patch

Server:TestDB1:/oracle/product/stage $cd july2014patch
Server:TestDB1:/oracle/product/stage/july2014patch $ls -ltr
total 90320
-r--r--r--    1 oracle   dba        46241073 Jul 25 13:22 p18522509_112040_AIX64-5L.zip
Server:TestDB1:/oracle/product/stage/july2014patch $ unzip p18522509_112040_AIX64-5L.zip



2)

Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/OPatch $$ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.0

$ORACLE_HOME/OPatch/opatch lsinventory


OPatch succeeded.
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/OPatch $opatch lsinventory -details


Server:TestDB2:/home/oracle/Patch $mkdir CH129614
Server:TestDB2:/home/oracle/Patch $cd CH129614
Server:TestDB2:/home/oracle/Patch/CH129614 $history -1 8
388     cd OPatch
389     opatch lsinventory -detail
390     cd
391     mkdir Patch
392     stty erase
393     cd Patch
394     mkdir CH129614
395     cd CH129614
396     history -8
Server:TestDB2:/home/oracle/Patch/CH129614 $opatch lsinventory -detail

5) go to the patch director



    Ensure that the $PATH definition has the following executables: make, ar, ld, and nm.

    The location of these executables depends on your operating system. On many operating systems, they are located in /usr/ccs/bin, in which case you can set your PATH definition as follows:

    export PATH=$PATH:/usr/ccs/bin

Determine whether any currently installed one-off patches conflict with the PSU patch as follows:

Server:TestDB1:/oracle/product/TestDB1 $ls -ltr
total 16
drwxr-xr-x   76 oracle   dba            4096 Jan 11 2013  11.2.0.1
drwxr-xr-x   78 oracle   dba            4096 Jul  5 09:15 11.2.0.4
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4 $export ORACLE_HOME=/oracle/product/TestDB2/11.2.0.4
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4 $export LD_LIBRARY_PATH=/oracle/product/TestDB2/11.2.0.4/lib
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4 $export LD_LIBRARY_PATH=$ORACLE_HOME/lib
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4 $export PATH=$PATH:$ORACLE_HOME/bin
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4 $which Opatch
no Opatch in /usr/bin /etc /usr/sbin /usr/ucb /usr/bin/X11 /sbin /usr/java14_64/jre/bin /usr/java5/jre/bin /usr/java5/bin /opt/IBM/cmdb/nmap-4.76 /usr/local/bin /usr/bin /etc /usr/sbin /usr/ucb /home/oracle/bin /usr/bin/X11 /sbin . /usr/vacpp/bin /bin /usr/local/bin /usr/eco/bin /oracle/product/TestDB2/11.2.0.1/bin /oracle/local/bin /oracle/product/TestDB2/11.2.0.4/bin
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4 $$ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.6


unzip p18522509_112040_<platform>.zip
cd 18522509
opatch prereq CheckConflictAgainstOHWithDetail -ph ./


Server:TestDB2:/oracle/product/stage/july2014patch $cd 18522509
Server:TestDB2:/oracle/product/stage/july2014patch/18522509 $e
Server:TestDB2:/oracle/product/stage/july2014patch/18522509 $echo $ORACLE _HOME   ---check the home it should correct home(latest home on which patch is being applied)
/oracle/product/TestDB2/11.2.0.4
Server:TestDB2:/oracle/product/stage/july2014patch/18522509 $opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /oracle/product/TestDB2/11.2.0.4
Central Inventory : /oracle/oraInventory
   from           : /oracle/product/TestDB2/11.2.0.4/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /oracle/product/TestDB2/11.2.0.4/cfgtoollogs/opatch/opatch2014-07-26_07-31-20AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
Server:TestDB2:/oracle/product/stage/july2014patch/18522509 $opatch apply
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


Oracle Home       : /oracle/product/TestDB2/11.2.0.4
Central Inventory : /oracle/oraInventory
   from           : /oracle/product/TestDB2/11.2.0.4/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.4.0
Log file location : /oracle/product/TestDB2/11.2.0.4/cfgtoollogs/opatch/opatch2014-07-26_07-32-24AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   18031668  18522509

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y



Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/oracle/product/TestDB2/11.2.0.4')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '18031668' to OH '/oracle/product/TestDB2/11.2.0.4'

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.ldap.rsf, 11.2.0.4.0...

Patching component oracle.rdbms.crs, 11.2.0.4.0...

Patching component oracle.precomp.common, 11.2.0.4.0...

Patching component oracle.ldap.rsf.ic, 11.2.0.4.0...

Patching component oracle.rdbms.deconfig, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Patching component oracle.rdbms.rman, 11.2.0.4.0...



============

    Log in to the system as the owner of the Oracle Database 11g Release 2 (11.2) Oracle home directory.
    Copy the Pre-Upgrade Information Tool (utlu112i.sql) and utltzuv2.sql from the Oracle Database 11g Release 2 (11.2) ORACLE_HOME/rdbms/admin directory to a directory outside of the Oracle home, such as the temporary directory on your system.


$ORACLE_HOME/rdbms/admin/utlu112i.sql

2. Execute Pre Upgrade Script:

Should be change to the directory where utlu112i.sql  had been copied in the previous step.    Start SQL*Plus and connect to the database instance as a user with SYSDBA privileges. Then run and spool the utlu112i.sql file. Please note that the database should be started using the Source Oracle Home.

$ sqlplus '/ as sysdba'
SQL> spool upgrade_info.log
SQL> @utlu112i.sql
SQL> spool off
SQL>

or

Execute utlu112i.sql script from  the new 11gR2 (11.2.0.2) Home:

SQL>spool preupgradeinfo.txt
SQL > @<New 11gR2ORACLE_HOME>\rdbms\admin\utlu112i.sql
SQL > spool off
SQL > exit

Review preupgradeinfo.txt and fix the warnings from the output.
Review /tmp/upgrade.spl and fix the warnings from the output.
or

STEP  3
======
After installing the latest 11.2 RDBMS  software, start the 11.2.0.1 instance with the previous ORACLE_HOME and spool/run 11.2.0.2 $ORACLE_HOME/rdbms/admin/utlu112i.sql script against the running, previous instance.

Running the Pre-Upgrade Information Tool is mandatory whether you are upgrading with DBUA or manually. Otherwise you can expect to encounter the error:

12. Upgrade Database:

At the operating system prompt, change to the $ORACLE_HOME/rdbms/admin directory of 11gR2 Oracle Home.(with new ORACLE_HOME

$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus "/ as sysdba"
SQL> startup UPGRADE

startup upgrade  pfile='/oracle/product/TestDB1/11.2.0.1/dbs/initTestDB1.ora'

Set the system to spool results to a log file for later verification after the upgrade is completed and start the upgrade script.

SQL> set echo on
SQL> SPOOL upgrade.log
SQL> @catupgrd.sql
SQL> spool off
eg

SQL> SPOOL upgrade.log
SQL> @catupgrd.sql
SQL> Rem
SQL> Rem $Header: rdbms/admin/catupgrd.sql /st_rdbms_11.2.0/3 2011/05/18 15:07:25 cmlim Exp $
SQL> Rem
SQL> Rem catupgrd.sql
SQL> Rem
SQL> Rem Copyright (c) 1999, 2011, Oracle and/or its affiliates.
SQL> Rem All rights reserved.
SQL> Rem
SQL> Rem    NAME
SQL> Rem         catupgrd.sql - CATalog UPGraDe to the new release
SQL> Rem
SQL> Rem    DESCRIPTION
SQL> Rem        This script is to be used for upgrading a 9.2, 10.1 or 10.2
SQL> Rem        database to the new release.  This script provides a direct




These measures are an important final step to ensure the integrity and consistency of the newly upgraded Oracle Database software. Also, if you encountered a message listing obsolete initialization parameters when you started the database for upgrade, then remove the obsolete initialization parameters from the parameter file before restarting. If necessary, convert the SPFILE to a PFILE so you can edit the file to delete parameters.

eg:

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

startup pfile='/oracle/product/TestDB1/11.2.0.1/dbs/initTestDB1.ora'

SQL> startup  pfile='/oracle/product/TestDB2/11.2.0.1/dbs/initTestDB2.ora';
ORACLE instance started.

Total System Global Area 3423965184 bytes
Fixed Size                  2251168 bytes
Variable Size            1845495392 bytes
Database Buffers         1426063360 bytes
Redo Buffers              150155264 bytes
Database mounted.
Database opened.
SQL> set echo on

or




3.3.2 Loading Modified SQL Files into the Database

The following steps load modified SQL files into the database. For an Oracle RAC environment, perform these steps on only one node.

    For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus. Connect as SYSDBA and run the catbundle.sql script as follows:

    cd $ORACLE_HOME/rdbms/admin
    sqlplus /nolog
    SQL> CONNECT / AS SYSDBA
    SQL> STARTUP
    SQL> @catbundle.sql psu apply
    SQL> QUIT

    The catbundle.sql execution is reflected in the dba_registry_history view by a row associated with bundle series PSU.

    For information about the catbundle.sql script, see My Oracle Support Document 605795.1 Introduction to Oracle Database catbundle.sql.

    Check the following log files in $ORACLE_HOME/cfgtoollogs/catbundle or $ORACLE_BASE/cfgtoollogs/catbundle for any errors:

    catbundle_PSU_<database SID>_APPLY_<TIMESTAMP>.log
    catbundle_PSU_<database SID>_GENERATE_<TIMESTAMP>.log

    where TIMESTAMP is of the form YYYYMMMDD_HH_MM_SS. If there are errors,


-- start the database with new home
   delete the old link for spfil ,password file and create it in new home
 

SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/oracle/cfgtoollogs/catbundle/catbundle_PSU_DPCPPT_APPLY_2015Jan05_17_51_04.log
SQL>
SQL>
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

TIMESTAMP
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2015-01-05 17:52:12


Verfification
-------------------
1)
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus "/ as sysdba"
SQL> @utlrp.sql

@$ORACLE_HOME/rdbms/admin/utlrp.sql

2) change the oratab entry after taking backup
3) update the listerner entry with latest oracle_home
4) run that full database stat.
5) check the remotely connectivity and to which user database has been started .and send mail to customer with screenshot.


SQL> startup pfile='/oracle/product/TestDB2/11.2.0.1/dbs/initTestDB2.ora';

SQL> @utlu112s.sql
.
Oracle Database 11.2 Post-Upgrade Status Tool           07-26-2014 10:05:47
.
Component                               Current      Version     Elapsed Time
Name                                    Status       Number      HH:MM:SS
.
Oracle Server
.                                         VALID      11.2.0.4.0  00:19:39
JServer JAVA Virtual Machine
.                                         VALID      11.2.0.4.0  00:06:58
Oracle Workspace Manager
.                                         VALID      11.2.0.4.0  00:01:11
OLAP Analytic Workspace
.                                         VALID      11.2.0.4.0  00:01:36
OLAP Catalog
.                                         VALID      11.2.0.4.0  00:01:28
Oracle OLAP API
.                                         VALID      11.2.0.4.0  00:00:36
Oracle Enterprise Manager
.                                         VALID      11.2.0.4.0  00:12:42
Oracle XDK
.                                         VALID      11.2.0.4.0  00:01:10
Oracle Text
.                                         VALID      11.2.0.4.0  00:00:50
Oracle XML Database
.                                         VALID      11.2.0.4.0  00:03:47
Oracle Database Java Packages
.                                         VALID      11.2.0.4.0  00:00:20
Oracle Multimedia
.                                         VALID      11.2.0.4.0  00:03:29
Spatial
.                                         VALID      11.2.0.4.0  00:09:00
Oracle Expression Filter
.                                         VALID      11.2.0.4.0  00:00:12
Oracle Rules Manager
.                                         VALID      11.2.0.4.0  00:00:14
Oracle Application Express
.                                         VALID     3.2.1.00.10
Final Actions
.                                                                00:00:00
Total Upgrade Time: 01:03:22

PL/SQL procedure successfully completed.


SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/oracle/cfgtoollogs/catbundle/catbundle_PSU_TestDB2_APPLY_2014Jul26_10_07_14.log
SQL>



Server:TestDB2:/home/oracle $cd /oracle/product/TestDB2/11.2.0.1/dbs
Server:TestDB2:/oracle/product/TestDB2/11.2.0.1/dbs $ls -lrt
total 24
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
lrwxrwxrwx    1 oracle   dba              45 Sep  4 2012  initTestDB2.ora -> /oracle/admin/TestDB2/pfile/initTestDB2.ora
-rw-r-----    1 oracle   dba              24 Sep  4 2012  lkTestDB2
lrwxrwxrwx    1 oracle   dba              47 Sep  5 2012  spfileTestDB2.ora -> /oracle/admin/TestDB2/pfile/spfileTestDB2.ora
lrwxrwxrwx    1 oracle   dba              42 Sep  5 2012  orapwTestDB2 -> /oracle/admin/TestDB2/pfile/orapwTestDB2
-rw-rw----    1 oracle   dba            1544 Jul 26 06:47 hc_TestDB2.dat
===============
Server:TestDB2:/oracle/product/TestDB2/11.2.0.1/dbs $echo $ORACLE_HOME
/oracle/product/TestDB2/11.2.0.4
Server:TestDB2:/oracle/product/TestDB2/11.2.0.1/dbs $

cd /oracle/product/TestDB2/11.2.0.1/dbs
rm initTestDB2.ora
cd /oracle/product/TestDB2/11.2.0.4/dbs
ln -s /oracle/admin/TestDB2/pfile/initTestDB2.ora initTestDB2.ora



Server:TestDB2:/oracle/product/TestDB2/11.2.0.1/dbs $cp -p initTestDB2.ora initTestDB2.ora_26jul_bkp
Server:TestDB2:/oracle/product/TestDB2/11.2.0.1/dbs $rm initTestDB2.ora
Server:TestDB2:/oracle/product/TestDB2/11.2.0.1/dbs $ls -lrt /oracle/admin/TestDB2/pfile/initTestDB2.ora
-rw-------    1 oracle   dba            1088 Jul  9 2013  /oracle/admin/TestDB2/pfile/initTestDB2.ora
Server:TestDB2:/oracle/product/TestDB2/11.2.0.1/dbs $

total 24
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
-rw-r-----    1 oracle   dba              24 Jul 26 08:12 lkTestDB2
-rw-rw----    1 oracle   dba            1544 Jul 26 10:23 hc_TestDB2.dat
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4/dbs $ln -s /oracle/admin/TestDB2/pfile/initTestDB2.ora initTestDB2.ora
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4/dbs $ls -ltr
total 24
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
-rw-r-----    1 oracle   dba              24 Jul 26 08:12 lkTestDB2
-rw-rw----    1 oracle   dba            1544 Jul 26 10:23 hc_TestDB2.dat
lrwxrwxrwx    1 oracle   dba              45 Jul 26 10:24 initTestDB2.ora -> /oracle/admin/TestDB2/pfile/initTestDB2.ora
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4/dbs $ls -n /oracle/admin/TestDB2/pfile/spfileTestDB2.ora spfileTestDB2.ora
spfileTestDB2.ora not found
-rw-r-----    1 300      203            3584 May 24 12:15 /oracle/admin/TestDB2/pfile/spfileTestDB2.ora
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4/dbs $ln -s ^?^?^?^?^?^?
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4/dbs $ln -s  /oracle/admin/TestDB2/pfile/spfileTestDB2.ora spfileTestDB2.ora
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4/dbs $ln -s /oracle/admin/TestDB2/pfile/orapwTestDB2 orapwTestDB2
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4/dbs $ls -ltr
total 24
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
-rw-r-----    1 oracle   dba              24 Jul 26 08:12 lkTestDB2
lrwxrwxrwx    1 oracle   dba              45 Jul 26 10:24 initTestDB2.ora -> /oracle/admin/TestDB2/pfile/initTestDB2.ora
-rw-rw----    1 oracle   dba            1544 Jul 26 10:25 hc_TestDB2.dat
lrwxrwxrwx    1 oracle   dba              47 Jul 26 10:25 spfileTestDB2.ora -> /oracle/admin/TestDB2/pfile/spfileTestDB2.ora
lrwxrwxrwx    1 oracle   dba              42 Jul 26 10:25 orapwTestDB2 -> /oracle/admin/TestDB2/pfile/orapwTestDB2
Server:TestDB2:/oracle/product/TestDB2/11.2.0.4/dbs $


total 0
drwxr-xr-x    2 oracle   dba             256 Feb 25 2011  trace
drwxr-xr-x    2 oracle   dba             256 Sep  6 2012  log
drwxr-xr-x    3 oracle   dba             256 Jul 26 10:38 admin
Server:TestDB1:/oracle/network $cd admin
Server:TestDB1:/oracle/network/admin $ls -ltr
total 488
-rwxr-x---    1 oracle   dba            2373 Sep  5 2012  listener.ora.11g
-rwxr-x---    1 oracle   dba            2367 Jan 11 2013  listener.ora.11g_01
-rwxr-x---    1 oracle   dba            2732 Jul  5 12:00 listener.ora_Jul_5_2014
-rwxr-x---    1 oracle   dba            2850 Jul 30 15:26 listener.ora
-rw-r--r--    1 oracle   dba          227711 Jul 31 14:08 tnsnames.ora
drwxr-xr-x    2 oracle   dba            4096 Jul 31 14:08 archive
Server:TestDB1:/oracle/network/admin $

total 24
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
lrwxrwxrwx    1 oracle   dba              45 Sep  4 2012  initTestDB1.ora -> /oracle/admin/TestDB1/pfile/initTestDB1.ora
-rw-r-----    1 oracle   dba              24 Sep  4 2012  lkTestDB1
lrwxrwxrwx    1 oracle   dba              47 Sep  5 2012  spfileTestDB1.ora -> /oracle/admin/TestDB1/pfile/spfileTestDB1.ora
lrwxrwxrwx    1 oracle   dba              42 Sep  5 2012  orapwTestDB1 -> /oracle/admin/TestDB1/pfile/orapwTestDB1
-rw-rw----    1 oracle   dba            1544 Aug  2 10:16 hc_TestDB1.dat
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $cp -p initTestDB1.ora initTestDB1.ora_02aug
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $rm initTestDB1.ora
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $ls -ltr
total 32
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
lrwxrwxrwx    1 oracle   dba              45 Sep  4 2012  initTestDB1.ora -> /oracle/admin/TestDB1/pfile/initTestDB1.ora
-rw-r-----    1 oracle   dba              24 Sep  4 2012  lkTestDB1
lrwxrwxrwx    1 oracle   dba              47 Sep  5 2012  spfileTestDB1.ora -> /oracle/admin/TestDB1/pfile/spfileTestDB1.ora
lrwxrwxrwx    1 oracle   dba              42 Sep  5 2012  orapwTestDB1 -> /oracle/admin/TestDB1/pfile/orapwTestDB1
-rw-------    1 oracle   dba            1088 Jul  9 2013  initTestDB1.ora_02aug
-rw-rw----    1 oracle   dba            1544 Aug  2 10:16 hc_TestDB1.dat
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $rm initTestDB1.ora
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $ls -ltr
total 32
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
-rw-r-----    1 oracle   dba              24 Sep  4 2012  lkTestDB1
lrwxrwxrwx    1 oracle   dba              47 Sep  5 2012  spfileTestDB1.ora -> /oracle/admin/TestDB1/pfile/spfileTestDB1.ora
lrwxrwxrwx    1 oracle   dba              42 Sep  5 2012  orapwTestDB1 -> /oracle/admin/TestDB1/pfile/orapwTestDB1
-rw-------    1 oracle   dba            1088 Jul  9 2013  initTestDB1.ora_02aug
-rw-rw----    1 oracle   dba            1544 Aug  2 10:16 hc_TestDB1.dat
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $ls -ltr /oracle/admin/TestDB1/pfile/initTestDB1.ora
-rw-------    1 oracle   dba            1088 Jul  9 2013  /oracle/admin/TestDB1/pfile/initTestDB1.ora
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $cp -p  spfileTestDB1.ora  spfileTestDB1.ora_2ng^?
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $cp -p  spfileTestDB1.ora  spfileTestDB1.ora_2aug
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $rm spfileTestDB1.ora
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $cp -p orapwTestDB1 orapwTestDB1_02aug
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $rm spfileTestDB1.ora
rm: spfileTestDB1.ora: No such file or directory
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $rm orapwTestDB1
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $ls -ltr
total 48
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
-rw-r-----    1 oracle   dba              24 Sep  4 2012  lkTestDB1
-rw-------    1 oracle   dba            1088 Jul  9 2013  initTestDB1.ora_02aug
-rw-r-----    1 oracle   dba            1536 Jul 15 2013  orapwTestDB1_02aug
-rw-r-----    1 oracle   dba            3584 Aug  1 12:54 spfileTestDB1.ora_2aug
-rw-rw----    1 oracle   dba            1544 Aug  2 10:16 hc_TestDB1.dat
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1/dbs $cd ..
Server:TestDB1:/oracle/product/TestDB1/11.2.0.1 $cd ..
Server:TestDB1:/oracle/product/TestDB1 $ls -ltr
total 16
drwxr-xr-x   76 oracle   dba            4096 Jan 11 2013  11.2.0.1
drwxr-xr-x   79 oracle   dba            4096 Aug  2 10:29 11.2.0.4
Server:TestDB1:/oracle/product/TestDB1 $cd  11.2.0.4
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4 $cd dbs
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ls -ltr
total 24
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
-rw-r-----    1 oracle   dba              24 Aug  2 10:33 lkTestDB1
-rw-rw----    1 oracle   dba            1544 Aug  2 12:13 hc_TestDB1.dat
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ls -n /oracle/admin/TestDB1/pfile/spfileTestDB1.ora spfileTestDB1.o
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ls -n /oracle/admin/TestDB1/pfile/spfileTestDB1.ora spfileTestDB1.ora
spfileTestDB1.ora not found
-rw-r-----    1 300      203            3584 Aug  1 12:54 /oracle/admin/TestDB1/pfile/spfileTestDB1.ora
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ls -n /oracle/admin/TestDB1/pfile/initTestDB1.ora initTestDB1.ora
initTestDB1.ora not found
-rw-------    1 300      203            1088 Jul  9 2013  /oracle/admin/TestDB1/pfile/initTestDB1.ora
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ls -lr
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ls -ltr /oracle/admin/TestDB1/pfile/initTestDB1.ora
-rw-------    1 oracle   dba            1088 Jul  9 2013  /oracle/admin/TestDB1/pfile/initTestDB1.ora
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ln -s /oracle/admin/TestDB1/pfile/spfileTestDB1.ora spfileTestDB1.ora
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ln -s /oracle/admin/TestDB1/pfile/initTestDB1.ora initTestDB1.ora
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ln -s /oracle/admin/TestDB1/pfile/orapwTestDB1 orapwTestDB1
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ls -ltr
total 24
-rw-r--r--    1 oracle   dba            2851 May 15 2009  init.ora
-rw-r-----    1 oracle   dba              24 Aug  2 10:33 lkTestDB1
lrwxrwxrwx    1 oracle   dba              47 Aug  2 12:20 spfileTestDB1.ora -> /oracle/admin/TestDB1/pfile/spfileTestDB1.ora
-rw-rw----    1 oracle   dba            1544 Aug  2 12:20 hc_TestDB1.dat
lrwxrwxrwx    1 oracle   dba              45 Aug  2 12:20 initTestDB1.ora -> /oracle/admin/TestDB1/pfile/initTestDB1.ora
lrwxrwxrwx    1 oracle   dba              42 Aug  2 12:20 orapwTestDB1 -> /oracle/admin/TestDB1/pfile/orapwTestDB1
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on Sat Aug 2 12:20:47 2014

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> su

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup
ORACLE instance started.

Total System Global Area 3423965184 bytes
Fixed Size                  2251168 bytes
Variable Size            1879049824 bytes
Database Buffers         1392508928 bytes
Redo Buffers              150155264 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $cat /etc/oratab
# ------------------------------------------------------------------------------
#
# This file is used by ORACLE utilities.  It is created by root.sh and updated
# by the Database Configuration Assistant when creating a database.
#
# A colon, ':', is used as the field terminator.
# A new line terminates the entry.  Lines beginning
# with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home directory of
# the database respectively.  The third filed indicates to the dbstart utility
# that the database should , "Y",
# or should not, "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#-------------------------------------------------------------------------------
#       Amendment history
#-------------------------------------------------------------------------------
# When          Who     What
# 25-Feb-11     WTM     Created
# 09-Feb-11     WTM     Added bxl55dev, cis55dev, csf55dev, ebs55dev, eml55dev
#                       and inl55dev
# 21-Mar-11     WTM     Added cml55dev
# 04-Apr-11     Cardy   Added acm02dev
# 21-Aug-2012   PS      Added emagent , asfdev
# 03-Sep-2012   MR      Added listener_11g, fus06dev,fus07dev,TestDB1 and TestDB2
# 18-Mar-13     WTM     Added crd01dev
# 13-Jul-13     CGJ     Upgraded acm02dev and listener_11g to 11.2.0.3.
# 05-Jul-14     YVRB    Upgraded crd01dev,fus06dev,fus07dev and listener_11g to 11.2.0.4 - CH125745
# 26-Jul-14     SA      Upgraded TestDB2 11.2.0.4 - CH129614
# ------------------------------------------------------------------------------
#
dummy:/oracle/product/asfdev/11.2.0.4:N
dummy10205:/oracle/product/10.2.0.5:N
acm02dev:/oracle/product/acm02dev/11.2.0.3:N
bxl55dev:/oracle/product/bxl55dev/10.2.0.5:N
cis55dev:/oracle/product/cis55dev/10.2.0.5:N
cml55dev:/oracle/product/cml55dev/10.2.0.5:N
csf55dev:/oracle/product/csf55dev/10.2.0.5:N
ebs55dev:/oracle/product/ebs55dev/10.2.0.5:N
eml55dev:/oracle/product/eml55dev/10.2.0.5:N
inl55dev:/oracle/product/inl55dev/10.2.0.5:N
fus06dev:/oracle/product/fus06dev/11.2.0.4:N
fus07dev:/oracle/product/fus07dev/11.2.0.4:N
TestDB1:/oracle/product/TestDB1/11.2.0.1:N
TestDB2:/oracle/product/TestDB2/11.2.0.4:N
crd01dev:/oracle/product/crd01dev/11.2.0.4:N
listener_11g:/oracle/product/listener/11.2.0.4:N
listener_10g:/oracle/product/listener/10.2.0.5:N

emagent:/oracle/product/emgc_10g/sdgdev002_oracle10g/agent12g/agent_inst:N
agent12g1:/oracle/product/emgc_10g/sdgdev002_oracle10g/agent12g/core/12.1.0.1.0:N
asfdev:/oracle/product/asfdev/11.2.0.4:N
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $ct
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $vi /etc/oratab
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $. oraenv
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $.oraenv
ksh: .oraenv:  not found
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $. oraenv
ORACLE_SID = [TestDB1] ?
The Oracle base remains unchanged with value /oracle
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $echo $ORACLE_HOME
/oracle/product/TestDB1/11.2.0.4
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $cd
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4/dbs $cd ..
Server:TestDB1:/oracle/product/TestDB1/11.2.0.4 $cd ..
Server:TestDB1:/oracle/product/TestDB1 $cd ..
Server:TestDB1:/oracle/product $cd ..
Server:TestDB1:/oracle $cd network
Server:TestDB1:/oracle/network $ls -ltr
total 0
drwxr-xr-x    2 oracle   dba             256 Feb 25 2011  trace
drwxr-xr-x    2 oracle   dba             256 Sep  6 2012  log
drwxr-xr-x    3 oracle   dba             256 Jul 26 10:38 admin
Server:TestDB1:/oracle/network $cd admin
Server:TestDB1:/oracle/network/admin $ls -ltr
total 488
-rwxr-x---    1 oracle   dba            2373 Sep  5 2012  listener.ora.11g
-rwxr-x---    1 oracle   dba            2367 Jan 11 2013  listener.ora.11g_01
-rwxr-x---    1 oracle   dba            2732 Jul  5 12:00 listener.ora_Jul_5_2014
-rwxr-x---    1 oracle   dba            2850 Jul 30 15:26 listener.ora
-rw-r--r--    1 oracle   dba          227711 Jul 31 14:08 tnsnames.ora
drwxr-xr-x    2 oracle   dba            4096 Jul 31 14:08 archive
Server:TestDB1:/oracle/network/admin $

  oracle 24576426        1   0   Jul 21      -  2:40 ora_pmon_inl55dev
Server:TestDB1:/oracle/network/admin $ps -ef|grep tns
  oracle 60817490 12255602   1 12:30:47  pts/4  0:00 grep tns
  oracle  8585570        1   0   Jul 05      -  9:31 /oracle/product/listener/11.2.0.4/bin/tnslsnr listener_11g -inherit
Server:TestDB1:/oracle/network/admin $lsnrctl

LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production on 02-AUG-2014 12:30:57

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> reload listener_11g
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=REGISTER)))
The command completed successfully
LSNRCTL>


  Instance "fus06dev", status READY, has 1 handler(s) for this service...
Service "fus06devXDB" has 1 instance(s).
  Instance "fus06dev", status READY, has 1 handler(s) for this service...
Service "fus07dev" has 2 instance(s).
  Instance "fus07dev", status UNKNOWN, has 1 handler(s) for this service...
  Instance "fus07dev", status READY, has 1 handler(s) for this service...
Service "fus07devXDB" has 1 instance(s).
  Instance "fus07dev", status READY, has 1 handler(s) for this service...
Service "TestDB1" has 2 instance(s).
  Instance "TestDB1", status UNKNOWN, has 1 handler(s) for this service...
  Instance "TestDB1", status READY, has 1 handler(s) for this service...
Service "TestDB1XDB" has 1 instance(s).
  Instance "TestDB1", status READY, has 1 handler(s) for this service...
Service "TestDB2" has 2 instance(s).
  Instance "TestDB2", status UNKNOWN, has 1 handler(s) for this service...
  Instance "TestDB2", status READY, has 1 handler(s) for this service...
Service "TestDB2XDB" has 1 instance(s).
  Instance "TestDB2", status READY, has 1 handler(s) for this service...
Service "inl55dev" has 1 instance(s).
  Instance "inl55dev", status UNKNOWN, has 1 handler(s) for this service...
Service "inl55dev.world" has 1 instance(s).
  Instance "inl55dev", status READY, has 1 handler(s) for this service...
Service "inl55dev_XPT.world" has 1 instance(s).
  Instance "inl55dev", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> xit

Take a list of INVALID objects in the database after  upgrade:

SQL> spool invalid_obj_after_DBupgradeto11202.log;
SQL> select * from v$instance;
SQL> select sysdate from dual;
SQL> select owner,object_name,status from dba_objects where status ='INVALID';
SQL> spool off;

Compare the invalid objects list with the one taken at section 1.1, step 6 before upgrade and verify that there are no new invalid objects after applying the patch.

Execute the command.
  ps –ef | grep ora_| grep CNTLNTQ1
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;


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


Prechecks :
perform flashcopy/backp of the db
Space on mount points, tablespace level.
Check for invalid components
Check for stale schema stats (using check_schema_stale_stats.sql )
Run pre upgrade tool (utlu112i_11204_009.sql)

2) Change the oratab entry

3) un-tar the oracle home tar file and Clone new Oracle home

4) create soft links and start db in upgrade mode

5) Run the catupgrd.sql script to do the upgrade

6) perform post db activities


Verification Steps :

a)Check the inventory to list out the latest patches



Cloning an Oracle Home

You may wish to clone an Oracle Home, for example you have all your databases on a single Oracle Home but you want to separate Development from Test.
 This could be so you can soak test Patch Set Updates (PSU) on Development before applying to Test and then Production. 
Or you might wish to have 2 Oracle Homes, so you can patch one and then switch all databases to the patched Oracle Home for minimal downtime.


Copying the Oracle Home

First you need to copy the Oracle Home at file level using cp as user root as shown below:

[root@v1ex2dbadm01 ~]# cp -Rp /u01/app/oracle/product/12.1.0.2/dbhome_1 /u01/app/oracle/product/12.1.0.2/dbhome_2

Then check the Oracle Home and the Cloned Oracle Home are the same size:

[root@v1ex2dbadm01 ~]# du -h /u01/app/oracle/product/12.1.0.2/dbhome_1 --max-depth=0
12G /u01/app/oracle/product/12.1.0.2/dbhome_1
[root@v1ex2dbadm01 ~]# du -h /u01/app/oracle/product/12.1.0.2/dbhome_2 --max-depth=0
12G /u01/app/oracle/product/12.1.0.2/dbhome_2

Then repeat on all the other nodes:

[root@v1ex2dbadm02 ~]# cp -Rp /u01/app/oracle/product/12.1.0.2/dbhome_1 /u01/app/oracle/product/12.1.0.2/dbhome_2
[root@v1ex2dbadm02 ~]# du -h /u01/app/oracle/product/12.1.0.2/dbhome_1 --max-depth=0
12G /u01/app/oracle/product/12.1.0.2/dbhome_1
[root@v1ex2dbadm02 ~]# du -h /u01/app/oracle/product/12.1.0.2/dbhome_2 --max-depth=0
12G /u01/app/oracle/product/12.1.0.2/dbhome_2


Cloning the Oracle Home

Now we have a copy of the Oracle Home, we next need to clone using the clone.pl perl script as shown below:

/usr/bin/perl $ORACLE_HOME/clone/bin/clone.pl \
'-O"CLUSTER_NODES={v1ex2dbadm01,v1ex2dbadm02}"' \
'-O"LOCAL_NODE=v1ex2dbadm01"' ORACLE_BASE=/u01/app/oracle \
ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=OraDB12Home2 '-O-noConfig'

CLUSTER_NODES = all the nodes in the cluster
LOCAL_NODE = The node you are running the command on
ORACLE_BASE = The Oracle Base defined on the Server
ORACLE_HOME = The Cloned Oracle Home, already exported
ORACLE_HOME_NAME = The name you wish to give to the Cloned Oracle Home

[root@v1ex2dbadm01 ~]# su - oracle
[oracle@v1ex2dbadm01 ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_2
[oracle@v1ex2dbadm01 ~]$ /usr/bin/perl $ORACLE_HOME/clone/bin/clone.pl \
> '-O"CLUSTER_NODES={v1ex2dbadm01,v1ex2dbadm02}"' \
> '-O"LOCAL_NODE=v1ex2dbadm01"' ORACLE_BASE=/u01/app/oracle \
> ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=OraDB12Home2 '-O-noConfig'
./runInstaller -clone -waitForCompletion "CLUSTER_NODES={v1ex2dbadm01,v1ex2dbadm02}" "LOCAL_NODE=v1ex2dbadm01" "ORACLE_BASE=/u01/app/oracle" "ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_2" "ORACLE_HOME_NAME=OraDB12Home2" -noConfig -silent -paramFile /u01/app/oracle/product/12.1.0.2/dbhome_2/clone/clone_oraparam.ini
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB. Actual 5392 MB Passed
Checking swap space: must be greater than 500 MB. Actual 24532 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-06-21_02-57-14PM. Please wait ...You can find the log of this install session at:
/u01/app/oraInventory/logs/cloneActions2017-06-21_02-57-14PM.log
 .................................................. 5% Done.
 .................................................. 10% Done.
 .................................................. 15% Done.
 .................................................. 20% Done.
 .................................................. 25% Done.
 .................................................. 30% Done.
 .................................................. 35% Done.
 .................................................. 40% Done.
 .................................................. 45% Done.
 .................................................. 50% Done.
 .................................................. 55% Done.
 .................................................. 60% Done.
 .................................................. 65% Done.
 .................................................. 70% Done.
 .................................................. 75% Done.
 .................................................. 80% Done.
 .................................................. 85% Done.
 ..........
Copy files in progress.

Copy files successful.

Link binaries in progress.

Link binaries successful.

Setup files in progress.

Setup files successful.

Setup Inventory in progress.

Setup Inventory successful.

Finish Setup successful.
The cloning of OraDB12Home2 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2017-06-21_02-57-14PM.log' for more details.

Setup Oracle Base in progress.

Setup Oracle Base successful.
 .................................................. 95% Done.

As a root user, execute the following script(s):
1. /u01/app/oracle/product/12.1.0.2/dbhome_2/root.sh

Execute /u01/app/oracle/product/12.1.0.2/dbhome_2/root.sh on the following nodes:
[v1ex2dbadm01]

.................................................. 100% Done.

[oracle@v1ex2dbadm01 ~]$

Next check the re-linking is RDS not UDP:

[oracle@v1ex2dbadm01 ~]$ /u01/app/oracle/product/12.1.0.2/dbhome_2/bin/skgxpinfo
rds
[oracle@v1ex2dbadm01 ~]$

If UDP is set (the output is udp instead of rds as shown above), then relink using command below:

cd $ORACLE_HOME/rdbms/lib; ORACLE_HOME=$ORACLE_HOME make -f ins_rdbms.mk ipc_rds ioracle

Then repeat on all the other nodes, remember to change LOCAL_NODE:

[root@v1ex2dbadm02 ~]# su - oracle
[oracle@v1ex2dbadm02 ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_2
[oracle@v1ex2dbadm02 ~]$ /usr/bin/perl $ORACLE_HOME/clone/bin/clone.pl \
> '-O"CLUSTER_NODES={v1ex2dbadm01,v1ex2dbadm02}"' \
> '-O"LOCAL_NODE=v1ex2dbadm02"' ORACLE_BASE=/u01/app/oracle \
> ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=OraDB12Home2 '-O-noConfig'
./runInstaller -clone -waitForCompletion "CLUSTER_NODES={v1ex2dbadm01,v1ex2dbadm02}" "LOCAL_NODE=v1ex2dbadm02" "ORACLE_BASE=/u01/app/oracle" "ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_2" "ORACLE_HOME_NAME=OraDB12Home2" -noConfig -silent -paramFile /u01/app/oracle/product/12.1.0.2/dbhome_2/clone/clone_oraparam.ini
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB. Actual 10725 MB Passed
Checking swap space: must be greater than 500 MB. Actual 24565 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-06-21_03-05-37PM. Please wait ...You can find the log of this install session at:
/u01/app/oraInventory/logs/cloneActions2017-06-21_03-05-37PM.log
 .................................................. 5% Done.
 .................................................. 10% Done.
 .................................................. 15% Done.
 .................................................. 20% Done.
 .................................................. 25% Done.
 .................................................. 30% Done.
 .................................................. 35% Done.
 .................................................. 40% Done.
 .................................................. 45% Done.
 .................................................. 50% Done.
 .................................................. 55% Done.
 .................................................. 60% Done.
 .................................................. 65% Done.
 .................................................. 70% Done.
 .................................................. 75% Done.
 .................................................. 80% Done.
 .................................................. 85% Done.
 ..........
Copy files in progress.

Copy files successful.

Link binaries in progress.

Link binaries successful.

Setup files in progress.

Setup files successful.

Setup Inventory in progress.

Setup Inventory successful.

Finish Setup successful.
The cloning of OraDB12Home2 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2017-06-21_03-05-37PM.log' for more details.

Setup Oracle Base in progress.

Setup Oracle Base successful.
 .................................................. 95% Done.

As a root user, execute the following script(s):
1. /u01/app/oracle/product/12.1.0.2/dbhome_2/root.sh

Execute /u01/app/oracle/product/12.1.0.2/dbhome_2/root.sh on the following nodes:
[v1ex2dbadm02]

.................................................. 100% Done.

[oracle@v1ex2dbadm02 ~]$ /u01/app/oracle/product/12.1.0.2/dbhome_2/bin/skgxpinfo
rds
[oracle@v1ex2dbadm02 ~]$

Next you need to run root.sh as shown below:

[oracle@v1ex2dbadm01 ~]$ exit
logout
[root@v1ex2dbadm01 ~]# /u01/app/oracle/product/12.1.0.2/dbhome_2/root.sh
Check /u01/app/oracle/product/12.1.0.2/dbhome_2/install/root_v1ex2dbadm01.v1.com_2017-06-21_15-04-16.log for the output of root script
[root@v1ex2dbadm01 ~]#

Then repeat on all the other nodes:

[oracle@v1ex2dbadm02 ~]$ exit
logout
[root@v1ex2dbadm02 ~]# /u01/app/oracle/product/12.1.0.2/dbhome_2/root.sh
Check /u01/app/oracle/product/12.1.0.2/dbhome_2/install/root_v1ex2dbadm02.v1.com_2017-06-21_15-06-49.log for the output of root script
[root@v1ex2dbadm02 ~]#

Verify that the Cloned Oracle Home comprises of all the nodes in the cluster:

[root@v1ex2dbadm01 ~]# su - oracle
[oracle@v1ex2dbadm01 ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_2
[oracle@v1ex2dbadm01 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -oh $ORACLE_HOME | grep node
Rac system comprising of multiple nodes
Local node = v1ex2dbadm01
Remote node = v1ex2dbadm02
[oracle@v1ex2dbadm01 ~]$

Then repeat on all the other nodes:

[root@v1ex2dbadm02 ~]# su - oracle
[oracle@v1ex2dbadm02 ~]$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_2
[oracle@v1ex2dbadm02 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -oh $ORACLE_HOME | grep node
Rac system comprising of multiple nodes
Local node = v1ex2dbadm02
Remote node = v1ex2dbadm01
[oracle@v1ex2dbadm02 ~]$


Switching Databases to Cloned Oracle Home

Change the Oracle Home using server control:

[oracle@v1ex2dbadm01 ~]$ srvctl config database -d V1DEV -a
Database unique name: V1DEV
Database name:
Oracle home: /u01/app/oracle/product/12.1.0.2/dbhome_1
Oracle user: oracle
Spfile: +DATAC1/V1DEV/PARAMETERFILE/spfileV1DEV.ora
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATAC1,RECOC1
Mount point paths:
Services: v1jobservice
Type: RAC
Start concurrency:
Stop concurrency:
Database is enabled
Database is individually enabled on nodes:
Database is individually disabled on nodes:
OSDBA group: dba
OSOPER group: dba
Database instances: V1DEV1,V1DEV2
Configured nodes: v1ex2dbadm01,v1ex2dbadm02
Database is administrator managed
[oracle@v1ex2dbadm01 ~]$ srvctl modify database -d V1DEV -o /u01/app/oracle/product/12.1.0.2/dbhome_2
[oracle@v1ex2dbadm01 ~]$ srvctl config database -d V1DEV -a
Database unique name: V1DEV
Database name:
Oracle home: /u01/app/oracle/product/12.1.0.2/dbhome_2
Oracle user: oracle
Spfile: +DATAC1/V1DEV/PARAMETERFILE/spfileV1DEV.ora
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools:
Disk Groups: DATAC1,RECOC1
Mount point paths:
Services: v1jobservice
Type: RAC
Start concurrency:
Stop concurrency:
Database is enabled
Database is individually enabled on nodes:
Database is individually disabled on nodes:
OSDBA group: dba
OSOPER group: dba
Database instances: V1DEV1,V1DEV2
Configured nodes: v1ex2dbadm01,v1ex2dbadm02
Database is administrator managed
[oracle@v1ex2dbadm01 ~]$

Next change /etc/oratab to reflect the new Oracle Home:

[oracle@v1ex2dbadm01 ~]$ vi /etc/oratab
[oracle@v1ex2dbadm01 ~]$ more /etc/oratab | grep dbhome_2
V1DEV1:/u01/app/oracle/product/12.1.0.2/dbhome_2:N # line added by Agent

Then repeat on all the other nodes:

[oracle@v1ex2dbadm02 ~]$ vi /etc/oratab
[oracle@v1ex2dbadm02 ~]$ more /etc/oratab | grep dbhome_2
V1DEV2:/u01/app/oracle/product/12.1.0.2/dbhome_2:N # line added by Agent

Now we rolling bounce the database:

[oracle@v1ex2dbadm01 ~]$ srvctl status database -d V1DEV -v
Instance V1DEV1 is running on node v1ex2dbadm01. Instance status: Open,Running from Old Oracle Home.
Instance V1DEV2 is running on node v1ex2dbadm02 with online services v1jobservice. Instance status: Open,Running from Old Oracle Home.
[oracle@v1ex2dbadm01 ~]$ srvctl stop instance -d V1DEV -i V1DEV1 -f
[oracle@v1ex2dbadm01 ~]$ srvctl start instance -d V1DEV -i V1DEV1
[oracle@v1ex2dbadm01 ~]$ srvctl stop instance -d V1DEV -i V1DEV2 -f
[oracle@v1ex2dbadm01 ~]$ srvctl start instance -d V1DEV -i V1DEV2
[oracle@v1ex2dbadm01 ~]$ srvctl status database -d V1DEV -v
Instance V1DEV1 is running on node v1ex2dbadm01. Instance status: Open.
Instance V1DEV2 is running on node v1ex2dbadm02 with online services v1jobservice. Instance status: Open.
[oracle@v1ex2dbadm01 ~]$



Related My Oracle Support (MOS) notes:

Master Note For Cloning Oracle Database Server ORACLE_HOME’s Using the Oracle Universal Installer (OUI) (Doc ID 1154613.1)

Cloning An Existing Oracle Database 12c Release 1 (12.1.0.x) RDBMS Installation Using OUI (Doc ID 1493677.1)

No comments:

Post a Comment