DBA Blogs
Bug using SQL_MACRO (TABLE) with table parameter
Oracle RAC Concepts (gestion des instances / hang / reconfiguration)
ORA-04031 when explain plan of a very big and complex query
Does TLS 1.3 supported in the current OEM 24ai version
DBMS_SCHEDULER commit_semantics => 'ABSORB_ERRORS' How to Handle Exceptions
i am facing issue in fra as space is getting filled and not deleting flashback log filling the mount point on the server
Database Design/Data Modelling
CREATE UNIQUE INDEX <NAME> ON <TABLE> (ID DESC);
Smart Select
View vs function SQL_MACRO
Tracking Deletes on a table
Coordinated Replicats: The Best Way to Do Initial Load
Coordinated vs parallel replicat for Oracle GoldenGate initial loads: why coordinated wins and scales a single table.
The post Coordinated Replicats: The Best Way to Do Initial Load appeared first on DBASolved.
Using INCLUDE Files and Macros in OCI GoldenGate
OCI GoldenGate drops the dirprm and dirmac directories, but INCLUDE files and macros still work. Here is how to create and reference them in the cloud console.
The post Using INCLUDE Files and Macros in OCI GoldenGate appeared first on DBASolved.
Demystifying Netfilter and nftables: How Linux Packet Filtering Really Works
Understanding how Linux handles network packets at the kernel level can feel overwhelming — until you see how the pieces fit together. Netfilter provides the foundation, while nftables gives us a modern, flexible way to define firewall rules, NAT, and packet mangling.
Whether you’re debugging connectivity issues, writing security tools, or optimizing performance, knowing these internals helps you work more effectively with Linux networking.
Netfilter: The Kernel’s Packet Processing FrameworkNetfilter is the Linux kernel’s packet filtering and mangling infrastructure. It defines well-known hook points where packets can be inspected and modified as they flow through the system:
- PREROUTING — Right after a packet arrives, before routing decisions
- INPUT — Packets destined for the local system
- FORWARD — Packets being routed through the host
- OUTPUT — Locally generated packets
- POSTROUTING — After routing, before leaving the host
Chains attached to these hooks let you enforce security policies, perform NAT, or influence routing.
nftables: The Modern Replacement for iptablesnftables brings a cleaner, more consistent syntax and better performance compared to the older iptables framework. It organizes configuration into tables, chains, rules, sets, and expressions.
Core nftables Building Blocks TablesContainers that group related chains, sets, and rules. Common families include ip (IPv4), ip6 (IPv6), and inet (both).
nft add table ip myfirewall
Chains
Sequences of rules. Base chains attach directly to Netfilter hooks and define behavior (filter, nat, route).
nft add chain ip myfirewall input { type filter hook input priority 0 \; }
Rules
Define matching conditions and actions (accept, drop, jump, etc.).
nft add rule ip myfirewall input tcp dport 22 accept
Sets
Efficient collections for matching (IP addresses, ports, etc.).
nft add set ip myfirewall trusted_ips { type ipv4_addr \; }
nft add element ip myfirewall trusted_ips { 192.168.1.10, 10.0.0.5 }
Practical Example: Simple Firewall
Here’s how to create a basic firewall that allows SSH from trusted IPs and drops everything else:
nft add table ip myfirewall
nft add chain ip myfirewall input { type filter hook input priority 0 \; }
nft add set ip myfirewall trusted_ips { type ipv4_addr \; }
nft add element ip myfirewall trusted_ips { 192.168.1.1, 192.168.1.2 }
nft add rule ip myfirewall input ip saddr @trusted_ips accept
nft add rule ip myfirewall input drop
Behind the Scenes: User Space to Kernel
Tools like nft use libmnl and libnftnl to communicate with the kernel via Netlink. This allows atomic batch operations — multiple changes applied together or not at all — ensuring consistent firewall state.
Best Practices for Production- Use named sets for frequently updated lists (trusted IPs, blocked addresses)
- Keep base chains simple and explicit with a final drop rule
- Leverage priorities to control execution order
- Batch operations when making multiple changes
- Monitor and log dropped packets for visibility
Netfilter and nftables form a powerful, unified framework for packet processing in Linux. Understanding how tables, chains, rules, and sets work together helps you build more effective firewalls, troubleshoot network issues faster, and appreciate the elegance of the modern Linux networking stack.
Whether you’re securing servers, implementing complex NAT rules, or exploring kernel internals, nftables gives you the tools to control traffic with precision and clarity.
Mastering High Availability Connection Strings in Oracle: What Really Happens Behind the Scenes
Most Oracle DBAs and developers copy-paste the same “recommended” TNS connection string for RAC and Data Guard without fully understanding how each parameter affects real-world behavior. That changes today.
This guide breaks down the critical parameters in a typical HA connect descriptor, shows measurable timing impacts, and gives clear guidance on when to tune what — so your applications stay resilient during switchovers, failovers, and maintenance.
The Standard HA Connect StringHere’s the common pattern you’ll see in MAA documentation:
(DESCRIPTION =
(CONNECT_TIMEOUT=90)(RETRY_COUNT=100)(RETRY_DELAY=3)
(TRANSPORT_CONNECT_TIMEOUT=1000ms)
(ADDRESS_LIST = (LOAD_BALANCE=on) (ADDRESS = ...))
(ADDRESS_LIST = (LOAD_BALANCE=on) (ADDRESS = ...))
(CONNECT_DATA = (SERVICE_NAME = my_service))
)
Let’s explore what each setting actually does and how changing it impacts connection behavior.
1. FAILOVER = ON (Default)Controls whether the client tries alternate addresses when one fails. Keep this ON unless you have a very specific reason to disable it. Turning it OFF makes connections order-dependent and can prevent reaching an available site during role transitions.
2. LOAD_BALANCE = ONRandomizes the starting address in an ADDRESS_LIST. This prevents one SCAN IP from being hammered and helps spread load. Strongly recommended when you have multiple addresses, especially during partial outages or maintenance.
3. RETRY_COUNT & RETRY_DELAYRETRY_COUNT defines how many additional rounds the client makes through the address list. RETRY_DELAY adds a pause between rounds so the service has time to become available after a switchover or failover.
Tip: Use RETRY_DELAY=3 (seconds) as a good starting point. Tight loops (RETRY_DELAY=0) create unnecessary load and should be avoided in production.
4. TRANSPORT_CONNECT_TIMEOUTThis is crucial when an IP or port is unreachable. It caps how long the client waits for a TCP connect before moving to the next address. Set it low enough to fail fast during outages, but high enough to handle normal network jitter (1000ms is a common balanced value).
5. CONNECT_TIMEOUTLimits the total time for a single connection attempt, including server process creation. Set this higher than TRANSPORT_CONNECT_TIMEOUT (commonly 60–90 seconds) to allow normal connects under load while protecting against hanging attempts.
Practical Recommendations- For frequent role changes (Fast-Start Failover): Use LOAD_BALANCE=on and moderate RETRY_COUNT
- For stable primary with rare switchovers: Prefer LOAD_BALANCE=off with clear site ordering
- Always set TRANSPORT_CONNECT_TIMEOUT explicitly — don’t rely on defaults
- Align your application connection pool timeouts with the worst-case client wait time
- Use the latest Oracle client (26ai recommended) for millisecond precision support
Don’t treat the HA connection string as magic copy-paste code. Understand what each parameter controls and tune it to your environment’s failover patterns and network characteristics. Small changes here can dramatically improve application resilience during planned maintenance and unplanned outages.
Test your connection strings under simulated failure scenarios (service down, network blocked) and measure real connect times. The better you understand your client behavior, the more predictable and reliable your high-availability applications will be.
Oracle AI Database 26ai Supercharges Active Data Guard: Faster Failovers, Stronger Multicloud Resilience
Mission-critical applications demand minimal downtime and lightning-fast recovery. With Oracle AI Database 26ai, Oracle has dramatically improved Data Guard and Active Data Guard role transitions, making high-availability architectures faster and more reliable than ever.
These enhancements push Oracle Maximum Availability Architecture (MAA) Platinum tier capabilities across Oracle’s multicloud ecosystem, giving organizations consistent, enterprise-grade resilience no matter where they run.
Game-Changing Performance ImprovementsOracle’s testing shows impressive gains:
- Up to **5x faster failovers** — often completing in under 30 seconds
- Up to **3.4x faster switchovers**
- Consistent results across both small and large workloads
- No changes required to your applications
These optimizations span database recovery, checkpoint processing, service management, and multitenant operations — delivering real reductions in Recovery Time Objectives (RTO).
MAA Platinum Tier Now Available Across MulticloudOrganizations using Oracle Database@Azure, Oracle Database@AWS, or Oracle Database@Google Cloud can now standardize on the same Platinum MAA architecture:
- Local HA with RTO under 10 seconds
- Regional DR with RTO under 30 seconds
- Zero or near-zero Recovery Point Objective (RPO)
This consistency lets teams apply the same proven best practices, operational procedures, and resiliency strategies across all their multicloud deployments.
Why This Matters for Your Business- Less Downtime — Faster planned maintenance and unplanned recovery
- Better User Experience — Minimal disruption during role transitions
- Simplified Operations — Standardize high-availability practices across environments
- Future-Proof Architecture — Built for the most demanding mission-critical workloads
Existing Exadata and Exadata Database Service customers running Active Data Guard will see immediate benefits from moving to Oracle AI Database 26ai. The performance gains make Platinum MAA tier objectives much more achievable without major architectural overhauls.
Next StepsIf you’re running mission-critical databases, now is the perfect time to evaluate Oracle AI Database 26ai. The combination of Exadata performance, Active Data Guard, and these accelerated role transitions creates one of the strongest availability platforms available today.
Explore the updated MAA reference architectures and multicloud certification matrix to see how you can strengthen your high-availability strategy across Oracle Cloud and major hyperscalers.
Connect to Oracle Like It’s Kafka: OKafka Authentication Made Simple
One of the nicest things about OKafka is how familiar it feels if you’ve used Kafka before. You configure connections with Properties objects, just like kafka-clients. The big difference? You’re talking directly to Oracle Database Transactional Event Queues instead of a separate broker.
Here’s how to set up authentication cleanly for development and production.
Two Main Authentication Paths 1. PLAINTEXT (Great for Local Dev)Simple username/password setup using an ojdbc.properties file:
Properties props = new Properties();
props.put("security.protocol", "PLAINTEXT");
props.put("bootstrap.servers", "your-host:port");
props.put("oracle.service.name", "your_service_name");
props.put("oracle.net.tns_admin", "/path/to/config/dir");
Your ojdbc.properties file should contain:
user=testuser
password=YourStrongPassword123
2. SSL / mTLS (Production Ready)
Use Oracle Wallet for secure connections. Point to your wallet directory and specify the TNS alias:
props.put("security.protocol", "SSL");
props.put("oracle.net.tns_admin", "/path/to/wallet");
props.put("tns.alias", "your_tns_alias");
Full Working Example
Here’s a complete snippet to create an AdminClient and make a topic:
try (Admin admin = AdminClient.create(props)) {
NewTopic topic = new NewTopic("MY_EVENTS", 5, (short) 0);
admin.createTopics(Collections.singletonList(topic)).all().get();
System.out.println("Topic created successfully");
}
Pro Tips for Smooth Sailing
- Always use uppercase topic names with OKafka
- Store wallet files securely and never commit them to version control
- Test with Oracle Database Free + Testcontainers for quick iterations
- Move to mTLS early in your development cycle
OKafka makes connecting to Oracle feel just like connecting to any other Kafka cluster — but you get all the power, security, and transactional guarantees of the database built right in.
No extra infrastructure. No separate cluster to manage. Just reliable event streaming where your data already lives.
OKafka: Run Kafka-Style Apps Directly in Oracle Database with Zero Extra Infrastructure
Want the familiar Kafka Java APIs without standing up and managing a separate Kafka cluster? Oracle’s **OKafka** (Kafka Java Client for Transactional Event Queues) lets you produce and consume events straight from your Oracle Database — with full transactional guarantees and exactly-once semantics.
Here’s everything you need to know to get started quickly and build reliable event-driven applications on Oracle AI Database.
Why OKafka?- Use standard Kafka Java producer/consumer code
- Events are stored and processed inside the database
- Atomic transactions between database changes and event publishing
- No separate message broker to operate and scale
- Works with Oracle Database 23ai Free and above
First, create a database user with the required privileges:
CREATE USER okafka_user IDENTIFIED BY Oracle123;
GRANT AQ_USER_ROLE TO okafka_user;
GRANT CONNECT, RESOURCE, UNLIMITED TABLESPACE TO okafka_user;
GRANT EXECUTE ON DBMS_AQ TO okafka_user;
GRANT EXECUTE ON DBMS_AQADM TO okafka_user;
GRANT SELECT ON GV_$SESSION TO okafka_user;
-- ... (full list in documentation)
Then create your first topic:
BEGIN
DBMS_AQADM.CREATE_DATABASE_KAFKA_TOPIC(
topicname => 'MY_TOPIC',
partition_num => 5,
retentiontime => 7*24*3600
);
END;
Connection Configuration
Option 1: PLAINTEXT (Simple)
security.protocol=PLAINTEXT
bootstrap.servers=your-host:port
oracle.service.name=your_service
oracle.net.tns_admin=/path/to/ojdbc.properties
Option 2: SSL (Recommended for Production)
Use Oracle Wallet for secure mTLS connections.
Building Your First OKafka App- Clone the OKafka distribution
- Build with Gradle:
./gradlew jaror./gradlew fullJar - Add the resulting JAR to your project
Properties props = new Properties();
props.put("bootstrap.servers", "your-host:port");
props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
KafkaProducer producer = new KafkaProducer<>(props);
ProducerRecord record = new ProducerRecord<>("MY_TOPIC", "key1", "Hello from OKafka!");
producer.send(record).get();
producer.close();
Consumer Example
KafkaConsumer consumer = new KafkaConsumer<>(props);
consumer.subscribe(Collections.singletonList("MY_TOPIC"));
while (true) {
ConsumerRecords records = consumer.poll(Duration.ofMillis(100));
for (ConsumerRecord record : records) {
System.out.println("Received: " + record.value());
}
}
Best Practices
- Use transactions for atomic database + event operations
- Always handle proper error paths and rollbacks
- Test with Testcontainers + Oracle Database Free
- Monitor queue depth and consumer lag
- Start with PLAINTEXT for development, move to SSL in production
OKafka brings the power and familiarity of Kafka directly into Oracle Database. You get enterprise-grade messaging with transactional integrity, high availability, and zero additional infrastructure to manage.
Whether you’re building microservices, event-driven architectures, or real-time analytics, OKafka lets you leverage your existing Oracle investment for reliable pub/sub messaging.
Why Run Your Message Broker Inside Oracle Database? Meet TxEventQ
Building event-driven applications usually means standing up another system — Kafka, RabbitMQ, or similar. But what if your database could handle reliable messaging natively, with full transactional guarantees and zero extra infrastructure?
That’s exactly what **Oracle Database Transactional Event Queues (TxEventQ)** delivers.
What Is TxEventQ?TxEventQ is a built-in, high-performance messaging system inside Oracle Database. It supports:
- Multiple producers and consumers
- Exactly-once delivery semantics
- Partitioned queues with ordering guarantees
- Full SQL access to events and metadata
Available since Oracle Database 21c (including the free edition), it’s ready to use today.
Why Teams Are Choosing TxEventQ- Simplified Architecture — No separate message broker to manage, patch, or scale
- Transactional Integrity — Database changes and message publishing happen atomically
- Exactly-Once Semantics — Critical for financial, compliance, and mission-critical flows
- SQL-Native — Query, join, and analyze events using familiar SQL
It’s especially powerful when you need tight coupling between data changes and event publishing — no dual-write problems.
How to Get StartedThe easiest path for Java developers is the **Kafka Java Client for Oracle TxEventQ (OKafka)**. It uses the familiar Kafka APIs you already know, but talks directly to the database.
Other options include:
- PL/SQL using DBMS_AQ
- REST via Oracle REST Data Services (ORDS)
- Python, Node.js, .NET, and other language drivers
- Event-driven microservices inside the database
- Change Data Capture (CDC) patterns
- Application integration and workflow orchestration
- Real-time analytics and notifications
- Start with the Kafka Java API if you’re already familiar with Kafka
- Use triggers for automatic event publishing on DML operations
- Leverage partitioning for high-throughput scenarios
- Combine with Oracle AI Database features for intelligent event processing
TxEventQ lets you bring reliable pub/sub messaging directly into your Oracle Database, eliminating the need for yet another system to manage. It’s fast, transactional, and deeply integrated with everything else Oracle Database offers.
Whether you’re modernizing legacy systems, building new event-driven apps, or simplifying your architecture, TxEventQ is worth serious consideration.
Build Better Kafka Apps on Oracle AI Database with This Agent Skill
Writing solid Kafka Java code for Oracle AI Database’s Transactional Event Queues (using OKafka) can be tricky. Agents often miss Oracle-specific patterns around authentication, transactions, serialization, and testing.
That’s why I created a focused agent skill: **okafka-java-code** — designed to generate high-quality, production-ready OKafka applications from the start.
Why This Skill ExistsMost AI coding assistants generate OKafka code that works... but not well. They miss key Oracle behaviors like using `getDBConnection()` for transactional consistency, proper topic administration, and realistic testing with Testcontainers.
This skill packages the hard-won patterns I use daily into something any agent can reuse.
What the Skill Includes- OKafka administration (topic creation)
- Authentication and connection properties
- Transactional producer and consumer patterns
- OSON serialization best practices
- Integration testing with Testcontainers
- Troubleshooting and common pitfalls
Here’s the kind of clean, correct code the skill generates for a transactional workflow:
private void publish(BusinessEvent event, boolean failAfterDatabaseWrite) throws Exception {
producer.beginTransaction();
try {
producer.send(new ProducerRecord<>(topic, event.id(), event.payload())).get();
insertProducedEvent(producer.getDBConnection(), event);
if (failAfterDatabaseWrite) {
throw new IllegalStateException("Simulated failure");
}
producer.commitTransaction();
} catch (Exception e) {
abortAndRethrow(e);
}
}
And the consumer side follows the same safe transactional pattern.
The Testing StoryThe skill also generates full integration tests using Testcontainers + Oracle Database Free. It validates:
- Successful commit (data + Kafka record both visible)
- Producer abort (no data persisted)
- Consumer rollback (message available for retry)
- Install the skill from the GitHub repo
- Describe your use case to your agent
- Review and run the generated code
- Iterate with confidence
Good agent skills shift the conversation. Instead of fixing basic setup issues, you can focus on business logic, transaction correctness, and real application behavior.
By packaging proven OKafka patterns into a reusable skill, you raise the baseline quality of every generated application — saving hours of debugging and review time.
If you work with Oracle AI Database and Kafka-style messaging, give this skill a try. It’s one of the fastest ways to go from “it compiles” to “this is production-ready.”


