Wednesday, 11 November 2020

How to Installation Linux and Grid Infrastructure Installation with Database Creation in ASM Storage

Installation of Linux 7.5 64bit

Operating System : Oracle Enterprise Linux 7.564it
Database & Grid Software : 12.1.0.2.0 64Bit EE
Space for OS Installation: 100GB
RAM : 4.2 GB 

Note:
Minimum RAM is recommended for grid Infrastructure. 
 
Click:-  Create a New Virtual Machine

Click:- Next with Typical (Recommended) Option

Select :- I will install the operating system later. Option and Click:- Next 


Select :- Linux option with version there you will use. Click:- Next

Write:- Virtual Machine Name and Machine. Click:- Next

Name: grid_oda

Location: E:\grid_oda

Write: -Storage for Machine and Select: - Split virtual disk into multiple files Click: - Next

Storage: 100GB

Click: - Customize Hardware

Memory   : 4096 (4GB)

Processor : 2 and 1

Select:- ISO Image file I Selected Linux 7.5 64bit

Select: - Network and Display setting as per Images

Click: - Close and Finish 

Set Operation System Configuration Gird Infrastructure and Data

   

1- Disbale Selinux (selinux must disabled)

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

$ getenforce

$ getenforce 0

$ sestatus

$ vi /etc/selinux/config

 # This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=enforcing            ------------ Change it (SELINUX=disabled)

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

$ reboot

2- Disbale Firewall

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

$ systemctl status  firewalld.service

$ systemctl stop firewalld.service

$ systemctl disable  firewalld.service

$ systemctl status  firewalld.service

 3- Set Host file  

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

 $ vi /etc/hosts

 192.168.10.10    oda12.oracle.com oda12

 :wq!

 4- Install RPM for Oracle Database and Grid ASM CRS/SRV

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

 $ su - root

$ cd /u01/binary/Drv7.5/drv7.5/

 $ mkdir /media/cdrom

 $ mount /dev/sr0 /media/cdrom

 $ cp media.repo /etc/yum.repos.d/

 $ cd /media/cdrom/Packages/

 $ yum --disablerepo=\* --enablerepo=media install oracle-database-server-12cR2-preinstall-1.0-3.el7.x86_64

 $ ls *.rpm

oracleasmlib-2.0.12-1.el7.x86_64.rpm  oracleasm-support-2.1.11-2.el7.x86_64.rpm

 $ cd /u01/binary

 $ rpm -ivh oracleasmlib-2.0.12-1.el7.x86_64.rpm

 $ rpm -ivh oracleasm-support-2.1.11-2.el7.x86_64.rpm

 Note:

when we Installed Oracle Database preinstall rpm, rpm create oracle user, grid user and dba and oinstall group.

 Grid recommendation: 

