Saturday, February 23, 2019

Steps to Install and Configure Oracle 19c 2 Nodes RAC Setup on Oracle Linux 7.6 (64-Bit)

If you are curious to know how to install and configure Oracle 19c Cluster setup to explore the new features of this version then this article may guide you through.


Software Requirements.


1. Download Latest Oracle VM Virtual box for your suitable host OS from https://www.virtualbox.org/wiki/Downloads




2. Download Oracle Linux 6.7 (64-bit) from Oracle edelivery site. https://www.edelivery.oracle.com



3. Download Oracle 19c GRID and RDBMS software from oracle edelivery.










System Readiness:


#################################################
 It is assumed that the required 2 Database Servers are installed 
and configured over Oracle VM Virtualbox environment using the above software. Including Network and Shared Storage Provisioning.
#################################################

Now we will see how we can configure the Oracle 19c two nodes RAC setup. 


Execute the below commands to quickly set up the system prerequisites on both servers.


sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
systemctl stop chronyd.service
systemctl disable chronyd.service
mv /etc/chrony.conf /etc/chrony.conf.bak

groupadd -g 54331 oinstall
groupadd -g 54332 dba
groupadd -g 54333 oper
groupadd -g 54334 backupdba
groupadd -g 54335 dgdba
groupadd -g 54336 kmdba
groupadd -g 54337 asmdba
groupadd -g 54338 asmoper
groupadd -g 54339 asmadmin
groupadd -g 54340 racdba

useradd -m -u 54332 -g oinstall -G dba,asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash  grid 
echo "grid" | passwd --stdin grid
useradd -m -u 54331 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,asmadmin,racdba -d /home/oracle -s /bin/bash  oracle 
echo "oracle" | passwd --stdin oracle
mkdir -p /u01/app/grid
mkdir -p /u01/app/19.2/grid
mkdir -p /u02/app/oracle
mkdir -p /u02/app/oracle/product/19.2
chmod -R 775 /u01
chmod -R 775 /u02
chown -R grid:oinstall /u01
chown -R oracle:oinstall /u02/app/oracle


Update the bash profile file for grid, oracle and root users respectively as below.


In grid's bash profile:

export ORACLE_SID=+ASM1
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.2/grid
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
umask 22 

In oracle's bash profile:

export ORACLE_SID=orcl
export ORACLE_BASE=/u02/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.2
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
umask 22 

In root's bash profile:

export ORACLE_HOME=/u01/app/19.2/grid
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH

Install the required RPMs as below:


yum install -y oracle-database-preinstall-18c.x86_64

yum install kmod-oracleasm

yum install oracleasm-support oracleasmlib oracleasm-`uname -r`


Configure oracleasm utility.


oracleasm configure -i 


Update the '/etc/hosts' file with suitable IP Addresses and Hostnames.

#public ip
192.168.56.115  sspdb01.localdomain sspdb01 
192.168.56.116  sspdb02.localdomain sspdb02

#Vip
192.168.56.118 sspdb01-vip.localdomain sspdb01-vip
192.168.56.119 sspdb02-vip.localdomain  sspdb02-vip

#private ip
10.10.10.21   sspdb01-priv.localdomain sspdb01-priv
10.10.10.22   sspdb02-priv.localdomain sspdb02-priv

#SCAN ip
192.168.56.120 sspdb-cluster sspdb-cluster-scan


Make sure the public and Private networks are reachable from both nodes. 
The VIP network should not be reachable as of now. once the setup is done this virtual network will be enabled automatically.
Make sure the 3 Scan IPs are resolvable via nslookup utility; since its just a lab setup I used a single scan IP as mentioned in above '/etc/hosts' file.


Cluster (Grid) Software Setup:


In 19c, the Grid Clusterware setup is slightly differed with previous traditional installations. Here we have to Unzip the grid software to Grid's ORACLE_HOME directly and run the gridSetup.sh script.


