2. 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: navneetupneja@gmail.com
Blog: http://navneetupnejadba.wordpress.com/
Twitter: @navneetupneja
Presentations: http://www.slideshare.net/navneetupneja
Navneet UpnejaNavneet Upneja
4. 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.
5. 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”.
6. • 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
10. 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….)
14. 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;
15. 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”.
16. SQL> insert into temp_gt select * from dba_objects;
Default Behavior Temp Undo Enabled
17. 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
18. 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.
19. 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
20. 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.
22. 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.
23. 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.
25. 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.
26. Adaptive Query Optimization
•Enable Optimizer to make Run
– Time Adjustments to Execution
Plan
•Right Intent to have better
statistcis.
•Adaptive Plan
Join Methods
Parallel Distribution
•Adaptive Statistics
Dynamic Statistics
Automatic Re-optimization
SQL Plan Directives