Tuesday, January 2, 2024

Deploy Oracle Autonomous Database Free Container Image on Linux VM

 

- Overview:

  • Oracle announced the general availability of Autonomous Database free container image at Oracle 2023 Cloudworld.
  • The ADB free container image comes pre-built with the following components exactly like OCI ADB serverless public cloud service: 
    • Oracle Autonomous Databases (ADW or ATP).
    • Oracle Application Express (Apex).
    • Oracle Rest Data Service. (ORDS).
    • Database Actions including SQL Developer, Performance Hub.
    • MongoDB API.
  • You can use the free container image to perform a local development and the ability to merge your work later in an OCI ADB service.
  • Oracle Autonomous Database Free container minimum needs 4 CPUs and 8 GB memory.
  • The free container image is now available on Oracle Container Github Registry.  

In this blog, I'll demonstrate the steps to deploy the ADB free container image on an Oracle Linux VM running from Oracle VM VirtualBox on my laptop. 

 
Prerequisites:
  • Oracle VM VirtualBox installed.
  • Oracle Linux 8 VM with internet access running from Oracle VM VirtualBox.

Step #1: Install and Start Docker on Linux VM

As root user 

1. Install yum-utils package using command:
    dnf install -y dnf-utils zip unzip  

2. Enable all required repositories using command:
    dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

3. Install Docker using commands:
    dnf remove -y runc
    dnf install -y docker-ce --nobest

4. Enable and start Docker service using commands:
     systemctl start docker.service
     systemctl status docker.service





5. Confirm Docker version using command:
     docker version




















Step #2: Download and Run ADB Free Container Image

As non root user with sudo privilege.

1. Pull the image from the repository and start a container to run ADB free container image using command:

sudo docker run -d \
-p 1521:1522 \
-p 1522:1522 \
-p 8443:8443 \
-p 27017:27017 \
--hostname <Your_Host_name Or IP Address> \
--cap-add SYS_ADMIN \ 
--device /dev/fuse \
--name <Your Docket container name> \
container-registry.oracle.com/database/adb-free:latest

Where:
- Ports:

Port

Description

1521

TLS

1522

mTLS

8443

HTTPS port for ORDS / APEX and Database Actions

27017

Mongo API ( MY_ATP )


- hostname: is the Fully Qualified Domain Name (FQDN) of your host.
For OFS mount, container should start with SYS_ADMIN capability. 
- Also, virtual device /dev/fuse should be accessible.















2. Check new Docker image using command:
     sudo docker image ls     





3. Check the status of the ADB container using command:
    sudo docker container ls





4. Change the preinstalled default expired password for the ADMIN user for MY_ADW and MY_ATP instances.
- For ATP instance
   sudo docker exec <Container_ID> /u01/scripts/change_expired_password.sh MY_ATP admin Welcome_MY_ATP_1234 <New Password>













- For ADW instance:
   sudo docker exec <Container_ID> /u01/scripts/change_expired_password.sh MY_ADW admin Welcome_MY_ADW_1234 <New Password>







Step #3: Sign-in to Web Database Actions

- APEX

https://<Host_Name>:8443/ords/my_atp/
https://<Host_Name>:8443/ords/my_adw/

- SQL Developer Web 
https://<Host_Name>:8443/ords/my_atp/sql-developer
https://<Host_Name>:8443/ords/my_adw/sql-developer

Sign-in with admin user and password previously reset in step #2.



































































Friday, December 29, 2023

Stop/Start Oracle Database Cloud Service using OCI CLI

 

- Overview:

  • Oracle Database Cloud Service (DBCS) supports stop billing for virtual machine databases. To take the advantage of this capability, you need to stop DB system's node (DB system virtual machine). 
  • Stopping a node stops billing for all OCPUs associated with that node. Billing resumes if you restart the node. However, the billing of other DBCS resources (like NVME disks) will continue.
  •  DB system nodes are stopped individually. For multi-node RAC DB systems, you may need to act on only one node.
  • You can stop/start DBCS node using
    • Oracle OCI console.
    • Oracle OCI CLI command line tool.
    • REST APIs.
