Thursday, October 14, 2021

How to install Terraform RHEL8

 Install Terraform RHEL8

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

  • Login as root user


[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# dnf install -y dnf-plugins-core

Updating Subscription Management repositories.

Unable to read consumer identity


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Red Hat Update Infrastructure 3 Client Configuration Server 8 HA                                                                          30 kB/s | 2.1 kB     00:00

Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)                                                                        38 kB/s | 2.8 kB     00:00

Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)                                                                        69 MB/s |  33 MB     00:00

Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)                                                                           32 kB/s | 2.4 kB     00:00

Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)                                                                          101 MB/s |  37 MB     00:00

Red Hat Enterprise Linux 8 for x86_64 - High Availability (RPMs) from RHUI                                                                27 kB/s | 2.4 kB     00:00

Red Hat Enterprise Linux 8 for x86_64 - High Availability (RPMs) from RHUI                                                                11 MB/s | 2.5 MB     00:00

Package dnf-plugins-core-4.0.18-4.el8.noarch is already installed.

Dependencies resolved.

Nothing to do.

Complete!

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#





[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# dnf config-manager --add-repo https://rpm.releases.hashicorp.com/$release/hashicorp.repo

Updating Subscription Management repositories.

Unable to read consumer identity


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Adding repo from: https://rpm.releases.hashicorp.com//hashicorp.repo

Status code: 404 for https://rpm.releases.hashicorp.com//hashicorp.repo (IP: 199.232.66.49)

Error: Configuration of repo failed

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#


********** Repo url has issue (Status code: 404 for https://rpm.releases.hashicorp.com//hashicorp.repo (IP: 199.232.66.488))*********** You have to set variable export release=RHEL


[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

Updating Subscription Management repositories.

Unable to read consumer identity


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Adding repo from: https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#




[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# yum install terraform

Updating Subscription Management repositories.

Unable to read consumer identity


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Last metadata expiration check: 0:00:15 ago on Thu 14 Oct 2021 05:11:42 AM UTC.

Dependencies resolved.

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

 Package                                  Architecture                          Version                                   Repository                                Size

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

Installing:

 terraform                                x86_64                                1.0.9-1                                   hashicorp                                 25 M


Transaction Summary

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

Install  1 Package


Total size: 25 M

Installed size: 76 M

Is this ok [y/N]: y

Downloading Packages:

[SKIPPED] terraform-1.0.9-1.x86_64.rpm: Already downloaded

warning: /var/cache/dnf/hashicorp-164999f2fbadbd87/packages/terraform-1.0.9-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a3219f7b: NOKEY

Hashicorp Stable - x86_64                                                                                                                161 kB/s | 3.1 kB     00:00

Importing GPG key 0xA3219F7B:

 Userid     : "HashiCorp Security (HashiCorp Package Signing) <security+packaging@hashicorp.com>"

 Fingerprint: E8A0 32E0 94D8 EB4E A189 D270 DA41 8C88 A321 9F7B

 From       : https://rpm.releases.hashicorp.com/gpg

Is this ok [y/N]: y

Key imported successfully

Running transaction check

Transaction check succeeded.

Running transaction test

Transaction test succeeded.

Running transaction

  Preparing        :                                                                                                                                                 1/1

  Installing       : terraform-1.0.9-1.x86_64                                                                                                                        1/1

  Verifying        : terraform-1.0.9-1.x86_64                                                                                                                        1/1

Installed products updated.


Installed:

  terraform-1.0.9-1.x86_64


Complete!

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#



[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]# terraform -version

Terraform v1.0.9

on linux_amd64

[root@ip-192.168.1.1 ~]#

[root@ip-192.168.1.1 ~]#



[root@ip-192.168.1.1 ~]# terraform -help
Usage: terraform [global options] <subcommand> [args]

The available commands for execution are listed below.
The primary workflow commands are given first, followed by
less common or more advanced commands.

Main commands:
  init          Prepare your working directory for other commands
  validate      Check whether the configuration is valid
  plan          Show changes required by the current configuration
  apply         Create or update infrastructure
  destroy       Destroy previously-created infrastructure

All other commands:
  console       Try Terraform expressions at an interactive command prompt
  fmt           Reformat your configuration in the standard style
  force-unlock  Release a stuck lock on the current workspace
  get           Install or upgrade remote Terraform modules
  graph         Generate a Graphviz graph of the steps in an operation
  import        Associate existing infrastructure with a Terraform resource
  login         Obtain and save credentials for a remote host
  logout        Remove locally-stored credentials for a remote host
  output        Show output values from your root module
  providers     Show the providers required for this configuration
  refresh       Update the state to match remote systems
  show          Show the current state or a saved plan
  state         Advanced state management
  taint         Mark a resource instance as not fully functional
  test          Experimental support for module integration testing
  untaint       Remove the 'tainted' state from a resource instance
  version       Show the current Terraform version
  workspace     Workspace management

Global options (use these before the subcommand, if any):
  -chdir=DIR    Switch to a different working directory before executing the
                given subcommand.
  -help         Show this help output, or the help for a specified subcommand.
  -version      An alias for the "version" subcommand.

Monday, August 16, 2021

Oracle 21c Database Installation on AWS Redhat Linux 8

Oracle 21c database installation on Linux 8




RPM Requirements :


dnf install -y bc

dnf install -y binutils

dnf install -y compat-openssl10

dnf install -y elfutils-libelf

dnf install -y glibc

dnf install -y glibc-devel

dnf install -y ksh

dnf install -y libaio

dnf install -y libXrender

dnf install -y libX11

dnf install -y libXau

dnf install -y libXi

dnf install -y libXtst

dnf install -y libgcc

dnf install -y libnsl

dnf install -y libstdc++

dnf install -y libxcb

dnf install -y libibverbs

dnf install -y make

dnf install -y policycoreutils

dnf install -y policycoreutils-python-utils

dnf install -y smartmontools

dnf install -y sysstat

dnf install -y unixODBC



dnf install xorg-x11*


Security Limits requirements :


oracle   soft   nofile    1024

oracle   hard   nofile    65536

oracle   soft   nproc    16384

oracle   hard   nproc    16384

oracle   soft   stack    10240

oracle   hard   stack    32768

oracle   hard   memlock    134217728

oracle   soft   memlock    134217728

oracle   soft   data    unlimited

oracle   hard   data    unlimited




[oracle@ip dbhome]$

[oracle@ip dbhome]$ sqlplus "/as sysdba"


SQL*Plus: Release 21.0.0.0.0 - Production on Mon Aug 16 10:40:18 2021

Version 21.3.0.0.0


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



Connected to:

Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production

Version 21.3.0.0.0


SQL> select name ,open_mode from v$database;


NAME      OPEN_MODE

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

ORCL      READ WRITE


SQL> show pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 ORCLPDB                        READ WRITE NO

SQL>

SQL>


Sunday, August 15, 2021

Oracle Database 21c is available for download on Linux OS


Oracle Database 21c is available for download on Linux OS





Wednesday, July 14, 2021

Check Kernel and Package information in Linux OS

 

Check Kernel and Package information in Linux 


check Linux  distribution and version

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

#1

[root@localhost ~]# cat /etc/os-release

NAME="Oracle Linux Server"

VERSION="7.8"

ID="ol"

ID_LIKE="fedora"

VARIANT="Server"

VARIANT_ID="server"

VERSION_ID="7.8"

PRETTY_NAME="Oracle Linux Server 7.8"

ANSI_COLOR="0;31"

CPE_NAME="cpe:/o:oracle:linux:7:8:server"

HOME_URL="https://linux.oracle.com/"

BUG_REPORT_URL="https://bugzilla.oracle.com/"


ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"

ORACLE_BUGZILLA_PRODUCT_VERSION=7.8

ORACLE_SUPPORT_PRODUCT="Oracle Linux"

ORACLE_SUPPORT_PRODUCT_VERSION=7.8

[root@localhost ~]#


#2

[root@localhost ~]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 7.8 (Maipo)

[root@localhost ~]#


#3


[root@localhost ~]# cat /etc/oracle-release

Oracle Linux Server release 7.8

[root@localhost ~]#


check kernel version 

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


[root@localhost ~]# uname -r

4.14.35-1902.300.11.el7uek.x86_64

[root@localhost ~]#




To check Package is installed or not 

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


rpm -q package_name


rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep package_name


[root@localhost ~]#

[root@localhost ~]# rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep ssh 

openssh-server-7.4p1-21.0.1.el7 (x86_64)

openssh-7.4p1-21.0.1.el7 (x86_64)

openssh-clients-7.4p1-21.0.1.el7 (x86_64)

libssh2-1.8.0-3.el7 (x86_64)

[root@localhost ~]#




check multiple packages, and review the output for the validations

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


rpm -q binutils compat-libstdc++ gcc glibc libaio libgcc libstdc++ \

make sysstat unixodbc


[root@localhost ~]# rpm -q binutils compat-libstdc++ gcc glibc libaio libgcc libstdc++ \

> make sysstat unixodbc

binutils-2.27-43.base.0.1.el7.x86_64

package compat-libstdc++ is not installed

gcc-4.8.5-39.0.3.el7.x86_64

glibc-2.17-307.0.1.el7.1.x86_64

libaio-0.3.109-13.el7.x86_64

libgcc-4.8.5-39.0.3.el7.x86_64

libstdc++-4.8.5-39.0.3.el7.x86_64

make-3.82-24.el7.x86_64

sysstat-10.1.5-19.el7.x86_64

package unixodbc is not installed

[root@localhost ~]#


Sunday, June 20, 2021

How to run pre-upgrade utility before upgrade ?

How to run pre-upgrade utility before upgrade ?


[oracle@localhost ~]$ /u01/app/oracle/product/12.2.0/dbhome_1/jdk/bin/java -jar /backup/19.3.0/dbhome_1/rdbms/admin/preupgrade.jar  TERMINAL TEXT

Report generated by Oracle Database Pre-Upgrade Information Tool Version

19.0.0.0.0 Build: 1 on 2021-04-28T16:15:41


Upgrade-To version: 19.0.0.0.0


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

Status of the database prior to upgrade

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

      Database Name:  ORCL

     Container Name:  orcl

       Container ID:  0

            Version:  12.2.0.1.0

     DB Patch Level:  No Patch Bundle applied

         Compatible:  12.2.0

          Blocksize:  8192

           Platform:  Linux x86 64-bit

      Timezone File:  26

  Database log mode:  ARCHIVELOG

           Readonly:  FALSE

            Edition:  EE


  Oracle Component                       Upgrade Action    Current Status

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

  Oracle Server                          [to be upgraded]  VALID

  JServer JAVA Virtual Machine           [to be upgraded]  VALID

  Oracle XDK for Java                    [to be upgraded]  VALID

  Real Application Clusters              [to be upgraded]  OPTION OFF

  Oracle Workspace Manager               [to be upgraded]  VALID

  OLAP Analytic Workspace                [to be upgraded]  VALID

  Oracle Label Security                  [to be upgraded]  VALID

  Oracle Database Vault                  [to be upgraded]  VALID

  Oracle Text                            [to be upgraded]  VALID

  Oracle XML Database                    [to be upgraded]  VALID

  Oracle Java Packages                   [to be upgraded]  VALID

  Oracle Multimedia                      [to be upgraded]  VALID

  Oracle Spatial                         [to be upgraded]  VALID

  Oracle OLAP API                        [to be upgraded]  VALID


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

BEFORE UPGRADE

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


  REQUIRED ACTIONS

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

  None


  RECOMMENDED ACTIONS

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

  1.  Update NUMERIC INITIALIZATION PARAMETERS to meet estimated minimums.

      This action may be done now or when starting the database in upgrade mode

      using the 19 ORACLE HOME.


       Parameter                                 Currently  19 minimum

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

      *memory_target                             713031680          1203765248


      The database upgrade process requires certain initialization parameters

      to meet minimum values.  The Oracle upgrade process itself has minimum

      values which may be higher and are marked with an asterisk.  After

      upgrading, those asterisked parameter values may be reset if needed.


  2.  Please make sure that all the MVs are refreshed and sys.sumdelta$ becomes

      empty before doing upgrade, unless you have strong business reasons not

      to do so. You can use dbms_mview.refresh() to refresh the MVs except

      those stale ones  to be kept due to business need. If there are any stale

      MVs depending on changes in sys.sumdelta$, do not truncate it, because

      doing so will cause wrong results after refresh.


      There is one or more non-fresh MV in the database or sumdelta$ is not

      empty.


      Oracle recommends that all materialized views (MV's) are refreshed before

      upgrading the database because this will clear the MV logs and the

      sumdelta$ table, and make the UPGRADE process faster. If you choose to

      not refresh some MVs, the change data for those MV's will be carried

      through the UPGRADE process. After UPGRADE, you can refresh the MV's and

      MV incremental refresh should work in normal cases.


  3.  (AUTOFIXUP) Gather stale data dictionary statistics prior to database

      upgrade in off-peak time using:


        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;


      Dictionary statistics do not exist or are stale (not up-to-date).


      Dictionary statistics help the Oracle optimizer find efficient SQL

      execution plans and are essential for proper upgrade timing. Oracle

      recommends gathering dictionary statistics in the last 24 hours before

      database upgrade.


      For information on managing optimizer statistics, refer to the 12.2.0.1

      Oracle Database SQL Tuning Guide.


  4.  Please make sure that all the MVs are refreshed and sys.sumdelta$ becomes

      empty before doing upgrade, unless you have strong business reasons not

      to do so. You can use dbms_mview.refresh() to refresh the MVs except

      those stale ones  to be kept due to business need. If there are any stale

      MVs depending on changes in sys.sumdelta$, do not truncate it, because

      doing so will cause wrong results after refresh.


      There is one or more non-fresh MV in the database or sumdelta$ is not

      empty.


      Oracle recommends that all materialized views (MV's) are refreshed before

      upgrading the database because this will clear the MV logs and the

      sumdelta$ table, and make the UPGRADE process faster. If you choose to

      not refresh some MVs, the change data for those MV's will be carried

      through the UPGRADE process. After UPGRADE, you can refresh the MV's and

      MV incremental refresh should work in normal cases.


  INFORMATION ONLY

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

  5.  To help you keep track of your tablespace allocations, the following

      AUTOEXTEND tablespaces are expected to successfully EXTEND during the

      upgrade process.


                                                 Min Size

      Tablespace                        Size     For Upgrade

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

      SYSTEM                             840 MB       947 MB

      TEMP                               131 MB       150 MB

      UNDOTBS1                            70 MB       439 MB


      Minimum tablespace sizes for upgrade are estimates.


  6.  Ensure there is additional disk space in LOG_ARCHIVE_DEST_1 for at least

      4618 MB of archived logs.  Check alert log during the upgrade that there

      is no write error to the destination due to lack of disk space.


      Archiving cannot proceed if the archive log destination is full during

      upgrade.


      Archive Log Destination:

       Parameter    :  LOG_ARCHIVE_DEST_1

       Destination  :  /u01/app/oracle/product/12.2.0/dbhome_1/dbs/arch


      The database has archiving enabled.  The upgrade process will need free

      disk space in the archive log destination(s) to generate archived logs to.


  7.  Check the Oracle Backup and Recovery User's Guide for information on how

      to manage an RMAN recovery catalog schema.


      If you are using a version of the recovery catalog schema that is older

      than that required by the RMAN client version, then you must upgrade the

      catalog schema.


      It is good practice to have the catalog schema the same or higher version

      than the RMAN client version you are using.


  ORACLE GENERATED FIXUP SCRIPT

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

  All of the issues in database ORCL

  which are identified above as BEFORE UPGRADE "(AUTOFIXUP)" can be resolved by

  executing the following


    SQL>@/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql


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

AFTER UPGRADE

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


  REQUIRED ACTIONS

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

  None


  RECOMMENDED ACTIONS

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

  8.  Upgrade the database time zone file using the DBMS_DST package.


      The database is using time zone file version 26 and the target 19 release

      ships with time zone file version 32.


      Oracle recommends upgrading to the desired (latest) version of the time

      zone file.  For more information, refer to "Upgrading the Time Zone File

      and Timestamp with Time Zone Data" in the 19 Oracle Database

      Globalization Support Guide.


  9.  To identify directory objects with symbolic links in the path name, run

      $ORACLE_HOME/rdbms/admin/utldirsymlink.sql AS SYSDBA after upgrade.

      Recreate any directory objects listed, using path names that contain no

      symbolic links.


      Some directory object path names may currently contain symbolic links.


      Starting in Release 18c, symbolic links are not allowed in directory

      object path names used with BFILE data types, the UTL_FILE package, or

      external tables.


  10. (AUTOFIXUP) Gather dictionary statistics after the upgrade using the

      command:


        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;


      Oracle recommends gathering dictionary statistics after upgrade.


      Dictionary statistics provide essential information to the Oracle

      optimizer to help it find efficient SQL execution plans. After a database

      upgrade, statistics need to be re-gathered as there can now be tables

      that have significantly changed during the upgrade or new tables that do

      not have statistics gathered yet.


  11. Gather statistics on fixed objects after the upgrade and when there is a

      representative workload on the system using the command:


        EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;


      This recommendation is given for all preupgrade runs.


      Fixed object statistics provide essential information to the Oracle

      optimizer to help it find efficient SQL execution plans.  Those

      statistics are specific to the Oracle Database release that generates

      them, and can be stale upon database upgrade.


      For information on managing optimizer statistics, refer to the 12.2.0.1

      Oracle Database SQL Tuning Guide.


  ORACLE GENERATED FIXUP SCRIPT

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

  All of the issues in database ORCL

  which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by

  executing the following


    SQL>@/u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql



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

PREUPGRADE SUMMARY

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

  /u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade.log

  /u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql

  /u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql


Execute fixup scripts as indicated below:


Before upgrade:


Log into the database and execute the preupgrade fixups

@/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql


After the upgrade:


Log into the database and execute the postupgrade fixups

@/u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql


Preupgrade complete: 2021-04-28T16:15:41

[oracle@localhost ~]$





SQL> @/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql






Executing Oracle PRE-Upgrade Fixup Script


Auto-Generated by:       Oracle Preupgrade Script

                         Version: 19.0.0.0.0 Build: 1

Generated on:            2021-04-28 16:15:36


For Source Database:     ORCL

Source Database Version: 12.2.0.1.0

For Upgrade to Version:  19.0.0.0.0


Preup                             Preupgrade

Action                            Issue Is

Number  Preupgrade Check Name     Remedied    Further DBA Action

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

    1.  parameter_min_val         NO          Manual fixup recommended.

    2.  mv_refresh                NO          Informational only.

                                              Further action is optional.

    3.  dictionary_stats          YES         None.

    4.  mv_refresh                NO          Informational only.

                                              Further action is optional.

    5.  tablespaces_info          NO          Informational only.

                                              Further action is optional.

    6.  min_archive_dest_size     NO          Informational only.

                                              Further action is optional.

    7.  rman_recovery_version     NO          Informational only.

                                              Further action is optional.


The fixup scripts have been run and resolved what they can. However,

there are still issues originally identified by the preupgrade that

have not been remedied and are still present in the database.

Depending on the severity of the specific issue, and the nature of

the issue itself, that could mean that your database is not ready

for upgrade.  To resolve the outstanding issues, start by reviewing

the preupgrade_fixups.sql and searching it for the name of

the failed CHECK NAME or Preupgrade Action Number listed above.

There you will find the original corresponding diagnostic message

from the preupgrade which explains in more detail what still needs

to be done.


PL/SQL procedure successfully completed.


SQL> SQL> SQL> SQL> SQL> SQL>

SQL>

SQL>

SQL>


Sunday, June 6, 2021

Direct Upgrade to Oracle Database 19c

We can do Direct Upgrade to Oracle Database 19c 




Thursday, June 3, 2021

Difference between hash_value and plan_hash_value in oracle

 hash_value and plan_hash_value



select sql_text,sql_id,hash_value,plan_hash_value from v$sql where sql_text like '%last_name%'






Error : Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection

 


Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection (CONNECTION_ID=)



Please check the firewall , allow database port at firewall level and test using 


telnet IP db_port 




Wednesday, June 2, 2021

Query to Check Big Endian or Little Endian format for your Oracle Database

Query to Check Big Endian or Little Endian format for your Oracle Database 


Login into Oracle database 

SQL> select * from v$transportable_platform;    


PLATFORM_ID PLATFORM_NAME                             ENDIAN_FORMAT      CON_ID

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

          1 Solaris[tm] OE (32-bit)                   Big                     0

          2 Solaris[tm] OE (64-bit)                   Big                     0

          7 Microsoft Windows IA (32-bit)             Little                  0

         10 Linux IA (32-bit)                         Little                  0

          6 AIX-Based Systems (64-bit)                Big                     0

          3 HP-UX (64-bit)                            Big                     0

          5 HP Tru64 UNIX                             Little                  0

          4 HP-UX IA (64-bit)                         Big                     0

         11 Linux IA (64-bit)                         Little                  0

         15 HP Open VMS                               Little                  0

          8 Microsoft Windows IA (64-bit)             Little                  0

          9 IBM zSeries Based Linux                   Big                     0

         13 Linux x86 64-bit                          Little                  0

         16 Apple Mac OS                              Big                     0

         12 Microsoft Windows x86 64-bit              Little                  0

         17 Solaris Operating System (x86)            Little                  0

         18 IBM Power Based Linux                     Big                     0

         19 HP IA Open VMS                            Little                  0

         20 Solaris Operating System (x86-64)         Little                  0

         21 Apple Mac OS (x86-64)                     Little                  0


20 rows selected.


SQL>




On Linux - 12c db

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


SQL> select platform_id from v$database;


PLATFORM_ID

-----------

         13


SQL>

SQL> COL "Source" FORM a32

SQL> COL "Compatible Targets" FORM a40

select d.platform_name "Source", t.platform_name "Compatible Targets", endian_format

from v$transportable_platform t, v$database d where t.endian_format = (select endian_format from v$transportable_platform t, v$database d where d.platform_name = t.platform_name)

order by "Compatible Targets"

/SQL>   2    3    4


Source                           Compatible Targets                       ENDIAN_FORMAT

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

Linux x86 64-bit                 Apple Mac OS (x86-64)                    Little

Linux x86 64-bit                 HP IA Open VMS                           Little

Linux x86 64-bit                 HP Open VMS                              Little

Linux x86 64-bit                 HP Tru64 UNIX                            Little

Linux x86 64-bit                 Linux IA (32-bit)                        Little

Linux x86 64-bit                 Linux IA (64-bit)                        Little

Linux x86 64-bit                 Linux x86 64-bit                         Little

Linux x86 64-bit                 Microsoft Windows IA (32-bit)            Little

Linux x86 64-bit                 Microsoft Windows IA (64-bit)            Little

Linux x86 64-bit                 Microsoft Windows x86 64-bit             Little

Linux x86 64-bit                 Solaris Operating System (x86)           Little

Linux x86 64-bit                 Solaris Operating System (x86-64)        Little


12 rows selected.


SQL>


On Windows - 12c db

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

SQL> select platform_id from v$database;


PLATFORM_ID

-----------

         12


SQL>

SQL>

SQL>

SQL> COL "Source" FORM a32

SQL> COL "Compatible Targets" FORM a40

SQL> select d.platform_name "Source", t.platform_name "Compatible Targets", endian_format

  2  from v$transportable_platform t, v$database d where t.endian_format = (select endian_format from v$transportable_platform t, v$database d where d.platform_name = t.platform_name)

  3  order by "Compatible Targets"

  4  /


Source                           Compatible Targets                       ENDIAN_FORMAT

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

Microsoft Windows x86 64-bit     Apple Mac OS (x86-64)                    Little

Microsoft Windows x86 64-bit     HP IA Open VMS                           Little

Microsoft Windows x86 64-bit     HP Open VMS                              Little

Microsoft Windows x86 64-bit     HP Tru64 UNIX                            Little

Microsoft Windows x86 64-bit     Linux IA (32-bit)                        Little

Microsoft Windows x86 64-bit     Linux IA (64-bit)                        Little

Microsoft Windows x86 64-bit     Linux x86 64-bit                         Little

Microsoft Windows x86 64-bit     Microsoft Windows IA (32-bit)            Little

Microsoft Windows x86 64-bit     Microsoft Windows IA (64-bit)            Little

Microsoft Windows x86 64-bit     Microsoft Windows x86 64-bit             Little

Microsoft Windows x86 64-bit     Solaris Operating System (x86)           Little

Microsoft Windows x86 64-bit     Solaris Operating System (x86-64)        Little


12 rows selected.


SQL>

Monday, May 31, 2021

Oracle Database Releases and Support Timelines

Oracle Database Releases and Support Timelines  


Currently Oracle 19c database version is stable  and long term support













Migrate Oracle Database workload to Cloud : Re-host (Lift and Shift),Re-platform, Refactor

Migrate database workload to Cloud 


When Migrating database and application to cloud ,it is very important to keep in mind the business goals ,application and database capabilities and cost of migration .


There are different strategies for different application and database migrations goals .


  • Re-host (Lift and Shift) - Oracle on EC2

    Same administration experience as on-premise   

    Full Control over the environment 

    All feature is available 

    All version is supported 

  • Re-platform - Oracle on RDS

    Optimized Architecture

    Database Install and Maintenance

    Automated Patching & Upgrade 

    Automated Backup 

    High Availability 

    OS Patching & Maintenance 

    Scaling


  • Refactor (Rearchitect) - Adopt Cloud Native Services

            Amazon Aurora

            Amazon Redshift

            PostgreSQL

            Other database engine 

            Eliminate Oracle Licensing Cost 

Sunday, May 30, 2021

Cloud Migration Lifecycle

Cloud Database Migration Lifecycle 


Migration to cloud have two major phase :- 

  • Staging 
  • Cutover 

Migration Lifecycle 

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


  • Migration Assessment (3 to 5 Weeks )

Migration Readiness Assessment 

        Understand Business acceptation

        Note down current know issue, pain area & challenge

        Total Cost Of ownership (TCO)   

        Application Dependency Mapping

        Compliance & Risk  

  • Migration Planning  (6-8 Weeks)

Application Portfolio Assessment

Target Architecture

Operating Model

        Build Cloud Landing Zone

Migration Plan 

Migration Wave Sequencing

  • Migration (9++ Weeks)

Migrate Workload

Validate Migrated Workload

Cutover 

Decommission 

  • Optimization 

Cost Optimization 

Performance Optimization 

Recommended Best Practice 

        Backup setup + Etc.

        Documentation & Knowledge Sharing 

High Level Migration Timeline 

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


  • Migration Assessment (3 to 5 Weeks )
  • Migration Planning  (6 to 8 Weeks)
  • Migration + Optimization  (9++ Weeks)


*Timeline will be change and depends upon inventory and complexity 


Oracle Database Migration Tools & Techniques

Oracle Database Migration Tools & Techniques 


Oracle Native Migrations Tools 

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

• Data Pump

• Transportable Tablespaces

• Full Transportable Export/Import

• Data Guard

• Incremental Backups

• Oracle GoldenGate

• RMAN 


AWS Native Migration Tools 

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


• Database Migration Service (DMS)

• CloudEndure

• AWS Application Migration Service 


Thursday, May 27, 2021

Oracle standby database Error ORA-10458: standby database requires recovery,ORA-01196,ORA-01110

 

Oracle database Error ORA-10458: standby database requires recovery

ORA-01196: file 1 is inconsistent due to a failed media recovery session

ORA-01110: data file 1



SQL> set numwidth 30;

SQL> set pagesize 50000;

SQL> alter session set nls_date_format = 'DD-MON-RRRR HH24:MI:SS';

select status,checkpoint_change#,checkpoint_time, resetlogs_change#, resetlogs_time, count(*), fuzzy from v$datafile_header group by status,checkpoint_change#,checkpoint_time, resetlogs_change#, resetlogs_time, fuzzy;

Session altered.


SQL>


STATUS              CHECKPOINT_CHANGE# CHECKPOINT_TIME                   RESETLOGS_CHANGE# RESETLOGS_TIME                             COUNT(*) FUZ

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

ONLINE                         2472666 26-MAY-2021 11:19:09                        1408558 29-APR-2021 11:19:37                              4 YES



SQL> select min(fhrba_Seq), max(fhrba_Seq) from X$KCVFH;


                MIN(FHRBA_SEQ)                 MAX(FHRBA_SEQ)

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

                            63                             63


SQL>


SQL> SELECT SEQUENCE#, APPLIED FROM V$ARCHIVED_LOG;


 SEQUENCE# APPLIED

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

         1 NO

         2 NO

        20 YES

        21 YES

        19 YES

        22 YES

        23 YES

        24 YES

        25 YES

        26 YES

        27 YES

        28 YES

        29 YES

        30 YES

        31 YES

        32 YES

        33 YES

        34 YES

        36 YES

        35 YES

        38 YES

        40 YES

        41 YES

        39 YES

        37 YES

        42 YES

        43 YES

        44 YES

        45 YES

        46 YES

        47 YES

        47 YES

        46 YES

        48 YES

        48 YES

        49 YES

        49 NO

        50 NO

        50 YES

        52 YES

        51 YES

        53 YES

        54 YES

        55 YES

        56 YES

        57 YES

        58 YES

        59 YES

        60 YES

        61 YES

        62 YES


SQL>

SQL> alter database open read only;

alter database open read only

*

ERROR at line 1:

ORA-10458: standby database requires recovery

ORA-01196: file 1 is inconsistent due to a failed media recovery session

ORA-01110: data file 1: '/u01/app/oracle/oradata/india_stby/system01.dbf'




SQL>

SQL>

SQL> recover standby database;

ORA-00279: change 2472666 generated at 05/26/2021 11:19:09 needed for thread 1

ORA-00289: suggestion :

/u01/app/oracle/fra/INDIA_STBY/archivelog/2021_05_27/o1_mf_1_63_%u_.arc

ORA-00280: change 2472666 for thread 1 is in sequence #63



Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

cancel

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below

ORA-01196: file 1 is inconsistent due to a failed media recovery session

ORA-01110: data file 1: '/u01/app/oracle/oradata/india_stby/system01.dbf'



ORA-01112: media recovery not started






SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;


Database altered.


SQL> alter database open read only;


Database altered.


SQL> select * from hr.abc;


        ID NAME

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

         2 From standby after primary

         1 A

         3 from primary after convert


SQL> select name ,open_mode ,database_role from v$database;


NAME      OPEN_MODE            DATABASE_ROLE

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

INDIA     READ ONLY            PHYSICAL STANDBY


SQL>


SQL>

SQL>

SQL> shut immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL>

SQL> startup

ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance

ORACLE instance started.


Total System Global Area 1048576000 bytes

Fixed Size                  8628640 bytes

Variable Size             369100384 bytes

Database Buffers          662700032 bytes

Redo Buffers                8146944 bytes

Database mounted.

Database opened.

SQL> select name ,open_mode ,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE

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

INDIA     READ ONLY            PHYSICAL STANDBY


We can open database in read write mode using below command and this is also called manual failover 


SQL> alter database activate standby database;