as root:
cd /media/sf_Software/19c/
unzip -q V981627-01.zip -d /u01/app/19.2/grid
chown -R grid:oinstall /u01


As grid user:
cd /u01/app/19.2/grid/
./gridSetup.sh



Unlike the previous versions, you can see various types cluster setups available in 19c.  
To know more about each type cluster configuration and it's purpose,  please refer to Oracle Document grid-infrastructure-installation-and-upgrade 19c.

However, here is the generic installation so I will be choosing the default  standalone cluster.




We can see a new SCAN option called Shared, for more information refer to grid-infrastructure-installation-and-upgrade 19c.

Selecting the default Local SCAN option here.




Add the 2nd node's details and setup SSH connectivity for Grid user.



self-explanatory


self-explanatory



self-explanatory



self-explanatory




Choose suitable interfaces as below.



As usual choose ASM Storage.



I chose the Grid Infrastructure Management Repository (GIMR) to be configured as this will be useful for debugging cluster related failures.




I will be using same Disk group for OCR/VD/GIMR here, though we have the option to different disk group for GIMR.




Below are the required OCR disk group capacity depending on the Redundancy which will also holds GIMR data.

External: around 30 GB
Normal: around 60 GB
High : around 90 GB.



I selected External Redundancy



self-explanatory



self-explanatory



self-explanatory



self-explanatory



self-explanatory



self-explanatory




We have the option to provide the root or equivalent sudo credentials in the below step. However I would like to see what exactly it does during the root scripts execution, the credentials are not passed.



self-explanatory


Run the 'Fix and Check Again' and also resolve the relevant warnings/Failed checks.



self-explanatory



self-explanatory




Once make sure we are good to proceed.



self-explanatory



self-explanatory




You can observe the changes in root.sh output as compared to previous installations. 

1st Node:


[root@sspdb01 rpm]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@sspdb01 rpm]# /u01/app/19.2/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/19.2/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/19.2/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/sspdb01/crsconfig/rootcrs_sspdb01_2019-02-23_00-25-26AM.log
2019/02/23 00:26:07 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2019/02/23 00:26:08 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2019/02/23 00:26:08 CLSRSC-363: User ignored prerequisites during installation
2019/02/23 00:26:08 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2019/02/23 00:26:17 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2019/02/23 00:26:20 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.
2019/02/23 00:26:20 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.
2019/02/23 00:26:23 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2019/02/23 00:29:25 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.
2019/02/23 00:30:00 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2019/02/23 00:30:01 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2019/02/23 00:30:39 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2019/02/23 00:30:40 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2019/02/23 00:31:06 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2019/02/23 00:31:07 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2019/02/23 00:32:06 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2019/02/23 00:32:32 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2019/02/23 00:32:53 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2019/02/23 00:33:11 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.

ASM has been created and started successfully.

[DBT-30001] Disk groups created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-190223AM123423.log for details.

2019/02/23 00:36:42 CLSRSC-482: Running command: '/u01/app/19.2/grid/bin/ocrconfig -upgrade grid oinstall'
CRS-4256: Updating the profile
Successful addition of voting disk bec6dfe80d344f21bf747466dd2342aa.
Successfully replaced voting disk group with +OCR.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   bec6dfe80d344f21bf747466dd2342aa (/dev/oracleasm/disks/OCR05) [OCR]
Located 1 voting disk(s).
2019/02/23 00:42:07 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2019/02/23 00:44:59 CLSRSC-343: Successfully started Oracle Clusterware stack
2019/02/23 00:44:59 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2019/02/23 00:53:03 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2019/02/23 01:00:02 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

2nd Node:


