Monday, March 23, 2026

Key Differences & 19c Best Practices (AMM and ASMM)

Key Differences between AMM and ASMM & 19c Best Practices


AMM (Automatic Memory Management) -  (MEMORY_TARGET):

How it works: Oracle automatically distributes memory between SGA and PGA.


Pros: Simplest to configure; dynamic resizing across both areas.


Cons: Incompatible with HugePages, which are crucial for performance in large systems. Can have issues with /dev/shm on Linux.


Recommendation: Suitable for testing or small instances (< 4GB SGA).


ASMM (Automatic Shared Memory Management) - (SGA_TARGET):

How it works: Oracle automatically tunes SGA components (buffer cache, shared pool) but PGA is managed separately.


Pros: Recommended for production; supports HugePages for better performance, reduces OS paging.


Cons: Requires manual tuning of PGA_AGGREGATE_TARGET.


19c Context: Oracle 19c generally recommends ASMM (using SGA_TARGET and PGA_AGGREGATE_TARGET) for production environments over AMM to ensure optimal memory management and stability


Which is better for minimizing swap usage? ASMM vs AMM

Which is better for minimizing swap usage?


 AMM (Automatic Memory Management)

  • MEMORY_TARGET 

 ASMM (Automatic Shared Memory Management) 

  • SGA_TARGET


In most real-world Oracle deployments, using manual memory management (i.e., SGA_TARGET + PGA_AGGREGATE_TARGET) results in lower swap usage than MEMORY_TARGET / MEMORY_MAX_TARGET.


Why MEMORY_TARGET causes more swap usage

Automatic Memory Management (AMM), which uses:


MEMORY_TARGET

MEMORY_MAX_TARGET


requires a Linux system to allocate a large shared memory segment plus additional OS memory for management.

On Linux, AMM uses /dev/shm (tmpfs), and if its size is less than MEMORY_TARGET, Oracle falls back to regular pages, increasing swap pressure.

Problems with MEMORY_TARGET:


Tends to cause kernel swapping due to dynamic resizing of SGA/PGA.

Additional overhead for memory rebalancing.

On NUMA servers, AMM can mismatch memory locality → more swap.

Oracle itself recommends NOT using AMM on production systems.


Oracle Docs: AMM is mainly recommended for small dev/test systems, not production.


Why SGA_TARGET results in lower swap usage

SGA_TARGET uses Automatic Shared Memory Management (ASMM).

Memory is allocated in huge pages (if enabled), giving performance and eliminating swap spikes.

With:


SGA_TARGET (or even SGA_MAX_SIZE)

PGA_AGGREGATE_TARGET


Oracle uses memory more predictably:


Benefits:


Stable memory footprint → no resizing storms.

Huge Pages support → swap is effectively zero.

No tmpfs (/dev/shm) dependency.

Fits well with modern Linux kernel memory management.


Oracle recommends ASMM for production databases.


Winner for swap control: SGA_TARGET (ASMM) If your goal is:

  •  avoid swap
  •  maintain predictable memory usage
  •  use huge pages
  •  ensure performance stability

Use SGA_TARGET + PGA_AGGREGATE_TARGET (ASMM).


Recommended Production Setup:


MEMORY_TARGET=0

MEMORY_MAX_TARGET=0


SGA_TARGET=<value>

SGA_MAX_SIZE=<value>


PGA_AGGREGATE_TARGET=<value>


Enable Huge Pages on Linux for optimal performance.


Monday, March 16, 2026

Oracle AI Database Free support Platforms and Connectivity

Oracle AI Database 26ai – Supported Free Platforms


The Oracle AI Database 26ai Free tier can be deployed on the following platforms:


  • Oracle Linux 8 (OL8 / RHEL 8)
  • Oracle Linux 9 (OL9 / RHEL 9)
  • Oracle Linux 8 for ARM (aarch64)
  • Docker / Podman
  • Oracle VirtualBox
  • Microsoft Windows (64‑bit)



Client Tools and Languages for Connecting to Oracle AI Database Free

You can connect to Oracle AI Database Free using a wide range of tools and programming languages:

Database Tools


  • SQLcl
  • SQL*Plus


