domingo, 26 de septiembre de 2021

How to install Grid Infrastructure binaries 19c in Silent mode for Linux

In this article I will show how to install Grid Infrastructure Software 19c and how to configure it using silent mode in Oracle Enterprise Linux 8. 

Installation-only steps

 Unzip the binaries into the GI Home Directory:

$ unzip LINUX.X64_193000_grid_home.zip -d /u01/app/oracle/product/19.0.0/grid_home
$ cd /u01/app/oracle/product/19.0.0/grid_home
$ cp ./inventory/response/grid_install.rsp . 

Configuring passwordless between servers:

$ /u01/app/oracle/product/19.0.0/grid_home/deinstall/sshUserSetup.sh -user grid -hosts "srv1 srv2" -noPromptPassphrase -advanced

Creating response file:

$ cat <<EOF > grid_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0
INVENTORY_LOCATION=/u01/app/oracle/product/19.0.0/oraInventory
oracle.install.option=CRS_SWONLY
ORACLE_BASE=/u01/app/oracle/product/19.0.0/grid_base
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.scanType=LOCAL_SCAN
oracle.install.crs.config.SCANClientDataFile=
oracle.install.crs.config.gpnp.scanName=scan01
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.ClusterConfiguration=STANDALONE
oracle.install.crs.config.configureAsExtendedCluster=false
oracle.install.crs.config.memberClusterManifestFile=
oracle.install.crs.config.clusterName=cluster01
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.gpnp.gnsOption=
oracle.install.crs.config.gpnp.gnsClientDataFile=
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.sites=
oracle.install.crs.config.clusterNodes=srv1:srv1-vip,srv2:srv2-vip
oracle.install.crs.config.networkInterfaceList=bond0:192.168.10.0:1,bond1:10.10.50.0:5
oracle.install.crs.configureGIMR=false
oracle.install.asm.configureGIMRDataDG=
EOF

Set the env variable to validate OEL8:

$ export CV_ASSUME_DISTID=OEL8
 

Install GI Software:

$ /u01/app/oracle/product/19.0.0/grid_home/gridSetup.sh -silent -responseFile /u01/app/oracle/product/19.0.0/grid_home/grid_install.rsp -ignorePrereqFailure

Scripts Post-Installation:

in srv1:

#/u01/app/oracle/product/19.0.0/oraInventory/orainstRoot.sh

in srv2:

#/u01/app/oracle/product/19.0.0/oraInventory/orainstRoot.sh

in srv1:

#/u01/app/oracle/product/19.0.0/grid_home/root.sh

in srv2:

#/u01/app/oracle/product/19.0.0/grid_home/root.sh

Configuration steps

Creating response file:

