Showing posts with label Must Read. Show all posts
Showing posts with label Must Read. Show all posts

Monday, 31 August 2026

Oracle Indexes: Fix Slow SQL Without Overdoing It

A SQL query running for 8 seconds may not create panic during testing. In production, the same query can become a real incident when it runs thousands of times from an application, report, or batch process.

I have seen queries drop from seconds to milliseconds after adding one correct index. I have also seen OLTP systems become slower because every column was indexed without understanding the workload. Both situations are common.

Indexes are powerful, but they are not free. They reduce unnecessary reads for SELECT queries, but they add cost to INSERT, UPDATE, DELETE, storage, statistics gathering, and maintenance. A good DBA does not create indexes blindly. A good DBA checks the SQL pattern, data volume, selectivity, execution plan, and write workload before touching production.



Sunday, 16 August 2026

Oracle Key Vault: DBA Guide for TDE Keys and scenarios

A database backup can finish successfully and still fail during recovery.

That usually sounds strange until encryption enters the picture. RMAN backup is available, archive logs are available, Data Guard is in sync, but during restore someone asks the real question: where is the TDE wallet or master key?

This is where many production environments become risky. TDE wallets are present on database servers, Java keystores are owned by middleware teams, SSH keys are copied between hosts, certificates are renewed manually, and old wallet backups are kept in folders nobody wants to touch.

Oracle Key Vault helps reduce this spread by centralizing the management of TDE master keys, Oracle wallets, Java keystores, certificates, credential files, SSH keys, and other secrets. For a DBA, the value is not only security. It is also recoverability, auditability, controlled access, and cleaner operations during patching, migration, Data Guard switchover, and disaster recovery.

Why Key Management Becomes a DBA Problem

Encryption may start as a security requirement, but the operational impact often lands with the DBA team.

A few common production situations are very familiar:

  • A TDE wallet was created on the primary database server but was never validated on the standby.
  • A database restore completed, but encrypted tablespaces could not be opened.
  • A RAC node was rebuilt, but the Oracle Key Vault endpoint client was missed.
  • A certificate expired and the issue appeared during a maintenance window.
  • Audit asked who accessed or rotated a key, and the answer was scattered across tickets and server logs.

Oracle Key Vault brings these security objects under central control. Instead of each database server becoming its own small vault, OKV becomes the controlled repository where access, lifecycle, backup, and reporting can be managed properly.

The important production point is this: once a database depends on external key management, key availability becomes part of database availability.


How Oracle Key Vault Fits with TDE

Oracle Transparent Data Encryption protects data at rest. Oracle Key Vault does not replace TDE. It manages the keys and security objects used by TDE.

In a typical setup, the database server is enrolled as an Oracle Key Vault endpoint. That endpoint gets access to the required virtual wallet or security objects. The database can then access its TDE master encryption keys through the OKV client configuration.

For modern Oracle databases, the two parameters DBAs should pay attention to are WALLET_ROOT and TDE_CONFIGURATION. Older environments may still have wallet locations configured through sqlnet.ora, especially after upgrades or migrations, so it is worth checking the actual configuration before making assumptions.

SHOW parameter wallet_root
SHOW parameter tde_configuration

SET lines 200 COL wallet_type FOR a20 COL status FOR a20 COL keystore_mode FOR a20 COL wrl_parameter FOR a60

SELECT con_id,
wallet_type,
status,
keystore_mode,
wrl_parameter FROM v$encryption_wallet ORDER BY con_id;

SELECT tablespace_name,
encrypted FROM dba_tablespaces WHERE encrypted = 'YES' ORDER BY tablespace_name;

ALTER SYSTEM SET wallet_root='/u01/app/oracle/admin/PRODDB/wallet' SCOPE=spfile;

SHUTDOWN IMMEDIATE; STARTUP;

ALTER SYSTEM SET tde_configuration='KEYSTORE_CONFIGURATION=OKV' SCOPE=both;

In some environments, you may see values such as OKV|FILE or FILE|OKV. Do not treat these as random alternatives. They are commonly seen during migration or dual-keystore designs. Always verify the Oracle version, current wallet state, and whether the database is using united or isolated keystore mode in a multitenant setup.


The Endpoint Check DBAs Should Not Skip

The database view gives one side of the story. The endpoint check gives another.

