Академический Документы
Профессиональный Документы
Культура Документы
New Features
Web Version
In past releases there have been compatibility issues between new features
Occasionally bugs....
Product Managers and Pre Sales are usually a better source of information
Data Guard
Single configuration for container database
Pluggable databases share redo thread
May become difficult to manage if standby databases need to be rebuilt
Single large SGA may increase size of kernel page tables area for each
process (foreground / background or both)
Will offset some of the savings in background process memory
New In-Memory database may have same problem
Functionality is limited
For a specific table, only one set of table partitions can be enabled for
index partitions
If a table partition has INDEXING ON then all rows in that partition will be
indexed in each partial index
dbms_stats.gather_index_stats
(
ownname => 'GP',
indname => 'PCAR1',
estimate_percent => NULL
);
SELECT partition_name,num_rows
FROM dba_ind_partitions
WHERE index_name = 'PCAR1';
PARTITION_NAME NUM_ROWS
P2008 0
P2009 0
P2010 0
P2011 456
P2012 480
dbms_stats.gather_index_stats
(
ownname => 'GP',
indname => 'PCAR2',
estimate_percent => NULL
);
SELECT num_rows
FROM dba_indexes
WHERE index_name = 'PCAR2';
NUM_ROWS
936
0 SELECT STATEMENT
1 SORT AGGREGATE
2 PARTITION RANGE SINGLE
3 TABLE ACCESS FULL (PCAR)
Predicate Information (identified by operation id):
3 - filter("SEASON_KEY"=2010)
Cost = 14
0 SELECT STATEMENT
1 SORT AGGREGATE
2 PARTITION RANGE SINGLE
3 INDEX FAST FULL SCAN (PCAR3)
Predicate Information (identified by operation id):
3 - filter("SEASON_KEY"=2011)
Cost = 2
0 SELECT STATEMENT
1 SORT AGGREGATE
2 PARTITION RANGE INLIST
3 TABLE ACCESS FULL (PCAR)
Predicate Information (identified by operation id):
3 - filter("SEASON_KEY"=2010 OR "SEASON_KEY"=2011)
Cost = 27
For example:
The database can be open and accessing the data file while the move is in
progress
DBMS_PART.CLEANUP_ONLINE_OP (<schema>,<table>,<partition>);
DBMS_PART.CLEANUP_ONLINE_OP (<schema>,<table>);
DBMS_PART.CLEANUP_ONLINE_OP (<schema>);
DBMS_PART.CLEANUP_ONLINE_OP;
DESCRIBE icar
Name Null? Type
SEASON_KEY NUMBER
RACE_KEY NUMBER
DRIVER_KEY VARCHAR2(4)
TEAM_KEY VARCHAR2(3)
POSITION NUMBER
LAPS_COMPLETED NUMBER
RACE_POINTS NUMBER
31 © 2013 - Julian Dyke juliandyke.com
Invisible Columns
In the data dictionary COL$ contains the following rows for the ICAR table
SELECT c.name,c.type#,c.col#,c.intcol#,c.segcol#,
TO_CHAR (c.property,'XXXXXXXXXXXX') AS property
FROM sys.col$ c, sys.obj$ o, sys.user$ u
WHERE c.obj# = o.obj#
AND o.owner# = u.user#
AND u.name = 'GP‘
AND o.name = 'ICAR';
DESCRIBE icar
Name Null? Type
SEASON_KEY NUMBER
RACE_KEY NUMBER
DRIVER_KEY VARCHAR2(4)
TEAM_KEY VARCHAR2(3)
POSITION NUMBER
RACE_POINTS NUMBER
SELECT c.name,c.type#,c.col#,c.intcol#,c.segcol#,
TO_CHAR (c.property,'XXXXXXXXXXXX') AS property
FROM sys.col$ c, sys.obj$ o, sys.user$ u
WHERE c.obj# = o.obj#
AND o.owner# = u.user#
AND u.name = 'GP‘
AND o.name = 'ICAR';
DESCRIBE icar
Name Null? Type
SEASON_KEY NUMBER
RACE_KEY NUMBER
DRIVER_KEY VARCHAR2(4)
TEAM_KEY VARCHAR2(3)
POSITION NUMBER
RACE_POINTS NUMBER
LAPS_COMPLETED NUMBER
SELECT c.name,c.type#,c.col#,c.intcol#,c.segcol#,
TO_CHAR (c.property,'XXXXXXXXXXXX') AS property
FROM sys.col$ c, sys.obj$ o, sys.user$ u
WHERE c.obj# = o.obj#
AND o.owner# = u.user#
AND u.name = 'GP‘
AND o.name = 'ICAR';
GENERATED
[ ALWAYS | BY DEFAULT [ ON NULL ] ]
AS IDENTITY [ ( identity_options ) ]
SELECT data_default
FROM dba_tab_columns
WHERE owner = 'GP‘
AND table_name = 'DRIVER2‘
AND column_name = 'DRIVER_KEY';
"GP"."ISEQ$$_92584".nextval
SELECT
sequence_owner AS owner,min_value,max_value,increment_by,
cycle_flag,order_flag,cache_size
FROM dba_sequences
WHERE sequence_name = 'ISEQ$$_92584';
For example:
Temporal validity allows tables to be created where rows are valid for a
specific period of time
A major defect is that is not possible to create primary keys with temporal
validity. This functionality may be added in a future release, until which
time this feature may be of limited use.
Who was in the team for the 2009 British Grand Prix qualifying?
SELECT * FROM driver
AS OF PERIOD FOR team_member_valid_time TO_DATE (‘20-JUN-2009’);
DRIVER_KEY TEAM_KEY JOINING_DATE LEAVING_DATE
FMAS FER 01-JAN-2006 31-DEC-2013
KRAI FER 01-JAN-2007 31-DEC-2009
DESCRIBE driver
Name Null? Type
DRIVER_KEY VARCHAR2(4)
TEAM_KEY VARCHAR2(3)
JOINING_DATE DATE
LEAVING_DATE DATE
Maximum length of CHAR and NCHAR remains at 2000 and 1000 respectively
SQL> @$ORACLE_HOME/rdbms/admin/utl32k.sql;
SELECT column_name,segment_name,securefile
FROM dba_lobs
WHERE owner = 'GP‘
AND table_name = 'ECAR';
SELECT column_name,index_name
FROM dba_lobs
WHERE owner = 'GP‘
AND table_name = 'ECAR';
COLUMN_NAME INDEX_NAME
NOTES SYS_IL0000092626C00007$$
Syntax is:
Restrictions
Cannot be specified in SELECT FOR UPDATE statements
Cannot be used with CURRVAL or NEXTVAL pseudo-columns
Cannot be used with materialized view incremental refresh
-----------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
-----------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 5 | 335 | 41 (0)|
|* 1 | COUNT STOPKEY | | | | |
| 2 | VIEW | | 480 | 32160 | 41 (0)|
|* 3 | SORT ORDER BY STOPKEY| | 480 | 23520 | 41 (0)|
| 4 | HASH GROUP BY | | 480 | 23520 | 41 (0)|
|* 5 | HASH JOIN | | 480 | 23520 | 41 (0)|
| 6 | TABLE ACCESS FULL | TEAM | 104 | 1248 | 2 (0)|
|* 7 | HASH JOIN | | 480 | 17760 | 39 (0)|
|* 8 | TABLE ACCESS FULL| CAR | 480 | 8160 | 36 (0)|
| 9 | TABLE ACCESS FULL| DRIVER | 493 | 9860 | 3 (0)|
-----------------------------------------------------------------------
-------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
-------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 480 | 44640 | 41 (0)|
| 1 | SORT ORDER BY | | 480 | 44640 | 41 (0)|
|* 2 | VIEW | | 480 | 44640 | 41 (0)|
|* 3 | WINDOW SORT PUSHED RANK| | 480 | 23520 | 41 (0)|
| 4 | HASH GROUP BY | | 480 | 23520 | 41 (0)|
|* 5 | HASH JOIN | | 480 | 23520 | 41 (0)|
| 6 | TABLE ACCESS FULL | TEAM | 104 | 1248 | 2 (0)|
|* 7 | HASH JOIN | | 480 | 17760 | 39 (0)|
|* 8 | TABLE ACCESS FULL | CAR | 480 | 8160 | 36 (0)|
| 9 | TABLE ACCESS FULL | DRIVER | 493 | 9860 | 3 (0)|
-------------------------------------------------------------------------
SELECT d.driver_name,t.team_name,SUM(c.driver_points)
FROM car c,driver d,team t Driver Name Points
WHERE c.season_key = 2012 Sebastian Vettel 281
AND c.driver_key = d.driver_key Fernando Alonso 278
AND c.team_key = t.team_key Kimi Raikkonen 207
GROUP BY d.driver_name,t.team_name Lewis Hamilton 190
ORDER BY SUM(c.driver_points) DESC Jenson Button 188
FETCH FIRST 20 PERCENT ROWS WITH TIES;
-----------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
-----------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 480 | 50880 | 41 (0)|
| 1 | SORT ORDER BY | | 480 | 50880 | 41 (0)|
|* 2 | VIEW | | 480 | 50880 | 41 (0)|
| 3 | WINDOW SORT | | 480 | 23520 | 41 (0)|
| 4 | HASH GROUP BY | | 480 | 23520 | 41 (0)|
|* 5 | HASH JOIN | | 480 | 23520 | 41 (0)|
| 6 | TABLE ACCESS FULL | TEAM | 104 | 1248 | 2 (0)|
|* 7 | HASH JOIN | | 480 | 17760 | 39 (0)|
|* 8 | TABLE ACCESS FULL| CAR | 480 | 8160 | 36 (0)|
| 9 | TABLE ACCESS FULL| DRIVER | 493 | 9860 | 3 (0)|
-----------------------------------------------------------------------
-------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
-------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 480 | 44640 | 41 (0)|
| 1 | SORT ORDER BY | | 480 | 44640 | 41 (0)|
|* 2 | VIEW | | 480 | 44640 | 41 (0)|
|* 3 | WINDOW SORT PUSHED RANK| | 480 | 23520 | 41 (0)|
| 4 | HASH GROUP BY | | 480 | 23520 | 41 (0)|
|* 5 | HASH JOIN | | 480 | 23520 | 41 (0)|
| 6 | TABLE ACCESS FULL | TEAM | 104 | 1248 | 2 (0)|
|* 7 | HASH JOIN | | 480 | 17760 | 39 (0)|
|* 8 | TABLE ACCESS FULL | CAR | 480 | 8160 | 36 (0)|
| 9 | TABLE ACCESS FULL | DRIVER | 493 | 9860 | 3 (0)|
-------------------------------------------------------------------------
For example, an inefficient execution plan has been generated for a query
We determine that the root cause is poor cardinality estimates for the
DRIVER_KEY column in the CAR table
dbms_stats.gather_table_stats
(
ownname => 'GP',
tabname => 'CAR',
estimate_percent => NULL
);
dbms_stats.gather_table_stats
(
ownname => 'GP',
tabname => 'CAR',
estimate_percent => NULL
method_opt => 'FOR COLUMNS driver_key'
);
dbms_stats.gather_table_stats
(
ownname => 'GP',
tabname => 'CAR',
estimate_percent => NULL
method_opt => 'FOR COLUMNS driver_key SIZE 2048'
);
BEGIN
dbms_stats.gather_table_stats
(
ownname => 'GP',
tabname => 'CAR6',
estimate_percent => NULL,
method_opt => 'FOR COLUMNS (DRIVER_KEY,TEAM_KEY) SIZE 2048‘
);
END;
74 © 2013 - Julian Dyke juliandyke.com
Histograms
Multi-Column Statistics
DECLARE
l_extension_name VARCHAR2(30);
BEGIN
l_extension_name := dbms_stats.create_extended_stats
(
ownname => 'GP',
tabname => 'CAR6',
extension => '(driver_key,team_key)‘
);
END;
BEGIN
dbms_stats.gather_table_stats
(
ownname => 'GP',
tabname => 'CAR6',
estimate_percent => NULL,
method_opt => 'FOR COLUMNS (DRIVER_KEY,TEAM_KEY) SIZE 2048‘
);
END;
75 © 2013 - Julian Dyke juliandyke.com
Histograms
Multi-Column Statistics
Correct
Cardinality
Correct
Cardinality
For example:
jdbc:oracle:thin:gp/gp@(DESCRIPTION=(TRANSPORT_CONNECT_TIMEOUT=3)
(CONNECT_TIMEOUT=60)(RETRY_COUNT=10)(FAILOVER=ON)
(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=vmcluster1-scan.juliandyke.com))
(CONNECT_DATA=(SERVICE_NAME=SERVICE1)))
import oracle.jdbc.replay.OracleDataSourceImpl;
import oracle.jdbc.replay.ReplayableConnection;
OracleDataSourceImpl ods = new OracleDataSourceImpl();
ods.setURL(url);
connection = ods.getConnection();
connection.setAutoCommit (false);
...
((ReplayableConnection)connection).beginRequest();
# Application processing
((ReplayableConnection)connection).endRequest();
oracle.jdbc.internal.replay.level = FINEST
handlers = java.util.logging.FileHandler
java.util.logging.FileHandler.pattern = /home/oracle/12c/appcon2/replay_%U.trc
java.util.logging.FileHandler.limit = 500000000
java.util.logging.FileHandler.count = 1000
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
Execute using:
java -Djava.util.logging.config.file=/home/oracle/appcon/properties J7
info@juliandyke.com