In this blog, I'll demonstrate the commands to stop/start DBCS node using OCI CLI command line. 
If you have a requirement to run non-production DBCS on working hours only, then you can schedule stop/start commands (for example from CRONTAB).

Prerequisites:
  • An Oracle cloud fee trial or paid account.
  • Installed and configured OCI CLI client. I have OCI client installed and configured on Oracle OCI compute instance (a Linux virtual machine) under OPC account.

Stop DBCS Node

- OCI CLI command: oci db node stop --db-node-id <DBCS-Node-OCID>
- The JSON-formatted command's response will show "lifecycle-state": "STOPPING".
- You can get DBCS Node OCID from OCI console.
   1. Open the navigation menu. Select Oracle Database, then select Oracle Base Database.
   2. Select your Compartment. A list of DB systems is displayed.
   3. In the list of DB systems, find the DB system you want to stop, and then click its name to display  
       details about it.
   4. In the list of nodes, click the Actions menu for a node and click "copy OCID" action.    

- Example











Get the Status of DBCS Node

- OCI CLI command: oci db node get --db-node-id <DBCS-Node-OCID>
- The JSON-formatted command's response will show "lifecycle-state".
   - STOPPING: DB node is stopping.
   - STOPPED: DB node is stopped.
   - STARTING: DB node is starting.
   - AVAILABLE: DB node is running.

- Example









Start DBCS Node

- OCI CLI command: oci db node start --db-node-id <DBCS-Node-OCID>
- The JSON-formatted command's response will show "lifecycle-state": "STARTING".
- Example:




















Sunday, November 19, 2023

ExaCC: Create a Custom Database Software Image

 

- Overview:

  • ExaCC users patch and provision their Oracle Database Homes using standard Oracle published images. 
  • Oracle makes the major Oracle database versions with the last 4 release updates available on control plane servers for download.
  • Custom database software images provide
    • Apply a standardized custom Database Software Image across multiple Database Homes for specific application needs.
    • Move on-premise databases running custom one-off software updates to ExaCC.
    • Build custom images within ExaCC service without special entitlements required to download patches from MOS.

In this blog, I'll demonstrate the steps to create a custom database software image using OCI console then use the new image to create a database home.

Step #1: Create A  Custom Database Software Image

1.  Sign in to your OCI tenancy where your Exadata Database Service on Cloud @ Customer system is deployed.

2. Navigate to "Oracle Database" > "Oracle Exadata Database Service on Cloud@Customer".








3. Under "Resources" section, select "Database Software Images" then click "Create Database Software Image" button.















4. In "Create Database Software Image" screen, provide the required information then click "Create Database Software Image" button.
     - Display Name: Image display name.
     - Choose the right compartment.
     - Choose major database version.
     - Choose a patch set update, proactive bundle patch, or release update.
     - Enter one-off patch numbers (optional).















Once create database software image successfully completes, image state will be "Available". 






Step #2: Create A Database Home Using New Image

1. Navigate to "Oracle Database" > "Oracle Exadata Database Service on Cloud@Customer".
2. Click on your VM cluster name.
3. Under "Resources" section, select "Database Homes" then click "Create Database Home" button.









4. In "Create Database Home" screen, enter database home, click "Change Database Image" button to select database home image type from either "Oracle Provided Database Software Images" or "Custom Database Software Images".











5. In "Select a Database Software Image" screen
    - Image Type: select "Custom Database Software Images".
    - Choose a compartment: the compartment where you created the customized image.
    - Select image row from the list of available customized images.














6. Click "Create Database Home" button.




























Once create database home successfully completes, Oracle database home state will be "Available". 









7. Connect to any of the VM cluster nodes and run "opatch lspatches" to confirm installed patches.














ExaCC: Scale VM Cluster Exadata Usable Storage

 