[root@sspdb02 ~]# /u01/app/19.2/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/19.2/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/19.2/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/sspdb02/crsconfig/rootcrs_sspdb02_2019-02-23_01-04-55AM.log
2019/02/23 01:05:38 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2019/02/23 01:05:39 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2019/02/23 01:05:39 CLSRSC-363: User ignored prerequisites during installation
2019/02/23 01:05:39 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2019/02/23 01:05:45 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2019/02/23 01:05:45 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.
2019/02/23 01:05:45 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.
2019/02/23 01:05:50 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2019/02/23 01:05:55 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.
2019/02/23 01:05:55 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2019/02/23 01:06:10 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2019/02/23 01:06:11 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2019/02/23 01:06:17 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2019/02/23 01:06:18 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2019/02/23 01:07:47 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2019/02/23 01:08:12 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2019/02/23 01:08:40 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2019/02/23 01:08:58 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
2019/02/23 01:09:13 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2019/02/23 01:09:53 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2019/02/23 01:11:46 CLSRSC-343: Successfully started Oracle Clusterware stack
2019/02/23 01:11:47 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2019/02/23 01:14:42 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2019/02/23 01:15:35 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

Post of Cluster Setup:


[root@sspdb02 bin]# ./crsctl check cluster -all
**************************************************************
sspdb01:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
sspdb02:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

[root@sspdb02 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       sspdb01                  STABLE
               ONLINE  ONLINE       sspdb02                  STABLE
ora.chad
               ONLINE  ONLINE       sspdb01                  STABLE
               ONLINE  ONLINE       sspdb02                  STABLE
ora.net1.network
               ONLINE  ONLINE       sspdb01                  STABLE
               ONLINE  ONLINE       sspdb02                  STABLE
ora.ons
               ONLINE  ONLINE       sspdb01                  STABLE
               ONLINE  ONLINE       sspdb02                  STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       sspdb01                  STABLE
      2        ONLINE  ONLINE       sspdb02                  STABLE
      3        ONLINE  OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       sspdb02                  STABLE
ora.MGMTLSNR
      1        OFFLINE OFFLINE                               STABLE
ora.OCR.dg(ora.asmgroup)
      1        ONLINE  ONLINE       sspdb01                  STABLE
      2        ONLINE  ONLINE       sspdb02                  STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       sspdb01                  Started,STABLE
      2        ONLINE  ONLINE       sspdb02                  Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       sspdb01                  STABLE
      2        ONLINE  ONLINE       sspdb02                  STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       sspdb02                  STABLE
ora.mgmtdb
      1        OFFLINE OFFLINE                               STABLE
ora.qosmserver
      1        ONLINE  ONLINE       sspdb02                  STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       sspdb02                  STABLE
ora.sspdb01.vip
      1        ONLINE  ONLINE       sspdb01                  STABLE
ora.sspdb02.vip
      1        ONLINE  ONLINE       sspdb02                  STABLE
--------------------------------------------------------------------------------

The above mentioned OFFLINE services are needed to be exclusively added to make it ONLINE, Refer to grid-infrastructure-installation-and-upgrade 19c.

At this point, the GRID Setup is successfully completed. 

Oracle Software installation:


Unzip the Oracle database software to oracle's ORACLE_HOME directly and run the runInstaller.sh script.

as root:
cd /media/sf_Software/19c/
unzip -q V981623-01.zip -d /u02/app/oracle/product/19.2
chown -R oracle:oinstall /u02

As oracle user:
cd /u02/app/oracle/product/19.2

start the installation now.

./runInstaller.sh


self-explanatory



Make sure all the Clusterware Nodes are selected and also setup the SSH connectivity for 'oracle' user as below.



self-explanatory



self-explanatory



self-explanatory



Choose the relevant groups, I have selected the default ones.




I will run the root scripts exclusively hence leaving the below one unchecked.



self-explanatory



self-explanatory



self-explanatory



Run the root.sh script on both nodes.


self-explanatory


The database software installation is successfully completed.

I hope you enjoyed reading this article. 

Please let me know once you also install this setup. 

Monday, February 18, 2019

yum -- could not resolve host Trying other mirror ... dhclient

After installing a brand new Oracle Linux 7.6 in Virtual box i just wanted to deploy the relevant oracle rpms using 'yum install' command but i faced below error.

Snippet: yum install -y oracle-database-preinstral.....

    Downloading packages:
No Presto metadata available for ol7_UEKR5
No Presto metadata available for ol7_latest
NetworkManager-adsl-1.12.0-8.e FAILED                                         
https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/NetworkManager-adsl-1.12.0-8.el7_6.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: yum.oracle.com; Unknown error"
rying other mirror.
     .............................
     ............................
     No more Mirror lists..

To resolve this issue i had to call the 'dhclient', which is explained in brief as below.

The Internet Systems Consortium DHCP Client, dhclient, provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address.

The DHCP protocol allows a host to contact a central server which maintains a list of IP addresses which may be assigned on one or more subnets. A DHCP client may request an address from this pool, and then use it on a temporary basis for communication on network. The DHCP protocol also provides a mechanism whereby a client can learn important details about the network to which it is attached, such as the location of a default router, the location of a name server, and so on.

Finally, it worked fine as below also enabled internet as usual.


root@localhost sf_Stage]# dhclient
rooot@localhost sf_Stage]# yum install -y oracle-database-preinstall-18c.x86_64
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-preinstall-18c.x86_64 0:1.0-1.el7 will be installed
--> Processing Dependency: ksh for package: oracle-database-preinstall-18c-1.0-1.el7.x86_64
--> Processing Dependency: libaio-devel for package: oracle-database-preinstall-18c-1.0-1.el7.x86_64
--> Running transaction check
---> Package ksh.x86_64 0:20120801-139.0.1.el7 will be installed
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                                          Arch                     Version                                 Repository                    Size
======================================================================================================================================================
Installing:
 oracle-database-preinstall-18c                   x86_64                   1.0-1.el7                               ol7_latest                    18 k