Oracle Key Vault uses endpoint software on the database or application server. The command-line utility okvutil is one of the quickest ways to confirm whether the endpoint can talk to OKV and access the assigned security objects.

export OKV_HOME=/u01/app/oracle/okv
export PATH=$OKV_HOME/bin:$PATH

okvutil list

grep -i server $OKV_HOME/conf/okvclient.ora
ls -l $OKV_HOME/conf

nslookup okv-vip.example.com
nc -vz okv-vip.example.com 5696

grep -Ei "ORA-283|ORA-284|TDE|OKV|PKCS|wallet|keystore" 
$ORACLE_BASE/diag/rdbms/*/*/trace/alert*.log

If okvutil list fails, do not immediately recreate wallets. Start with simple checks. Is OKV_HOME correct? Is okvclient.ora present? Was the endpoint enrolled? Can the host reach the OKV server or VIP? Was the endpoint certificate replaced? Did the database move to another Oracle home?

For RAC, validate from every node. A common operational miss is checking only node 1. Everything looks healthy until a service relocates or an instance restarts on node 2.


High Availability: Central Control Needs Strong Design

Centralizing keys improves governance, but it also introduces a dependency that must be designed properly.

A running database may continue during a temporary OKV issue depending on cache behavior and whether the required key is already available. But that does not mean the design is safe. The real test is a database restart, PDB open, standby open read-only, key rotation, or restore to another host.

For critical databases, OKV should be included in the same operational checklist as Data Guard, RAC, backup, and monitoring.

  • OKV high availability or cluster design
  • OKV backup and restore testing
  • Endpoint configuration on all RAC nodes
  • Standby endpoint access
  • Firewall and DNS validation from primary and DR sites
  • Certificate expiry monitoring
  • Key rotation testing in lower environments

A DR test should not be marked successful only because redo apply worked. If TDE is enabled, encrypted data access after role transition must also be tested.


RAC, Data Guard, GoldenGate and Hybrid Estates

Oracle Key Vault is simple to understand in a single database setup. It becomes more interesting in a real enterprise estate.

In RAC, every node must have a working OKV endpoint configuration. Service relocation, node restart, or instance failover can expose node-specific issues.

In Data Guard, the standby must be able to access the required TDE keys. A standby can be perfect from a redo apply perspective but still fail after promotion if key access was never validated.

In GoldenGate environments, wallets, certificates, database credentials, and encrypted source or target data can all become part of the security chain. OKV helps reduce unmanaged local copies, but endpoint access and operational ownership must be planned properly.

In hybrid or multi-cloud setups, the difficult questions are often outside the database. Can the DR site reach OKV? Does DNS resolve correctly after failover? Are firewall rules open from all database subnets? Who owns certificate renewal? Is OKV monitored by both security and operations teams?


Oracle vs PostgreSQL: Same Goal, Different Model

Oracle has a strong database-native TDE model, and Oracle Key Vault integrates closely with that ecosystem.

PostgreSQL is different. Community PostgreSQL usually follows a layered security model. DBAs commonly combine SSL/TLS, SCRAM authentication, pgcrypto for specific column-level encryption use cases, OS or storage-level encryption, cloud KMS, or external vault solutions. Some PostgreSQL vendors provide their own TDE features, but it is not the same operational model as Oracle TDE with OKV.

SHOW ssl;

SELECT pid,
ssl,
version,
cipher FROM pg_stat_ssl WHERE ssl = true;

CREATE EXTENSION IF NOT EXISTS pgcrypto;

SELECT pgp_sym_encrypt('sensitive-value', 'do-not-hardcode-this-key');

The PostgreSQL example above is only to show the capability. In production, encryption keys should not be hardcoded inside SQL, scripts, or application configuration files. Key ownership, rotation, and auditability must be designed properly.


Common Failure Scenarios

Most OKV-related issues are not mysterious. They usually come from one missed endpoint step, one wrong permission, one network rule, or one assumption that was never tested.

  • Database restart fails because the keystore cannot be opened.
  • Standby opens after failover but encrypted tablespaces are not accessible.
  • RAC node 1 works, but node 2 fails after service relocation.
  • OKV endpoint was re-enrolled, but the database server still has old configuration files.
  • Firewall or DNS changes break OKV connectivity from the DR site.
  • Key rotation was performed without validating standby, restore, and application behaviour.