Programming Languages


  • Java
  • Python
  • Node.js
  • C# / .NET
  • PHP
  • Ruby
  • Go



Official Reference

For detailed setup instructions and downloads, please refer to the official Oracle page:

🔗 https://www.oracle.com/in/database/free/get-started/

Thursday, March 12, 2026

How to switch/connect with other database (demo)?

 


postgres=#

postgres=#

postgres=#

postgres=# \c demo

You are now connected to database "demo" as user "postgres".

demo=#

demo=#

demo=# \l demo

 demo | postgres | UTF8     | libc            | English_India.1252 | English_India.1252 |        |           |


How to create database in PostgreSQL ?

 

postgres=#

postgres=#

postgres=# create database demo;

CREATE DATABASE

postgres=#

postgres=# \l

 demo      | postgres | UTF8     | libc            | English_India.1252 | English_India.1252 |        |           |

 postgres  | postgres | UTF8     | libc            | English_India.1252 | English_India.1252 |        |           |

 template0 | postgres | UTF8     | libc            | English_India.1252 | English_India.1252 |        |           | =c/postgres          +

           |          |          |                 |                    |                    |        |           | postgres=CTc/postgres

 template1 | postgres | UTF8     | libc            | English_India.1252 | English_India.1252 |        |           | =c/postgres          +

           |          |          |                 |                    |                    |        |           | postgres=CTc/postgres


postgres=#

PostgreSQL : 'more' is not recognized as an internal or external command, operable program or batch file.

 postgres=#

postgres=#

postgres=#

postgres=# \l

'more' is not recognized as an internal or external command,

operable program or batch file.

postgres=#

postgres=#



postgres=# \l

'more' is not recognized as an internal or external command,

operable program or batch file.

postgres=#




This happens in psql on Windows when the MORE command is missing or overridden in the system PATH.

psql uses the system pager (more) to display long output like \l, \dt, etc.



postgres=#

postgres=# \pset pager off

Pager usage is off.

postgres=#

postgres=# \l

                                                            List of databases

   Name    |  Owner   | Encoding | Locale Provider |      Collate       |       Ctype        | Locale | ICU Rules |   Access privileges

-----------+----------+----------+-----------------+--------------------+--------------------+--------+-----------+-----------------------

 postgres  | postgres | UTF8     | libc            | English_India.1252 | English_India.1252 |        |           |

 template0 | postgres | UTF8     | libc            | English_India.1252 | English_India.1252 |        |           | =c/postgres          +

           |          |          |                 |                    |                    |        |           | postgres=CTc/postgres

 template1 | postgres | UTF8     | libc            | English_India.1252 | English_India.1252 |        |           | =c/postgres          +

           |          |          |                 |                    |                    |        |           | postgres=CTc/postgres

(3 rows)


postgres=#

postgres=#

Wednesday, March 11, 2026

Important Oracle Database License Audit Checklist

 Oracle Database License Audit Checklist 


1. Perform a Comprehensive Oracle Environment Inventory (On‑Prem & Cloud)

  • Catalog every Oracle database deployment, including production, development, testing, and disaster‑recovery environments.
  • Include all infrastructure types: physical servers, virtual machines, containers, and cloud-hosted databases.
  • Record the database edition (Standard Edition, Enterprise Edition) and version (e.g.11g,19c, 21c).



2. Verify License Entitlements and Agreements

  • Map each deployment to its corresponding license type (NUP, Processor‑based).
  • Use Oracle’s Core Factor Table to correctly calculate processor requirements.
  • Review legacy contracts, existing ULAs, and any embedded licensing rights that may impact compliance.



3. Assess Feature and Option Usage

  • Use automated tools/scripts to detect usage of chargeable features such as RAC, Partitioning, Advanced Compression, etc.
  • Confirm that all enabled features are properly licensed or disable those not in use.



4. Evaluate Virtualization and Cloud Architectures

  • Track virtual machine movement across hypervisors (e.g. VMware vSphere, Nutanix ).
  • Ensure hard partitioning or affinity rules are documented and enforced where required.
  • Review Oracle workloads running on public cloud IaaS platforms like AWS, Azure, or OCI to confirm licensing alignment.