- Overview:

  • With multiple VMs per Exadata Infrastructure feature release, you can scale up or down the following resources on VM cluster:
    • Local storage /u02. Scaling memory requires a rolling restart of the cluster nodes to take effect.
    • Memory. Scaling memory requires a rolling restart of the cluster nodes to take effect.
    • OCPU. Scaling OPCU is Online.
    • Exadata storage. Scaling OPCU is Online.
  • The minimum recommended size is 2 TB.
  • Use the following formula to calculate the minimum required ASM storage:
    • For each disk group, for example, DATA, RECO, note the total size and free size by running the "asmcmd lsdg" command on any node of the VM cluster.
    • Calculate the used size as (Total size - Free size) / 3 for each disk group. The /3 is used because the disk groups are triple mirrored.
    • DATA:RECO ratio is:
      • 80:20 if Local Backups option was NOT selected in the user interface.
      • 40:60 if Local Backups option was selected in the user interface.
    • Ensure that the new total size as given in the user interface passes the following conditions:
      • Used size for DATA * 1.15 <= (New Total size * DATA % ).
      • Used size for RECO * 1.15 <= (New Total size * RECO % ).

In this blog, I'll demonstrate the steps to scale up the usable Exadata storage using OCI console.

Steps to Scale Up VM Cluster Exadata Usable Storage 


1. Note the current total size and free size by running "asmcmd lsdg" command on any node of the VM cluster.





2.  Sign in to your OCI tenancy where your Exadata Database Service on Cloud @ Customer system is deployed.

3. Navigate to "Oracle Database" > "Oracle Exadata Database Service on Cloud@Customer" > "Exadata VM Clusters".
















4. Click on your VM cluster name.










5. On VM cluster details home page, click "Scale VM Resources" button.


 
 









































6. On "Scale VM Cluster" screen, under "Configure the Exadata storage" section, specify the usable Exadata storage new size then click "Save Changes" button. The new size will be distributed based on DATA:RECO ratio, which is 80:20 in our example.  























Cluster state will switch to "UPDATING", but all resources will be UP on both nodes.











You can track scaling progress and activities from "Work Requests" page under Resources section in VM cluster details home page.
























Once scaling successfully completes, cluster's state will changed back to "AVAILABLE". Under "Resource allocation" section, Exadata Storage (TB) will show the new total usable storage.





























7. Connect to any of the VM cluster and run "asmcmd lsdg" command to check ASM disk groups new size.





ExaCC: Scale VM Cluster Local Storage Size

 

- Overview:

  • With multiple VMs per Exadata Infrastructure feature release, you can scale up or down the following resources on VM cluster:
    • Local storage /u02. Scaling memory requires a rolling restart of the cluster nodes to take effect.
    • Memory. Scaling memory requires a rolling restart of the cluster nodes to take effect.
    • OCPU. Scaling OPCU is Online.
    • Exadata storage. Scaling OPCU is Online.  
  • You specify how much space is provisioned from local storage to each VM. 
  • This space is mounted at location /u02, and is used primarily for Oracle Database homes
  • The minimum supported size of /u02 is 60 GB per VM.
  • The maximum supported size of /u02 is 900 GB per VM. Depending on the number of other VMs in the system and the space consumed by those VMs.
  • A rolling restart of each VM is required to resize /u02.

In this blog, I'll demonstrate the steps to scale up local file system size using OCI console.

Steps to Scale Up VM Cluster Local File System Size

1.  Sign in to your OCI tenancy where your Exadata Database Service on Cloud @ Customer system is deployed.

2. Navigate to "Oracle Database" > "Oracle Exadata Database Service on Cloud@Customer" > "Exadata VM Clusters".
















3. Click on your VM cluster name.










4. On VM cluster details home page, click "Scale VM Resources" button.


 
 










5. On "Scale VM Cluster" screen, under "Resource allocation per VM" section, enter local file system size per VM then click "Save Changes" button.





 







You can track scaling progress and activities from "Work Requests" page under Resources section in VM cluster details home page.























Once scaling successfully completes, cluster's state will changed back to "AVAILABLE". Under "Resource allocation" section, Local Storage (GB) will show the new total size for the cluster.





































Also you can confirm new size from VM node by running df -h command.



 





Oracle AI Database Private Agent Factory Overview

  From AI to Agentic AI To understand the Private Agent Factory, we must first look at the broader landscape of artificial intelligence.  Th...