Friday, July 3, 2020

19c Remarkable New Features

Oracle 19c is packed up with lots of cool features, I've summarized the significant ones in below categories.

Support:

[Supported untill 2027. As per Note 742060.1 --which keeps changing]

 














Performance Features:

- SQL plan management automatically evolve the plans and accept the best ones.

- Gather Statistics Auto task can run more frequently:
    - Enable high-frequency task:    
EXEC DBMS_STATS.SET_GLOBAL_PREFS('AUTO_TASK_STATUS','ON');
    - Set Maximum job run time duration: [e.g. 10min = 600 sec]
EXEC DBMS_STATS.SET_GLOBAL_PREFS('AUTO_TASK_MAX_RUN_TIME','600');
    - Job execution frequency:  [e.g. 6hours = 21600 seconds]
EXEC DBMS_STATS.SET_GLOBAL_PREFS('AUTO_TASK_INTERVAL','21600');

- Caching Big tables:
Specify how much % of the db_buffer_cache will be allocated for caching big tables: [40%]
SQL> alter system set db_big_table_cache_percent_target = 40;

Note: Oracle will automatically cache any big table in the memory if its temperature goes off 1000.

- Automatic Indexing:
Automatic indexing analyze the application workload every 15 minutes and automatically creates, drop and rebuilds unusable B-tree indexes in a database based on the changes in application workload.

Auto Index Creation:
Indexes will be intially create as INVISIBLE indexes if the analysis show performance improvement on candidate SQL statements it will be converted to VISIABLE and will be used by the application, if not, the created indexes will be marked as UNSUABLE and will be dropped later and the candidate SQL statements will be blacklisted to not use use Auto Indexes in the future.

Auto Index Deletion:
If Automatic Indexing found an index created by "Auto Indexing feature" is unsed for 373 days it will be dropped automatically.
This role doesn't apply on the manually created indexes "not created by Auto Indexing feature".

Technical Details:
------------------
Enable/Disable:
..............
Enable Auto Indexing and Allow creation of VISIBLE auto indexes to be used immediately by the Application:
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE','IMPLEMENT');

Enable Auto Indexing but Allow only the creation of INVISIBLE auto indexes, so it will NOT be used by the Application:
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE','REPORT ONLY');

Disable the Auto Indexing feature:
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_MODE','OFF');

Scope of Analysis:

ADD ALL schemas to the Auto Indexing scope:
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SCHEMA', NULL, TRUE);

REMOVE a schema from Auto Indexing list:
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SCHEMA', 'HR', FALSE);

REMOVE ALL schemas from the Auto Indexing scope:
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SCHEMA', NULL, FALSE);

Add a schema to the Auto Indexing scope:
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SCHEMA', 'HR', NULL);

Control the Auto Deletion RETENTION of the UNUSED indexes created by AUTO INDEXING feature: [e.g. 90 days | The default is 373 days]
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_RETENTION_FOR_AUTO', '90');

Control the Auto Deletion RETENTION of the UNUSED indexes created manually: [Default is never to be deleted]
[Strongly recommended to NOT set this parameter]
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_RETENTION_FOR_MANUAL', '90');
    To Reset it back to Never Delete Manually created indexes:
    SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_RETENTION_FOR_MANUAL', NULL);

Specify the Default Tablespace to store Auto indexes: [e.g. IDX_TBS tablespace | The default is to store them on the DEFAULT TABLESPACE for the database]
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_DEFAULT_TABLESPACE', 'IDX_TBS');

Specify percentage of tablespace to allocate for new Auto indexes: [e.g. 5%]
SQL> EXEC DBMS_AUTO_INDEX.CONFIGURE('AUTO_INDEX_SPACE_BUDGET', '5');

Show automatic Indexing information for last 24 hours:
declare
 report clob := null;
begin
 report := DBMS_AUTO_INDEX.REPORT_ACTIVITY();
end;
/

Show the last activity for Automatic Indexing operation:
declare
 report clob := null;
begin
 report := DBMS_AUTO_INDEX.REPORT_LAST_ACTIVITY(
 type => 'HTML',
 section => 'SUMMARY +INDEX_DETAILS +ERRORS',
 level => 'BASIC');