5. Prepare an Accurate and Audit‑Ready Data Package

  • Validate all data generated by LMS (License Management Services) scripts before sharing externally.
  • Avoid running Oracle‑provided audit scripts without expert review.
  • Document all licensing interpretations, configuration decisions, and control measures for audit transparency.



Note :- 

We have to very careful run any script in environment before review with experts ...... 

Monday, February 16, 2026

Use Cases of Oracle Grid Control

 

Use Cases of Oracle Grid Control 

Oracle Grid Control was designed for centralized management of on‑premise Oracle IT infrastructure, especially when organizations had many databases, middleware servers, and hosts.

1. Centralized Monitoring of Large On‑Prem Environments

Grid Control provides a single-window solution for monitoring multiple Oracle databases, WebLogic servers, hosts, and even some non-Oracle technologies (IBM WebSphere, SQL Server, etc.) in one place.

2. End-to-End Application & Service Monitoring

It includes service-level management, real user monitoring, and deep diagnostics for multi-tier applications—ideal for environments needing SLA visibility.

3. Database Performance Diagnostics (11g Features)

For Oracle Database 11g Release 2, Grid Control provides:

  • Enhanced performance pages
  • ADDM integration
  • Real-time SQL monitoring
  • Parallel SQL tuning

4. Real Application Clusters (RAC) & High Availability Management

Use cases include:

  • Managing policy-managed RAC databases
  • Auto-discovery of RAC nodes
  • Monitoring Oracle Clusterware and Grid Infrastructure

5. Configuration, Provisioning, and Lifecycle Management

Grid Control supports configuration management, provisioning, and patching in on‑prem environments.

6. Modeling IT Environment & Service-Level Management

Advanced use cases include:

  • Modeling composite services
  • Service-level agreements (SLAs)
  • Root-cause analysis for service failures

Ideal For:

✔ Large on‑prem Oracle estates
✔ Mixed orchestration environments (DB + WebLogic + Hosts)
✔ Traditional data centers without cloud
✔ RAC-heavy deployments
✔ Organizations needing SLA and service monitoring


Use Cases of Oracle Cloud Control (OEM 12c/13c)

Oracle Cloud Control expands on Grid Control by adding cloud, engineered systems, automation, and lifecycle capabilities.

1. Managing Entire Enterprise + Cloud Infrastructure

Cloud Control is Oracle’s integrated platform for monitoring databases, engineered systems, applications, middleware, hardware, and cloud environments centrally.

2. Hybrid & Cloud Management

It provides capabilities for:

  • Oracle Cloud (OCI) monitoring
  • Hybrid deployments (on‑prem + cloud)
  • Cloud automation, configuration, and provisioning

3. Full Lifecycle Management & Automation

Cloud Control offers automated:

  • Configuration management
  • Provisioning
  • Patch automation
  • Compliance assessment

4. Engineered Systems (Exadata, ZDLRA) Management

Cloud Control supports Oracle engineered systems for:

  • Hardware health monitoring
  • Exadata cell and storage metrics
  • Database machine-level performance
    (Engineered systems management is explicitly part of Cloud Control’s scope.)

5. Deep Diagnostics & Tuning via Licensed Packs

Cloud Control integrates advanced features when packs are enabled:

  • Diagnostics Pack (AWR/ASH integration)
  • Tuning Pack
  • Lifecycle Management Pack

6. Compliance & Security Monitoring

Cloud Control supports compliance frameworks and access control management for enterprise governance—e.g., SOX, security baselines.

7. Managing Large Fleets at Scale

Includes support for:

  • Fleet Maintenance
  • Mass agent deployment
  • Drift analysis
  • Enterprise-wide policy enforcement

Ideal For:

✔ Multi-datacenter enterprises
✔ Cloud + on‑prem hybrid environments
✔ Exadata and engineered systems
✔ Large fleet automation & compliance
✔ Organizations needing advanced diagnostics and tuning


🆚 Summary: When to Use What

RequirementGrid ControlCloud Control
Large on‑prem infrastructure
Hybrid / Cloud environments
Engineered systems (Exadata)Limited✔ Full support
Advanced automation & provisioningModerate✔ Extensive
SLA, service modeling✔ Enhanced
Diagnostics, Tuning PacksAvailable✔ Fully integrated
Modern UI, plugin architectureLegacy✔ Modern extensible

