Thursday, June 4, 2020

Manual Oracle Home Cloning || 11g Release 2 (11.2.0.4)

Below are the details manual oracle home cloning steps.

Please refer the attached log file with detailed steps and execution log files.

Please refer my YouTube channel and for more details

https://youtu.be/czC73ljVCKE


1. Take tar backup of existing Oracle home.

tar -cvzf OH_BINARIES_BKP.tar.gz /u01/app/oracle/product/11204/dbhome_1/*

2. untar the backup tar file in step1 with Target Oracle home and target owner

mkdir -p /u01/app/oracle/product/11204/dbhome_2
cd /u01/app/oracle/product/11204/dbhome_2
tar -xvzf/u01/app/oracle/product/11204/OH_BINARIES_BKP.tar.gz .

3. Post steps to be performed on both the nodes. 

cd /u01/app/oracle/product/11204/dbhome_2/clone/bin 
./clone.pl ORACLE_HOME=/u01/app/oracle/product/11204/dbhome_2 ORACLE_HOME_NAME=11204_dbhome_2 ORACLE_BASE=/u01/app/oracle

4. Update the cluster nodes 

Repeat step1 to step3 on all cluster nodes and run below commands

/u01/app/oracle/product/11204/dbhome_2/oui/bin/runInstaller -updateNodeListORACLE_HOME=/u01/app/oracle/product/11204/dbhome_2 "CLUSTER_NODES={npexdbadm01, npexdbadm02}"

5. Enable on rds protocol on oracle Home (Applicable only for Oracle homes in EXADATA machine) 

export ORACLE_HOME=/u01/app/oracle/product/11204/dbhome_2


cd $ORACLE_HOME/rdbms/lib

make -f ins_rdbms.mk ipc_rdsioracle

6. To check if the Binaries are RAC Enabled: (Applicable only for RAC)

cd $ORACLE_HOME/rdbms/lib
nm -r libknlopt.a | grep -c kcsm.o
1 >>> means RAC feature enabled 
0 >>> means RAC feature NOT enabled 

cd $ORACLE_HOME/rdbms/lib

make -f ins_rdbms.mk rac_onioracle

7. Verification:

/u01/app/oracle/product/11204/dbhome_2/OPatch/opatchlsinventory

 cat /u01/app/oracInventory/Context/inventory.xml  

>>> Verify Target OH is having all the cluster nodes


Regards,

Mallik


Oracle Patching Demo|| PSU Patching || 11g Release 2 (11.2.0.4) - OPatch


Maintaining patch compliance helps ensure performance and security in your Oracle system

Why do we do patching?

-         Security

-         BUG fixes

-         New feature enhancement

-         Upgradations

-         Compliance

What all we do patching in Oracle database?

-         Grid Home/binaries (In case of Oracle RAC)

-         Oracle Home/binaries

-         Databases

What are types are patching in Oracle database?

-         Rolling Patching (Hot patching, Online Patching, Out of place patching)

-         Non-Rolling Patching

What are types re patches do Oracle has?

-         Bundle patch

-         ONEOFF patch

-         Online patch

-         Composite patch

-         Merge patching many more 

What are tolls we do use in Oracle patching?

-         OPatch (in case of Binaries)

-         Catbudle-11g & datapatch-12c (in case of database)

Note: There are other patching in Exadata, YUM patching, CELL patching, IB switch patching and other component’s patching


Master Document for downloading Latest Patches: 888828.1

BUG List:

Bug Fix List: the 11.2.0.4 Patch Bundles for Oracle Exadata Database Machine (Doc ID 1601749.1)  

 

Start with Oracle 11g Patching:

1) Prechks: 

-Patch_April2017

$ORACLE_HOME/OPatch/opatchprereqCheckConflictAgainstOHWithDetail -phBaseDir/u01/patches/25440411/24828123

$ORACLE_HOME/OPatch/opatchprereqCheckConflictAgainstOHWithDetail -phBaseDir/u01/patches/25440411/23054319/custom/server/23054319

$ORACLE_HOME/OPatch/opatchprereqCheckSystemSpace -phBaseDir/u01/patches/25440411/24828123

$ORACLE_HOME/OPatch/opatchprereqCheckSystemSpace -phBaseDir/u01/patches/25440411/23054319/custom/server/23054319


2) backup database and oracle binaries before patching and stop listener & database:

 ps -ef|grepsmon

cat /etc/oratab

ps -ef | grep agent | grep java | sed 's/\s\+/ /g' | cut -d " " -f 1,8 | sed 's/\/jdk.*//'


-- database backup

-- Oracle home binaries backup 


lsnrctl stop

lsnrctlstatus

shut immediate

 

3) Stop Agent:

 su -l oracle -c "/opt/OracleHomes/agent_home/core/12.1.0.3.0/bin/emctl stop agent"

su -l oracle -c "/opt/OracleHomes/agent_home/core/12.1.0.3.0/bin/emctl status agent"

 

