Saturday, August 22, 2020

Install Oracle Database 19c home using RPM in Oracle Linux 7.7 OS

 login as: root

root@192.168.0.108's password:

Last failed login: Sat Aug 22 09:25:51 IST 2020 from 192.168.0.106 on ssh:notty

There was 1 failed login attempt since the last successful login.

Last login: Sat Aug 22 09:23:18 2020 from 192.168.0.106

[root@oralin77oradb19c ~]# yum install oracle-database-ee-19c

Loaded plugins: langpacks, ulninfo

No package oracle-database-ee-19c available.

Error: Nothing to do

[root@oralin77oradb19c ~]#

login as: root

root@192.168.0.108's password:

Last login: Sat Aug 22 09:57:42 2020

[root@oralin77oradb19c ~]# ll

total 8

-rw-------. 1 root root 2214 Aug 22 07:51 anaconda-ks.cfg

drwxr-xr-x. 2 root root    6 Aug 22 09:17 Desktop

drwxr-xr-x. 2 root root    6 Aug 22 09:17 Documents

drwxr-xr-x. 2 root root   53 Aug 22 10:23 Downloads

-rw-r--r--. 1 root root 2262 Aug 22 09:17 initial-setup-ks.cfg

drwxr-xr-x. 2 root root    6 Aug 22 09:17 Music

drwxr-xr-x. 2 root root    6 Aug 22 09:17 Pictures

drwxr-xr-x. 2 root root    6 Aug 22 09:17 Public

drwxr-xr-x. 2 root root    6 Aug 22 09:17 Templates

drwxr-xr-x. 2 root root    6 Aug 22 09:17 Videos

[root@oralin77oradb19c ~]# cd Do

Documents/ Downloads/

[root@oralin77oradb19c ~]# cd Downloads/

[root@oralin77oradb19c Downloads]# ll

total 2631512

-rw-r--r--. 1 root root 2694664264 Aug 22 10:23 oracle-database-ee-19c-1.0-1.x86_64.rpm

[root@oralin77oradb19c Downloads]# du -sh *

2.6G    oracle-database-ee-19c-1.0-1.x86_64.rpm

[root@oralin77oradb19c Downloads]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm

warning: oracle-database-ee-19c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY

error: Failed dependencies:

        oracle-database-preinstall-19c is needed by oracle-database-ee-19c-1.0-1.x86_64

[root@oralin77oradb19c Downloads]# yum install oracle-database-preinstall-19c

Loaded plugins: langpacks, ulninfo

ol7_UEKR5                                                                                                                             | 2.5 kB  00:00:00

ol7_latest                                                                                                                            | 2.7 kB  00:00:00

Resolving Dependencies

--> Running transaction check

---> Package oracle-database-preinstall-19c.x86_64 0:1.0-2.el7 will be installed

--> Processing Dependency: ksh for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64

--> Processing Dependency: libaio-devel for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64

--> Processing Dependency: glibc-devel for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64

--> Processing Dependency: libstdc++-devel for package: oracle-database-preinstall-19c-1.0-2.el7.x86_64

--> Running transaction check

---> Package glibc-devel.x86_64 0:2.17-307.0.1.el7.1 will be installed

--> Processing Dependency: glibc-headers = 2.17-307.0.1.el7.1 for package: glibc-devel-2.17-307.0.1.el7.1.x86_64

--> Processing Dependency: glibc = 2.17-307.0.1.el7.1 for package: glibc-devel-2.17-307.0.1.el7.1.x86_64

--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-307.0.1.el7.1.x86_64

---> Package ksh.x86_64 0:20120801-142.0.1.el7 will be installed

---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed

---> Package libstdc++-devel.x86_64 0:4.8.5-39.0.5.el7 will be installed

--> Processing Dependency: libstdc++(x86-64) = 4.8.5-39.0.5.el7 for package: libstdc++-devel-4.8.5-39.0.5.el7.x86_64

--> Running transaction check

---> Package glibc.x86_64 0:2.17-292.0.1.el7 will be updated

--> Processing Dependency: glibc = 2.17-292.0.1.el7 for package: glibc-common-2.17-292.0.1.el7.x86_64

---> Package glibc.x86_64 0:2.17-307.0.1.el7.1 will be an update

---> Package glibc-headers.x86_64 0:2.17-307.0.1.el7.1 will be installed

---> Package libstdc++.x86_64 0:4.8.5-39.0.1.el7 will be updated