A Case Study about: Data Guard Failover and Missing Key Access

A TDE-enabled Oracle database was protected by Data Guard. Redo transport was healthy, apply lag was under control, and the standby looked ready for DR.

During a failover test, the standby was promoted successfully. The database opened, but application testing failed when encrypted data was accessed.

The root cause was not Data Guard. The standby host did not have proper OKV endpoint access to the required virtual wallet. The team had validated replication but had not validated TDE key access from the standby server.

The fix was to enroll the standby correctly as an OKV endpoint, grant access to the required virtual wallet, validate endpoint connectivity, check wallet status from the database, and test encrypted data access again after role transition.

The lesson is simple: for encrypted databases, Data Guard readiness is not only redo apply. It also includes key availability.



DBA Insights from Production

The most dangerous encryption issue is the one discovered during recovery.

A database can run for months without anyone noticing that a standby endpoint is wrong, a wallet backup is outdated, a RAC node cannot reach OKV, or a restore host does not have the correct access. These issues surface during patching, failover, restore, or migration, exactly when pressure is highest.

My practical recommendations are:

  • Add OKV checks to database health check scripts.
  • Validate endpoint connectivity from every RAC node.
  • Include OKV validation in Data Guard switchover and failover drills.
  • Test encrypted tablespace access after restore.
  • Track certificate expiry and endpoint re-enrollment.
  • Do not rotate keys in production without a tested rollback and communication plan.
  • Document ownership between DBA, security, Unix, network, and cloud teams.

Oracle Key Vault gives control, but only when the operational process around it is strong.


Quick Takeaways

  • Oracle Key Vault reduces wallet and key sprawl, but it must be included in availability planning.
  • WALLET_ROOT and TDE_CONFIGURATION are key parameters for modern Oracle TDE setup.
  • okvutil list is a simple but powerful endpoint validation command.
  • RAC nodes, standby servers, and restore hosts must all be checked separately.
  • Data Guard readiness is incomplete without TDE key access validation.
  • PostgreSQL security usually needs a layered design rather than one OKV-style model.

FAQs

1. Does Oracle Key Vault replace TDE?

No. TDE encrypts the database data. Oracle Key Vault centrally manages the keys and security objects used by TDE.

2. Will OKV slow down every SQL query?

Normally, no. OKV is more relevant during key access, startup, keystore open, key rotation, migration, and recovery operations. It is not called for every row read.

3. What should I check first during an OKV issue?

Start with v$encryption_wallet from the database and okvutil list from the database server. These two checks quickly separate database-side and endpoint-side issues.

4. Is OKV mandatory for Data Guard?

No, not in every design. But if the primary database uses OKV-managed TDE keys, the standby must also be able to access the required keys.

5. How is PostgreSQL different?

Oracle has native TDE integration with OKV. PostgreSQL commonly uses TLS, pgcrypto, storage encryption, application-level encryption, external vaults, or cloud KMS depending on the requirement.


Conclusion

Oracle Key Vault solves a real production problem: too many keys, wallets, certificates, and secrets spread across too many systems.

For Oracle DBAs, the biggest benefit is not only central storage. It is controlled access, audit support, cleaner key lifecycle operations, and reduced recovery risk. When TDE is used across RAC, Data Guard, GoldenGate, and hybrid environments, this becomes even more important.

At the same time, OKV should not be treated as a black box owned only by the security team. Once Oracle databases depend on it, DBAs need to understand endpoint configuration, TDE parameters, standby access, certificate dependency, and what happens during failover or restore.

The best time to test key access is not during a failed recovery. It is during planned validation.

Review your encrypted databases. Check where the keys live. Confirm who can access them. Validate OKV from all nodes. Test standby and restore scenarios. Add OKV checks to your operational runbooks.

Encryption protects data, but key management protects the recovery path. 


Have you ever seen a restore, switchover, or migration delayed because the wallet or encryption key was missing? 

Share your experience below. These are the production lessons that are rarely visible in architecture diagrams.



Sunday, 9 August 2026

Sometimes It Is Not One Big Problem. It Is Everything Running in the Background.


After more than 12 years of working with production databases, I have learned that performance problems do not always begin with one terrible query.

