Monday, May 31, 2021

lift and shift of EBS 12.1 to OCI using Hybrid DR methodology

This post covers the high level steps on how we can Lift and Shift on prem EBS 12.1.3 with Database 11.2.0.4 to Oracle Cloud Infrastructure using Hybrid DR methodology. This Hybrid DR methodology is used when we want to Lift and Shift EBS to OCI using minimal downtime approach. The database in Oracle Cloud Infrastructure is running on VM DB system which is Oracle Cloud Infrastructure PaaS and application server in Compute which is Oracle Cloud Infrastructure IaaS. For more information on approach you can go through the Oracle Doc Hybrid DR . 

Before starting on the steps, there are some important notes which i want to highlight

1. This method is not certified by EBS ATG team. This was done as part of my POC and hence if you are doing it, you are at risk of not getting  support from EBS team. Few days back, Oracle had released the manual migration approach which you can also follow https://blogs.oracle.com/ebsandoraclecloud/ebs-to-oci-manual-migration-documents-available. I will be doing a POC on the manual approach now.

2. Please be aware of the support policies for EBS 12.1.3 and Db 11.2.0.4 for VM Db system. 

3. Once the migration is completed, the tablespaces should be encrypted in order of cloud tooling to work from VM DB system and activities such as taking backups from console etc

4. There should be a network setup between on prem and OCI either using Fast Connect, IPSec VPN or through public internet.

 

Sample Architecture


Coming to the steps, as part of DBCS provisioning in VM DB system , we need to delete the files  which were created as part of provisioning. Before deleting, i took one full backup of the database from the console

 







 Next, we will prepare the on prem Database for DR readiness and also take the backup of application

1. Enable Force logging in on prem db. 

 2. Add the standby logs in the on prem db. 

 3. Create the password file and transfer it to OCI DB home(Single node).

 

 

Delete the starter Database in OCI

 

[oracle@hybriddr on_prem_backup]$  srvctl config database PROD_iad3sv

[oracle@hybriddr on_prem_backup]$

 

SQL> set heading off linesize 999 pagesize 0 feedback off trimspool on

SQL> spool /tmp/files.lst

SQL> select 'asmcmd rm '||name from v$datafile

union all

select 'asmcmd rm '||name from v$tempfile

union all

select 'asmcmd rm '||member from v$logfile;  2    3    4    5

SQL> spool off

SQL> create pfile='/tmp/PROD_iad3sv.pfile ' from spfile;

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Automatic Storage Management and Real Application Testing options

 

 

[oracle@hybriddr on_prem_backup]$

 

Shutdown the database

First collect the configuration of the database for future reference:

 

[oracle@hybriddr on_prem_backup]$ srvctl config database -d PROD_iad3sv >/tmp/PROD_iad3sv.config

 

Now stop the database

[oracle@hybriddr on_prem_backup]$ srvctl stop database -d PROD_iad3sv -o immediate

 

[oracle@hybriddr on_prem_backup]$ chmod 777 /tmp/files.lst

 

Using grid user remove the unwanted lines and run the script

 

[grid@hybriddr ~]$ . /tmp/files.lst

 

 

Configure static listener

 

Add the following content to the listener of dbaas host

 

SID_LIST_LISTENER =

 (SID_LIST = (SID_DESC =

 (GLOBAL_DBNAME = PROD_iad3sv) (ORACLE_HOME =/u01/app/oracle/product/11.2.0.4/dbhome_1)

 (SID_NAME = PROD)

 ))

 

And reload the listener

[grid@hybriddr admin]$ lsnrctl reload

 

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 27-MAY-2021 08:55:35

 

Copyright (c) 1991, 2020, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

The command completed successfully

 

 

 

Configure the TNSnames.ora, sqlnet.ora files in both on prem and OCI database

 

Check the connection from on prem

 

