Oracle 11g Vs 18c
Oracle 11g Vs 18c
1. General Overview
Oracle 11g:
o Released in 2007.
Oracle 18c:
Oracle 11g:
Oracle 18c:
o Autonomous Database Capabilities: Features like self-
tuning, self-repairing, and self-securing.
3. Cloud Orientation
Oracle 11g:
Oracle 18c:
4. Performance Improvements
Oracle 11g:
Oracle 18c:
5. Multi-Tenant Architecture
Oracle 11g:
Oracle 18c:
6. Security Enhancements
Oracle 11g:
Oracle 18c:
7. Licensing Model
Oracle 11g:
Oracle 18c:
8. End of Support
Oracle 11g:
Oracle 18c:
Summary
Certainly! Oracle 18c introduces several new functions, data types, and
enhancements to existing features compared to Oracle 11g. Below is a
detailed comparison focusing on specific functions, data types, and how
they evolved.
Oracle 11g:
Oracle 18c:
o Native JSON Support: Introduced the JSON data type,
allowing efficient storage and querying of JSON documents. It
also provided functions like:
Oracle 11g:
Oracle 18c:
APPROX_COUNT_DISTINCT
APPROX_SUM
APPROX_RANK
o INMEMORY_ Functions*: Functions like INMEMORY_JOIN_GROUP
were added to optimize in-memory join operations.
Oracle 11g:
Oracle 18c:
4. Partitioning Enhancements
Oracle 11g:
Oracle 18c:
o Hybrid Partitioning: Supported combining partitioning
strategies, such as range-list or range-hash partitioning.
Oracle 11g:
Oracle 18c:
PREDICTION_PROBABILITY
PREDICTION_COST
6. Security Features
Oracle 11g:
Oracle 18c:
7. Performance Enhancements
Oracle 11g:
Oracle 18c:
Oracle 11g:
Oracle 18c:
Summary of Evolution
Oracle 18c introduces a wide range of new data types, functions, and
enhancements designed to improve performance, scalability, and ease of
use for both developers and administrators. It also incorporates modern
technologies like JSON support, machine learning, and automation, making
it a significant step forward from Oracle 11g.
Oracle 18c introduced native JSON support, allowing efficient storage and
querying of JSON data. Below are examples demonstrating how to use
JSON data types and associated functions.
name VARCHAR2(100),
);
VALUES (
1,
'Alice',
);
INSERT INTO employees (id, name, details)
VALUES (
2,
'Bob',
);
FROM employees;
SELECT name
FROM employees
FROM employees e,
JSON_TABLE(details, '$.skills[*]'
COLUMNS (
) jt;
FROM employees;
Construct JSON Arrays
FROM DUAL;
This example implements a PTF that adds a calculated column to any input
table.
RETURN DBMS_TF.DESCRIBE_T;
END add_computed_column_pkg;
RETURN DBMS_TF.DESCRIBE_T IS
BEGIN
DBMS_TF.ADD_COLUMN(tab, 'COMPUTED_VALUE',
DBMS_TF.TYPE_NUMBER);
RETURN NULL;
END describe;
input_column DBMS_TF.COLUMN_DATA_T;
computed_column DBMS_TF.COLUMN_DATA_T;
BEGIN
computed_column := DBMS_TF.GET_COLUMN(tab,
'COMPUTED_VALUE');
END LOOP;
END fetch_rows;
END add_computed_column_pkg;
USING add_computed_column_pkg;
-- Example table
SELECT *
FROM add_computed_column(numbers);
Output:
I VALU COMPUTED_VAL
D E UE
1 10 20
2 20 40
Summary
These features exemplify Oracle 18c's focus on flexibility, ease of use, and
performance improvements.
1. SQL Macros
BEGIN
END add_vat;
-- Usage
FROM products;
Explanation:
The add_vat macro substitutes price * 1.20 directly in the SQL query,
ensuring high performance.
BEGIN
END filter_active;
-- Usage
Explanation:
SELECT department_id,
FROM employees
GROUP BY department_id;
Explanation:
If the result exceeds the maximum size, it truncates the output and
appends the text ... (truncated).
3. APPROX_ Functions
Example: APPROX_COUNT_DISTINCT
FROM employees
GROUP BY department_id;
Explanation:
Example: APPROX_RANK
SELECT APPROX_RANK(0.9) WITHIN GROUP (ORDER BY salary) AS
percentile_90
FROM employees;
Explanation:
4. INMEMORY_ Functions
The INMEMORY_ functions are designed for databases utilizing Oracle's In-
Memory Column Store (IMCS), significantly boosting performance for
analytical queries.
Example: INMEMORY_PRUNING
FROM employees
To verify pruning:
SELECT *
Explanation:
Example: INMEMORY_JOIN_GROUP
Explanation:
Summary of Features
These features make Oracle 18c an excellent choice for modern data
processing needs, balancing performance and usability.
BEGIN
END calculate_bonus;
FROM employees;
Key Benefits:
Key Benefits:
Improvements:
DECLARE
sql_stmt VARCHAR2(200);
result_count NUMBER;
BEGIN
END;
Key Benefits:
Features of UTL_CALL_STACK:
Provides information about the current PL/SQL call stack, such as:
DECLARE
v_divide_by_zero NUMBER;
BEGIN
EXCEPTION
DBMS_OUTPUT.PUT_LINE('Error occurred!');
Output:
Error occurred!
Error Depth: 2
Key Benefits:
Summary of Benefits
1. Hybrid Partitioning
Key Features:
sale_id NUMBER,
sale_date DATE,
amount NUMBER
);
Explanation:
2. Automatic Partitioning
Key Features:
emp_id NUMBER,
department VARCHAR2(100),
hire_date DATE
INSERT INTO employees VALUES (2, 'IT', SYSDATE); -- Creates "IT" partition
INSERT INTO employees VALUES (3, 'HR', SYSDATE); -- Uses existing "HR"
partition
Explanation:
Key Features:
order_id NUMBER,
order_date DATE,
);
-- Insert data
Explanation:
emp_id NUMBER,
first_name VARCHAR2(50),
last_name VARCHAR2(50),
hire_date DATE,
);
-- Insert Data
FROM employees;
Output:
EMP_I FULL_NA YEARS_OF_SERV
D ME ICE
Alice
1 9
Smith
Bob
2 6
Johnson
FROM employees
Output:
EMP_I FULL_NA
D ME
1 Alice Smith
Benefit: Queries that filter or sort based on the full_name virtual column
can now use the index.
Virtual columns are often used for partitioning tables dynamically without
storing derived values.
order_id NUMBER,
order_date DATE,
year_month GENERATED ALWAYS AS (TO_CHAR(order_date, 'YYYY-MM'))
VIRTUAL
);
-- Insert Data
-- Query Data
Limitations
Summary
Key Enhancements:
5. ACTIONS LOGON
Explanation:
o The login_policy audits all logins except those from the SYS
user.
Key Enhancements:
7. DEFAULT STORAGE(ENCRYPT);
Private Temporary Tables (PTTs) are temporary tables that are scoped to a
session or transaction, providing greater control over temporary data.
Key Features:
Explanation:
5. Insert Data:
4. Schema-Only Accounts
Key Features:
Explanation:
3. Grant Privileges:
8. order_date DATE,
9. customer_name VARCHAR2(100)
10. );
Note: The account is used only for object ownership, not for direct
database access.
Summary of Benefits
Feature Key Benefit
Private
Provides session or transaction-level isolation for
Temporary
temporary data, reducing cleanup overhead.
Tables
1. Automatic Indexing
Oracle 19c introduced Automatic Indexing, but its evolution began with
enhancements in Oracle 18c to simplify index management and improve
query performance automatically.
AI-Driven Decisions:
Real-Time Performance:
Validation Process:
7. FROM DBA_INDEXES
Benefits:
Key Enhancements:
In-Memory External Tables:
In-Memory Joins:
4. SELECT SUM(revenue)
5. FROM sales
9. FROM V$IM_SEGMENTS;
17. )
18. LOCATION ('external_sales.csv')
19. )
20. INMEMORY;
Benefits:
3. Summary of Benefits
Enhances query
In-Memory Optimized analytics, faster
performance using
Column query execution, and reduced
columnar storage in
Store latency.
memory.