Sometimes it is several smaller things happening together. One session is using slightly more CPU, another is holding a lock, a background job is running longer than expected, and storage latency has quietly increased. None of them looks disastrous alone, but together they make the whole system struggle.

Stress can build in much the same way.

We usually search for one obvious reason when we feel exhausted: a difficult project, a production incident, financial pressure, or a problem at home.

But sometimes there is no single cause. It is the late-night message we answered, the lunch we skipped, the conversation we kept replaying, the water we forgot to drink, and the sleep we sacrificed because one task was still pending

Each one appears manageable. Together, they become a collection of background processes that nobody remembered to stop.


The Small Things That Keep Us Switched On


Lesson 1: Work Never Completely Ends

Anyone working in production support knows that some situations cannot wait. If a critical database is unavailable, “Let us check tomorrow morning” is unlikely to be accepted as a recovery plan.

But not every email is an incident. Not every Teams message is an escalation. And not every sentence beginning with “quick question” will actually be quick.

When work follows us into every evening, the laptop may be closed, but the mind remains connected. We continue thinking about tomorrow’s change, an unresolved ticket, or the possibility that another message might arrive.

Effectively, the brain remains on call—usually without claiming the allowance.

There needs to be a reasonable difference between being responsible and being permanently available.


Lesson 2: We Postpone the Basics First

During a busy day, lunch is often treated as an optional dependency.

We plan to eat after the next meeting. Then another call starts, a ticket is escalated, and lunch finally happens at 4:30 PM. That is not necessarily intermittent fasting. Sometimes it is simply poor calendar management.

Water, movement, and sleep are handled in much the same way. The body may tolerate this for a while, which can make us believe everything is fine. However, inadequate sleep can affect attention, mood, and emotional regulation, making ordinary problems feel harder the following day.

No productivity application can fully compensate for repeatedly ignoring the basics—not even the one with the attractive dashboard.


Lesson 3: Some Meetings Continue in Our Heads

We have all attended a meeting that officially ended at 3:00 PM but continued in our mind until bedtime.

Perhaps someone spoke unfairly. Maybe an important question remained unanswered. We replay the discussion and prepare several excellent responses—unfortunately, all of them arrive four hours too late.

It is unrealistic to expect every emotion to disappear when a meeting ends. A more practical approach is to write down what happened, decide whether an action is required, and set a time to deal with it.

Otherwise, a 30-minute conversation can occupy mental storage for the rest of the day.


Lesson 4: Notifications Create Invisible Work

One notification does not seem stressful. The problem is the repeated switching

You are reviewing a document when a Teams message appears. Then an email arrives, the phone vibrates, and somebody requests a “small update” in another channel. By evening, you have been active for nine hours but are not entirely sure what you completed.

Research suggests that notifications can interrupt attention even when we do not open them. Turning off unnecessary alerts does not mean becoming unreachable. It means deciding which applications genuinely deserve permission to interrupt you.

If five applications are all marked as urgent, perhaps none of them understands the meaning of urgent.


Lesson 5: Sitting All Day Does Not Help

DBAs can spend several hours in the same chair, particularly during an incident, production change, or troubleshooting call.

At some point, the chair knows more about the shift schedule than the family does.

Movement does not have to mean a full gym session. A short walk after lunch, standing during a call, or stepping away from the screen between meetings can break a long period of sitting.

A ten-minute walk will not resolve chronic stress or fix the execution plan. It can, however, give the mind a useful pause.


Lesson 6: Not Every Energy Dip Is a Blood-Sugar Problem

Tiredness, irritability, and poor concentration are frequently blamed on a “blood-sugar crash.” That explanation is often too simple.

The same symptoms may be related to poor sleep, dehydration, irregular meals, stress, medication, or an underlying health condition. An afternoon slump alone is not enough to conclude that someone has hypoglycaemia.

Regular, balanced meals are a sensible starting point. If fatigue, dizziness, or other unexplained symptoms continue, speak with a qualified medical professional. Google, a smartwatch, and one motivational video do not constitute a clinical team.


Lesson 7 Connection Matters More Than We Admit

When work becomes intense, personal time is often the first item removed from the calendar.

We postpone meeting friends, speak less with family, and remain half-connected to the phone even when we are with people; just in case the world ends while we are having dinner.