🎯 Short Answer

  • Grid Control → Best for older, fully on‑premises Oracle environments needing centralized monitoring and basic lifecycle management.
  • Cloud Control → Best for modern enterprises requiring cloud integration, engineered systems support, automation at scale, and advanced diagnostics/compliance.

Database Control vs Grid Control vs Cloud Control (OEM)

 

🚀 Database Control vs Grid Control vs Cloud Control (OEM)

1. Database Control (DB Control)

Scope: Single database / single host

What it is:

  • A lightweight management console installed automatically with an Oracle database.
  • Uses the local DB Control Agent and stores configuration in the database’s own repository.

Best for:
✔ Managing one database
✔ Basic monitoring
✔ Single-server environments

Limitations:
❌ Cannot manage multiple databases centrally
❌ No enterprise monitoring
❌ Feature deprecated since Oracle 12c
❌ Not suitable for HA/DR, Exadata, RAC monitoring at scale

Think of it as:

A local-only admin console for one Oracle DB instance.


2. Grid Control (OEM 10g / 11g)

Scope: Enterprise-level monitoring across multiple servers

What it is:

  • First enterprise-grade OEM version that gave you central management.
  • Came with:
    • OMS (Oracle Management Server)
    • OMR (Oracle Management Repository)
    • Agent on each monitored host

Best for:
✔ Monitoring multiple DBs
✔ Managing RAC, ASM
✔ Host & application monitoring
✔ Patch management (PSUs)
✔ SLA dashboards

Limitations:
❌ Older architecture
❌ Not cloud-ready
❌ No plugin-based extensibility (limited compared to Cloud Control)

Think of it as:

Enterprise monitoring 1.0 — centralized, but still traditional.


3. Cloud Control (OEM 12c → 13c)

Scope: Enterprise + Cloud + Engineered systems

What it is:

  • Successor to Grid Control.
  • Plugin-based architecture to support:
    • Oracle DB (all versions)
    • Middleware (WebLogic)
    • Engineered systems (Exadata, ZDLRA)
    • Oracle Cloud, OCI
    • Non-Oracle technologies (SQL Server, VMware, etc.)

Key capabilities added:

  • Lifecycle Management
  • Patching & Provisioning Automation
  • Fleet Maintenance
  • Compliance Management (e.g., STIG, CIS)
  • Cloud & hybrid monitoring
  • Advanced diagnostics (AWR, ASH, ADDM integrated)

Best for:
✔ Large enterprises
✔ Multi-datacenter environments
✔ Exadata-heavy setups
✔ CI/CD for DB patching (Fleet Maintenance)
✔ Compliance & audit-driven organizations

Think of it as:

Enterprise monitoring 2.0 — scalable, cloud-aware, and automation‑focused.


📌 Quick Comparison Table

FeatureDatabase ControlGrid ControlCloud Control
ScopeSingle DBMulti-DB EnterpriseHybrid Cloud + Enterprise
RepositoryLocal DBCentral OMRCentral OMR (Enhanced)
Cloud support✔ OCI, Hybrid
Engineered systems (Exadata)Limited✔ Full support
Patch automationBasicBetterBest (Fleet Maintenance)
PluginsLimited✔ Full plugin system
StatusDeprecatedLegacyCurrent (OEM 13c)

🧠 In Simple Terms

  • Database ControlLocal tool for one database
  • Grid ControlCentral tool for many databases
  • Cloud ControlEnterprise+Cloud management with automation & plugins




Wednesday, February 11, 2026

How to pull image in docker and run ? Hello-World image

use : https://hub.docker.com/_/hello-world



anurag@Anurags-MacBook-Air ~ % 

anurag@Anurags-MacBook-Air ~ % 

anurag@Anurags-MacBook-Air ~ % 

anurag@Anurags-MacBook-Air ~ % docker pull hello-world

Using default tag: latest

latest: Pulling from library/hello-world

Digest: sha256:ef54e839ef541993b4e87f25e752f7cf4238fa55f017957c2eb44077083d7a6a

Status: Image is up to date for hello-world:latest

docker.io/library/hello-world:latest

anurag@Anurags-MacBook-Air ~ % 