---> Package libstdc++.x86_64 0:4.8.5-39.0.5.el7 will be an update

--> Running transaction check

---> Package glibc-common.x86_64 0:2.17-292.0.1.el7 will be updated

---> Package glibc-common.x86_64 0:2.17-307.0.1.el7.1 will be an update

--> Finished Dependency Resolution


Dependencies Resolved


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

 Package                                            Arch                       Version                                  Repository                      Size

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

Installing:

 oracle-database-preinstall-19c                     x86_64                     1.0-2.el7                                ol7_latest                      19 k

Installing for dependencies:

 glibc-devel                                        x86_64                     2.17-307.0.1.el7.1                       ol7_latest                     1.1 M

 glibc-headers                                      x86_64                     2.17-307.0.1.el7.1                       ol7_latest                     691 k

 ksh                                                x86_64                     20120801-142.0.1.el7                     ol7_latest                     882 k

 libaio-devel                                       x86_64                     0.3.109-13.el7                           ol7_latest                      12 k

 libstdc++-devel                                    x86_64                     4.8.5-39.0.5.el7                         ol7_latest                     1.5 M

Updating for dependencies:

 glibc                                              x86_64                     2.17-307.0.1.el7.1                       ol7_latest                     3.6 M

 glibc-common                                       x86_64                     2.17-307.0.1.el7.1                       ol7_latest                      12 M

 libstdc++                                          x86_64                     4.8.5-39.0.5.el7                         ol7_latest                     306 k


Transaction Summary

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

Install  1 Package  (+5 Dependent packages)

Upgrade             ( 3 Dependent packages)


Total download size: 20 M

Is this ok [y/d/N]: y

Downloading packages:

No Presto metadata available for ol7_latest

warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/glibc-2.17-307.0.1.el7.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY06 ETA

Public key for glibc-2.17-307.0.1.el7.1.x86_64.rpm is not installed

(1/9): glibc-2.17-307.0.1.el7.1.x86_64.rpm                                                                                            | 3.6 MB  00:00:02

(2/9): glibc-devel-2.17-307.0.1.el7.1.x86_64.rpm                                                                                      | 1.1 MB  00:00:00

(3/9): glibc-headers-2.17-307.0.1.el7.1.x86_64.rpm                                                                                    | 691 kB  00:00:00

(4/9): ksh-20120801-142.0.1.el7.x86_64.rpm                                                                                            | 882 kB  00:00:00

(5/9): libaio-devel-0.3.109-13.el7.x86_64.rpm                                                                                         |  12 kB  00:00:00

(6/9): libstdc++-4.8.5-39.0.5.el7.x86_64.rpm                                                                                          | 306 kB  00:00:00

(7/9): libstdc++-devel-4.8.5-39.0.5.el7.x86_64.rpm                                                                                    | 1.5 MB  00:00:00

(8/9): oracle-database-preinstall-19c-1.0-2.el7.x86_64.rpm                                                                            |  19 kB  00:00:00

(9/9): glibc-common-2.17-307.0.1.el7.1.x86_64.rpm                                                                                     |  12 MB  00:00:04

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

Total                                                                                                                        4.3 MB/s |  20 MB  00:00:04

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Importing GPG key 0xEC551F03:

 Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"

 Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03

 Package    : 7:oraclelinux-release-7.7-1.0.5.el7.x86_64 (@anaconda/7.7)

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Updating   : glibc-common-2.17-307.0.1.el7.1.x86_64                                                                                                   1/12

  Updating   : glibc-2.17-307.0.1.el7.1.x86_64                                                                                                          2/12

  Updating   : libstdc++-4.8.5-39.0.5.el7.x86_64                                                                                                        3/12

  Installing : libstdc++-devel-4.8.5-39.0.5.el7.x86_64                                                                                                  4/12

  Installing : ksh-20120801-142.0.1.el7.x86_64                                                                                                          5/12

  Installing : glibc-headers-2.17-307.0.1.el7.1.x86_64                                                                                                  6/12

  Installing : glibc-devel-2.17-307.0.1.el7.1.x86_64                                                                                                    7/12

  Installing : libaio-devel-0.3.109-13.el7.x86_64                                                                                                       8/12

  Installing : oracle-database-preinstall-19c-1.0-2.el7.x86_64                                                                                          9/12

  Cleanup    : libstdc++-4.8.5-39.0.1.el7.x86_64                                                                                                       10/12

  Cleanup    : glibc-common-2.17-292.0.1.el7.x86_64                                                                                                    11/12

  Cleanup    : glibc-2.17-292.0.1.el7.x86_64                                                                                                           12/12

  Verifying  : glibc-2.17-307.0.1.el7.1.x86_64                                                                                                          1/12

  Verifying  : libstdc++-devel-4.8.5-39.0.5.el7.x86_64                                                                                                  2/12

  Verifying  : glibc-common-2.17-307.0.1.el7.1.x86_64                                                                                                   3/12

  Verifying  : ksh-20120801-142.0.1.el7.x86_64                                                                                                          4/12

  Verifying  : libaio-devel-0.3.109-13.el7.x86_64                                                                                                       5/12

  Verifying  : glibc-devel-2.17-307.0.1.el7.1.x86_64                                                                                                    6/12

  Verifying  : glibc-headers-2.17-307.0.1.el7.1.x86_64                                                                                                  7/12

  Verifying  : libstdc++-4.8.5-39.0.5.el7.x86_64                                                                                                        8/12

  Verifying  : oracle-database-preinstall-19c-1.0-2.el7.x86_64                                                                                          9/12

  Verifying  : glibc-common-2.17-292.0.1.el7.x86_64                                                                                                    10/12

  Verifying  : glibc-2.17-292.0.1.el7.x86_64                                                                                                           11/12

  Verifying  : libstdc++-4.8.5-39.0.1.el7.x86_64                                                                                                       12/12