Supportive relationships cannot remove difficult circumstances, but they can make those circumstances easier to manage. Sometimes a relaxed conversation with someone we trust is more useful than another hour spent trying to optimise ourselves.


Recovery May Begin with Subtraction

When a database is overloaded, we do not always solve the problem by adding more resources. Sometimes we stop an unnecessary job, reduce repeated calls, correct an inefficient query, or remove work that should never have been running.

The same principle can apply to us.

Recovery may not begin with another tracking application, a complicated morning routine, or ten new habits that eventually become eleven new sources of guilt.

It may begin with something much simpler:

  • Turn off one unnecessary notification.
  • Decline one meeting that does not need to happen.
  • Eat lunch without looking at a screen.
  • Leave one genuinely non-urgent message until tomorrow.
  • Allow an empty space in the calendar to remain empty.

The objective is not to eliminate every source of stress. Some pressure is unavoidable, particularly in roles carrying operational responsibility. The problem begins when pressure becomes continuous and recovery is repeatedly postponed.

We spend a great deal of time monitoring the health of our systems. Occasionally, we should check what has been running in our own background for too long.

Not every alert requires a P1 response—but please understand the alert before muting it and going for coffee.

Stay healthy.



Oracle Redo Logs: Sizing Without Guesswork

Redo log problems rarely start with a clean error message. They usually show up as slow commits, archive destinations filling faster than expected, Data Guard apply lag, or batch jobs that suddenly take longer during month-end. By the time someone checks the alert log, the database may already be switching logs too frequently, checkpointing aggressively, or waiting for archiving to catch up.

A common reaction is to increase redo log size and move on. Sometimes that is required, but it is not always the real fix. Redo log sizing controls how frequently Oracle switches logs. It does not reduce the amount of redo generated by bad SQL, unnecessary indexes, row-by-row commits, or poorly designed batch jobs.

This post looks at Oracle redo log sizing from a production DBA angle. We will check log switch frequency, estimate redo generation rate, review MTTR guidance, discuss common failure scenarios, and compare the idea briefly with PostgreSQL WAL pressure.



Saturday, 18 July 2026

The Outage Usually Begins Before the Database Fails

A database incident rarely begins when the monitoring system raises an alert. It usually begins weeks earlier - with an unreviewed execution plan, an ignored capacity trend, an oversized privilege, or a recovery procedure that nobody has tested.

By the time the DBA receives the call, the database is often exposing an operational weakness that was already present. The immediate symptom may be exhausted storage, a failed deployment, excessive I/O, or a missing object, but the underlying cause is frequently a gap in engineering discipline.

I have seen expensive Oracle platforms fail because nobody noticed that the Fast Recovery Area was growing rapidly. I have also seen relatively modest PostgreSQL environments remain stable for years because the team consistently reviewed changes, monitored capacity, controlled access, and tested recovery.



Thursday, 11 June 2026

Oracle 26ai Read-Only Users and Sessions

One very common production request sounds simple:

"Can we give this user access, but make sure they cannot change anything?"

Before Oracle AI Database 26ai, DBAs usually handled this by creating a separate reporting user, granting only SELECT, removing DML privileges, or depending on carefully designed roles. That approach works when access is cleanly designed from the beginning. But in real production systems, users often collect privileges over time. Support users get emergency grants, application users may have broader access than expected, and batch accounts sometimes have privileges that nobody wants to touch during an incident.



Wednesday, 3 June 2026

My Oracle ACE Journey: From Practical Sharing to Oracle ACE Pro

  Some journeys do not begin with a plan. They begin with curiosity, consistency, and a simple intention to share what we learn.

My Oracle ACE journey is one such journey.



Sunday, 31 May 2026

Recognized Among FeedSpot’s Top 70 Database Blogs to Follow in 2026

I am happy to share that Learn DBA : A Life Long Learning Experience has been selected by FeedSpot as one of the Top 70 Database Blogs to Follow in 2026.



Thursday, 14 August 2025

Celebrating Freedom with PostgreSQL: A Tribute on India's Independence Day

 As India marks 78 years of freedom, it’s a perfect moment to draw some  parallels between our nation’s journey and our favorite open-source database, PostgreSQL. This Independence Day, let’s explore how the spirit of freedom and innovation reflects in both our national history and PostgreSQL’s capabilities.


