<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Suraj Ramesh's Blog]]></title><description><![CDATA[Full Stack DR]]></description><link>https://surajramesh.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1704279022877/1V7Ewq0WK.png</url><title>Suraj Ramesh&apos;s Blog</title><link>https://surajramesh.com</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Nov 2026 15:37:35 GMT</lastBuildDate><atom:link href="https://surajramesh.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Enable Run Command plugin for Ubuntu based VMs in OCI]]></title><description><![CDATA[Learn how to install the Run Command plugin on Ubuntu VMs in OCI for secure, remote script execution without SSH or open ports]]></description><link>https://surajramesh.com/enable-run-command-plugin-for-ubuntu-based-vms-in-oci</link><guid isPermaLink="true">https://surajramesh.com/enable-run-command-plugin-for-ubuntu-based-vms-in-oci</guid><category><![CDATA[OCI]]></category><category><![CDATA[fullstackdr]]></category><category><![CDATA[compute]]></category><category><![CDATA[Disaster recovery]]></category><dc:creator><![CDATA[Suraj Ramesh]]></dc:creator><pubDate>Fri, 23 May 2025 14:02:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/46T6nVjRc2w/upload/86e415c9d887e9cde07c0c3d736b4b6a.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction:</h3>
<p>Managing cloud instances in OCI often means logging in via SSH, manually running scripts, and opening ports, but what if you could skip all that? With <strong>Run Command</strong> in Oracle Cloud Infrastructure (OCI), you can remotely execute scripts on your compute instances without needing SSH access or inbound ports at all.</p>
<p>Whether you’re automating routine tasks like configuring secondary VNICs, joining instances to an identity provider, troubleshooting connectivity issues, or responding to cross-region disaster recovery events, Run Command makes it simple and secure.</p>
<p>Under the hood, it works through the <strong>Compute Instance Run Command plugin</strong>, part of the <a target="_blank" href="https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/manage-plugins.htm#manage-plugins">Oracle Cloud Agent software</a>, which handles command execution safely from within the instance.</p>
<p>By default, the Run Command plugin comes with various <strong>Oracle Cloud platform images</strong> like Oracle Autonomous Linux, Oracle Linux, CentOS, and Windows Server.</p>
<p>Currently Ubuntu images don't have the run command plugin installed by default. In this post, we’ll show you how to manually install the Run Command plugin on an OCI compute instance running an <strong>Ubuntu platform image</strong>.</p>
<blockquote>
<p>The <a target="_blank" href="https://www.oracle.com/cloud/full-stack-disaster-recovery/">OCI Full Stack DR</a> service relies heavily on the Run Command feature to perform key tasks like attaching or detaching block volumes for moving and non-moving instances, mounting or unmounting file systems, and running user-defined scripts. Therefore, having the Run Command plugin is essential if you are planning to integrate the VMs with an Ubuntu platform image with Full Stack DR.</p>
</blockquote>
<h3 id="heading-pre-requisites-for-using-run-command">Pre-requisites for using run command</h3>
<p>Before you can use the Run Command feature in OCI, you’ll need to set up the right <strong>IAM policies</strong> for both users and instances to ensure secure access.</p>
<p>Also, keep in mind that <strong>Run Command executes scripts with administrator (root) privileges</strong>, so use it responsibly.</p>
<p>For detailed setup steps and policy examples, check out the <a target="_blank" href="https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/runningcommands.htm">official OCI documentation.</a></p>
<h3 id="heading-install-the-cloud-agent-package-and-test-the-run-command-functionality">Install the Cloud Agent package and test the Run Command functionality</h3>
<ol>
<li><p>I have launched a VM named “ubuntu-vm” with <strong>Canonical-Ubuntu-24.04-aarch64-2025.05.20-0 platform image</strong></p>
</li>
<li><p>Navigate to the Management section in the OCI console, as expected, you will not see the run command plugin available for the VM.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1747919147005/2736b07c-219b-4a43-b0a6-32f1f50f2ac6.png" alt class="image--right mx-auto mr-0" /></p>
<ol start="3">
<li><p>Uninstall the oracle cloud agent software.</p>
<pre><code class="lang-bash"> sudo snap remove oracle-cloud-agent
</code></pre>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1748006461475/b9ad6d1b-3372-4c3b-a44c-4a4c683fd222.png" alt class="image--center mx-auto" /></p>
<p>4. Download and copy the cloud agent package file to the VM. <strong>Please note to get the cloud agent package you need to create a support ticket with Oracle.</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1748007534621/17d35d2c-3bdc-494e-a1c1-982ae6b54e08.png" alt class="image--center mx-auto" /></p>
<ol start="5">
<li>Install the cloud agent package</li>
</ol>
<pre><code class="lang-bash">sudo gdebi oracle-cloud-agent_1.51.0-4_amd64.deb
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1748007605718/72b1fd60-a632-4679-9cc7-3ac2b90c4387.png" alt class="image--center mx-auto" /></p>
<ol start="6">
<li>Test the Run Command through the OCI Console. From the VM's home page, navigate to Management → Run Command → Create Command. To keep it simple, type any Linux command in the script section — for example, date — and then click Create Command.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1748007869955/2636bb85-a3a7-46c5-9404-1ea84a179914.png" alt class="image--center mx-auto" /></p>
<ol start="7">
<li><p>Verify the status after a few minutes to confirm successful completion.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1748008042733/cb4139ca-60b6-4e4d-b967-7c250f581f60.png" alt class="image--center mx-auto" /></p>
<p> In case if you want to verify the status of the running command you can verify the logs from the VM using the below command.</p>
</li>
</ol>
<pre><code class="lang-bash">tail -f /var/<span class="hljs-built_in">log</span>/oracle-cloud-agent/plugins/runcommand/runcommand.log
</code></pre>
<h3 id="heading-conclusion">Conclusion:</h3>
<p>In summary, enabling the Run Command plugin for Ubuntu VMs in Oracle Cloud makes managing and automating tasks much easier. This guide shows you how to install and test it, so you can run scripts remotely without using SSH or opening ports. This also helps you integrate Ubuntu VMs smoothly with Full Stack DR.</p>
]]></content:encoded></item><item><title><![CDATA[CD3 Automation Toolkit Integration with OCI Full Stack DR]]></title><description><![CDATA[oracle cloud disaster recovery automation]]></description><link>https://surajramesh.com/cd3-automation-toolkit-integration-with-oci-full-stack-dr</link><guid isPermaLink="true">https://surajramesh.com/cd3-automation-toolkit-integration-with-oci-full-stack-dr</guid><category><![CDATA[FSDR]]></category><category><![CDATA[Oracle Cloud]]></category><category><![CDATA[OCI]]></category><category><![CDATA[Disaster recovery]]></category><category><![CDATA[Oracle]]></category><dc:creator><![CDATA[Suraj Ramesh]]></dc:creator><pubDate>Mon, 07 Oct 2024 15:00:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/vZJdYl5JVXY/upload/b2a8cf6d85fa58b453ee5a9f99dfdc41.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Infrastructure as Code (IaC) is essential in the cloud because it automates infrastructure provisioning, ensures consistency, and improves scalability. It helps reduce costs, enhances security, and improves administrator productivity. IaC also integrates well with DevOps practices, enabling agile development and efficient multi-cloud or hybrid cloud management. By treating infrastructure as code, teams can version control, collaborate, and standardise deployments, resulting in faster, more reliable cloud operations.</p>
<p>In Oracle Cloud Infrastructure (OCI), the CD3 Automation Toolkit is available to assist our customers in beginning their IaC journey using Excel templates. CD3 stands for <strong>Cloud Deployment Design Deliverable</strong>. The CD3 Automation Toolkit enables users to efficiently build, export, and manage OCI resources by transforming Excel templates into fully functional Terraform modules in just minutes. The CD3 Toolkit also provides scripts that use OCI SDK modules, available as Python scripts. The CD3 Toolkit ensures seamless resource management through the OCI DevOps GIT service and Jenkins Pipelines.</p>
<p>For more information, please visit <a target="_blank" href="https://oracle-devrel.github.io/cd3-automation-toolkit/latest/cd3-overview/">CD3 Documentation</a>.</p>
<h3 id="heading-getting-started-with-cd3">Getting Started with CD3</h3>
<p>There are two ways to install and use CD3</p>
<ol>
<li><p>OCI Resource manager stack</p>
</li>
<li><p>Manual Container launch</p>
</li>
</ol>
<p>Depending on your preference, you can install CD3; in this example, I have used the Manual Container launch approach (Option 2). For more details, refer to <a target="_blank" href="https://oracle-devrel.github.io/cd3-automation-toolkit/latest/install-cd3">CD3 docs</a></p>
<p>I have built the current CD3 v2024.4.1 image and started the container cd3-toolkit-1. The below screenshot shows that I could run the <mark>exec</mark> into the running container.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728294619298/4208c3ba-a202-45b1-88f7-759f51b5e5f2.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-connect-the-container-to-oci-tenancy-and-use-cli"><strong>Connect the container to OCI Tenancy and use CLI.</strong></h3>
<ol>
<li>After completing the required prerequisites, I have initialised the environment. You must update all the required details in the tenancyconfig.properties file. Please take a look at the <a target="_blank" href="https://oracle-devrel.github.io/cd3-automation-toolkit/latest/connect-container-to-oci-tenancy/">tenancy configuration</a> for more details.</li>
</ol>
<pre><code class="lang-plaintext">cd /cd3user/oci_tools/cd3_automation_toolkit/user-scripts/
</code></pre>
<pre><code class="lang-plaintext">python createTenancyConfig.py tenancyconfig.properties
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728298936184/18ca17b1-399e-4a22-af77-6861e7536a67.png" alt class="image--center mx-auto" /></p>
<ol start="2">
<li><p>I have used “fsdrdemo” as a prefix, which you can see in the generated folder structure and file names.</p>
</li>
<li><p>I will use the toolkit with CLI, but integration with Jenkins is also available. To use Jenkins, you must provide the required parameters in the <strong>tenacyconfig.properties</strong> file.</p>
</li>
<li><p>The next step is to update the <strong>fsdrdemo_setUpOCI.properties</strong> file and run the <a target="_blank" href="http://setUpOCI.py"><strong>setUpOCI.py</strong></a> script. For more details, please refer to the CLI configuration.</p>
</li>
</ol>
<pre><code class="lang-plaintext">cd /cd3user/oci_tools/cd3_automation_toolkit/
</code></pre>
<pre><code class="lang-plaintext">python setUpOCI.py /cd3user/tenancies/fsdrdemo/fsdrdemo_setUpOCI.properties
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728299079964/77e48025-038a-4646-987f-96b06249dec5.png" alt class="image--center mx-auto" /></p>
<p>You can manage the various supported services for your OCI Infrastructure using the CD3 toolkit.</p>
<h3 id="heading-full-stack-dr-integration-with-cd3-toolkit">Full Stack DR integration with CD3 toolkit</h3>
<p>For Full Stack DR integration with the CD3 toolkit, the automation is available as Python scripts that use OCI Full Stack DR SDKs. CD3 enables users to export and update Full Stack DR plans. Different DR plans can be exported into separate Excel tabs. DR plan steps can be updated in Excel and then applied to the Full Stack DR using the toolkit.</p>
<p><strong>Common Use Cases:</strong></p>
<p>These scripts will be helpful for the below-mentioned Full Stack DR use cases.</p>
<ul>
<li><p>If an existing DR Protection group member is updated in the Full Stack DR, the DR plan gets deleted. To handle this, export all <em>User-defined steps</em> to CD3 Excel and use this data to recreate the new DR plan after updating a member.</p>
</li>
<li><p>Clone the <em>User-Defined Steps</em> from one plan to another within the same region or across regions.</p>
</li>
<li><p>Manage the <em>User-Defined Steps</em> in DR plans with an Excel spreadsheet.</p>
</li>
</ul>
<p><strong>Features:</strong></p>
<ul>
<li><p>Easy to manage and update <em>User-Defined Steps</em>.</p>
</li>
<li><p>The order of the DR Plan's steps is preserved in the Excel sheet, allowing steps to be created in the same sequence as desired in the console.</p>
</li>
<li><p>A single Excel sheet can manage all DR Switchover and Failover plans.</p>
</li>
</ul>
<h3 id="heading-update-full-stack-drpg-members">Update Full Stack DRPG members:</h3>
<p>Let’s assume we need to modify the members of the DR protection groups. If you add or modify the members in the DRPG, the existing DR plans will be deleted. Assuming this DR plan has multiple user-defined plan groups/steps, manually creating those steps using the OCI console will be time-consuming. Let’s use the CD3 toolkit FSDR scripts to achieve this task. We are going to perform the following tasks:</p>
<ol>
<li><p>Export the existing DR plan - Using CD3 scripts</p>
</li>
<li><p>Modify the members in DRPG - Using OCI Console</p>
</li>
<li><p>Create the new DR plan - Using OCI Console</p>
</li>
<li><p>Export the new DR plan - Using CD3 scripts</p>
</li>
<li><p>Update the new DR plan - Using CD3 scripts</p>
</li>
</ol>
<p><strong>Export the existing DR plan - Using CD3 scripts:</strong></p>
<ol>
<li>We already have an existing DRPG pair, with a moving instance and volume group added to the Primary DRPG. In addition to the built-in plan groups, I have created and customised the switchover plan with various user-defined plan groups and steps.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728300335153/bde8ca63-fe0b-42bf-b418-ca0071766d88.png" alt class="image--center mx-auto" /></p>
<ol start="2">
<li>Run the setUpOCI.py script and select the OCI FSDR option</li>
</ol>
<pre><code class="lang-plaintext">python setUpOCI.py /cd3user/tenancies/fsdrdemo/fsdrdemo_setUpOCI.properties
</code></pre>
<p><strong><mark>Enter Other OCI Tools - Option 17</mark></strong></p>
<p><strong><mark>Enter OCI FSDR - Option 3</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728300647710/d69f84c3-ca68-482c-9697-647e484f0ae7.png" alt class="image--center mx-auto" /></p>
<ol start="3">
<li><p>We have two options ( Export DR plan and Update DR plan); since we are going to take an Export of the current DR plan, select Export DR plan - 1</p>
<p> <strong><mark>Enter Update DR plan - Option 2</mark></strong></p>
</li>
<li><p>It will prompt you to provide the Excel file name, Excel sheet name and DR plan OCID.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728306460496/8119dcc7-d839-44d9-b8ba-65e03e324311.png" alt class="image--center mx-auto" /></p>
<p> <strong>Excel File name: fsdrdemo_oci_fsdr-plan.xlsx</strong></p>
<p> <strong>Sheet Name: FSDR-Plan</strong></p>
</li>
<li><p>The file will be generated in the “/cd3user/tenancies/fsdrdemo/othertools_files” folder.</p>
<pre><code class="lang-plaintext"> [cd3user@f52b32925428 othertools_files]$ pwd
 /cd3user/tenancies/fsdrdemo/othertools_files
 [cd3user@f52b32925428 othertools_files]$ ls -ltr
 total 24
 -rw-r--r-- 1 cd3user cd3user 23235 Oct  7 11:33 fsdrdemo_oci-fsdr-plan.xlsx
 [cd3user@f52b32925428 othertools_files]$