You will create groups with fix IDs that`s why we will delete all users and groups and we will create all users and groups manually with fix Ids. 

 5- Users Delete on

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

 userdel oracle

userdel grid

 6- Group delete on both Machine or Node

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

 groupdel dba

groupdel oinstall

 7- User Drictory delete on both Machine or Node

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

 rm -rf /home/oracle

rm -rf /home/grid

 8- Add Group on both Machine or Node

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

 groupadd -g 1000 oinstall

groupadd -g 1100 asmadmin

groupadd -g 1200 dba

groupadd -g 1201 oper

groupadd -g 1300 asmdba

groupadd -g 1301 asmoper

9- Add user on both machine or node

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

useradd -u 1100 -g oinstall -G dba,asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "GI Owner" grid

useradd -u 1101 -g oinstall -G dba,asmdba,oper -d /home/oracle -s /bin/bash -c "OR Owner" oracle

10- Show Error (We can igrnore this error because of pervious oracle user some file available in "bin/bash"

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

 Creating mailbox file: File exists

 11- Create Directory for Oracle & Grid on OS

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

 mkdir -p /u01/app/grid

mkdir -p /u01/app/grid/product/12.1.0/home

mkdir -p /u01/app/oracle/product/12.1.0/db_1

mkdir -p /u01/app/oraInventory

 12- Set Users Password Oracle,Grid on OS

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

 passwd grid        (password=grid)

passwd oracle   (password=oracle)

 13- Change Ownership on Directories

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

 chown -R grid:oinstall /u01/app/grid

chown -R grid:oinstall /u01/app/oraInventory

chown -R grid:oinstall /u01/app/grid

chown -R oracle:oinstall /u01/app/oracle

chmod -R 775 /u01

 14- Write Bash_Profile for "GRID USER"

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

 vi /home/grid/.bash_profile

 # for Grid

 TMP=/tmp;

TMPDIR=/tmp;

 ORACLE_BASE=/u01/app/grid;

ORACLE_HOME=/u01/app/grid/product/12.1.0/home;

ORACLE_SID=+ASM;

PATH=$ORACLE_HOME/bin:$PATH;

EDITOR=vi;

 export TMP TMPDIR ORACLE_BASE ORACLE_HOME ORACLE_SID PATH EDITOR

export PATH

 :wq!

 15- Write Bash_Profile for "ORACLE USER"

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

vi /home/oracle/.bash_profile

 # for oracle

 TMP=/tmp;

TMPDIR=/tmp;

 ORACLE_BASE=/u01/app/oracle;

ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1;

ORACLE_SID=orcl;

ORACLE_HOSTNAME=oda12.oracle.com;

ORACLE_UNQNAME=orcl;

TZ=Etc/GMT-5;

LD_LIBRARY_PATH=$ORACLE_PATH/lib:/lib:/usr/lib;

PATH=$ORACLE_HOME/bin:$PATH;

EDITOR=vi;

CLASS_PATH=$ORACLE_HOME/Jre;

 export TMP TMPDIR ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_HOSTNAME ORACLE_UNQNAME TZ PATH EDITOR LD_LIBRARY_PATH CLASS_PATH

export PATH

 :wq!

 16- Add New Limit for Grid "limits.conf" (oracle preinstall rpm alredy set Limit for Oracle DBS)

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

vi /etc/security/limits.conf

 grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

VM Tab -> Settings... 

Click: Add...

Select: Hard Disk

Click: Next

Click: SCSI (Recommended)

Click: Next

Select: Create a new virtual disk

Click: Next

Maximum disk size (GB): 10

Select: Allocate all disk space now.

Select: Split virtual disk into multiple files

Click: Next

Click: Finish

1) Two Disks add 10 10 GB for CRS (AMS Cluster Installation)

2) Two Disks add 10 10 GB for FRA (Archive log and Backup)

3) Two Disks Add 20 20 GB for DATA (Database Only)

OS Disk Partition Formatting for Ready to Use

Note:  Perform All steps on ROOT User

1- Disk Formatting

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

$  fdisk -l

$  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 0x63812638.

Command (m for help): n

Partition type:

   p   primary (0 primary, 0 extended, 4 free)

   e   extended

Select (default p): p

Partition number (1-4, default 1): 1

First sector (2048-20971519, default 2048):

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519):

Using default value 20971519

Partition 1 of type Linux and of size 10 GiB is set

Command (m for help): w

The partition table has been altered!

$ fdisk /dev/sdc

$ fdisk /dev/sdd

$ fdisk /dev/sde

$ fdisk /dev/sdf

$ fdisk /dev/sdg

Note:  All disks format as per above practice.

2- Listing Of Format Disk

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

$ fdisk -l

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x63812638

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1            2048    20971519    10484736   83  Linux

Note: All Disk show like this.

3- Configuring the Oracle ASM library

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

$ oracleasm configure -i

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library

driver.  The following questions will determine whether the driver is

loaded on boot and what permissions it will have.  The current values

will be shown in brackets ('[]').  Hitting <ENTER> without typing an

answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid

Default group to own the driver interface []: asmadmin

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]:

Writing Oracle ASM library driver configuration: done

3- Start Oracle ASM library

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

$ /etc/init.d/oracleasm start

/etc/init.d/oracleasm is deprecated in favor of userspace tool: /usr/sbin/oracleasm

############# OR #############

$ /usr/sbin/oracleasm init

Creating /dev/oracleasm mount point: /dev/oracleasm

Loading module "oracleasm": oracleasm

Configuring "oracleasm" to use device physical block size

Mounting ASMlib driver filesystem: /dev/oracleasm

4- Create Disk Label for AMS

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

$  /usr/sbin/oracleasm createdisk DISK1 /dev/sdb1

Writing disk header: done

Instantiating disk: done

$ /usr/sbin/oracleasm createdisk DISK2 /dev/sdc1

$  /usr/sbin/oracleasm createdisk DISK3 /dev/sdd1

$ /usr/sbin/oracleasm createdisk DISK4 /dev/sde1

$  /usr/sbin/oracleasm createdisk DISK5 /dev/sdf1

$  /usr/sbin/oracleasm createdisk DISK6 /dev/sdg1

$ cd /dev/oracleasm/disks/

$ ls -lrt

total 0

brw-rw---- 1 grid asmadmin 8, 17 Oct  1 19:47 DISK1

brw-rw---- 1 grid asmadmin 8, 33 Oct  1 19:48 DISK2

brw-rw---- 1 grid asmadmin 8, 49 Oct  1 19:48 DISK3

brw-rw---- 1 grid asmadmin 8, 65 Oct  1 19:48 DISK4

brw-rw---- 1 grid asmadmin 8, 81 Oct  1 19:49 DISK5

brw-rw---- 1 grid asmadmin 8, 97 Oct  1 19:50 DISK6

Installation of Grid Infrastructure

Select :- Install and Configure Oracle Grid Infrastructure for a Standalone Server  Click :- Next

Click: - Next

Disk group name: CRS

Redundancy: Normal [O]

 High      :  Three disk mirroring with the same size of disk.  

Normal :  Two disk mirroring with the same size of disk.

External: Single disk no mirroring.

Candidate Disks [O]

Click: - Next

Note:  We are just installing cluster service with sprite group this disk group dedicated for ASM Configuration    

Select: - Use same passwords for these accounts [o]

Select: - sys password option [Admin_6677] Click: - Next

Note: 

Sys Password option and write sys password there with strong character [Admin_6677] we use this password when we will install DBS ASM SYS password and DBS sys password would be same.

Click: - Next

Click:- Next

Click :- Next

Click:- Next

Click:- Next

Click:- Install

Run on ROOT USER terminal

$ /u01/app/oraInventory/orainstRoot.sh 

$ /u01/app/grid/product/12.1.0/home/root.sh

ADD Disk Group Through ASMCA Utility

Note:

We will add two disk group for Database and Archive log both groups are same size with normal redundancy. Disk groups add on grid user with ASMCA utility.

Click:- Create     (For Disk Group Creation)

Disk Group Name: FRA

Redundancy : Normal

Select: Two Disks  

Note:

This group for FRA with the same Size (Flush Recovery Area).This group contain archivelog and backups. 

Click:- OK 

Click:- OK

Disk Group Name: DATA

Redundancy : Normal

Select: Two Disks 

Note:

This group for DATA with the same Size (Database Files).This group contain dbs file,redolog ,controlfile .

Click:- OK 

Click:-OK

Note:

We can see three disk group for deferent purpose.

CRS Disk Group : Standalone ASM Cluster Configuration ASM spfile and etc..

DATA Disk Group: For Datafile, Controlfile, redolog files etc...

FRA Disk Group: For Archivelog file and Backup.

Click:- Exit and Yes 

Oracle Database Software Installation

Click: Next and Yes

Select : Install database software only

Click: Next

Select : Single instance database installation

Click: Next

Click: Next

Click: Next

Click: Next

Click: Next

Click: Install

Click: OK 

Click: Close

Database Creation

Select: Create Database

Click: Next

Global Database Name: orcl

 Database Files Location: +DATA

 Fast Recovery Area: +FRA

 Database Character Set: AL32UTF8

 Administrator Password: Admin_6677

 Confirm Password: Admin_6677

 [Uncheck] Create As Container Database

Click:  Next

Click: - OK and Close

 
Completed.

Note: My Future Post Will Linked with this Post


Friday, 4 September 2020

How to Apply AD & TXK Code Level Patching

 Document: Applying the Latest AD and TXK Release Update Packs to Oracle E-Business Suite Release 12.2 (Doc ID 1617461.1)

Step - 1 Source Apps Environment and Start Adadmin Server

 $ source /u01/applmgr/upg/fs1/EBSapps/appl/APPSDELL_upgebs.env

 $ sh $ADMIN_SCRIPTS_HOME/adadminsrvctl.sh start

 Step - 2 Copy All AD & TXK Patches in EBS Patch Directory and Unzip

 

$ cd /u01/install/patches/apps/ad_txk_patches

 $ cp * /u01/applmgr/upg/fs_ne/EBSapps/patch/

 $ cd /u01/applmgr/upg/fs_ne/EBSapps/patch/

 $ unzip -o p26834480_R12.AD.C_R12_LINUX.zip

 Step - 3 As per README.txt of 26834480 apply prerequisite

 

$ cd /u01/applmgr/upg/fs_ne/EBSapps/patch/26834480/admin

 $ ls adgrants*

adgrants_nt.sql  adgrants.sql

 $ cp adgrants.sql /u02/oracle/db/tech_st/12.1.0/appsutil/admin/

 $ source /u02/oracle/db/tech_st/12.1.0/DELL_upgebs.env $ cd $ORACLE_HOME/appsutil/admin

 $ ls adgrants.sql

adgrants.sql

$ sqlplus /nolog

SQL> @adgrants.sql APPS

Step - 4 Apply AD Patch 26834480

 $ adop phase=apply patches=26834480 hotpatch=yes

 Enter the APPS password: apps

Enter the SYSTEM password: manager

Enter the WLSADMIN password: Oracle_123

 Step - 5 Apply Others Critical AD Patches with Merge Option

 $ cd /u01/applmgr/upg/fs_ne/EBSapps/patch

 $ unzip -o p28280348_R12.AD.C_R12_GENERIC.zip

 $ unzip -o p30213183_R12.AD.C_R12_GENERIC.zip

 $ unzip -o p30258630_R12.AD.C_R12_GENERIC.zip

 $ unzip -o p30355167_R12.AD.C_R12_GENERIC.zip

 $ adop phase=apply patches=28280348,30213183,30258630,30355167 hotpatch=yes merge=yes

 Enter the APPS password: apps

Enter the SYSTEM password: manager

Enter the WLSADMIN password: Oracle_123

TXK Error & Solution

###################################################################################-------------------------------------------- ERROR --------------------------------------------

###################################################################################sqlplus -s APPS/apps @/u01/applmgr/upg/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adsqlwrapper.sql '/u01/applmgr/upg/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/ADZDWRKR.sql apps manager CUTOVER 0 7 12'

Connected.

PL/SQL procedure successfully completed.

Connected.

Session altered.

PL/SQL procedure successfully completed.

declare

*

ERROR at line 1:

ORA-01031: insufficient privileges

ORA-06512: at "SYS.DBMS_SESSION", line 122

ORA-06512: at "APPS.AD_ZD_CTX", line 7

ORA-06512: at "APPS.AD_ZD_PARALLEL_EXEC", line 538

ORA-01031: insufficient privileges

ORA-06512: at "SYS.DBMS_SESSION", line 122

ORA-06512: at "APPS.AD_ZD_CTX", line 7

ORA-06512: at "APPS.AD_ZD_PARALLEL_EXEC", line 524

ORA-01031: insufficient privileges

ORA-06512: at line 16


###################################################################################------------------------------------------- SOLUTION -------------------------------------------

###################################################################################[oracle@upgebs sql]$ source /u01/applmgr/upg/fs1/EBSapps/appl/APPSDELL_upgebs.env

[oracle@upgebs sql]$ sqlplus apps/apps

SQL> set lines 250 pages 250

SQL> col NAMESPACE format a15

SQL> col SCHEMA format a15

SQL> col PACKAGE format a20

SQL> run

  1* select * from dba_context where namespace='AD_ZD_CTX'

NAMESPACE       SCHEMA          PACKAGE              TYPE

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

AD_ZD_CTX       APPLSYS         AD_ZD_CTX            ACCESSED LOCALLY

SQL> create or replace context AD_JAR using AD_JAR;

Context created.

SQL> create or replace context AD_ZD_CTX using AD_ZD_CTX;

Context created.

SQL>  select * from dba_context where namespace='AD_ZD_CTX';

NAMESPACE       SCHEMA          PACKAGE              TYPE

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

AD_ZD_CTX       APPS            AD_ZD_CTX            ACCESSED LOCALLY


[oracle@upgebs log]$ sqlplus -s APPS/apps @/u01/applmgr/upg/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adsqlwrapper.sql '/u01/applmgr/upg/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/ADZDWRKR.sql apps manager CUTOVER 0 7 12'


PL/SQL procedure successfully completed.

Connected.

Session altered.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.


Note: Before Apply TXK you will must apply above solution.


Step - 6 Unzip TXK Main Patches & Others Critical Patches

$ unzip -o p28840822_R12.TXK.C_R12_GENERIC.zip

$ unzip -o p29965377_R12.TXK.C_R12_GENERIC.zip

$ unzip -o p29781255_R12.TXK.C_R12_GENERIC.zip

$ unzip -o p28371446_R12.TXK.C_R12_GENERIC.zip

Step - 7 Apply TXK Main & Others Critical Patches with Merge Option

$ adop phase=apply patches=28840822,29965377,29781255,28371446 hotpatch=yes merge=yes

Enter the APPS password: apps

Enter the SYSTEM password: manager

Enter the WLSADMIN password: Oracle_123

Step -8 Source the run edition environment file

$ cd /u01/applmgr/upg/

$ ls

EBSapps.env  fs1  fs2  fs_ne

$ source EBSapps.env run

  E-Business Suite Environment Information

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

  RUN File System           : /u01/applmgr/upg/fs1/EBSapps/appl

  PATCH File System         : /u01/applmgr/upg/fs2/EBSapps/appl

  Non-Editioned File System : /u01/applmgr/upg/fs_ne

  DB Host: upgebs.hinopak.com  Service/SID: DELL

 

  Sourcing the RUN File System ...

Step -9 Stop the Oracle Weblogic Server Admin Server on the run file system

$ sh $ADMIN_SCRIPTS_HOME/adadminsrvctl.sh stop

Enter the WebLogic Admin password: Oracle_123

Enter the APPS Schema password: apps

Step -10 Update Database Tier to Latest Code

A-    Source the run edition environment file.

$ cd /u01/applmgr/upg/

$ source EBSapps.env run

B-     Execute the admkappsutil.pl utility to create the appsutil.zip file in $INST_TOP/admin/out. 

$ perl $AD_TOP/bin/admkappsutil.pl

 $ cd $INST_TOP/admin/out

 $ ls appsutil.zip

 appsutil.zip

 $ cp appsutil.zip /u02/oracle/db/tech_st/12.1.0

 C-      Source Database Environment with unzip appsutil.zip and run adautocfg.sh

$ source /u02/oracle/db/tech_st/12.1.0/DELL_upgebs.env

$ cd $ORACLE_HOME

$ unzip -o appsutil.zip

$ sh $ORACLE_HOME/appsutil/scripts/<CONTEXT_NAME>/adautocfg.sh

D-    Source Apps Environment & Run AutoConfig on the run file system

 $ cd /u01/applmgr/upg/

 $ source EBSapps.env run

 $ sh $INST_TOP/admin/scripts/adautocfg.sh

 Enter the APPS user password: apps

 

AD TXK Completed