anurag@Anurags-MacBook-Air ~ % 

anurag@Anurags-MacBook-Air ~ % docker run hello-world


Hello from Docker!

This message shows that your installation appears to be working correctly.


To generate this message, Docker took the following steps:

 1. The Docker client contacted the Docker daemon.

 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.

    (arm64v8)

 3. The Docker daemon created a new container from that image which runs the

    executable that produces the output you are currently reading.

 4. The Docker daemon streamed that output to the Docker client, which sent it

    to your terminal.


To try something more ambitious, you can run an Ubuntu container with:

 $ docker run -it ubuntu bash


Share images, automate workflows, and more with a free Docker ID:

 https://hub.docker.com/


For more examples and ideas, visit:

 https://docs.docker.com/get-started/


anurag@Anurags-MacBook-Air ~ % >....                                                                                                                                                                           

This message shows that your installation appears to be working correctly.


To generate this message, Docker took the following steps:

 1. The Docker client contacted the Docker daemon.

 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.

    (arm64v8)

 3. The Docker daemon created a new container from that image which runs the

    executable that produces the output you are currently reading.

 4. The Docker daemon streamed that output to the Docker client, which sent it

    to your terminal.


To try something more ambitious, you can run an Ubuntu container with:

 $ docker run -it ubuntu bash


Share images, automate workflows, and more with a free Docker ID:

 https://hub.docker.com/


For more examples and ideas, visit:

 https://docs.docker.com/get-started/


anurag@Anurags-MacBook-Air ~ % 


if you see " Hello from Docker! " then all good 


Tuesday, February 10, 2026

Oracle AI Database 26ai ?

Oracle AI Database 26ai – Key Highlights


Next Long-Term Support Release

Delivers over 300 new features focused on AI integration and developer productivity.


AI & Machine Learning Enhancements

AI Vector Search

Supports generation and storage of vector embeddings for documents, images, audio, and more.

Enables fast similarity search using Oracle’s existing analytical engines.


Integrated Machine Learning

Leverages Oracle’s extensive ML algorithms to rapidly build sophisticated AI-driven applications.


AI-Optimized Core Functions

Uses AI to improve accuracy of execution-time estimates and resource costing.




Developer Productivity Improvements

Flexible Development Models

Simplified development for JSON, relational, or hybrid application architectures.


Enhanced Microservices & Messaging

Expanded support for modern microservice-based application designs.


New RAFT Protocol Support

Simplifies database distribution and sharding for regulatory and performance-driven requirements.




SQL & PL/SQL Advancements

New Data Types & Language Enhancements

Improves creation and optimization of OLTP and analytical applications.


SQL Firewall

Offers advanced security by controlling precisely which SQL statements can execute against the database.



Database Administration Improvements

Refined Management Tasks

Reduced complexity and improved performance across key DBA operations.

New automation for tasks such as reclaiming free space in tablespaces.


Performance Enhancements

Infrastructure-level boosts, including True Cache, for higher throughput.

SQL-level optimizations enabling significantly faster execution of certain statements.

Wednesday, February 4, 2026

How to Monitor When Oracle Management Packs Are Activated or Used in Oracle database ?

 

How to Monitor When Oracle Management Packs Are Activated or Used

Oracle provides multiple internal views, advisor logs, and AWR/ADDM activity indicators that reveal accidental or unauthorized use of:

  • Diagnostics Pack
  • Tuning Pack

Below is a complete monitoring framework.


1. Check if Diagnostic/Tuning Features Were Used (Primary Indicator)

Oracle logs all usage in DBA_FEATURE_USAGE_STATISTICS.

Run:

SELECT name, detected_usages, total_samples, last_usage_date
FROM dba_feature_usage_statistics
WHERE name IN (
'Automatic Workload Repository',
'ADDM',
'SQL Tuning Advisor',
'SQL Access Advisor',
'ASH',
'AWR Baseline',
'Real-Time SQL Monitoring'
)
ORDER BY last_usage_date DESC;

What to look for:

  • DETECTED_USAGES > 0 → feature was used
  • LAST_USAGE_DATE not null → pack was accessed
  • If you disabled packs but this still updates → OEM or some script is still invoking features

This is the most authoritative licensing indicator.