Installing for dependencies:
 ksh                                              x86_64                   20120801-139.0.1.el7                    ol7_latest                   883 k
 libaio-devel                                     x86_64                   0.3.109-13.el7                          ol7_latest                    12 k

Transaction Summary
======================================================================================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 913 k
Installed size: 3.2 M
Downloading packages:
No Presto metadata available for ol7_latest
warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/libaio-devel-0.3.109-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Public key for libaio-devel-0.3.109-13.el7.x86_64.rpm is not installed
(1/3): libaio-devel-0.3.109-13.el7.x86_64.rpm                                                                                  |  12 kB  00:00:01   
(2/3): oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm                                                                     |  18 kB  00:00:00   
(3/3): ksh-20120801-139.0.1.el7.x86_64.rpm                                                                                     | 883 kB  00:00:01   
------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                 456 kB/s | 913 kB  00:00:02   
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
 Userid     : "Oracle OSS group (Open Source Software group) "
 Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03


Thanks.

Thursday, February 14, 2019

TDE Column Level Encryption in Oracle 12c database (in Oracle E-Business Suite Release 12.2.4) - Part 2

In the previous initial post we understood how to implement the TDE at the column level, the below procedure explains how to rollback the TDE columns from the database.

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

Rollback Plan:-

=============================================================
List out all the encrypted columns in the database and decrypt them using below kind of statements.

1. Data Decrypt:-

ALTER TABLE HR.PER_PAY_PROPOSALS MODIFY (PROPOSED_SALARY_N DECRYPT);
............................................
............................................



2. Make sure No encrypted columns exist:-

col owner format a5
column table_name format a30;
column column_name format a30;
column encryption_alg format a25;
select owner,table_name
 , column_name
 , encryption_alg
 from dba_encrypted_columns order by owner;


3. Close the Password-based keystore:-


ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY Password;

4. Remove the Wallet location from sqlnet.ora (IFILE if its EBS).

================================================================
Note:- Hidden Parameter to skip old lost master encryption keys in oracle TDE
ALTER SYSTEM SET "_db_discard_lost_masterkey"=TRUE ;
=================================================================================