[oracle@onprem-ebs admin]$ sqlplus sys/*****@PROD_IAD3SV as sysdba

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 27 12:07:15 2021

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Automatic Storage Management and Real Application Testing options

 

SQL>

 

 

 

From OCI VM DB

 

[oracle@hybriddr admin]$ sqlplus system/*****@PROD

 

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 27 12:07:38 2021

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL>

 

 

 

Modify the init parameters for redo shipping:-

 

In the source on prem add the below parameetrs

SQL> ALTER SYSTEM SET log_archive_config='dg_config=(PROD,PROD_iad3sv)' SCOPE=both;

 SQL> ALTER SYSTEM SET log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles) db_unique_name=PROD' SCOPE=both;

 

System altered.

 SQL> ALTER SYSTEM SET log_archive_dest_2='service=PROD_iad3sv async valid_for=(online_logfiles,primary_role) db_unique_name=PROD_iad3sv' SCOPE=both;

 

System altered.

 

SQL> ALTER SYSTEM SET fal_server='PROD_iad3sv' SCOPE=both;

 

System altered.

 

SQL> ALTER SYSTEM SET fal_client='PROD' SCOPE=both;

 

System altered.

 

SQL> ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=both;

 

System altered.

 

SQL> alter system set log_archive_dest_state_2=defer;

 

System altered.

 

SQL>

 

 

 In dr

SQL> ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=both;

 

System altered.

 

SQL> ALTER SYSTEM SET log_archive_config='dg_config=(PROD,PROD_iad3sv)' SCOPE=both;

 

 

take the backup of on prem database and transfer it to OCI

 Restore the Database




SQL> select open_mode,database_role from v$database;

 

OPEN_MODE            DATABASE_ROLE

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

MOUNTED              PHYSICAL STANDBY

 

 

In the primary

SQL> Alter system set log_archive_dest_state_2=enable scope=both sid='*';

 

System altered.

 

 

In the standby

Start the mrp

alter database recover managed standby database disconnect from session;

 

Database altered.

 

SQL> SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH, (SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;

 

    Thread Last Sequence Received Last Sequence Applied Difference

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

         1                     46                    46          0

 

 

 

 

 

Enable Autoconfig in the database


The complete step by step document is available at a price of $49. If you want the document, please contact me over samratsinha05@gmail.com/ Whatsapp-+91-8709658491


Saturday, May 22, 2021

OCI Load Balancer redirection

 We all are aware that load balancers helps in distributing the requests to the backend servers based upon certain algorithms. OCI Load Balancers helps in achieving high availability and scalability. Based upon our requirement we can induce multiple policies and application level health checks in OCI Load Balancer. For information about OCI Load Balancer, you can go through Load Balancer. In this specific blog, i have tried to give the demonstration on how using Load Balancer advanced configurations such as Path Routes, Hostnames and Rule sets, we can redirect the request to specific backend server. In my earlier posts https://samappsdba.blogspot.com/2020/05/configuring-oci-load-balancer-for-ebs.html,i have explained how we can create a basic Load balancer in OCI.


I already have one public load balancer and one backend sets which comprises of two web servers webserver1 and webserver2. The web servers have the files webserver1.html and webserver2.html under the  /var/www/html path. 




As of now, if i type the public IP address of LB in the browser, it redirects me to the backend web server1 and webserver 2 as the algorithm choosen is Round Robin



And hit the ip address of the LB and it redirects me to second web server




 Upto this point Load balancer has the basic settings. Now i have two domains webserver1.tk and webserver2.tk 

The purpose would be to redirect the load to webserver1(webserver1.html) for the requests coming to webserver1.tk and redirect the load to webserver2(webserver2.html) for the requests coming to webserver2.tk. The handling of DNS queries are being served by OCI DNS Zones is out of scope for this post. I will cover the same in future posts.

First, under load balancer, i will create the specific hostnames.

Next, create 2 Path Route Set




next, create the rule sets








Now edit the listener which was created initially as part of OCI Load balancer setup and add an another listener. These two listeners will cater to two hostnames.



And then add the second listener








Now, if i hit the webserver.tk, the request is getting redirected to webserver/webserver1.html


test the same for webserver2.tk




There are many other advanced configurations which we can use with our OCI Load Balancer for which we can go through the Advanced OCI LB Config. The post was all about how using one flexible load balancer, we can serve multiple urls using hostnames, Path Routes and Rule sets. Hope this post helps someone. Keep learning cloud.