Installed:

  oracle-database-preinstall-19c.x86_64 0:1.0-2.el7


Dependency Installed:

  glibc-devel.x86_64 0:2.17-307.0.1.el7.1   glibc-headers.x86_64 0:2.17-307.0.1.el7.1 ksh.x86_64 0:20120801-142.0.1.el7 libaio-devel.x86_64 0:0.3.109-13.el7

  libstdc++-devel.x86_64 0:4.8.5-39.0.5.el7


Dependency Updated:

  glibc.x86_64 0:2.17-307.0.1.el7.1                glibc-common.x86_64 0:2.17-307.0.1.el7.1                libstdc++.x86_64 0:4.8.5-39.0.5.el7


Complete!

[root@oralin77oradb19c Downloads]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm



[root@oralin77oradb19c Downloads]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm

Preparing...                          ################################# [100%]

Updating / installing...

   1:oracle-database-ee-19c-1.0-1     ################################# [100%]

[INFO] Executing post installation scripts...

[INFO] Oracle home installed successfully and ready to be configured.

To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure

[root@oralin77oradb19c Downloads]#

[root@oralin77oradb19c Downloads]# /etc/init.d/oracledb_ORCLCDB-19c configure

Configuring Oracle Database ORCLCDB.

Prepare for db operation

8% complete

Copying database files

31% complete

Creating and starting Oracle instance

32% complete

36% complete


40% complete

43% complete

46% complete

Completing Database Creation

51% complete

54% complete

Creating Pluggable Databases

58% complete

77% complete

Executing Post Configuration Actions

100% complete

Database creation complete. For details check the logfiles at:

 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.

Database Information:

Global Database Name:ORCLCDB

System Identifier(SID):ORCLCDB

Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.


Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.

[root@oralin77oradb19c Downloads]#

[root@oralin77oradb19c Downloads]#


Friday, May 29, 2020

When we have enabled TRACE in terraform - how does the trace.log start with


Enable the trace log as follows :-
$env:TF_LOG="TRACE"
$env:TF_LOG_PATH="C:\temp\terraform_ts.txt"
$env:OCI_GO_SDK_DEBUG=1


The log would look as below, the start would have something something marked in yellow as below. This tip finds it use, when you have appended the already existing log.