</code></pre>
</li>
<li><p>Since the excel file is inside the container, you need to copy to the local folder to access the file. This can be done by using the below docker command. Make sure to replace the docker container id and folder structure. In my example. <strong><mark>f52b32925428</mark></strong> is my docker container id and <strong><mark>/Users/surajramesh/cd3/cd3-data </mark></strong> local folder where i want to copy the file.</p>
</li>
</ol>
<pre><code class="lang-plaintext"> docker cp f52b32925428:/cd3user/tenancies/fsdrdemo/othertools_files/fsdrdemo_oci-fsdr-plan.xlsx /Users/surajramesh/cd3/cd3-data
</code></pre>
<ol start="7">
<li><p>You can verify the DR plan details from the excel sheet. Refer to the Readme sheet for the instructions of how to use the excel template. FSDR-Plan sheet will have both the built-in and user-defined plan groups/steps with all the attributes.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728301616218/28076e13-183f-4ac5-847a-d7869cbb78f9.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<p><strong>Modify the members in DRPG and Create the new DR plan using OCI Console:</strong></p>
<ol>
<li><p>Add new compute member in the Standby DRPG.</p>
</li>
<li><p>Existing DR plan gets deleted.</p>
</li>
<li><p>Create the new Switchover plan.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728303951754/5fee5aa1-c95b-494b-ba17-fbbc6db5c191.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Gather the OCID of the new DR plan.</p>
</li>
<li><p><strong>Follow the same process as mentioned in the above mentioned export DR plan steps, but make sure you provide the new sheet name and the new DR plan OCID which we generated now in the DR plan OCID details and copy the sheet to the local folder.</strong></p>
</li>
<li><p>I have provided <strong>FSDR-New-Plan</strong> in the sheet name and new DR plan OCID generated.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728303579671/4ee088d1-6881-42b4-bb65-63d0957157a1.png" alt class="image--center mx-auto" /></p>
<p> Copy the excel sheet to the local folder.</p>
</li>
</ol>
<pre><code class="lang-plaintext"> docker cp f52b32925428:/cd3user/tenancies/fsdrdemo/othertools_files/fsdrdemo_oci-fsdr-plan.xlsx /Users/surajramesh/cd3/cd3-data
</code></pre>
<ol start="8">
<li>Now you will have <strong>FSDR-New-Plan</strong> sheet with the new DR plan details with only built-in plan groups.</li>
</ol>
<p><strong>Update the new DR plan - Using CD3 scripts</strong></p>
<ol>
<li><p>Let’s copy the required User-defind plan groups and steps from the <strong>FSDR-Plan</strong> ( old DR plan) to the <strong>FSDR-New-Plan</strong> (new DR plan) sheet.</p>
</li>
<li><p>You can refer to the Readme sheet in the generated excel sheet of updated the various required fields during the update DR plan command.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728302795494/58c03e3e-5179-4236-a090-ca165fbb6a3e.png" alt class="image--center mx-auto" /></p>
<ol start="3">
<li><p>Copy the required user-defined group and steps from the FSDR-Plan sheet to the FSDR-New-Plan sheet. Make sure you leave the id,steps.id value as empty and follow other instuctions as mentioned in Readme. You can copy and paste in the specific order as per the original DR plan. Don’t modify the built-in plan groups and steps. Make sure the readme file instructions are correctly followed. Once its done, save the file.</p>
</li>
<li><p>Copy the Update excel file from the local system to the docker container using the below command.</p>
</li>
</ol>
<pre><code class="lang-plaintext"> docker cp /Users/surajramesh/cd3/cd3-data/fsdrdemo_oci-fsdr-plan.xlsx f52b32925428:/cd3user/tenancies/fsdrdemo/othertools_files/fsdrdemo_oci-fsdr-plan.xlsx
</code></pre>
<ol start="5">
<li>Run the setUpOCI.py script and select the OCI FSDR option</li>
</ol>
<pre><code class="lang-plaintext">python setUpOCI.py /cd3user/tenancies/fsdrdemo/fsdrdemo_setUpOCI.properties
</code></pre>
<p><strong><mark>Enter Other OCI Tools - Option 17</mark></strong></p>
<p><strong><mark>Enter OCI FSDR - Option 3</mark></strong></p>
<p><strong><mark>Enter Update DR plan - Option 2</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728305797474/02cd986f-399f-427f-92da-5e93e6bad7c5.png" alt class="image--center mx-auto" /></p>
<ol start="6">
<li><p>Verify the updated DR plan in the OCI console. It should have all the required user-defined groups and steps in the required order.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728306631742/850edbee-bc4c-4c18-87fb-c9d969f2f36e.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<h3 id="heading-standalone-fsdr-scripts"><strong>Standalone FSDR Scripts:</strong></h3>
<p>As mentioned earlier, CD3 toolkit offers broad capabilities of managing OCI Infrastructure using excel based templates. In case if you would like just use the FSDR scripts alone, you can also use as a standalone scripts.</p>
<p>Excel template, export, and update scripts are available <a target="_blank" href="https://github.com/oracle-devrel/cd3-automation-toolkit/tree/main/othertools/oci-fsdr">here</a>. You need to make sure you have installed the required Python packages and have required OCI authentication to use those scripts.</p>
<h3 id="heading-conclusion"><strong>Conclusion:</strong></h3>
<p>The CD3 Automation Toolkit offers a powerful and efficient way to manage OCI resources through Infrastructure as Code and scripts. By leveraging Excel templates, users can easily export, update, and manage Full Stack Disaster Recovery plans, ensuring seamless integration and management of user-defined steps. The toolkit's ability to automate and streamline these processes not only saves time but also reduces the risk of errors associated with manual configurations. Additionally, the option to use FSDR scripts as standalone tools provides flexibility for users who wish to focus solely on disaster recovery management. Overall, the CD3 Automation Toolkit enhances the agility and reliability of cloud operations, making it an invaluable resource for organizations utilizing OCI.</p>
<h3 id="heading-additional-resources">Additional Resources:</h3>
<ul>
<li><p><a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/index.html"><strong>OCI Full Stack Disaster Recovery Documentation</strong></a></p>
</li>
<li><p><a target="_blank" href="https://docs.oracle.com/en/learn/full-stack-dr-run-command/"><strong>Full Stack DR run command</strong></a></p>
</li>
<li><p><a target="_blank" href="https://blogs.oracle.com/maa/post/iam-policies-fullstackdr"><strong>Full Stack DR IAM policies</strong></a></p>
</li>
<li><p><a target="_blank" href="https://github.com/oracle-samples/full-stack-disaster-recovery"><strong>OCI Full Stack Disaster Recovery - User defined group scripts</strong></a></p>
</li>
<li><p><a target="_blank" href="https://bit.ly/odevrel_slack"><strong>Join #full-stack-dr public slack channel</strong></a></p>
</li>
<li><p><a target="_blank" href="https://oracle-devrel.github.io/cd3-automation-toolkit/latest/">CD3 Toolkit</a></p>
</li>
<li><p><a target="_blank" href="https://oracle-devrel.github.io/cd3-automation-toolkit/latest/queries/">Join CD3 toolkit slack channel</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Automating Database Role Transitions in a Manual Data Guard with OCI Full Stack DR]]></title><description><![CDATA[Automate Oracle Database role transitions with Full Stack DR for enhanced disaster recovery in manually configured Data Guard setups]]></description><link>https://surajramesh.com/oracle-database-dataguard-fullstackdr</link><guid isPermaLink="true">https://surajramesh.com/oracle-database-dataguard-fullstackdr</guid><category><![CDATA[Oracle]]></category><category><![CDATA[Oraclecloudinfrastructure]]></category><category><![CDATA[fullstackdr]]></category><category><![CDATA[Oracle Database]]></category><category><![CDATA[Oracle 23ai]]></category><dc:creator><![CDATA[Suraj Ramesh]]></dc:creator><pubDate>Wed, 03 Jul 2024 12:49:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/rH8O0FHFpfw/upload/44355ed67085048756b05722fad701ff.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-introduction">Introduction</h3>
<p>When you create any of the supported <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/disaster-recovery-terminology.html">DR plans</a> using OCI Full Stack DR, OCI Full Stack DR provides built-in modules for the Oracle Database PaaS listed below, as long as Data Guard was set up using the Cloud automation available from those services.</p>
<ol>
<li><p>Oracle Base DB</p>
</li>
<li><p>Oracle Exadata DB on dedicated infrastructure</p>
</li>
</ol>
<p>Customers might use Oracle Base DB or Oracle Exadata DB on dedicated infrastructure with manual data configuration for various use cases, such as multiple standbys or <a target="_blank" href="https://docs.oracle.com/en/database/oracle/oracle-database/19/dgbkr/using-data-guard-broker-to-manage-switchovers-failovers.html#GUID-995CED84-BEA1-4675-9C68-B37CB996924F">Fast-Start Failover (FSFO)</a>.Customers sometimes run Oracle Database in OCI Standard Compute VMs with Data Guard. To integrate these types of Oracle Databases with Full Stack DR, you can customize the DR plans with <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/add-user-defined-plan-groups.html">user-defined plan groups</a> and manage database role changes using scripts or OCI functions.</p>
<p>In this blog, I will show you how to use Full Stack DR to automate role changes for databases where Data Guard is manually configured on a Base DB system.</p>
<h3 id="heading-architecture">Architecture</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720002090883/5c804e24-1f0b-41c3-b26b-e6ccedf71e28.png" alt="Architecture " class="image--center mx-auto" /></p>
<p>For simplicity, all the resources used in this blog are in the same region across two Availability Domains in the Ashburn region. This should also work for cross-region Data Guard. I have used the Base DB system for Oracle DB. Ideally, as part of Full Stack DR plans, you will have recovery steps for Compute, Storage, Database, Applications, etc. This blog covers only the Oracle DB recovery steps.</p>
<p><strong>Availability Domain 1:</strong></p>
<ol>
<li><p>Base DB System: adghol-qtv-iad (DB Unique name) ( Primary DB)</p>
</li>
<li><p>Compute VM: oel8-1 (VM to host scripts)</p>
</li>
</ol>
<p><strong>Availability Domain 2:</strong></p>
<ol>
<li><p>Base DB System : adghol-3px-iad (DB Unique name) (Standby DB)</p>
</li>
<li><p>Compute VM: oel8-2 (VM to host scripts)</p>
</li>
</ol>
<p><strong>Regional:</strong></p>
<ol>
<li>DR Protection Group (DRPG) : DB-AD1 and DB-AD2</li>
</ol>
<h3 id="heading-pre-requisites">Pre-requisites:</h3>
<ol>
<li><p>Oracle Data Guard has been manually set up between the two Base DB systems. Ensure the databases have the correct roles. For additional details, refer to <a target="_blank" href="https://docs.oracle.com/en/database/oracle/oracle-database/23/sbydb/creating-oracle-data-guard-physical-standby.html#GUID-B511FB6E-E3E7-436D-94B5-071C37550170">Oracle Data Guard documentation</a>.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720003352116/3840bcbd-360d-4ae3-af77-7dc5b3e80593.png" alt="DB Roles" class="image--center mx-auto" /></p>
</li>
<li><p>We will use oel8-1 and oel8-2 for running the scripts. Make sure to prepare the VMs to use the run command feature. For more details, refer <a target="_blank" href="https://docs.oracle.com/en/learn/full-stack-dr-run-command/">Full Stack DR run command</a>.</p>
</li>
<li><p>Install the <a target="_blank" href="https://www.oracle.com/in/database/technologies/instant-client/downloads.html">Oracle Client</a> on both VMs, oel8-1 and oel8-2. This will help connect to the database through TNS. Update the necessary security lists to allow the VMs to connect to the database.</p>
</li>
<li><p>Create scripts for performing the DB role reversal using DGMGRL commands. I have placed the <code>"changedbrole.sh"</code> script in the /home/opc/dbscripts folder on both VMs.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720004016739/c59c4d3b-cc21-4624-b725-f0b1915cf387.png" alt class="image--center mx-auto" /></p>
<p> Example: For Switchover from AD1 to AD2, run</p>
<p> <code>/home/opc/dbscripts/changedbrole.sh switchover adghol_qtv_iad adghol_3px_iad</code></p>
</li>
</ol>
<p>You can use any script, as long as you can handle the DB role changes.</p>
<ol start="5">
<li><p>Ensure the script works correctly for operations like switchover, failover, converting to snapshot standby, and converting to physical standby.</p>
</li>
<li><p>Scripts are available at <a target="_blank" href="https://github.com/surajmr/scripts">https://github.com/surajmr/scripts</a>.</p>
</li>
</ol>
<p><strong><mark>The scripts provided herein are for informational purposes only. Users must independently review and understand all security requirements pertaining to their corporate security policies and governance frameworks before use.</mark></strong></p>
<h3 id="heading-integration-with-full-stack-dr">Integration with Full Stack DR</h3>
<ol>
<li><p>Create DRPG's DB-AD1 and DB-AD2 in the Ashburn region. Assign DB-AD1 as the Primary role and DB-AD2 as the Standby role.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720004687291/e579729e-3cbf-47b9-8cc4-e1a2bb78c186.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Add "oel8-1" to DB-AD1 (DRPG) as a non-moving member and "oel8-2" to DB-AD2 (DRPG) as a non-moving member. Since we have configured Data Guard manually, there is no need to add Oracle Database as a member.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720004952343/9d3f8170-9936-45b0-8c6e-04ddbac04718.png" alt class="image--center mx-auto" /></p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720005052630/6bd41c76-1e88-4876-9143-c7263b651ee3.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Create DR plans in DB-AD2 DRPG. Full Stack DR lets you create a Stop drill plan only after completing the Start drill. Initially, you won't see all four plan types, but I created the Stop drill plan once the Start drill plan was done.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720005453337/9d5f2616-ac4d-4b4b-8b19-d55dce2c5044.png" alt class="image--center mx-auto" /></p>
</li>
<li><p>Customize the DR plans with user-defined plan groups using the <code>"changedbrole.sh"</code> script. Here, I have added a user-defined plan group for the switchover plan with the script details.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720005617379/a8fe2824-5c7e-4b1f-abb1-3bb93608bbb6.png" alt class="image--center mx-auto" /></p>
</li>
</ol>
<p>Similarly, I added the necessary user-defined plan groups for the respective plans.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>DR Plan type</strong></td><td><strong>DR plans</strong></td><td><strong>Script</strong></td></tr>
</thead>
<tbody>
<tr>
<td>Switchover</td><td>DB Switchover-AD1-AD2</td><td><code>/home/opc/dbscripts/changedbrole.sh switchover adghol_qtv_iad adghol_3px_iad</code></td></tr>
<tr>
<td>Failover</td><td>DB Failover-AD1-AD2</td><td><code>/home/opc/dbscripts/changedbrole.sh failover adghol_qtv_iad adghol_3px_iad</code></td></tr>
<tr>
<td>Start drill</td><td>DB StartDrill (Snapshot Standby)-AD1-AD2</td><td><code>/home/opc/dbscripts/changedbrole.sh convert_to_snapshot adghol_qtv_iad adghol_3px_iad</code></td></tr>
<tr>
<td>Stop drill</td><td>DB StopDrill ( Physical Standby)-AD1-AD2</td><td><code>/home/opc/dbscripts/changedbrole.sh convert_to_physical adghol_qtv_iad adghol_3px_iad</code></td></tr>
</tbody>
</table>
</div><ol start="5">
<li>Test all the DR plans and verify their successful execution.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720006404720/c4550a68-e789-4325-bbdf-bc85c5422daf.png" alt class="image--center mx-auto" /></p>
<blockquote>
<p>If you execute a failover plan, you need to reinstate the failed primary database (<code>adghol_qtv_iad</code>) as soon as it becomes available. This must be done outside of the Full Stack DR plan.</p>
</blockquote>
<ol start="6">
<li><p>Similarly, I have created all four types of DR plans in the other DB-AD1 (DRPG). Full Stack DR allows creating plans in the DRPG with a Standby role, so make sure to create the plans accordingly.</p>
</li>
<li><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720007918955/497e57d0-832a-4c0f-9092-3bff2fc602a2.png" alt class="image--center mx-auto" /></p>
<p> Customize the DR plans with user-defined plan groups using the <code>dbrolechange.sh</code> script. Here, I have added a user-defined plan group for the switchover plan with the script details.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720008724562/2b9ec2bf-7e03-4d0a-89ab-59e23b7aace3.png" alt class="image--center mx-auto" /></p>
<p> Similarly, I have added the necessary user-defined plan groups for each respective plan.</p>
</li>
</ol>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>DR Plan type</strong></td><td><strong>DR plans</strong></td><td><strong>Script</strong></td></tr>
</thead>
<tbody>
<tr>
<td>Switchover</td><td>DB Switchover-AD2-AD1</td><td><code>/home/opc/dbscripts/changedbrole.sh switchover adghol_3px_iad adghol_qtv_iad</code></td></tr>
<tr>
<td>Failover</td><td>DB Failover-AD2-AD1</td><td><code>/home/opc/dbscripts/changedbrole.sh failover adghol_3px_iad adghol_qtv_iad</code></td></tr>
<tr>
<td>Start drill</td><td>DB StartDrill (Snapshot Standby)-AD2-AD1</td><td><code>/home/opc/dbscripts/changedbrole.sh convert_to_snapshot adghol_3px_iad adghol_qtv_iad</code></td></tr>
<tr>
<td>Stop drill</td><td>DB StopDrill ( Physical Standby)-AD2-AD1</td><td><code>/home/opc/dbscripts/changedbrole.sh convert_to_physical adghol_3px_iad adghol_qtv_iad</code></td></tr>
</tbody>
</table>
</div><ol start="8">
<li>Test all the DR plans and verify their successful execution.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720009251749/ae3926fe-72f2-4aec-9434-7750ea2f9429.png" alt class="image--center mx-auto" /></p>
<blockquote>
<p>If you execute a failover plan, you need to reinstate the failed primary database (<code>adghol_3px_iad</code>) as soon as it becomes available. This must be done outside of the Full Stack DR plan.</p>
</blockquote>
<ol start="9">
<li>Considering you now have all four plan types available in both DB-AD1 and DB-AD2 DRPGs, the plans will become active or inactive depending on the DRPG role. The Primary DRPG will have plans in an <strong>inactive</strong> state, while the Standby DRPG will have plans in an <strong>active</strong> state.</li>
</ol>
<blockquote>
<p>Drill plans will become active during the drill plan execution.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720009444721/c6649581-82f8-4885-81da-3f5674b61cec.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1720009625566/560e6ef1-e7b2-4fa9-824f-c46487deefb0.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-conclusion">Conclusion:</h3>
<p>In conclusion, we have learned how to automate Oracle Database roles with Full Stack DR for Oracle Databases using manual Data Guard configuration. This can greatly improve the efficiency and reliability of your disaster recovery plans. By following the outlined steps, you can easily integrate manually configured Data Guard setups into Full Stack DR, ensuring smooth role transitions and strong protection for your Oracle databases and your Full Stack.</p>
<h3 id="heading-additional-resources">Additional Resources:</h3>
<ul>
<li><p><a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/index.html">OCI Full Stack Disaster Recovery Documentation</a></p>
</li>
<li><p><a target="_blank" href="https://docs.oracle.com/en/learn/full-stack-dr-run-command/">Full Stack DR run command</a></p>
</li>
<li><p><a target="_blank" href="https://blogs.oracle.com/maa/post/iam-policies-fullstackdr">Full Stack DR IAM policies</a></p>
</li>
<li><p><a target="_blank" href="https://github.com/oracle-samples/full-stack-disaster-recovery">OCI Full Stack Disaster Recovery - User defined group scripts</a></p>
</li>
<li><p><a target="_blank" href="https://bit.ly/odevrel_slack">Join #full-stack-dr public slack channel</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[How to Install Oracle Database 23ai Free Container Image on MacBook Pro]]></title><description><![CDATA[Learn how to install Oracle Database 23ai Free Container Image on a MacBook Pro using Podman]]></description><link>https://surajramesh.com/how-to-install-oracle-database-23ai-free-container-image-on-macbook-pro</link><guid isPermaLink="true">https://surajramesh.com/how-to-install-oracle-database-23ai-free-container-image-on-macbook-pro</guid><category><![CDATA[Oracle 23ai]]></category><category><![CDATA[Oracle]]></category><category><![CDATA[Oracle Database]]></category><category><![CDATA[Oraclecloudinfrastructure]]></category><dc:creator><![CDATA[Suraj Ramesh]]></dc:creator><pubDate>Thu, 23 May 2024 13:11:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1716470014119/acd8225a-882a-4549-88cc-b39e7e755a8f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>***TLDR:***<em>Oracle Database 23ai, rebranded from 23c, introduces over 300 new features focused on AI, development, and mission-critical data. This guide explains how to install and connect to Oracle Database 23ai using a free container image on a MacBook Pro with an Intel chip, utilising Podman for container management. The process includes setting up Podman, creating the container, and connecting to the database both inside and outside the container.</em></p>
<p><a target="_blank" href="https://blogs.oracle.com/database/post/oracle-23ai-now-generally-available">Oracle Database 23ai's general availability was announced earlier this month</a>. It includes over 300 new features and thousands of enhancements, focusing on three key areas:</p>
<ul>
<li><p>AI for Data</p>
</li>
<li><p>Dev for Data</p>
</li>
<li><p>Mission Critical for Data</p>
</li>
</ul>
<p>If you're wondering about Oracle Database 23c, it has been rebranded as Oracle Database 23ai due to the significant AI technology in this release. Oracle Database 23ai is version 23.4.0.0.0 and will be referred to as such from now on.</p>
<h3 id="heading-oracle-database-23ai-how-to-access">Oracle Database 23ai - How to Access</h3>
<p>Oracle Database 23ai can be installed or used through various options:</p>
<ol>
<li><p><strong>Local System or On-Premises Machine or Any Cloud Provider VMs</strong></p>
<ul>
<li><p>Oracle Database 23ai Free</p>
</li>
<li><p>Autonomous Database 23ai Free Container Image</p>
</li>
</ul>
</li>
<li><p><strong>Oracle Cloud Infrastructure - Oracle Database Managed Services</strong></p>
<ul>
<li><p>Oracle Database 23ai on Exadata Cloud@Customer</p>
</li>
<li><p>Oracle Database 23ai on Exadata Database Service</p>
</li>
<li><p>Oracle Database 23ai on Base Database Service</p>
</li>
<li><p>Oracle Database 23ai on Oracle Autonomous Database (only free tier)</p>
</li>
</ul>
</li>
<li><p><strong>Microsoft Azure - Oracle Database 23ai on Exadata Database Service</strong></p>
</li>
</ol>
<p>Please take a look at <a target="_blank" href="https://support.oracle.com/epmos/faces/DocumentDisplay?id=742060.1">My Oracle Support (MOS) note 742060.1</a> for updates on our release schedule for on-premises deployment.</p>
<p><strong>In this blog, I will explain how to install Oracle Database 23c using an Oracle Database 23ai Free container image on a MacBook Pro with an Intel chip.</strong></p>
<h3 id="heading-create-oracle-database-23ai-using-free-container-image">Create Oracle Database 23ai using Free Container Image</h3>
<ol>
<li>We will use <a target="_blank" href="https://podman.io/">Podman</a> to install and manage Oracle Database containers. I will install Podman Desktop using the Homebrew package manager. Open a terminal and run the following command:</li>
</ol>
<pre><code class="lang-plaintext">brew install podman-desktop
</code></pre>
<p>Install the homebrew package manager in case you don't have that</p>
<pre><code class="lang-plaintext">/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
</code></pre>
<p><strong><mark>If you're using a Mac with M1, M2, or M3 chips, you'll need to install Colima and Docker. For all the commands throughout the rest of the blog, replace every 'podman' command with 'docker'.</mark></strong></p>
<pre><code class="lang-plaintext">brew install docker