end;
/

Show automatic Indexing information for a specific time: [HTML]
declare
 report clob := null;
begin
 report := DBMS_AUTO_INDEX.REPORT_ACTIVITY(
 activity_start => TO_TIMESTAMP('2018-11-01', 'YYYY-MM-DD'),
 activity_end => TO_TIMESTAMP('2018-12-01', 'YYYY-MM-DD'),
 type => 'HTML',
 section => 'SUMMARY',
 level => 'BASIC');
end;
/

Configurations:
...............
SQL> SELECT * FROM DBA_AUTO_INDEX_CONFIG;
SQL> SELECT OWNER,INDEX_NAME,AUTO FROM DBA_INDEXES where AUTO='YES';


New Non blocking DDL statements added in 19c:

Just to remind you with the non-blocking DDL statements that were added in the previous releases:

Non-blocking ddl's added as of 11.2:

CREATE INDEX online
ALTER INDEX rebuild online
ALTER TABLE add column not null with default value
ALTER TABLE add constraint enable no validate
ALTER TABLE modify constraint validate
ALTER TABLE add column (without any default)
ALTER INDEX visible / invisible
ALTER INDEX parallel / no parallel

Non-blocking ddl's added to the list in 12.1:

DROP INDEX online (backported to 11.2)
ALTER TABLE set unused column online
ALTER TABLE drop constraint online
ALTER INDEX unusable online
ALTER TABLE modify column visible / invisible
ALTER TABLE move partition / sub-partition online
ALTER TABLE add nullable column with default value

Non-blocking ddl's added to the list in 12.2:

ALTER TABLE split partition [sub-partition] online
ALTER TABLE move online (move of a non-partitioned table)
ALTER TABLEe modify partition by .. online (to convert a non-partitioned table to partitioned state)

Non-blocking ddl's added to the list in 18.1:

ALTER TABLE merge partition online
ALTER TABLE modify partition by .. online (to change the partitioning schema of a table)


Security Features:

- 19c Cluster interconnect traffic is automatically secured by Transport Layer Security (TLS) no manual configuration needed by the DBA.

- Schema-only accounts can have no passwords to now allow login:
SQL> CREATE USER TEST NO AUTHENTICATION;

- Privilege analysis is now available as part of Oracle Database Enterprise Edition to show exactly what privileges are used or not used by each account.
  You will create a policy and enable it for some time to do the analysis, then you disable the police.


RAC/Clusterware Features:

- 19c Cluster interconnect trafic is automatically secured by Transport Layer Security (TLS) no manual configuration needed by the DBA.
- Starting from 19.3 Oracle back supports placing OCR/VOTEDISKs on a non-ASM shared filesystem.


Import/Export Features:


New parameters introduced to impdp:
TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y     Disable Logging for the imported object during the import and set it back to LOGGING after.
TRANSFORM=TABLE_COMPRESSION_CLAUSE:COMPRESS     Import tables with BASIC compression option
TRANSFORM=TABLE_COMPRESSION_CLAUSE:'ROW STORE COMPRESS ADVANCED'    Import tables with OLTP compression option
logtime=all     Enable time logging for output log messages for each step
COMPRESSION_ALGORITHM=[BASIC | LOW | MEDIUM | HIGH]     Compress the dumpfile with different compression algorithms.

A new audit policy introduced to audit EXPORT/IMPORT operations:
CREATE AUDIT POLICY policy_name  ACTIONS COMPONENT=DATAPUMP [EXPORT | IMPORT | ALL];
AUDIT POLICY audit_dp_all_policy BY all;


Backup & Recovery Features:

- Clone & Standby DB can be created using dbca -createDuplicateDB command:
# dbca -createDuplicateDB
    -gdbName             global_database_name
    -primaryDBConnectionString     easy_db_connection_string
    -sid             database_system_identifier
    [-initParams         initialization_parameters
        [-initParamsEscapeChar initialization_parameters_escape_character]]
    [-sysPassword         SYS_user_password]
    [-adminManaged]
    [-nodelist             database_nodes_list]
    [-datafileDestination     data_files_directory]
    [-recoveryAreaDestination     recovery_files_directory
        [-recoveryAreaSize     fast_recovery_area_size]]
    [-databaseConfigType     {SINGLE | RAC | RACONENODE}
        [-RACOneNodeServiceName service_name_for_RAC_One_Node_database]]
    [-useOMF {true | false}]
    [-storageType {FS | ASM}
        [-asmsnmpPassword     ASMSNMP_password]
        -datafileDestination     database_files_directory]
    [-createListener         new_database_listener]
    [-createAsStandby
        [-dbUniqueName db_unique_name_for_standby_database]]


Availability Features:


- The restore points created on Primary are automatically propagated to the Standby.

- Easy connect Plus can initiate connection with simple command:
sales-server//inst1

This Translates to:
(DESCRIPTION=
   (CONNECT_DATA=
      (SERVICE_NAME=)
      (INSTANCE_NAME=inst1))
   (ADDRESS=
      (PROTOCOL=TCP)
      (HOST=sales-server)
      (PORT=1521)))

e.g.
conn aa/aa@1.1.1.1/orcl


Data Guard Features:

- Duplicate standby DB from active primary database using Compression:
In 19c you can duplicate a standby database from an active primary DB using COMPRESSION feature which can send the database block via the network in a compressed format saving the bandwidth and the time as well.

Command example:

run {
allocate channel disk1 type disk;
allocate auxiliary channel aux1 type disk;
duplicate target database for standby from active database USING COMPRESSED BACKUPSET
spfile
parameter_value_convert 'orcl','orcls'
set db_name='orcl'
set db_unique_name='orcls';

}

- Automatic flashback of the standby:
When a FLASHBACK operation happen on the primary DB the Standby DB will be automatically flashed back.

- Restore points propagation:
  After the switchover between primary and standby the resotre points created on primary before the switchover will be available on the standby after the switchover.

- DML Operations on Active Data Guard: [insignificant feature! but thought to mention it]

If enabled, DML transactions can happen on the Standby DB, first DMls will not apply directly on the standby but will be first shipped to the Primary and applied on the Primary then changes will be replicated on the Standby then the DML will be completed (long path and can slow down the primary).

 To Enable DMLs on Standby:
 SQL> ALTER SYSTEM SET ADG_REDIRECT_DML=TRUE;
     Or: Enable it on session level:
     SQL> ALTER SESSION ENABLE ADG_REDIRECT_DML;
 To Enable PL/SQL operations on Standby:
 SQL> ALTER SESSION ENABLE ADG_REDIRECT_PLSQL;

- New Parameters to restart ADG process in case of hung network/IO:

  - DATA_GUARD_MAX_IO_TIME sets the maximum number of seconds that can elapse before a process is considered hung while performing a regular I/O operation in an Oracle Data Guard environment. [Default 240 sec]
  - DATA_GUARD_MAX_LONGIO_TIME sets the maximum number of seconds that can elapse before a process is considered hung while performing a long I/O operation in an Oracle Data Guard environment. [Default 240 sec]

- Sync the gap between the primary and the standby using one RMAN command: [From Standby side]
RMAN> recover standby database from service orclpr;

Note: orclpr is the service which connects to the Primary DB from the standby.

- Desupported ADG parameters:
  - MAX_CONNECTIONS attribute of the LOG_ARCHIVE_DEST_n initialization parameter.

Miscellaneous Features:

- DBA_REGISTRY_BACKPORTS view introduced to show the bugs that have been fixed by the patches applied to the database.
- Oracle Multimedia is desupported. Oracle recommends to store multimedia content in SecureFiles LOBs, and use third party products for image processing and conversion.
- Oracle Streams feature is desupported. Oracle recommends to use Oracle GoldenGate product to replace all replication features of Oracle Streams.
- DBMS_JOB Jobs Converted to DBMS_SCHEDULER Jobs in Oracle Database 19c. DBMS_JOBS already deprecated since 12.2.

References:
https://docs.oracle.com/en/database/oracle/oracle-database/19/admin/database-administrators-guide.pdf
https://apex.oracle.com/database-features/

No comments:

Post a Comment