2020/05/29 20:37:04 [INFO] Terraform version: 0.12.24  
2020/05/29 20:37:04 [INFO] Go runtime version: go1.12.13
2020/05/29 20:37:04 [INFO] CLI args: []string{"C:\\terraform\\terraform.exe", "init"}
2020/05/29 20:37:04 [DEBUG] Attempting to open CLI config file: C:\Users\opc\AppData\Roaming\terraform.rc
2020/05/29 20:37:04 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/05/29 20:37:04 [INFO] CLI command args: []string{"init"}
2020/05/29 20:37:04 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/05/29 20:37:04 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2020/05/29 20:37:04 [DEBUG] New state was assigned lineage "00136577-ec06-e2e0-e149-a16cdabb2f27"
2020/05/29 20:37:04 [TRACE] Meta.Backend: using default local state only (no backend configuration, and no existing initialized backend)
2020/05/29 20:37:04 [TRACE] Meta.Backend: instantiated backend of type <nil>
2020/05/29 20:37:04 [DEBUG] checking for provider in "."
2020/05/29 20:37:04 [DEBUG] checking for provider in "C:\\terraform"
2020/05/29 20:37:04 [DEBUG] checking for provider in ".terraform\\plugins\\windows_amd64"
2020/05/29 20:37:04 [DEBUG] found provider "terraform-provider-oci_v3.78.0_x4.exe"
2020/05/29 20:37:04 [DEBUG] found valid plugin: "oci", "3.78.0", "C:\\TFRC\\.terraform\\plugins\\windows_amd64\\terraform-provider-oci_v3.78.0_x4.exe"
2020/05/29 20:37:04 [DEBUG] checking for provisioner in "."
2020/05/29 20:37:04 [DEBUG] checking for provisioner in "C:\\terraform"
2020/05/29 20:37:04 [DEBUG] checking for provisioner in ".terraform\\plugins\\windows_amd64"
2020/05/29 20:37:04 [TRACE] Meta.Backend: backend <nil> does not support operations, so wrapping it in a local backend
2020/05/29 20:37:04 [TRACE] backend/local: state manager for workspace "default" will:
 - read initial snapshot from terraform.tfstate
 - write new snapshots to terraform.tfstate
 - create any backup at terraform.tfstate.backup

Wednesday, May 20, 2020

What does the timeouts in terraform do ?

timeouts {
    create = "25m"
} 

This function inside the main terraform script sets the configurable timeout value.

If we set it to 5m then following will be the output

timeouts {
    create  =  "5m"
} 


As the instances were not provisioned in 5min, the terraform apply terminated.
oci_core_instance.TFInstance: Still creating... [4m40s elapsed]
oci_core_instance.TFInstance: Still creating... [4m50s elapsed]
oci_core_instance.TFInstance: Still creating... [5m0s elapsed]

Error: timeout while waiting for state to become 'RUNNING' (last state: 'PROVISIONING', timeout: 5m0s)

  on instance.tf line 16, in resource "oci_core_instance" "TFInstance":
  16: resource "oci_core_instance" "TFInstance"{



Base recovery requirements - RPO and RTO



What is Recovery Point Objective (RPO)
- Tolerance for data loss
- How frequently should backups be taken ?

What is Recovery Time objective (RTO)
- Tolerance for downtime
- Downtime = Problem Identification + recovery planning + systems recovery
- Tiered RTO per level of granularity ( database, tablespace, table, row )
- Determine backup retention policy for on-site, off-site, and long-term backups.
- Retention policy can be configured based upon recovery window or Redundancy.

What is the criteria to assess the recovery requirements properly?
- You should first determine how critical a database is to the business when lost or unavailable?
- How much will the company loose per hour of downtime ?
- How much will be lost in productivity and labor costs if the database is down ?

How to classify databases according to criticality of availability (RTO)
- A large data warehouse can tolerate 12 hours worth of lost data, because batch loads can be re-run.
- An OLTP system cannot tolerate a downtime of even few minutes, as it results in the loss of $100,000 per hour of revenue. You will need to consider Data Guard here.

How to classify databases based upon how much data loss is acceptable (RPO)
- Are there databases that require more frequent backups ?
- Is there an adequate disk space available for archived logs ?

How to classify databases based on RTO?
- Is it minutes or hours ?
- Do you have a combined disk and tape backup strategy ? Based on this assess the retention period for backups. 

Friday, May 1, 2020

Powershell mention a simple if else statement



$x = "$InstallationFolder/file.dat"

if($x -eq $x) {
   Write-Host "file.dat file exists"
}else {
   Write-Host "file.dat does not file exists"
}

Friday, March 27, 2020

powershell cmdlet Copy-Item overwrites the existing files


Tested successfully
In Powershell, the cmdlet
Copy-Item overwrites the existing files

Copy-Item "C:\test\test.conf" -Destination "C:\conf\test.conf"

The above command will overwrite C:\conf\test.conf file with C:\test\test.conf

Monday, March 9, 2020

AWS Windows Image - Automating the install of Corretto

C:\installer\corretto.msi - Location of the MSI file
C:\corretto - Installation Directory

Start-Process "msiexec.exe" -ArgumentList "/i C:\installer\corretto.msi INSTALLDIR=""C:\corretto"" /qb!" -NoNewWindow -Wait