oracle 12c-new-features

28
Oracle Database 12c Whats New…

Upload: navneet-upneja

Post on 16-Feb-2017

71 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: ORACLE 12C-New-Features

Oracle Database 12c

Whats New…

Page 2: ORACLE 12C-New-Features

Navneet Upneja (Manager, Database & Applications) 9 Years of Experience in Oracle Databases, OBIEE, Informatica, ODI etc… Oracle Certified Professional Hand on experience on OLTP, Datawarehouse, Oracle BI, APEX…Co-Founder of AIOUG - North India Chapter.

Email: [email protected]

Blog: http://navneetupnejadba.wordpress.com/

Twitter: @navneetupneja

Presentations: http://www.slideshare.net/navneetupneja

Navneet UpnejaNavneet Upneja

Page 3: ORACLE 12C-New-Features

Overview• Multi-Tenant Architecture• Threaded Execution • Online Optimizer Statistics• GTT Statistics• Global Temporary Table Undo• Invisible Columns• Multiple Indexes• ILM• DDL Logging• Limit on PGA• Moving Datafile Online• Q&A

Page 4: ORACLE 12C-New-Features

Multitenant Architecture• Oracle 12c – “c” for “Consolidation”

– New concept of Container Database (CDB)– Multiple databases can be part of one CDB– Each Database is called “PDB”– CDB contains:

• Root Container (CDB$ROOT) : Master Datafiles and Metadata• Seed Container (PDB$SEED): Template to create new pdb.• Pluggable Database (PDB): One or more PDB’s• New “CDB_..” dictionary views.

Page 5: ORACLE 12C-New-Features

Threaded Architecture• Pre 12c and Default in 12c

– Windows: Threaded Model (Only one process “oracle.exe”)– Unix: Independent Process for each Oracle Process.– “threaded_execution” – New in 12c– Default to “False”.– Require reboot of instance– Login using “sys” Require password file after this change– 1 Process will have multiple sub-processes called “Threads”– DEDICATED_THROUGH_BROKER_LISTENER=ON– New columns added to “V$Process” table.

• STID – Thread Number• SOSID – Concatenation of Process and Thread• New entry in Execution type as “THREAD”

– PMON, VKTM, PSP0, DBW0.. , will be still implemented as before– Useful towards achieving “Consolidation”.

Page 6: ORACLE 12C-New-Features

• 1 OS process for each Oracle Background process•1 OS process for each user connection to the database• In default implementation, with no user connection, Total number of Attached processes: 165

Conventional Method or Non - Threaded

Page 7: ORACLE 12C-New-Features

With Threaded Execution enabled, Total number of Attached processes reduced to 18.

Page 8: ORACLE 12C-New-Features
Page 9: ORACLE 12C-New-Features

V$Process

Page 10: ORACLE 12C-New-Features

Online Optimizer Statistics Statistics are being gathered for objects created using

Direct Path operations like CTAS and Insert as select operations.

Only Basic Statistics are gathered Pre – 12c, Only Index creation had this feature. Will save Extra Full Table Scan(s) required to gather

statistics Useful in ETL Loads specifically for Staging table. Create Table AS (CTAS) Insert with Append (Bulk Load) Have its own restrictions as well..(Non-Empty

Segments,Tables with Virtual Columns….)

Page 11: ORACLE 12C-New-Features

Contd… CTAS

Page 12: ORACLE 12C-New-Features

Insert With Append

Page 13: ORACLE 12C-New-Features

10046 Trace

Page 14: ORACLE 12C-New-Features

Statistics for GTT’s• GTT shares its definition with system wide users• Content in GTT is private to particular session.• Pre 12c, statistics gathered on GTT’s were published system wide.• In 12c, statistics on GTT’s can be kept private to the session collecting the stats.• Useful in cases, where volume of data varies greatly across sessions.• Controlled with GLOBAL_TEMP_TABLE_STATS preference of DBMS_STATS• By default, preference is set to Session {SHARED}• Its really useful in Solving Peoplesoft Temp Table Problem

SELECT dbms_stats.get_prefs('GLOBAL_TEMP_TABLE_STATS','NUPNEJA','TEMP_GT')

FROM DUAL;

Page 15: ORACLE 12C-New-Features