TDE Column Level Encryption in Oracle 12c database (in Oracle E-Business Suite Release 12.2.4) - Part 1

This article is the series of steps to implementation  One of the Oracle Advanced Security Features called Transparent Data Encryption (TDE) at Column Level. The level encryption can be implemented on the highly sensitive columns of critical tables.

The brief details of this environment are Oracle EBS 12.2.4 with 2 Node RAC 12.1.0.2 setup.  I believe this procedure works well enough in environments other than EBS.



What is expected from this article?


It explains how the TDE Column-level encryption can be implemented on the proposed sensitive columns, also explains the implemented Wallet information, Encryption Algorithm, Columns that got encrypted, Procedure to perform backup and restore/duplicate the database in Encrypted environment. It will also help in managing the environment with useful commands.

It is assumed that no prior TDE setup is done and no prior Wallet locations exist in sqlnet.ora files.

Implementation Steps: - 


1. Set Wallet location in sqlnet.ora (Ifile) in both DB Nodes.

cd /u03/oracle/product/12.1.0.2/admin/ERPDB/wallet/

ENCRYPTION_WALLET_LOCATION=
 (SOURCE=
  (METHOD=FILE)
   (METHOD_DATA=
    (DIRECTORY=/u03/oracle/product/12.1.0.2/admin/ERPDB/wallet)))



## If it is EBS environment then do the above change in IFILE and run the autoconfig in DB Servers.

2. Create Software Password-Based Keystore from the 1st node.


set linesize 200
col wrl_parameter format a60
select * from gv$encryption_wallet;


ALTER KEY MANAGEMENT CREATE KEYSTORE '/u03/oracle/product/12.1.0.2/admin/ERPDB/wallet' IDENTIFIED BY Password ;


select * from gv$encryption_wallet;

3. Open the Keystore in the DB instance.


ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY Password;

select * from gv$encryption_wallet;


4. Create Master Encryption Key (1st node).


ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY WITH BACKUP USING 'erpdb_key_bkp';

select * from gv$encryption_wallet;


5. Enable the Auto-login Wallet in the 1st node.


ADMINISTER KEY MANAGEMENT 
CREATE AUTO_LOGIN KEYSTORE FROM KEYSTORE '/u03/oracle/product/12.1.0.2/admin/ERPDB/wallet' IDENTIFIED BY password;

===================================================================
COPY THE ABOVE GENERATED ALL THE KEYSTORES FROM WORKING NODE TO REMAINING DB NODE.
BOTH NODES SHOULD HAVE THESE IDENTICAL KEYSTORES IN WALLET LOCATION.
===================================================================


6. Copy Wallet via SCP command.


Node 1:-
cd /u03/oracle/product/12.1.0.2/admin/ERPDB/wallet
scp * orappt@DBHOSTNAME2:/u03/oracle/product/12.1.0.2/admin/ERPDB/wallet

## Check both locations have the same files with proper permissions and the same size.
## connect to 2nd Node DB and make sure the wallet is in an opened state.
# In EBS Database, Run the script $FND_TOP/sql/aftdeval.sql to generate the encryption script (Refer Doc ID 1585696.1) for more details.


6. Data Encryption (1st node).


spool Encrypt_Columns.log
set echo on;
--HR
ALTER TABLE HR.PER_PAY_PROPOSALS modify (PROPOSED_SALARY encrypt using 'AES256');
............
............
spool off;


7. Cross verify if all the proposed columns of the specific tables are encrypted with a proper encryption algorithm using the above query. At this point, the encryption implementation is completed.


col owner format a5
column table_name format a30;
column column_name format a30;
column encryption_alg format a25;
select owner,table_name
 , column_name
 , encryption_alg
 from dba_encrypted_columns order by owner;

Next Post will be on TDE Columns rollback procedure (Part 2)

Tuesday, July 3, 2018