brew install docker-compose

brew install colima

brew reinstall qemu

colima start --cpu 4 --memory 8 --arch x86_64
</code></pre>
<ol start="2">
<li><strong>All the instructions are applicable for MacBook Pro with Intel chip and using Podman.</strong> After installing Podman, you need to create and start your first Podman machine:</li>
</ol>
<pre><code class="lang-plaintext">podman machine init
podman machine set --cpus 4 --memory 8192
podman machine start
</code></pre>
<p><strong><em>Modify the CPU and memory size based on your requirements</em></strong></p>
<ol start="3">
<li>Open the Podman Desktop and verify the Podman machine is running.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1715862473101/632a8b3d-1e85-473e-adf8-151b8ad9adfe.png" alt="Podman Machine" class="image--center mx-auto" /></p>
<ol start="4">
<li>To start an Oracle Database 23ai instance, run the following command, where <strong>23aidb</strong> is the container name. If you'd like to use a different name, please just change the container's name. I am also mapping port <strong>1522</strong> (the local host) to the container port (<strong>1521</strong>); this will help when connecting to the database from outside the container.</li>
</ol>
<pre><code class="lang-plaintext">podman run -d --name 23aidb \
-p 1522:1521 \
container-registry.oracle.com/database/free:latest
</code></pre>
<p>Depending on the network bandwidth,pulling the container image and starting the container will take a few minutesr.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716467620863/d7c278a6-4608-48e5-84e8-dc776b2b8c18.png" alt="Oracle DB 23ai container" class="image--center mx-auto" /></p>
<p>In case you want to create a database with a custom configuration, you can do that using the reference below.</p>
<pre><code class="lang-plaintext">podman run --name &lt;container name&gt; \
-P | -p &lt;host port&gt;:1521 \
-e ORACLE_PWD=&lt;your database passwords&gt; \
-e ORACLE_CHARACTERSET=&lt;your character set&gt; \
-e ENABLE_ARCHIVELOG=true \
-e ENABLE_FORCE_LOGGING=true \
-v [&lt;host mount point&gt;:]/opt/oracle/oradata \
container-registry.oracle.com/database/free:latest
</code></pre>
<p>Parameters:</p>
<p>--name: The name of the container (default: auto generated)</p>
<p>-P | -p: The port mapping of the host port to the container port. Only one port is exposed: 1521 (Oracle Listener)</p>
<p>-e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated)</p>
<p>-e ORACLE_CHARACTERSET: The character set to use when creating the database (default: AL32UTF8)</p>
<p>-e ENABLE_ARCHIVELOG: To enable archive log mode when creating the database (default: false)</p>
<p>-e ENABLE_FORCE_LOGGING: To enable force logging mode when creating the database (default: false)</p>
<p>-v /opt/oracle/oradata The data volume to use for the database. Has to be writable by the Unix "oracle" (uid: 54321) user inside the container. If omitted the database will not be persisted over container recreation.</p>
<p>-v /opt/oracle/scripts/startup Optional: A volume with custom scripts to be run after database startup. For further details see the "Running scripts after setup and on startup" section below.</p>
<ol start="5">
<li>Verify the container using the below command.</li>
</ol>
<pre><code class="lang-plaintext">podman container ls
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716469343983/cbe6a215-8e0f-4479-9916-f248f700f6cd.png" alt class="image--center mx-auto" /></p>
<p><mark>Status should show Up(healthy)</mark></p>
<ol start="6">
<li>During container creation, random passwords are assigned to SYS, SYSTEM and PDBADMIN users. You can change passwords for those users using the below command. Replace the container name and password.</li>
</ol>
<pre><code class="lang-plaintext">podman exec 23aidb ./setPassword.sh m#P52sap$V
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716469460536/a4640d37-e506-4227-bee4-33b32a25c783.png" alt class="image--center mx-auto" /></p>
<ol start="7">
<li>You can monitor the database alert log using</li>
</ol>
<pre><code class="lang-plaintext">podman logs 23aidb
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716469499248/2caec1c3-ce59-4fef-af77-0873571cb908.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-connect-the-oracle-database-23ai">Connect the Oracle Database 23ai</h3>
<p>You can connect the database if the container has started and shows a 'healthy' status.</p>
<ol>
<li>Connect to the Database using any of the preferred users. Replace the container name and passwords accordingly.</li>
</ol>
<pre><code class="lang-plaintext">podman exec -it 23aidb sqlplus sys/m#P52sap$V@FREE as sysdba
podman exec -it 23aidb sqlplus system/m#P52sap$V@FREE
podman exec -it 23aidb sqlplus pdbadmin/m#P52sap$V@FREEPDB1
</code></pre>
<p>I have connected to the database using sys user.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716465964253/e21b67fe-fe0f-4820-980d-b9c066218ff8.png" alt class="image--center mx-auto" /></p>
<ol start="2">
<li>If you want to connect to the database from outside the container, you can through TNS using the ports which was used during the container creation. I am using <a target="_blank" href="https://www.oracle.com/database/sqldeveloper/technologies/sqlcl/">Oracle SQL Developer Command Line (SQLcl)</a> to connect to the database. If you don't have SQLcl, you can install it using the command below or use sqlplus.</li>
</ol>
<pre><code class="lang-plaintext">brew install sqlcl
</code></pre>
<ol start="3">
<li>Export the SQLcl location to the PATH variable</li>
</ol>
<pre><code class="lang-plaintext">export PATH=/usr/local/Caskroom/sqlcl/24.2.0.180.1721/sqlcl/bin:"$PATH"
</code></pre>
<ol start="4">
<li>Connect to the database from outside the container. I have used port 1522 during the container creation, modify the port number if you have used a different one.</li>
</ol>
<pre><code class="lang-plaintext">sql sys/m#P52sap$V@//localhost:1522/FREE as sysdba
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1716468377601/33eb15f0-9da5-43a7-a869-78de36457c66.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-conclusion">Conclusion:</h3>
<p>Getting started with Oracle Database 23ai using the Free container image is straightforward and allows you to leverage the latest advancements in AI, development, and mission-critical features. By following the steps outlined, you can efficiently set up and connect to Oracle Database 23ai on your MacBook Pro, enabling you to explore its robust capabilities and integrate them into your projects. Whether you're a developer, data scientist, or database administrator, Oracle Database 23ai offers powerful tools to enhance your data management and application development endeavours.</p>
<p>In the upcoming blogs, we will explore some of the exciting Oracle Database 23ai features. Stay tuned!</p>
<p><strong>Update</strong>: A <a target="_blank" href="https://www.youtube.com/watch?v=6jiCo0zytw0&amp;t=183s">video recording</a> is available for this blog.</p>
<h3 id="heading-references">References:</h3>
<ol>
<li><p><a target="_blank" href="https://medium.com/oracledevs/run-oracle-23ai-as-a-free-autonomous-db-container-on-macbook-pro-d83a90a44906">https://medium.com/oracledevs/run-oracle-23ai-as-a-free-autonomous-db-container-on-macbook-pro-d83a90a44906</a></p>
</li>
<li><p>Oracle Database 23ai - <a target="_blank" href="https://www.oracle.com/database/23ai/">https://www.oracle.com/database/23ai/</a></p>
</li>
<li><p>Oracle Database 23ai get started- <a target="_blank" href="https://www.oracle.com/in/database/free/get-started/">https://www.oracle.com/in/database/free/get-started/</a></p>
</li>
<li><p>Podman - <a target="_blank" href="https://podman.io/">https://podman.io/</a></p>
</li>
</ol>
]]></content:encoded></item><item><title><![CDATA[How to Implement Full Stack Disaster Recovery in OCI: Best Practices]]></title><description><![CDATA[OCI Full Stack DR best practices]]></description><link>https://surajramesh.com/how-to-implement-full-stack-disaster-recovery-in-oci-best-practices</link><guid isPermaLink="true">https://surajramesh.com/how-to-implement-full-stack-disaster-recovery-in-oci-best-practices</guid><category><![CDATA[fullstackdr]]></category><category><![CDATA[Oraclecloudinfrastructure]]></category><category><![CDATA[Oracle]]></category><category><![CDATA[Disaster recovery]]></category><dc:creator><![CDATA[Suraj Ramesh]]></dc:creator><pubDate>Wed, 10 Apr 2024 18:12:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/7r7-7RLdwCU/upload/6df9a6d70ba717e180c0f7297078961c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this blog, I will cover some of the best practices for implementing the OCI Full Stack DR for your business system.</p>
<ol>
<li><p><strong><mark>IAM Policies</mark>:</strong> Full Stack DR interacts <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/how-disaster-recovery-works.html#GUID-F4D767CB-4DC2-4506-B1FD-D00379151DEE">with a variety of OCI services</a> such as Compute, Oracle Database, Block Storage, File Storage, and Load Balancers. It's crucial to ensure the user managing the Full Stack DR is equipped with the appropriate IAM policies. Carefully setting up the necessary IAM policies and dynamic groups for the Full Stack DR administrator or user is a step that must be considered. For further guidance, please refer to this blog: <a target="_blank" href="https://blogs.oracle.com/maa/post/iam-policies-fullstackdr">https://blogs.oracle.com/maa/post/iam-policies-fullstackdr</a></p>
</li>
<li><p><mark>User-defined plan group execution command:</mark> Full Stack DR enables users to tailor their disaster recovery plans according to specific needs through the use of <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/add-user-defined-plan-groups.html">User-defined plan groups.</a> It is imperative that users ensure all prerequisites for executing user-defined scripts are met. For additional information and guidance, please consult this tutorial: <a target="_blank" href="https://docs.oracle.com/en/learn/full-stack-dr-run-command/index.html">https://docs.oracle.com/en/learn/full-stack-dr-run-command/index.html</a></p>
</li>
<li><p><mark>Always create various DR plan types</mark>: Full Stack DR enables the creation of various <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/dr-plans-type.html">Disaster Recovery (DR) plans</a>, including <strong>Switchover (planned), Failover (Unplanned), Start Drill, and Stop Drill.</strong> It is advisable to create and customize all these plan types within both the primary and standby DR protection groups. It's important to note that the <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/dr-plans-type.html">Stop Drill</a> plan can only be created after the completion of the Start Drill plan.</p>
</li>
<li><p><strong><mark>Create disaster recovery (DR) plans for both DR protection groups: </mark></strong> Full Stack DR lets you set up <strong><em>DR plans in the Standby DR protection group, meaning you can only run DR plans from your Standby region</em></strong>. Imagine "APP-IAD" and "APP-PHX" protection groups are set as Primary and Standby, respectively. You can switch from "APP-IAD" to "APP-PHX" using the switchover plan in the "APP-PHX" group. After switching, the roles of the DR protection groups change; "APP-PHX" becomes the Primary, and "APP-IAD" takes on the Standby role. If you need to switch back, you have to create DR plans in "APP-IAD". It's crucial to plan this from the start, so you have your DR plans ready in both "APP-IAD" and "APP-PHX" for whichever region you need to switch to. This is also true for other DR plan types like Failover and DR Drills.</p>
</li>
<li><p><strong><mark>Automating DR plan creation:</mark></strong> Just a heads up, if you find yourself needing to add or remove members, or change certain properties of members, our current setup will automatically delete existing DR plans. But don't worry, we'll give you a heads-up warning when you're about to make changes to the protection group.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1712763835192/4b81ac51-ded1-4282-9fd3-a74332f8c9ef.png" alt="Member addition or removal warning" class="image--center mx-auto" /></p>
<p> The Good news is, we're on it! We're working on making this process smoother, so in the future, any changes you make will simply refresh the plans instead of deleting them. For now, we recommend using OCI CLI scripts to quickly recreate your plan until this update is ready. Check out this tutorial for a step-by-step guide: <a target="_blank" href="https://docs.oracle.com/en/learn/full-stack-dr-oci-cli-command/index.html">https://docs.oracle.com/en/learn/full-stack-dr-oci-cli-command/index.html</a></p>
</li>
<li><p><strong><mark>Run regular prechecks</mark></strong><mark>:</mark> Whenever you set up a DR plan with Full Stack DR, we automatically generate <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/prechecks-dr-plan-executions.html">built-in prechecks</a> for you. We strongly advise running these pre-checks before you kick off your DR plan. But wait, there's more! You can also craft your own script to trigger these prechecks and even schedule them through cronjob or your favorite automation tools. This way, you'll always have your prechecks report ready and be one step ahead!</p>
</li>
</ol>
<h3 id="heading-conclusion">Conclusion:</h3>
<p>In summary, the journey to implementing Full Stack Disaster Recovery in OCI is paved with detailed planning, strategic execution, and regular maintenance. By adhering to best practices such as configuring IAM policies, customizing DR plans, and automating processes where possible, businesses can ensure a robust defense against potential disasters. Regular prechecks and updates to DR plans as your infrastructure evolves are crucial steps in maintaining the effectiveness of your disaster recovery strategy. Stay tuned for more in-depth discussions on each of these facets to further fortify your OCI Full Stack DR approach.</p>
]]></content:encoded></item><item><title><![CDATA[Mastering Resource Management: A Guide to Compartment Quotas in Oracle Cloud Infrastructure]]></title><description><![CDATA[Master Oracle Cloud cost control with Compartment Quotas guide for optimal resource use and avoiding budget excess]]></description><link>https://surajramesh.com/mastering-resource-management-a-guide-to-compartment-quotas-in-oracle-cloud-infrastructure</link><guid isPermaLink="true">https://surajramesh.com/mastering-resource-management-a-guide-to-compartment-quotas-in-oracle-cloud-infrastructure</guid><category><![CDATA[Oraclecloudinfrastructure]]></category><category><![CDATA[Oracle]]></category><category><![CDATA[Oracle Database]]></category><category><![CDATA[Cloud Computing]]></category><category><![CDATA[finops]]></category><dc:creator><![CDATA[Suraj Ramesh]]></dc:creator><pubDate>Tue, 26 Mar 2024 18:11:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/cUxF-FcFwL4/upload/6124926596916c7e89f1d97da2c6b6d8.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Oracle Cloud Infrastructure (OCI) provides various billing and cost management tools to help you easily monitor and manage your service costs. These tools feature a user-friendly interface, allowing you to access detailed billing reports, cost analysis, and budgeting options. With OCI's cost management solutions, tracking your spending, identifying ways to cut costs, and setting up alerts to prevent budget overruns is straightforward. Whether you're managing a small project or a large enterprise, OCI's billing tools offer a clear insight into your financial commitments, enabling you to make informed decisions about your cloud infrastructure spending.</p>
<p>In this blog, I will explain Compartment Quotas and how they will help control the resource allocation in OCI. Before that, let's revisit some of the concepts and terminologies related to this feature.</p>
<ul>
<li><p><strong><mark>Compartment</mark></strong> -- A compartment acts as a fundamental organisational unit. It's a logical container that groups related OCI resources together.</p>
</li>
<li><p><strong><mark>Budgets</mark></strong> -- It acts as a virtual guardrail for your cloud spending. Setting up budgets will help you monitor and manage your OCI expenses by setting spending limits and configuring alerts.</p>
</li>
<li><p><strong><mark>Service limit</mark></strong> -- Your tenancy has certain limits on the maximum number of resources you're allowed to use; Oracle sets these values. For example, you can create 10 Full Stack DR protection groups in a specific OCI region. For more details, refer to <a target="_blank" href="https://docs.oracle.com/en-us/iaas/Content/General/Concepts/servicelimits.htm">OCI Service limits</a>. An OCI administrator can contact Oracle support to increase the service limits for various services depending on the requirement.</p>
</li>
</ul>
<p>With this background information, let's dive into the details of Compartment Quotas.</p>
<h3 id="heading-why-you-need-compartment-quotas">Why you need Compartment Quotas:</h3>
<p>Let's assume the necessary OCI users have been created, and the appropriate IAM policies have been assigned to the respective teams according to their roles. This setup enables OCI users to create the needed OCI resources within the service limits set for each resource.</p>
<p>To check the service limits, go to the OCI console, open the navigation menu, and click <strong>Governance &amp; Administration</strong>. Then, under <strong>Tenancy Management</strong>, select <strong>Limits, Quotas and Usage</strong>.</p>
<p>In our example, we'll look at an IAM user named "Dbadmin", who has been given the following IAM policy to manage the autonomous database family in the production compartment.</p>
<pre><code class="lang-yaml"><span class="hljs-string">Allow</span> <span class="hljs-string">group</span> <span class="hljs-string">DatabaseAdmins</span> <span class="hljs-string">to</span> <span class="hljs-string">manage</span> <span class="hljs-string">autonomous-database-family</span> <span class="hljs-string">in</span> <span class="hljs-string">compartment</span> <span class="hljs-string">suraj</span>
</code></pre>
<p>Suppose the service limits allow it, instead of creating an Autonomous Transaction Processing Database with 5 ECPU and 2TB. The "DBADMIN" user accidentally created an Autonomous Transaction Processing Serverless Database with 50 ECPU and 20 TB. This mistake could lead to significant costs!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1711457068561/29a32fc1-8bd1-490a-8819-894738207bbf.png" alt="Creating ATP Database" class="image--center mx-auto" /></p>
<p>How can you avoid this? Compartment Quotas are the solution. They give tenant and compartment administrators better control over resource usage in OCI. Administrators can efficiently allocate resources to compartments using the Console.</p>
<h3 id="heading-what-is-compartment-quotas">What is Compartment Quotas:</h3>
<p>Compartment quotas are similar to <a target="_blank" href="https://docs.oracle.com/iaas/Content/General/Concepts/servicelimits.htm">service limits</a>. The main difference is that Oracle sets service limits, while administrators set compartment quotas. Administrators use policies to allocate resources flexibly.</p>
<p>Compartment quotas are established through <em>policy statements</em> crafted in straightforward declarative language, akin to the IAM policy language.</p>
<p>There are <strong>three types</strong> of quota policy statements you can use:</p>
<ul>
<li><p><code>set</code>: Defines the maximum amount of a cloud resource that a compartment can utilise.</p>
</li>
<li><p><code>unset</code>: Reverts quotas to the default service limits.</p>
</li>
<li><p><code>zero</code>: Denies access to a cloud resource for a compartment.</p>
</li>
</ul>
<h3 id="heading-how-to-use-compartment-quotas">How to use Compartment Quotas:</h3>
<p>Let see how we can use Compartment Quotas and allocate quotas for creating Autonomous Transaction Processing Serverless DB with 5 ECPU and 5 TB.</p>
<p>To create a Quota Policy, from the OCI console, open the navigation menu and click <strong>Governance &amp; Administration</strong>. Under <strong>Tenancy Management</strong>, click <strong>Quota Policies</strong></p>
<ol>
<li><p>Click Create Quota</p>
</li>
<li><p>Provide a name and description</p>
</li>
<li><p>Add the policy details in the Quota policy section</p>
</li>
</ol>
<pre><code class="lang-yaml"><span class="hljs-string">zero</span> <span class="hljs-string">database</span> <span class="hljs-string">quota</span> <span class="hljs-string">in</span> <span class="hljs-string">compartment</span> <span class="hljs-string">suraj</span>
<span class="hljs-string">set</span> <span class="hljs-string">database</span> <span class="hljs-string">quota</span> <span class="hljs-string">atp-ecpu-count</span> <span class="hljs-string">to</span> <span class="hljs-number">5</span> <span class="hljs-string">in</span> <span class="hljs-string">compartment</span> <span class="hljs-string">suraj</span>
<span class="hljs-string">set</span> <span class="hljs-string">database</span> <span class="hljs-string">quota</span> <span class="hljs-string">atp-total-storage-tb</span> <span class="hljs-string">to</span> <span class="hljs-number">5</span> <span class="hljs-string">in</span> <span class="hljs-string">compartment</span> <span class="hljs-string">suraj</span>
</code></pre>
<p><mark>zero database quota statement will zero out all the database service limits.</mark></p>
<ol start="4">
<li>Click Create Quota Policy</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1711475255820/ce0a6e4e-3e3b-4120-b037-de7f7391be31.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-verify-compartment-quotas">Verify Compartment Quotas:</h3>
<p>Now try to create an Autonomous Transaction Processing Serverless database with 50 EPU and 50 TB; since we allowed only 5 ECPU and 5 TB, you will get an error!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1711459376661/ab64ab61-e465-4e1a-92fa-1d522c11b25c.png" alt="Quota policy preventing to create ATP DB" class="image--center mx-auto" /></p>
<p>It is possible to create quota policies and create the resources only in specific regions; in the example below, the user can create an Autonomous Transaction Processing Serverless database only in the Ashburn and Phoenix regions.</p>
<pre><code class="lang-yaml"><span class="hljs-string">Zero</span> <span class="hljs-string">database</span> <span class="hljs-string">quota</span> <span class="hljs-string">in</span> <span class="hljs-string">compartment</span> <span class="hljs-string">suraj</span>
<span class="hljs-string">set</span> <span class="hljs-string">database</span> <span class="hljs-string">quota</span> <span class="hljs-string">atp-ecpu-count</span> <span class="hljs-string">to</span> <span class="hljs-number">5</span> <span class="hljs-string">in</span> <span class="hljs-string">compartment</span> <span class="hljs-string">suraj</span> <span class="hljs-string">where</span> <span class="hljs-string">any</span> {<span class="hljs-string">request.region</span> <span class="hljs-string">=</span> <span class="hljs-string">us-ashburn-1</span>, <span class="hljs-string">request.region</span> <span class="hljs-string">=</span> <span class="hljs-string">us-phoenix-1</span>}
<span class="hljs-string">set</span> <span class="hljs-string">database</span> <span class="hljs-string">quota</span> <span class="hljs-string">atp-total-storage-tb</span> <span class="hljs-string">to</span> <span class="hljs-number">5</span> <span class="hljs-string">in</span> <span class="hljs-string">compartment</span> <span class="hljs-string">suraj</span> <span class="hljs-string">where</span> <span class="hljs-string">any</span> {<span class="hljs-string">request.region</span> <span class="hljs-string">=</span> <span class="hljs-string">us-ashburn-1</span>, <span class="hljs-string">request.region</span> <span class="hljs-string">=</span> <span class="hljs-string">us-phoenix-1</span>}
</code></pre>
<h3 id="heading-more-details-about-compartment-quotas">More details about Compartment Quotas:</h3>
<p>What are service family names, and where can I find them?</p>
<p>See <a target="_blank" href="https://docs.oracle.com/en-us/iaas/Content/Quotas/Concepts/resourcequotas_topic-Available_Quotas_by_Service.htm#AvailableQuotasByService">Available Quotas by Service</a>. Under each service, the family name is listed.</p>
<p>What are all the quota names, and where can I find them?</p>
<p>See <a target="_blank" href="https://docs.oracle.com/en-us/iaas/Content/Quotas/Concepts/resourcequotas_topic-Available_Quotas_by_Service.htm#AvailableQuotasByService">Available Quotas by Service,</a> which lists all quota names under each service.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Compartment quotas, set by administrators, dictate the maximum resources a compartment can use, differing from Oracle-set service limits. Administrators can specify, revoke, or deny resource usage within compartments by employing policy statements, ensuring cost-effective and efficient resource management. This guide covers the essentials of compartment quotas, including their creation, application, and verification, to prevent unauthorised or accidental overuse of resources, such as creating extensive databases and other OCI resources, thereby aiding in better cost management and resource optimisation in OCI.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding OCI Full Stack Disaster Recovery: Key Concepts]]></title><description><![CDATA[In this article, I aim to shed light on the various components and terminologies associated with OCI Full Stack DR. If you're curious to learn about OCI…]]></description><link>https://surajramesh.com/understanding-oci-full-stack-disaster-recovery-key-concepts</link><guid isPermaLink="true">https://surajramesh.com/understanding-oci-full-stack-disaster-recovery-key-concepts</guid><dc:creator><![CDATA[Suraj Ramesh]]></dc:creator><pubDate>Tue, 27 Feb 2024 06:54:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/Oz_J_FXKvIs/upload/2f78ac560146aa6b1cd8c997c0b29564.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, I aim to shed light on the various components and terminologies associated with OCI Full Stack DR. If you're curious to learn about OCI Full Stack DR and how to kickstart your journey with it, I recommend reading <a target="_blank" href="https://surajramesh.com/kickstart-your-journey-with-oci-full-stack-disaster-recovery-dr">this article</a>. Here, we will delve deeper into understanding its core aspects, from DR Protection Groups to DR Plan Execution.</p>
<ol>
<li><strong>DR Protection Groups</strong>: The DR protection group is the core resource type in Full Stack DR. It is a consistency group created to represent the business system or application. DR protection groups must be created and associated with the right roles. The DR Protection group's role can be primary or standby.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1708956145958/500f4d25-136d-4d12-ada6-7f26b128bd4c.png" alt="DR protection group with roles" class="image--center mx-auto" /></p>
<ol start="2">
<li><strong>Members</strong>: Members are the OCI resource types that can be added to the DR protection groups. The current list of supported members are</li>
</ol>
<ul>
<li><p>Compute - Virtual machine, Dedicated virtual machine host</p>
</li>
<li><p>Autonomous Database - Serverless</p>
</li>
<li><p>Database - (PaaS) - Oracle Base DB, Oracle Exadata DB on dedicated infrastructure</p>
</li>
<li><p>Volume Group</p>
</li>
<li><p>Load balancer</p>
</li>
<li><p>Network load balancer</p>
</li>
<li><p>File system</p>
</li>
</ul>
<p>Based on your application topology, adding the necessary resource types as members to both primary and standby DR protection groups is essential.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1708965673226/59be2bf1-5390-4c70-b7a7-15b7d6b813c6.png" alt class="image--center mx-auto" /></p>
<ol start="3">
<li><strong>DR Plans:</strong> A DR plan is a resource type that can be created in paired DR protection groups. DR plan consists of a set of plan groups and steps. There are four types of DR plans</li>
</ol>
<div class="hn-table">
<table>
<thead>
<tr>
<td><em>DR Plan Type</em></td><td><em>What</em></td><td><em>Use cases</em></td></tr>
</thead>
<tbody>
<tr>
<td>Switchover (Planned)</td><td>Performs a planned transition of services from the primary region to the standby region</td><td>Planned DR testing</td></tr>
<tr>
<td>Failover (Unplanned)</td><td>Performs an unplanned transition of services to the standby region</td><td>An unplanned outage to production region resources</td></tr>
<tr>
<td>Start drill</td><td>Brings up the replica of the production stack in the standby region. No impact on the production region.</td><td>DR mock testing</td></tr>
<tr>
<td>Stop drill</td><td>Terminates and reverses the roles of the resources created in the standby region by the start drill plan.</td><td>DR mock testing</td></tr>
</tbody>
</table>
</div><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1708966627310/853b0730-550d-4e0d-956c-3be39490fc0d.png" alt /></p>
<p><strong><mark>Creating, customising and executing the DR plans are possible only from the Standby DR protection group region.</mark></strong></p>
<ol start="4">
<li>DR plan groups: A group of steps in a DR Plan. DR plan can consist of multiple plan groups depending on the plan types. Plan groups in a DR plan will get executed sequentially.There are two types of DR plan groups.</li>
</ol>
<ul>
<li><p>Built-in plan groups: Automatically generated by Full Stack DR when creating a DR Plan. Plan groups will be generated based on the type of members and DR plans. Examples: Launch compute instance, switchover database, switchover volume groups.</p>
</li>
<li><p>User-defined plan groups: Plan groups or steps created by the user. You can use either a script or OCI function in user-defined plan groups.</p>
</li>
</ul>
<p>Plan groups can be reordered as per the application requirements. We don't recommend to reorder the built-in plan groups.</p>
<ol start="5">
<li>DR plan steps: A single indivisible execution unit in a DR Plan. Each plan step must belong to a plan group. All plan steps in a plan group will be executed in parallel.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709013530009/e0742561-d187-418f-9485-54401b4dace1.png" alt class="image--center mx-auto" /></p>
<ol start="6">
<li><strong>DR plan Prechecks</strong> – Prechecks are a predetermined set of checks associated with a DR Plan. Prechecks help to validate the DR readiness. When you create a DR plan by default, it will have a built-in prechecks plan group and steps.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709013985220/28effc9b-ba78-4e22-8a56-933ff0ea45e5.png" alt class="image--center mx-auto" /></p>
<p>You have the option to execute DR plan prechecks whenever it you want to validate the DR plan, successful prechecks will provide confidence to DR operators and ensure DR readiness.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709015274626/3bf00a20-9a84-4336-bbab-6bc51615af5d.png" alt class="image--center mx-auto" /></p>
<ol start="7">
<li>DR Plan Execution: DR Plan execution represents an execution of a DR plan. All the plan groups will be executed sequentially as per the order in the DR plan.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709015865704/3a645b9d-9b40-4e2f-88f8-08f69c22b7d9.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709015909512/09e6419d-cccb-4e9f-b480-aed05aaf82cc.png" alt class="image--center mx-auto" /></p>
<p>Once the plan is executed successfully, roles of the DR protection group will be swapped automatically.</p>
<p>In conclusion, OCI Full Stack DR offers a comprehensive solution for disaster recovery. With its flexibility to customize and execute DR plans from the Standby DR protection group region, it provides businesses the confidence in their ability to recover from disasters. The feature to add necessary resources as members based on application topology makes it adaptable to various business requirements. Moreover, the ability to perform DR readiness checks gives an additional layer of assurance. Thus, understanding and leveraging these features of OCI Full Stack DR can significantly enhance your disaster recovery strategy.</p>
<h2 id="heading-additional-resources"><strong>Additional resources</strong></h2>
<p>Here are some additional resources to help you get started with Full Stack Disaster Recovery:</p>
<ul>
<li><p><a target="_blank" href="https://www.oracle.com/cloud/full-stack-disaster-recovery/">Full Stack Disaster Recovery product page</a></p>
</li>
<li><p><a target="_blank" href="https://www.oracle.com/cloud/full-stack-disaster-recovery/tutorials/">Full Stack DR Tutorials</a></p>
</li>
<li><p><a target="_blank" href="https://www.youtube.com/playlist?list=PLKCk3OyNwIzuhTZbFY0d7pvbEUktcNqtH">Full Stack DR Videos</a></p>
</li>
<li><p><a target="_blank" href="https://apexapps.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3357">Try out Full Stack Disaster Recovery using our hands-on lab</a></p>
</li>
<li><p><a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/index.html">Full Stack Disaster Recovery User Guide</a></p>
</li>
<li><p><a target="_blank" href="https://docs.oracle.com/en-us/iaas/api/#/en/disaster-recovery/20220125/">Full Stack Disaster Recovery API Reference Guide</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Kickstart Your Journey with OCI Full Stack Disaster Recovery (DR)]]></title><description><![CDATA[OCI Full Stack DR getting started]]></description><link>https://surajramesh.com/kickstart-your-journey-with-oci-full-stack-disaster-recovery-dr</link><guid isPermaLink="true">https://surajramesh.com/kickstart-your-journey-with-oci-full-stack-disaster-recovery-dr</guid><category><![CDATA[fullstackdr]]></category><category><![CDATA[Oracle Cloud]]></category><category><![CDATA[Disaster recovery]]></category><dc:creator><![CDATA[Suraj Ramesh]]></dc:creator><pubDate>Wed, 03 Jan 2024 13:21:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/9HI8UJMSdZA/upload/cc0600a24f630a862cfe691d0938e8c3.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-oci-full-stack-dr"><strong>What is OCI Full Stack DR:</strong></h2>
<p><a target="_blank" href="https://www.oracle.com/cloud/full-stack-disaster-recovery/">OCI Full Stack Disaster Recovery (Full Stack DR)</a> provides a fully automated and comprehensive disaster recovery orchestration solution for all the layers of a full stack cloud application, including infrastructure, database, and the application middle tier. Using Full Stack DR, you can easily recover your full stack applications across OCI regions or availability domains within the same region.</p>
<h2 id="heading-benefits-of-oci-full-stack-dr"><strong>Benefits of OCI Full Stack DR:</strong></h2>
<ul>
<li><p>Lower operating expenses - Full Stack DR lowers operating expenses by reducing the time and number of people required to complete DR run time operations.</p>
</li>
<li><p>DR for existing systems - Customers don’t need to reconfigure or redeploy existing business systems before configuring Full Stack DR to orchestrate complex recovery processes automatically.</p>
</li>
<li><p>Reduce Complexity - Full Stack DR uses built-in intelligence to automatically generate DR plans for the compute, storage, database and networking components.</p>
</li>
<li><p>Disaster Recovery at Scale - Full Stack DR provides the same simple process to execute DR operations for all your business systems with minimal human interaction.</p>
</li>
</ul>
<h2 id="heading-features-of-oci-full-stack-dr"><strong>Features of OCI Full Stack DR:</strong></h2>
<ul>
<li><p>It is a fully Managed Service, and it has tight integration with OCI Core Services like OCI Compute, Oracle Database Services, OCI Storage, and OCI Load Balancer.</p>
</li>
<li><p>Provides great flexibility - Can integrate with Oracle/Non-Oracle applications and databases that are deployed in any <a target="_blank" href="https://www.oracle.com/in/cloud/backup-and-disaster-recovery/what-is-disaster-recovery/#cloud-based-deployment">DR topology</a>.</p>
</li>
<li><p>Offers various choices of DR plans and DR plans are customisable according to application requirements.</p>
</li>
<li><p>Provides built-in prechecks to validate the readiness of the DR plan.</p>
</li>
<li><p>Execute and monitor all the DR plan operations from a Single pane of glass.</p>
</li>
</ul>
<h2 id="heading-pre-requisites-of-using-oci-full-stack-dr"><strong>Pre-requisites of using OCI Full Stack DR:</strong></h2>
<ul>
<li><p>Full Stack DR are currently available in these <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/disaster-recovery-usage.html#GUID-DB8F4CDA-34A9-467B-B847-8A81735DE9D5">OCI regions</a>. Both Production and DR infrastructure, database and applications must be hosted in any of those regions. Full Stack DR supports both inter and intra-regional deployments.</p>
</li>
<li><p>You should have all the steps required to recover your business systems.</p>
</li>
<li><p>You should either script (any language) or use <a target="_blank" href="https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm">OCI Functions</a> for any customisations required as part of the overall DR plan. You can refer to our GitHub repo for sample scripts.</p>
</li>
<li><p>Refer to the <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/prerequsisites-disaster-recovery.html#GUID-DA138EF5-DBF6-4EBE-BF59-307554D0A5CB">documentation</a> for preparing other OCI services that you plan to integrate with Full Stack DR.</p>
</li>
</ul>
<h2 id="heading-getting-started-with-oci-full-stack-dr">Getting started with OCI Full Stack DR:</h2>
<p>OCI Identity and Access Management (IAM) lets you control who has access to your cloud resources. You can control the type of access a group of users has and which specific resources.</p>
<p>We will go through the process of an OCI administrator creating various OCI IAM components like User, Group, Dynamic group, Policy, etc., which are required to use Full Stack DR and other IAM policies required to interact with OCI core services. Refer to <a target="_blank" href="https://docs.oracle.com/en-us/iaas/Contenat/Identity/getstarted/identity-domains.htm"><strong>OCI IAM documentation</strong></a> to understand more about various IAM components. Finally, we will verify accessing Full Stack DR by logging into the newly created OCI user.</p>
<p><strong>1. Create a user for Full Stack DR</strong></p>
<p>a. Login to the <a target="_blank" href="https://cloud.oracle.com/"><strong>OCI console</strong></a> with administrator credentials and select your home region.</p>
<p>b. From the hamburger menu, navigate to Identity &amp; Security -&gt;Domains-&gt; Default Domain-&gt;Users-&gt;Create user. Provide First name, Last name, Email id, and Create.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672756852703/ce8e6239-e0ec-465a-8a30-eb2072df3772.png?auto=compress,format&amp;format=webp" alt /></p>
<p><strong><mark>You will get an email (provided above) about activating the user account and must follow the instructions to activate the account.</mark></strong></p>
<p><strong>2. Create a group</strong></p>
<p>a.Login to the <a target="_blank" href="https://cloud.oracle.com/"><strong>OCI console</strong></a> with administrator credentials and select your home region.</p>
<p>b.From the hamburger menu, navigate to Identity &amp; Security -&gt;Domains-&gt; Default Domain-&gt;Groups-&gt;Create group. Provide Name, Description, and Select users to assign this group. You should select the User, which you created in Step 1 and Create.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672759061997/7c169d39-4534-4daa-a56c-d3df532246aa.png?auto=compress,format&amp;format=webp" alt /></p>
<p>3. Create a policy and provide access to Full Stack DR</p>
<p>a. Login to the <a target="_blank" href="https://cloud.oracle.com/"><strong>OCI console</strong></a> with administrator credentials and select your home region.</p>
<p>b. From the hamburger menu, navigate to Identity &amp; Security -&gt; Policies-&gt; Create Policy. Provide Name, Description, Compartment, Policy Builder enable Show manual editor and add the below Policy</p>
<p>Select the right compartment details where you will create the Policy. In this example, I am selecting compartment "suraj"</p>
<pre><code class="lang-plaintext">Allow group FullStackDRGroup to manage disaster-recovery-family in compartment suraj
</code></pre>
<p><strong><mark>You should use the correct group name (created in step 2) and compartment name in the policy syntax.</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672761304881/3a797e40-64b2-4b2a-919b-1b2f3e87c57f.png?auto=compress,format&amp;format=webp" alt /></p>
<p>Regarding the Full Stack DR, I have provided <mark>"manage"</mark> disaster-recovery-family access. Suppose if you need to have granular access to different full stack DR resource types, you can do that.Refer to <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/about-iam-policies-for-dr.html"><strong>Full Stack DR policies documentation</strong></a> for more details and modify the policies accordingly.</p>
<p><strong>4. Add policies to access other OCI services</strong></p>
<p>Full Stack DR implements DR workflows by managing other OCI resources such as Compute, Database, Block Storage, File Storage, Load Balancer, Object Storage, Functions,Vault, Virtual Cloud Network, and more.</p>
<p>We are going to add these below policies to the policy "fullstackdr-policy" created in step 3.</p>
<pre><code class="lang-plaintext">Allow group FullStackDRGroup to manage buckets in compartment suraj
Allow group FullStackDRGroup to manage objects in compartment suraj
Allow group FullStackDRGroup to manage databases in compartment suraj
Allow group FullStackDRGroup to manage autonomous-databases in compartment suraj
Allow group FullStackDRGroup to manage instance-family in compartment suraj
Allow group FullStackDRGroup to manage instance-agent-command-family in compartment suraj
Allow group FullStackDRGroup to manage volume-family in compartment suraj
Allow group FullStackDRGroup to read virtual-network-family in compartment suraj
Allow group FullStackDRGroup to use subnets in compartment suraj
Allow group FullStackDRGroup to use vnics in compartment suraj
Allow group FullStackDRGroup to use network-security-groups in compartment suraj
Allow group FullStackDRGroup to use private-ips in compartment suraj
Allow group FullStackDRGroup to read fn-app in compartment suraj
Allow group FullStackDRGroup to read fn-function in compartment suraj
Allow group FullStackDRGroup to use fn-invocation in compartment suraj
Allow group FullStackDRGroup use tag-namespaces in compartment suraj
Allow group FullStackDRGroup read vaults in compartment suraj
Allow group FullStackDRGroup read secret-family in compartment suraj
Allow group FullStackDRGroup to manage load-balancers in compartment suraj
Allow group FullStackDRGroup to manage network-load-balancers in compartment suraj
Allow group FullStackDRGroup to manage file-family in compartment suraj
</code></pre>
<p>a. Login to the <a target="_blank" href="https://cloud.oracle.com/"><strong>OCI console</strong></a> with administrator credentials and select your home region.</p>
<p>b. From the hamburger menu, navigate to Identity &amp; Security -&gt; Policies-&gt;Select the policy created in Step 3-&gt; Select Edit Policy Statements-&gt;Policy Builder-&gt;Advanced</p>
<p>Copy the list of policies as above and hit save changes. Verify whether all the added policies are reflected correctly.</p>
<p><strong><mark>You should use the correct group name (created in step 2) and compartment name in the policy syntax.</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672769680674/633807ed-b336-4e98-bc18-9c326f13785e.png?auto=compress,format&amp;format=webp" alt /></p>
<p>Refer to the <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/dr-managed-services-policies.html"><strong>complete set of services</strong></a> that currently Full Stack DR has integration with, and based on the documentation, you can provide restrictive access to other OCI services.</p>
<p><strong>5. Create a Dynamic Group and modify the policy</strong></p>
<p>Full Stack DR has the functionality of a <a target="_blank" href="https://docs.oracle.com/en-us/iaas/disaster-recovery/doc/add-user-defined-plan-groups.html">User-Defined Plan group,</a> using which you can create steps to execute commands in the OCI compute instance. Dynamic groups allow you to group OCI compute instances as "principal" actors (similar to user groups). You can then create policies to permit instances to make API calls against OCI Services.</p>
<p>a. Login to the <a target="_blank" href="https://cloud.oracle.com/"><strong>OCI console</strong></a> with administrator credentials and select your home region.</p>
<p>b.From the hamburger menu, navigate to Identity &amp; Security -&gt;Domains-&gt; Default Domain-&gt;Dynamic Groups-&gt;Create dynamic group. Provide Name, Description, Matching rules-&gt; Match any rules defined below -&gt; <strong><em><mark>In Rule 1, provide the below details. Make sure you modify your compartment OCID </mark></em></strong> -&gt; Create</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672772107720/2b3cd528-e56f-45db-9dc5-a75b56404210.png?auto=compress,format&amp;format=webp" alt /></p>
<p><strong>6. Verify Full Stack DR access</strong></p>
<p>Considering that we have set up all the necessary prerequisites, you should be able to log into the OCI console as the user (created in step 1) and verify the Full Stack DR functionality. Make sure you have the necessary user credentials for proceeding further.</p>
<p>a. Login to the <a target="_blank" href="https://cloud.oracle.com/"><strong>OCI console</strong></a> with user credentials and select your home region.</p>
<p>b. From the hamburger menu, navigate to Migration and Disaster Recovery-&gt;Disaster Recovery-&gt;DR Protection Groups</p>
<p>Now you should be able to Create a DR protection group and start working with the service.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1672772187086/f8b35ebf-43bd-467b-af79-db7cb23f45f9.png?auto=compress,format&amp;format=webp" alt /></p>
<h1 id="heading-conclusion">Conclusion:</h1>
<p>This article provides an in-depth look at Oracle Cloud Infrastructure's Full Stack Disaster Recovery (Full Stack DR), a fully automated disaster recovery solution for all layers of a full stack cloud application. The article discusses the benefits of Full Stack DR, such as lower operating expenses, disaster recovery for existing systems, and reduced complexity. It also features a detailed guide on how to get started with Full Stack DR, including creating a user, group, and policy for Full Stack DR, and verifying access. The article concludes with the promise of future discussions on various components and use cases of Full Stack DR.</p>
<p>Thanks for reading.</p>
]]></content:encoded></item></channel></rss>