4) Change the ownership of patch directory:

chown -R oracle:oinstall /u01/patches

--Place the latest Patch 6880880 


5) Create response file

/u01/app/oracle/product/11204/dbhome_1/OPatch/ocm/bin/emocmrsp -output /u01/patches/ocm.rsp 

6) Patching

/u01/patches/25440411/23054319/custom/server/23054319/custom/scripts/prepatch.sh -dbhome /u01/app/oracle/product/11204/dbhome_1

/u01/app/oracle/product/11204/dbhome_1/OPatch/opatchnapply -oh /u01/app/oracle/product/11204/dbhome_1 -local -silent -ocmrf /u01/patches/ocm.rsp /u01/patches/25440411/24828123

/u01/app/oracle/product/11204/dbhome_1/OPatch/opatchnapply -oh /u01/app/oracle/product/11204/dbhome_1 -local -silent -ocmrf /u01/patches/ocm.rsp /u01/patches/25440411/23054319/custom/server/23054319

/u01/patches/25440411/23054319/custom/server/23054319/custom/scripts/postpatch.sh -dbhome /u01/app/oracle/product/11204/dbhome_1

 

7) Oracle home patch verification

/u01/app/oracle/product/11204/dbhome_1/OPatch/opatchlspatches -oh /u01/app/oracle/product/11204/dbhome_1

 

8) Database patch

Verify which database you are connected to    

              select name from v$database;

              select database_role from v$database;

             

Check for invalid objects            

              column comp_name format a40

              column version format a12

              column status format a15

              select comp_name,version,status from dba_registry;

         

              column owner format a15

              column object_name format a40

              column object_type format a20

              select owner, object_name, object_type from dba_objects where status='INVALID' order by object_type,owner,object_name;

             

If there are a lot of invalids, this next command will list only the invalids containing SYS in the owner

              select owner, object_name, object_type from dba_objects where status='INVALID' and owner like '%SYS%' order by object_type,owner,object_name;

If there are invalids then run utlrp and check again      

              @?/rdbms/admin/utlprp.sql 16

              select comp_name,version,status from dba_registry;

              select owner, object_name, object_type from dba_objects where status='INVALID' order by object_type,owner,object_name;

 

Execute the catbundle script    

              @?/rdbms/admin/catbundle.sqlexa apply

              @?/rdbms/admin/utlprp.sql 8

             

Check invalids again     

              select comp_name,version,status from dba_registry;

              select owner, object_name, object_type from dba_objects where status='INVALID' order by object_type,owner,object_name;


9) Database patch verification:

Check that the apply finished successfully            

              select * from dba_registry_history;


col ACTION for a20

col NAMESPACE for a20

col VERSION for a30

col BUNDLE_SERIES for a20

col COMMENTS for a50

select * from dba_registry_history;

 

Regards

Mallik


Wednesday, June 3, 2020

Oracle Home Installation on Oracle Linux || 11g Release 2 (11.2)

Please refer the below YouTube channel for detailed explanation:

https://www.youtube.com/watch?v=azzh8khOUyM&t=151s

1.       Build or Installation Linux Server

Oracle linux is ready and it is update and running

2.       Download Oracle software and unzip

#11.2.0.4

unzip p13390677_112040_Linux-x86-64_1of7.zip

unzip p13390677_112040_Linux-x86-64_2of7.zip


3.       Hostname verification 

192.168.0.101   OEL58.localdomain    OEL58

4.       Verify the system pre-configuration

/sbin/sysctl -a

/etc/sysctl.conf

/etc/security/limits.conf

oracle              soft    nproc   16384

oracle              hard    nproc   16384

oracle              soft    nofile  4096

oracle              hard    nofile  65536

oracle              soft    stack   10240

 

Creating the Oracle user and groups

groupadd -g 54321oinstall

groupadd -g 54322 dba

groupadd -g 54323 oper

groupadd -g 54324asmadmin

groupadd -g 54325 asmdba

groupadd -g 54326 asmoper

 

useradd -u 54321 -g oinstall -G dba,asmdba,oper oracle

passwd oracle

>>> Welcome2020


Creating the directories

mkdir -p /u01/app/oracle/product/11.2.0.4/dbhome_1

chown -R oracle:oinstall /u01

chmod -R 775 /u01

 

Setting up the .bash_profile for oracle user

# Oracle Settings

TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/dbhome_1; export ORACLE_HOME

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

PATH=/usr/sbin:$PATH; export PATH

PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

 

5.       Oracle Home Installation

Go to the software location and launch the GUI screen for Installation

./runInstaller

Follow the installation screen and installation wizard

 

6.       Post Oracle Home Installation

Verify the /etc/oratab

Apply the Latest OPatch and Latest BP/CPU/PSU


Regards,
Mallik

Automation Script | Archivelog Generation Hourly Monitoring

1. List out all the running databases and pic one database where we want to monitore the archive log generation from last 1 month. [oracle@o...