$ cat <<EOF > grid_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0
INVENTORY_LOCATION=/u01/app/oracle/product/19.0.0/oraInventory
oracle.install.option=CRS_CONFIG
ORACLE_BASE=/u01/app/oracle/product/19.0.0/grid_base
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.scanType=LOCAL_SCAN
oracle.install.crs.config.SCANClientDataFile=
oracle.install.crs.config.gpnp.scanName=scan01
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.ClusterConfiguration=STANDALONE
oracle.install.crs.config.configureAsExtendedCluster=false
oracle.install.crs.config.memberClusterManifestFile=
oracle.install.crs.config.clusterName=cluster01
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.gpnp.gnsOption=
oracle.install.crs.config.gpnp.gnsClientDataFile=
oracle.install.crs.config.gpnp.gnsSubDomain=
oracle.install.crs.config.gpnp.gnsVIPAddress=
oracle.install.crs.config.sites=
oracle.install.crs.config.clusterNodes=srv1:srv1-vip,srv2:srv2-vip
oracle.install.crs.config.networkInterfaceList=bond0:
192.168.10.0:1,bond1:10.10.50.0:5
oracle.install.crs.configureGIMR=false
oracle.install.asm.configureGIMRDataDG=
oracle.install.crs.config.storageOption=FLEX_ASM_STORAGE
oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=
oracle.install.crs.config.sharedFileSystemStorage.ocrLocations=
oracle.install.crs.config.useIPMI=false
oracle.install.asm.SYSASMPassword=manager1
oracle.install.asm.diskGroup.name=OCR_VOTING
oracle.install.asm.diskGroup.redundancy=EXTERNAL
oracle.install.asm.diskGroup.AUSize=4
oracle.install.asm.diskGroup.FailureGroups=
oracle.install.asm.diskGroup.disks=/dev/oracleasm/disks/OCR
oracle.install.asm.diskGroup.quorumFailureGroupNames=
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/oracleasm/disks/*
oracle.install.asm.monitorPassword=manager1
oracle.install.asm.configureAFD=false
EOF


Set the env variable to validate OEL8:

$ export CV_ASSUME_DISTID=OEL8

Configure GI Software: 

$ /u01/app/oracle/product/19.0.0/grid_home/gridSetup.sh -silent -responseFile /u01/app/oracle/product/19.0.0/grid_home/grid_install.rsp -ignorePrereqFailure


Scripts Post-Configuration:

# in srv1: /u01/app/oracle/product/19.0.0/grid_home/root.sh    **(wait until complete)
# in srv2: /u01/app/oracle/product/19.0.0/grid_home/root.sh  

as grid:
$ in srv1: /u01/app/oracle/product/19.0.0/grid_home/gridSetup.sh -executeConfigTools -responseFile /u01/app/oracle/product/19.0.0/grid_home/grid_install.rsp -silent






viernes, 24 de septiembre de 2021

How to apply a patch with opatchauto

In this article I will show you how to install a patch in Grid Infrastructure home and in the Database Home using opatchauto.

For this example I will install the the following patches:

  • Patch 33803476 in Grid Infrastructure.
  • Patch 33803476 and 33808367 in Database home. 

 

Installing a patch in Grid Infrastructure home:

Update OPatch in Grid Infrastructure:

You have to download the patch 6880880 from Oracle Metalink and clear the directory $ORACLE_HOME/OPatch. Then you can unzip a new fresh version of OPatch:

$ unzip p6880880_190000_Linux-x86-64.zip -d /u01/app/oracle/product/19.0.0/grid_home

 Stopping the CRS:

 [root@srv1~]# /u01/app/oracle/product/19.0.0/grid_home/bin/crsctl stop crs



Applying the Patch:

[root@srv1~]# /u01/app/oracle/product/19.0.0/grid_home/OPatch/opatchauto  apply /u01/paquetes/33859214/33859214/33803476 -oh /u01/app/oracle/product/19.0.0/grid_home -nonrolling



Verifying the Patch:

[grid@srv1~]$ /u01/app/oracle/product/19.0.0/grid_home/OPatch/opatch lsinventory|egrep -i 'Patch description'
Patch description:  "TOMCAT RELEASE UPDATE 19.0.0.0.0 (33911149)"
Patch description:  "ACFS RELEASE UPDATE 19.15.0.0.0 (33815607)"
Patch description:  "OCW RELEASE UPDATE 19.15.0.0.0 (33815596)"
Patch description:  "Database Release Update : 19.15.0.0.220419 (33806152)"
Patch description:  "DBWLM RELEASE UPDATE 19.0.0.0.0 (33575402)"
[grid@srv1 ~]$

 

Installing a patch in Database home:

 

Update OPatch in Grid Infrastructure:

You have to download the patch 6880880 from Oracle Metalink and clear the directory $ORACLE_HOME/OPatch. Then you can unzip a new fresh version of OPatch:

$  unzip p6880880_190000_Linux-x86-64.zip -d /u01/app/oracle/product/19.0.0/db_home

 

Applying the patch: 

#  /u01/app/oracle/product/19.0.0/db_home/OPatch/opatchauto  apply /u01/paquetes/33859214/33859214/33803476 -oh /u01/app/oracle/product/19.0.0/db_home -nonrolling
#  /u01/app/oracle/product/19.0.0/db_home/OPatch/opatchauto  apply /u01/paquetes/33859214/33859214/33808367 -oh /u01/app/oracle/product/19.0.0/db_home -nonrolling


Verifying the Patch:

[oracle@srv1 33803476]$  /u01/app/oracle/product/19.0.0/db_home/OPatch/opatch lsinventory |egrep -i 'Patch description'
Patch description:  "OJVM RELEASE UPDATE: 19.15.0.0.220419 (33808367)"
Patch description:  "OCW RELEASE UPDATE 19.15.0.0.0 (33815596)"
Patch description:  "Database Release Update : 19.15.0.0.220419 (33806152)"
[oracle@srv1 ~]$

 

 

 

miércoles, 1 de septiembre de 2021

How to change the dataguard role in a control file

In this article I will show you how to change the dataguard role in the controlfile for a database. We will start with a database in PRIMARY dataguard role, then I will change the dataguard role to PHYSICAL STANDBY and finally I will convert it back to PRIMARY.

Current dataguard role in the controlfile:

SQL> select database_role from v$database;

DATABASE_ROLE
----------------
PRIMARY

The first step in order to convert the dataguard role in the controlfile is making a backup of it.

Taking a backup of controlfile:

RMAN> backup current controlfile;


Checking if the control file backup was created successfully:


RMAN>list backup of controlfile;

List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5       Full    17.92M     DISK        00:00:01     01-SEP-21
        BP Key: 5   Status: AVAILABLE  Compressed: NO  Tag: TAG20210901T003645
        Piece Name: /u01/app/oracle/product/19.0.0/db_base/homes/OraDB21Home1/dbs/0517tc4t_5_1_1
  Control File Included: Ckp SCN: 2808105      Ckp time: 1-SEP-21

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6       Full    17.95M     DISK        00:00:00     01-SEP-21
        BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: TAG20210901T003647
        Piece Name: /u01/app/oracle/product/19.0.0/db_base/homes/OraDB21Home1/dbs/c-1643369207-20210901-02
  Control File Included: Ckp SCN: 2808105      Ckp time: 01-SEP-21


Changing the dataguard role in the controlfile from PRIMARY to PHYSICAL STANDBY:


RMAN> shutdown immediate;

database dismounted
Oracle instance shut down

RMAN> startup nomount;

connected to target database (not started)
Oracle instance started

Total System Global Area    2885680056 bytes

Fixed Size                     9690040 bytes
Variable Size                637534208 bytes
Database Buffers            2231369728 bytes
Redo Buffers                   7086080 bytes


RMAN>  RESTORE STANDBY CONTROLFILE FROM '0517tc4t_5_1_1';

Starting restore at 01-SEP-21
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/ORCL/control01.ctl
output file name=/u01/app/oracle/oradata/ORCL/control02.ctl
Finished restore at 01-SEP-21

RMAN> alter database mount;

released channel: ORA_DISK_1
Statement processed

RMAN> select database_role from v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY

RMAN>



Changing the dataguard role in the controlfile from PHYSICAL STANDBY to PRIMARY:

RMAN> shutdown immediate;

database dismounted
Oracle instance shut down

RMAN> startup nomount;

connected to target database (not started)
Oracle instance started

Total System Global Area    2885680056 bytes

Fixed Size                     9690040 bytes
Variable Size                637534208 bytes
Database Buffers            2231369728 bytes
Redo Buffers                   7086080 bytes

RMAN>  RESTORE PRIMARY CONTROLFILE  FROM '0517tc4t_5_1_1';

Starting restore at 01-SEP-21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=47 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/ORCL/control01.ctl
output file name=/u01/app/oracle/oradata/ORCL/control02.ctl
Finished restore at 01-SEP-21

RMAN> alter database mount;

released channel: ORA_DISK_1
Statement processed

RMAN>  select database_role from v$database;

DATABASE_ROLE
----------------
PRIMARY

RMAN>

Oracle ACE Director Award - Deiby Gómez

Thanks #OracleACE Program for this awesome certificate recognizing the work I have done in the community for the last year. Looking forwa...