Temporary Undo• By default, undo records for temporary tables are stored in the undo

tablespace and are logged in the redo.• 12c introduces new concept of Temporary Undo: Undo generated by

transactions on temporary tables managed inside temporary undo segments.

• Reduces amount of undo stored in undo tablespace.• Inturn, reduces amount of redo generated.• Managed using TEMP_UNDO_ENABLED  parameter.• Can be set at session level or system level. • Default value is “FALSE”.• Temp Undo statistics can be monitored through “V$TEMPUNDOSTAT”.

Page 16: ORACLE 12C-New-Features

SQL> insert into temp_gt select * from dba_objects;

Default Behavior Temp Undo Enabled

Page 17: ORACLE 12C-New-Features

Invisible Column• Starting from 12c, one can add column to a table and make It as invisible.• Can be used as low level security for a column.• Different from system generated hidden columns• Would not be shown up in result of select if not explicitly defined in Select

list of columns.• Describe command will not show invisible column as part of table definition.• “set colinvisible on” to see the hidden/invisible column • Cannot create invisible column in

– External Tables– Cluster Tables– Temporary Tables

Page 18: ORACLE 12C-New-Features

Multiple Indexes on same column

• Multiple Indexes on same column(s)• Some characteristics of Index/Indexes

need to be different.• Unique and non Unique• B*Tree and Bitmap• Partitioning Strategies like Local and Global.

• One of the Index needs to be Invisible.• Useful for testing performance fixes.

Page 19: ORACLE 12C-New-Features

Information Life Cycle Management (ILM)

• Conventional Techniques– Storage Techniques : Moving data to Faster or

slower disks as per the usage of Data– Database: Partitioning

• Oracle 12c– Heat Map

• Data Compression• Moving Data to Different Tablespace

Page 20: ORACLE 12C-New-Features

DDL Logging• In 12c, we can log the DDL statements running in a session or at system

level.• Controlled by parameter “ENABLE_DDL_LOGGING”• Can be set at Session level as well.• DDL log is stored in the log/ddl subdirectory of the ADR home.• DDL log contains one log record for each DDL statement issued by the

database/session.• Two types of log files: XML and Text File.• Can be useful to diagnose all the DDL’s running in a big package/program.• Can be useful in troubleshooting any application program.

Page 21: ORACLE 12C-New-Features

Contd.

Page 22: ORACLE 12C-New-Features

Limit on PGA• The Program Global Area (PGA) is a private memory region that contains

the data and control information for a server process.• PGA_AGGREGATE_TARGET: Target aggregate PGA memory available to

all server processes attached to the instance.

Page 23: ORACLE 12C-New-Features

PGA_AGGREGATE_LIMIT• PGA_AGGREGATE_TARGET setting acts as a target, and not a

limit.• PGA_AGGREGATE_LIMIT initialization parameter enables you to

specify a hard limit on PGA memory.• Oracle Database aborts or terminates the sessions or processes

that are consuming the most untunable PGA memory– Calls for sessions that are consuming the most untunable PGA memory are

aborted.– If PGA memory usage is still over the PGA_AGGREGATE_LIMIT, then the

sessions and processes that are consuming the most untunable PGA memory are terminated.

Page 24: ORACLE 12C-New-Features

Excerpt from Trace

Page 25: ORACLE 12C-New-Features

Moving Datafile Online• Starting with Oracle 12c, we can move the datafile while it is online.•  ALTER DATABASE MOVE DATAFILE SQL statement to rename or

relocate online data files.• Enables you to rename or relocate a data file while the database is open

and users are accessing the data file.•  If a file with the same name already exists in the destination location, the

existing file is not overwritten, and the statement returns an error.• Keep option to retain the original file as well.• Datafile must be online to perform this.• You cannot move datafile of a pluggable database from container database.

Page 26: ORACLE 12C-New-Features

Adaptive Query Optimization

•Enable Optimizer to make Run – Time Adjustments to Execution Plan•Right Intent to have better statistcis.•Adaptive Plan

Join MethodsParallel Distribution

•Adaptive Statistics Dynamic StatisticsAutomatic Re-optimizationSQL Plan Directives

Page 27: ORACLE 12C-New-Features
Page 28: ORACLE 12C-New-Features