check pdb database name and dbid in oracle
SQL>
SQL> select dbid , name from v$pdbs;
DBID NAME
---------- ----------------------------------------
3326623803 PDB
SQL>
SQL>
SQL> select dbid , name from v$pdbs;
DBID NAME
---------- ----------------------------------------
3326623803 PDB
SQL>
SQL>
SQL> alter session set container=pdb$seed;
Session altered.
SQL>
SQL> show con_name
CON_NAME
------------------------------
PDB$SEED
SQL>
SQL>
SQL> alter pluggable database pdb open read write;
alter pluggable database pdb open read write
*
ERROR at line 1:
ORA-65118: operation affecting a pluggable database cannot be performed from
another pluggable database
SQL> alter session set container=pdb;
Session altered.
SQL> show con_name
CON_NAME
------------------------------
PDB
SQL>
SQL> alter pluggable database pdb open read write;
Pluggable database altered.
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 PDB READ WRITE NO
SQL>
To maintain the integrity of the data, there are four properties described in the database management system, which are known as the ACID properties
ACID properties are a set of principles that ensure reliable transaction processing in a database. They stand for:
These ACID properties ensure database reliability, especially in multi-user and distributed environments.
Oracle uses a multi-layered architecture where the database and database instance are distinct yet interconnected. Understanding their differences is key for Oracle DBAs.
An Oracle Database is a collection of physical files that store data and metadata. It consists of:
✅ Datafiles (.dbf
) – Store actual user and system data.
✅ Control files (.ctl
) – Track database structure and SCN.
✅ Redo log files (.log
) – Record all changes for recovery.
✅ Temporary & Undo tablespaces – Handle transactions and rollback.
✅ Archived logs – Used for database recovery (in ARCHIVELOG mode).
✅ Password File
✅ Alert logs logs
✅ Trace logs logs
🔹 The database persists even when the Oracle instance is shut down.
An Oracle Instance is a combination of memory structures (SGA & PGA) and background processes that interact with the database.
✅ SGA (System Global Area) – Shared memory that holds cached data and SQL execution plans.
✅ PGA (Program Global Area) – Memory specific to each session/process.
✅ Background Processes – Key ones include:
🔹 The instance exists only when the database is running.
Feature | Oracle Database | Oracle Instance |
---|---|---|
Definition | A collection of physical storage files | A combination of memory structures & background processes |
Persistence | Permanent (even after shutdown) | Temporary (exists only when running) |
Components | Datafiles, Control files, Redo logs, Tablespaces | SGA, PGA, Background Processes (DBWR, LGWR, PMON, SMON, etc.) |
Location | Stored on disk | Resides in RAM (memory) |
Startup Required? | Exists even when shut down | Created only when the database starts |
Example | /u01/oradata/orcl/system01.dbf | orcl (instance name) managed by pmon |
SELECT name, open_mode FROM v$database; -- Checks database status
SELECT instance_name, status FROM v$instance; -- Checks instance status
Oracle Database Server Configuration
Single Instance Database
A Single Instance Database is the most common Oracle Database deployment where one
database is managed by one instance on a single server
Architecture of a Single Instance Database
A Single Instance Database consists of:
✅ One Oracle Database (datafiles, control files, redo logs, archive logs).
✅ One Oracle Instance (SGA, PGA, background processes like DBWR, LGWR, SMON, PMON).
✅ One Server hosting the instance and database.
+----------------------+
| Server |
| +--------------+ |
| | Instance | | 🟢 Instance manages memory (SGA/PGA) & processes
| | (SGA, PGA) | |
| +--------------+ |
| | |
| +--------------+ |
| | Database | | 🟢 Database stores data (tablespaces, control files)
| +--------------+ |
+----------------------+
Key Features of a Single Instance Database
🔹 One-to-One Mapping → One instance manages one database.
🔹 Runs on a Single Server → CPU, memory, and disk resources belong to one system.
🔹 Uses Default Listener → Connects users via Oracle Net Listener (tnsnames.ora
).
🔹 No High Availability (HA) Features → If the server fails, the database is down.
🔹 Supports Standby Databases → Can be used with Oracle Data Guard for disaster recovery.
Benefits of a Single Instance Database
✅ Simple Deployment – Easy to install, configure, and manage.
✅ Lower Cost – No need for shared storage or multiple nodes.
✅ Efficient Performance – Best for applications that don’t require high availability.
✅ Easier Backup & Recovery – Managed using RMAN (Recovery Manager).
Limitations of a Single Instance Database
❌ No Automatic Failover – If the instance crashes, the database goes down.
❌ No Load Balancing – Cannot distribute the workload across multiple nodes.
❌ Scaling is Limited – Cannot scale horizontally like Oracle RAC.
Use Cases for a Single Instance Database
✅ Development & Testing Environments – Simple setup for application testing.
✅ Small to Medium Applications – Where high availability is not a critical requirement.
✅ Standalone Systems – Used in banking, healthcare, and retail for isolated systems.
A Single Instance Database is ideal for low to medium workloads, but for
high availability,
solutions like Oracle RAC or Data Guard are recommended.
Multi Single Instance database on Same Server
+----------------------------------------------------------+
| Server |
| +----------------+ +----------------+ |
| | Oracle Home 1 | | Oracle Home 2 | |
| | (Version 19) | | (Version 18) | |
| +----------------+ +----------------+ |
| | | |
| +-----+-----+ +-----+-----+ |
| | Database 1 | | Database 2 | |
| | (db1) | | (db2) | |
| +-----+-----+ +-----+-----+ |
| | | |
| +----+----+ +----+----+ |
| | Datafiles | | Datafiles | |
| | Control | | Control | |
| | Redo Log | | Redo Log | |
| +----+----+ +----+----+ |
| | | |
| +-----------------+ +----------------------------+.
| | Listener for db1 | | Listener for db2 |
| | (Port 1521) | | (Port 1522) |
| +-----------------+ +----------------------------+
+----------------------------------------------------------+
Oracle RAC (Real Application Cluster )
Multiple Oracle Homes
Each database instance on the server can have its own Oracle Home, which is a directory
that contains the Oracle software binaries, libraries, and executables.
- Oracle Home 1:
/u01/app/oracle/product/19.0.0/dbhome_1
(for db1
) - Oracle Home 2:
/u01/app/oracle/product/18.0.0/dbhome_2
(for db2
)
These separate Oracle Homes allow each instance to use its own Oracle binaries and
configurations (even different versions if needed).
Oracle Database comes in different editions, each designed for specific use cases, from small businesses to large enterprises. Here’s a breakdown of the available Oracle Database Editions:
🔹 Designed for small to medium-sized businesses.
🔹 Supports basic high availability with Oracle RAC (up to 2 nodes).
🔹 Limited to 16 CPU threads (across a maximum of 2 sockets).
🔹 No advanced features like Partitioning, Data Guard, or In-Memory.
🔹 Cost-effective compared to Enterprise Edition.
🔹 Full-featured enterprise-grade edition.
🔹 Supports unlimited CPU threads and large-scale environments.
🔹 Includes advanced features:
✅ Oracle RAC (Real Application Clusters) – High availability and scalability.
✅ Oracle Data Guard – Disaster recovery solution.
✅ Partitioning – Improves performance of large tables.
✅ Advanced Security & Encryption – Transparent Data Encryption (TDE), Data Masking.
✅ Multitenant Architecture – Supports multiple pluggable databases (PDBs).
✅ In-Memory Option – Speeds up analytics and reporting.
🔹 Used by large enterprises for mission-critical applications.
🔹 Free version for learning, development, and small-scale applications.
🔹 Limited to 2 CPU threads, 2GB RAM, and 12GB of user data.
🔹 No RAC, Data Guard, or Multitenant support.
🔹 Ideal for students, developers, and small projects.
🔹 Full functionality of Enterprise Edition, but designed for single-user environments.
🔹 No RAC or Data Guard support.
🔹 Used mainly for development and testing.
🔹 Cloud-based self-driving database available in Oracle Cloud Infrastructure (OCI).
🔹 Manages itself using machine learning (performance tuning, security, patching).
🔹 Two types:
✅ Autonomous Data Warehouse (ADW) – Optimized for analytics and reporting.
✅ Autonomous Transaction Processing (ATP) – Optimized for OLTP workloads.
🔹 Ideal for organizations looking for fully managed, serverless database solutions.
In this article , I am going to give you brief about what is Oracle database .
Before going to deep dive let's discuss some basic terminology :-
What is Data ?
Data is fact or figures , Data is any collection of facts, statistics, or information that can be stored, processed, and analyzed. It can exist in various forms, such as numbers, text, images, audio, or video.
In computing and databases, data refers to raw information that is stored in structured or unstructured formats.
In the context of Oracle databases, data is stored in tables within schemas and can be retrieved, modified, and managed using SQL queries.
What is Database ?
A database is an organized collection of data that is stored, managed, and accessed electronically. It allows users to store, retrieve, modify, and manage data efficiently.
A DBMS (Database Management System) is software that manages databases by enabling users to store, retrieve, update, and delete data efficiently. It provides an interface between the database and end-users or applications, ensuring data is organized, secure, and accessible.
Oracle is relational database i.e. oracle is RDBMS (Relational Database Management System)
An RDBMS (Relational Database Management System) is a type of database management system that stores data in a structured, tabular format with relationships between tables. It follows the relational model proposed by E.F. Codd in 1970.
EMP_ID | EMP_NAME | DEPT_ID | SALARY |
---|---|---|---|
101 | John Doe | 1 | 80000 |
102 | Jane Roe | 2 | 75000 |
103 | Alex Ray | 1 | 90000 |
DEPT_ID | DEPT_NAME |
---|---|
1 | IT |
2 | HR |
SELECT e.emp_name, d.dept_name
FROM employees e
JOIN departments d ON e.dept_id = d.dept_id;
Oracle Database is a high-performance RDBMS that supports advanced features like:
✅ Partitioning – Improves performance for large tables.
✅ RAC (Real Application Clusters) – Ensures high availability.
✅ Data Guard – Provides disaster recovery solutions.
✅ Multitenant Architecture – Supports multiple databases in a single container.
A table in a database is a structured object that stores data in a tabular format using rows (records) and columns (fields). It is the fundamental building block of a Relational Database Management System (RDBMS) like Oracle, MySQL, or SQL Server.
EMP_ID
, EMP_NAME
, SALARY
).NUMBER
, VARCHAR2
, DATE
).EMP_ID | EMP_NAME | DEPARTMENT | SALARY | HIRE_DATE |
---|---|---|---|---|
101 | John Doe | IT | 80000 | 2023-01-15 |
102 | Jane Roe | HR | 75000 | 2022-11-10 |
103 | Alex Ray | Finance | 90000 | 2021-09-20 |
SQL is divided into several categories based on its functionality:
SELECT
– Fetches data from tables.
SELECT emp_name, salary FROM employees WHERE department = 'IT';
CREATE
– Creates a table, view, or database object.ALTER
– Modifies an existing table structure.DROP
– Deletes a table or database object.TRUNCATE
– Removes all records but keeps the structure.
CREATE TABLE employees (
emp_id NUMBER PRIMARY KEY,
emp_name VARCHAR2(100),
salary NUMBER
);
INSERT
– Adds new records.UPDATE
– Modifies existing records.DELETE
– Removes specific records.
INSERT INTO employees (emp_id, emp_name, salary) VALUES (101, 'John Doe', 80000);
GRANT
– Assigns privileges to users.REVOKE
– Removes privileges from users.
GRANT SELECT ON employees TO user1;
COMMIT
– Saves changes permanently.ROLLBACK
– Reverts changes to the last save point.SAVEPOINT
– Creates intermediate save points in a transaction.
UPDATE employees SET salary = salary + 5000 WHERE emp_id = 101;
COMMIT;
postgres=# \set AUTOCOMMIT off
postgres=#
postgres=# \echo :AUTOCOMMIT
off
postgres=#
https://www.oracle.com/in/database/26ai/ Oracle 26 ai release Oracle AI Database Free Want to get hands-on with Oracle AI Database 26ai—ab...