Unable to open device "/dev/sdab1": Device or resource busy during oracleasm disk creation.


Resource or device busy issue when creating the ASM disks at OS level usign RAW disks provided from NETAPP Storage.


Issue:- Oracle ASM disks labeling failed for one of the Multi path RAW device which was provided from NETAPP storage as below

All the provided LUNs got mounted on DB Servers using below commands.

echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host2/scan

Once the disks got appeared at OS level in both nodes (2-Node RAC DB Server) the actual issue encountered.

[root@ebsdbser01 mapper]# fdisk -l /dev/sds
Disk /dev/sds: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 65536 bytes
Disk identifier: 0x40402c59

   Device Boot      Start         End      Blocks   Id  System
/dev/sds1               1       26108   209712478+  83  Linux
Partition 1 does not start on physical sector boundary.

[root@ebsdbser01 mapper]# fdisk -l /dev/sdab

Disk /dev/sdab: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 65536 bytes
Disk identifier: 0x40402c59

    Device Boot      Start         End      Blocks   Id  System
/dev/sdab1               1       26108   209712478+  83  Linux
Partition 1 does not start on physical sector boundary.

[root@ebsdbser01 mapper]# oracleasm createdisk FLASH01 /dev/sdab1

Unable to open device "/dev/sdab1": Device or resource busy



Work Around:-

As a work around, the Mapper device was taken for logical partitioning (fdisk) instead of its related one of the raw device path and then partprobe was used after partitioned. Finally all the dependent mutipaths got logically partitioned. And the ASM DISKS labelling successfully completed on both 2 node DB servers.

[root@ebsdbser01 mapper]# multipath -ll mpathe
mpathe (3600a098038303778462b49533170412f) dm-14 NETAPP,LUN C-Mode
size=200G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| |- 1:0:1:200 sds  65:32  active ready running
| `- 2:0:0:200 sdab 65:176 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
  |- 1:0:0:200 sdj  8:144  active ready running
  `- 2:0:1:200 sdak 66:64  active ready running
 
[root@ebsdbser01 mapper]# partprobe /dev/mapper/mpathe

[root@ebsdbser01 mapper]# ls -ltr /dev/mapper/mpathe*
lrwxrwxrwx. 1 root root 8 Jul  3 15:46 /dev/mapper/mpathep1 -> ../dm-24
lrwxrwxrwx. 1 root root 8 Jul  3 15:46 /dev/mapper/mpathe -> ../dm-14

[root@ebsdbser01 mapper]# oracleasm createdisk FLASH01 /dev/mapper/mpathep1
Writing disk header: done
Instantiating disk: done

[root@ebsdbser01 mapper]# oracleasm querydisk -d FLASH01
Disk "FLASH01" is a valid ASM disk on device [251,24]

[root@ebsdbser01 mapper]# oracleasm querydisk -p FLASH01
Disk "FLASH01" is a valid ASM disk
/dev/sdj1: LABEL="FLASH01" TYPE="oracleasm"
/dev/sds1: LABEL="FLASH01" TYPE="oracleasm"
/dev/sdab1: LABEL="FLASH01" TYPE="oracleasm"
/dev/sdak1: LABEL="FLASH01" TYPE="oracleasm"
/dev/mapper/mpathep1: LABEL="FLASH01" TYPE="oracleasm"

Tuesday, June 12, 2018

Database Incomplete recovery lead to ORA-00600: internal error code, arguments: [13013] ... On SYS related CLUSTER table.

An Oracle database hosting SAP SLT Application (SAP Landscape Transformation) got corrupted due to unexpected crash of ASM disk groups.

The most corrupted disks were related to FRA where the ORL and Archive logs placed upon.



When Oracle Support confirmed that these disks are no more in a state of recovery, One of my buddy Database Administrator Performed the  Incomplete Recovery.Post of incomplete DB recovery, all were in an assumption that everything is working fine.  



But The SAP SLT application users started complaining as below in their own words. 