2. Monitor the Management Pack Parameter (Active Status)

Run:

SHOW PARAMETER control_management_pack_access;

Expected safe value:

NONE

If it changes to:

  • DIAGNOSTIC
  • DIAGNOSTIC+TUNING

➡️ Packs are active and billable.

For automated monitoring, query:

SELECT value
FROM v$parameter
WHERE name='control_management_pack_access';


3. Check if AWR Snapshots Are Being Generated (Diagnostics Pack Usage)

If snapshots exist, AWR is active → Diagnostic Pack is considered used.

SELECT snap_id, begin_interval_time, end_interval_time
FROM dba_hist_snapshot
ORDER BY snap_id DESC
FETCH FIRST 10 ROWS ONLY;

If you see new snapshots after disabling:

➡️ Something is still collecting AWR data.


4. Monitor ADDM Execution (Diagnostics Pack)

SELECT task_name, created, status
FROM dba_advisor_tasks
WHERE advisor_name='ADDM';

If any task appears → Diagnostics Pack used.


5. Monitor SQL Tuning Advisor Activity (Tuning Pack)

SELECT task_name, created, status
FROM dba_advisor_tasks
WHERE advisor_name='SQL TUNING ADVISOR';

If tasks ran → Tuning Pack usage triggered.

Also check:

SELECT COUNT(*) FROM DBA_ADVISOR_LOG WHERE advisor_name='SQL TUNING ADVISOR';


6. Monitor SQL Access Advisor Activity (Tuning Pack)

SELECT task_name, created, execution_start
FROM dba_advisor_tasks
WHERE advisor_name='SQL ACCESS ADVISOR';

Any appearance = Tuning Pack usage.


7. Detect Automatic SQL Monitoring (Diagnostics + Tuning Pack)

SQL Monitoring is part of Tuning Pack.

Check ASH/SQL Monitor usage:

SELECT sql_id, status, sid, username, elapsed_time
FROM v$sql_monitor;

If rows appear → Tuning Pack active.


8. OEM Activity Monitoring (Common Source of Accidental Usage)

OEM may trigger pack usage even if DBAs don't run anything manually.

Check OEM repository:

For AWR/ASH report generation:

SELECT * FROM mgmt$awr_reports ORDER BY time_start DESC;

For SQL Tuning Advisor tasks created by OEM:

SELECT task_name, created
FROM dba_advisor_tasks
WHERE task_name LIKE 'SYS_AUTO_SQL%';

If OEM is generating:

  • AWR Reports
  • ADDM Reports
  • SQL Tuning tasks

➡️ Packs are being used even if parameter says NONE.


9. Enable Audit Monitoring for Parameter Changes

Track if someone re-enabled packs:

AUDIT ALTER SYSTEM;

Then check:

SELECT username, timestamp, sql_text
FROM dba_audit_trail
WHERE sql_text LIKE '%control_management_pack_access%';

This is extremely valuable during SOX audits.


📈 10. Recommended Scheduled Monitoring Script

Run daily/weekly through OEM/cron.

SELECT 'FEATURE_USAGE', name, detected_usages, last_usage_date
FROM dba_feature_usage_statistics
WHERE detected_usages > 0
UNION ALL
SELECT 'AWR_SNAP', snap_id, begin_interval_time, end_interval_time
FROM dba_hist_snapshot
WHERE begin_interval_time > SYSDATE-1;

Generate alerts if ANY usage is detected.


🎯 Summary – What You Must Monitor

Check AreaWhat It DetectsIndicates Usage
DBA_FEATURE_USAGE_STATISTICSCore featuresPrimary licensing indicator
DBA_HIST_SNAPSHOTAWR snapshotsDiagnostics Pack
ADDM TasksDiagnostics PackYes
SQL Tuning AdvisorTuning PackYes
SQL Access AdvisorTuning PackYes
SQL MonitoringTuning PackYes
OEM ActivityAuto usage triggersVery common
Audit of parameter changeRe-enabling packsCompliance breach



Key Differences & 19c Best Practices (AMM and ASMM)

Key Differences between  AMM and ASMM  & 19c Best Practices AMM (Automatic Memory Management) -  (MEMORY_TARGET): How it works: Oracle a...