Sunday, 10 August 2025

Step-by-Step Guide: Configuring Yum Repository in Linux for Oracle DBAs

 For Oracle DBAs managing Linux systems, configuring Yum repositories is essential for streamlining package management tasks like installation, updates, and dependency resolution. In this guide, I’ll walk you through setting up a Yum repository in a few simple steps, ensuring a smooth package management experience.



Monday, 19 May 2025

Oracle TDE (Part II): Advanced Encryption and Storage Considerations

  Oracle TDE provides flexible encryption options for both database and tablespace levels. The default encryption standard for database and tablespace encryption is AES128, while AES192 is used for column-level encryption. For added security, a random string, known as SALT, is appended to plaintext before encryption in column-level encryption. SALT enhances security but cannot be applied to indexed columns.



Sunday, 18 May 2025

Oracle TDE (Part I) : A Comprehensive Overview of Transparent Data Encryption

 Oracle's Transparent Data Encryption (TDE) is a pivotal feature for securing sensitive information in your database. It offers robust encryption for data stored in tables, tablespaces, and backups, ensuring that unauthorized users cannot access your critical data. TDE relies on external security modules, known as TDE wallets or keystores, to manage and protect encryption keys.



Sunday, 4 May 2025

Unlocking New Capabilities in Oracle RAC 19c

 Oracle 19c brings a host of new features and enhancements to Real Application Cluster (RAC), significantly improving resource management, cluster flexibility, and overall performance. Here’s a breakdown of the key updates:



Sunday, 20 April 2025

Exploring Oracle 19c: New Features in Data Guard, RMAN, and Backup & Recovery

 Oracle 19c introduces several powerful features that enhance Data Guard, RMAN, and backup and recovery capabilities. These updates streamline database management, improve performance, and provide more robust disaster recovery options. Let’s take a closer look at the highlights.



Monday, 3 March 2025

Elevate Your Oracle Database Security with Oracle Data Safe

 Ensuring robust database security and compliance is a critical concern for organizations, especially when dealing with sensitive data and regulatory requirements. Oracle Data Safe provides a unified control center designed to streamline security management and compliance tasks across various environments—whether on-premises, in Oracle Cloud Infrastructure (OCI), at Cloud@Customer, or on other cloud platforms.



Saturday, 1 March 2025

Building a Kind and Effective Leadership Style: 10 Essential Traits

 Leadership is about more than achieving targets; it’s about how you guide and nurture your team along the way. A kind leader cultivates a positive and supportive environment, fostering trust, collaboration, and growth. Below are ten essential traits that define a kind and effective leader:


Saturday, 15 February 2025

10 Common Oracle Performance Mistakes and How to Avoid Them

 Oracle database performance issues can significantly impact the efficiency and responsiveness of your system. Identifying and addressing bottlenecks is crucial for maintaining optimal performance. However, performance tuning is an iterative process, where solving one issue may reveal another. With experience and a systematic approach, applications can be debugged and scaled effectively. Below are ten common mistakes that often hinder Oracle performance and how to avoid them.


Sunday, 2 February 2025

Oracle TDE Demystified: Safeguarding Sensitive Data in Your Database

 Transparent Data Encryption (TDE) is a powerful security feature in Oracle Database designed to safeguard sensitive data through encryption. TDE protects data at rest, ensuring that even if database files (DBF) are stolen or compromised, the data remains secure and inaccessible to unauthorized parties.


Sunday, 19 January 2025

Navigating Human Struggles: A Tale of Empathy in the Workplace

 In the bustling world of office dynamics and performance evaluations, there lies a crucial juncture where empathy meets professionalism. Recently, I found myself at such a crossroads during a candid 1:1 performance review with one of my employees. What transpired during this encounter not only reinforced the essence of our organizational culture but also underscored the importance of extending compassion beyond the confines of the workplace.



Saturday, 21 December 2024

Transforming Database Operations with Oracle Autonomous Database: A Comprehensive Overview

 Oracle Autonomous Database is revolutionizing database management by introducing a suite of advanced features designed to simplify operations, enhance performance, and provide unmatched reliability. Here’s a closer look at the key features that make Oracle Autonomous Database a game-changer in the world of data management.