"We are seeing lot of db oracle related error messages in the application level, which hampers almost all activity in the system. Kindly check and do the needful."
Then myself started investigating. In my initial investigation itself  found that below error was being triggered since above mentioned Incomplete DB recovery. 

The Oracle Internal Error encountered as below.

ORA-00600: internal error code, arguments: [13013], [5001], [344], [8485480], [0], [8485480], [17], [], [], [], [], []


Oracle says if ORA-600 [13013] is due to corrupted Indexes and the following optional arguments should be considered as below(7 optional arguments), continued my investigation by matching the arguments as below.


Format: ORA-600 [13013] [a] [b] [c] [d] [e] [f]


    Arg [a] Passcount -- 5001

    Arg [b] Data Object number -- 344
    Arg [c] Tablespace Decimal Relative DBA (RDBA) of block containing the row to be updated -- 8485480
    Arg [d] Row Slot number -- [0]
    Arg [e] Decimal RDBA of block being updated (Typically same as [c]) -- [8485480]
    Arg [f] Code -- [17]

When i tried to catch  the problematic table using corrupted Indexes,  i found that is not a table but one of the SYS schema CLUSTER object.


A CLUSTER Object is a group of tables that share common columns and store related data in the same blocks, 

  • Identification of DB Object affected by above corruption.

SET LINESIZE 200
COL OBJECT_NAME FORMAT A10
COL OWNER FORMAT A15
SET LINESIZE 200
SELECT OBJECT_NAME,OWNER,OBJECT_ID,OBJECT_TYPE FROM DBA_OBJECTS WHERE OBJECT_ID=344;
OBJECT_NAME                    OWNER            OBJECT_ID OBJECT_TYPE
------------------------------ --------------- ---------- -----------------------
SMON_SCN_TO_TIME_AUX           SYS                    344 CLUSTER

The above cluster object is build up on the columns from a SYS table called SMON_SCN_TIME. I followed one odd way to find out the table building this cluster object by analyzing all the SYS related tables matching above CLUSTER name. Then i found the exact table and encountered the real issue when validating its structure.

  • Table affected by the above corruption


SQL> ANALYZE TABLE SYS."SMON_SCN_TIME" VALIDATE STRUCTURE CASCADE;

ERROR at line 1:
ORA-01499: table/index cross reference failure - see trace file

  • Issues got resolved post of rebuilding the corrupted index rebuilding below.

SQL> SELECT OWNER,INDEX_NAME FROM DBA_INDEXES WHERE TABLE_NAME='SMON_SCN_TIME';

OWNER      INDEX_NAME

---------- -------------------------
SYS        SMON_SCN_TIME_TIM_IDX
SYS        SMON_SCN_TIME_SCN_IDX

SQL> ANALYZE INDEX SMON_SCN_TIME_TIM_IDX VALIDATE STRUCTURE;


Index analyzed.


SQL> ANALYZE INDEX SMON_SCN_TIME_SCN_IDX VALIDATE STRUCTURE;


Index analyzed.


SQL> ALTER INDEX SMON_SCN_TIME_TIM_IDX REBUILD ONLINE;


Index altered.


SQL> ALTER INDEX SMON_SCN_TIME_SCN_IDX REBUILD ONLINE;


Index altered.


Finally After rebuilding above corrupted indexes got recovered and i could able to re-analyze the problematic table without any issues.



SQL> ANALYZE TABLE SYS."SMON_SCN_TIME" VALIDATE STRUCTURE CASCADE;

Table analyzed.


Post of above the  Oracle Internal error got disappeared from alert log and No complaints from Application user.


Happy reading...

Oracle RAC node unavailable with error: Server unexpectedly closed network connection6]clsc_connect: (0x251c670) no listener at (ADDRESS=(PROTOCOL=ipc)(KEY=OCSSD_LL_node2_))

 Early midnight I received a call from the monitoring team that one of the critical production database node is not available. As I am aware...