Ora12c NF PDF
Ora12c NF PDF
Agenda
12 Features
Key useful features; not all.
Not necessarily well advertised
Some demo
Oracle12c:GeeWhizFeatures
1. Pluggable Database
Application1
Application2
Application3
Application1
Application2
Application3
UserSIEBEL
UserSIEBEL
UserSIEBEL
UserSIEBEL
Oracle12c:GeeWhizFeatures
SGA
Container
Database
VirtualDB
VirtualDB
Pluggable
Database
(Containers)
Oracle12c:GeeWhizFeatures
DBA_USERS
SELECT 1 AS CON_ID, NAME
FROM USER$@cdb
SELECT 2 AS CON_ID, NAME
FROM USER$@pdb1
SELECT 3 AS CON_ID, NAME
FROM USER$@pdb2
PDB1
CON_ID=2
PDB2
CON_ID=3
PDB3
CON_ID=4
Oracle12c:GeeWhizFeatures
Oracle12c:GeeWhizFeatures
2. RMAN
Sysbackup role
grant sysbackup to rmanuser identified by
rmanuser;
rman target='rmanuser/rmanuser as sysbackup'
SQL in RMAN
No need to put SQL command
Select, even describe
Oracle12c:GeeWhizFeatures
Table Recovery
RMAN> recover table scott.accounts:p1
2> until scn 123456
3> auxiliary destination +DG1;
Remap Tablespace
4> remap tablespace users:accdata;
Datapump Dump
4> datapump destination /tmp dump file acc.dmp
5> notableimport;
Oracle12c:GeeWhizFeatures
Full
backup
Incremental
backup
FinalInc
Oracle12c:GeeWhizFeatures
3. Data Guard
Global Temporary Tables in ADG
You can use DML on GTTs
Uses temporary undo (in temp tablespace)
Sequences in ADG
select x.nextval from dual
Pulls the <cache> amount of numbers for SGA
Realtime cascade
Data Guard Broker
One command role transition
Resumable switchover
Oracle12c:GeeWhizFeatures
10
Process
StandbyRedoLogs
Oracle12c:GeeWhizFeatures
11
Process
Oracle12c:GeeWhizFeatures
12
4. MV Refresh
Table1
Table2
dbms_mview.refresh (
Table2
MV_Temp
Oracle12c:GeeWhizFeatures
13
part1
part2
part2
part3
part3
Table
GlobalIndex
Oracle12c:GeeWhizFeatures
ORPHANED_ENTRIES in
USER_INDEXES view
14
part1
part2
part2
part3
part3
Table
LocalIndex
Oracle12c:GeeWhizFeatures
15
T1
T2
T3
High
Oracle12c:GeeWhizFeatures
Low
16
7. Schema Management
DDL Logging
Enable alter system set enable_ddl_logging=true;
The logs are written in $DIAG\rdbms\DBName\INSTNAME\log\ddl
In XML format
<msg time='2013-08-30T20:29:36.635-04:00' org_id='oracle' comp_id='rdbms'
msg_id='opiexe:4181:2946163730' type='UNKNOWN' group='diag_adl'
level='16' host_id='STARUPNANT420B' host_addr='fe80::58b8:d0b2:f7c9:3147%27'
version='1'>
<txt> create table t11 (col1 number)
</txt>
</msg>
<msg time='2013-08-30T20:32:56.719-04:00' org_id='oracle' comp_id='rdbms'
msg_id='opiexe:4181:2946163730' type='UNKNOWN' group='diag_adl'
level='16' host_id='STARUPNANT420B' host_addr='fe80::58b8:d0b2:f7c9:3147%27'>
<txt>drop table t11
</txt>
</msg>
Oracle12c:GeeWhizFeatures
17
Multiple Indexes
SQL> create table t3 (col1 number, col2 number);
Table created.
SQL> create index in_t3 on t3(col1);
Index created.
Rules
Different types: b-tree/bitmap
Unique/nonUnique
Only one is visible at a time
Oracle12c:GeeWhizFeatures
18
Invisible Column
SQL> create table t4 (col1 number, col2 number invisible);
SQL> desc t4
Name Null? Type
SQL> set colinvisible on
----- ----- ----SQL> desc t4
COL1
NUMBER
Name
Null?
Type
SQL> insert into t4 values (1);
----------------- -------- ---------1 row created.
-SQL> select * from t4;
COL1
NUMBER
COL1
COL2 (INVISIBLE)
NUMBER
---------SQL> create index in_t4 on t4(col2);
1
Index created.
SQL> select col1, col2 from t4;
COL1
COL2
---------- ---------1
SQL> insert into t4 (col1,col2) values (2,2);
1 row created.
Oracle12c:GeeWhizFeatures
19
Default Values
SQL> create table t5 (col1 number,
col2 number default on null 0);
Table created.
SQL> desc t5
Name
Null?
----------------- -------COL1
COL2
NOT NULL
Type
-----NUMBER
NUMBER
Oracle12c:GeeWhizFeatures
20
select accno,
calc_int(bal, int_rate)
from accounts;
Oracle12c:GeeWhizFeatures
21
Notastoredfunction
22
Top-N Query
First 10, second 10 rows, etc.
select from (select from order by ) where rownum <= 10
12c way:
select *
from sales_fact
order by year, week, country, region, product
fetch first 10 rows only;
Next 10 rows
offset 10 rows fetch first 10 rows only
offset 10 rows fetch first 0.1 percent rows only
offset 10 rows fetch first 0.1 percent rows with
ties
Fetch10.sql
Oracle12c:GeeWhizFeatures
23
Session Sequences
Values visible only in the session
Not persistent
SQL>
SQL>
SQL>
3
SQL>
1
24
View Expansion
create view v1 as select * from t1;
select * from v1;
SQL>
SQL>
2
3
4
5
var o clob
begin
dbms_utility.expand_sql_text (
'select * from v1',:o);
end;
/
SQL> print o
SELECT "A1"."COL2" "COL2" FROM (SELECT "A2"."COL2"
"COL2" FROM ARUP."T1" "A2")
Exp1.sql
Oracle12c:GeeWhizFeatures
25
9. Administration
PGA Size Limit
pga_aggregate_target is merely a target
pga_aggregate_limit limits PGA memory consumption
Greater of
2 GB
2 X pga_aggregate_target
3 MB X processes
Error:
ORA-00028: your session has been killed
ORA-04036: PGA memory used by the instance exceeds
PGA_AGGREGATE_LIMIT
PGA memory used by the instance exceeds PGA_AGGREGATE_LIMIT of
4000 MB
26
Adapt1.sql
Incremental Stats
Stats of partitions
Oracle12c:GeeWhizFeatures
27
Oracle12c:GeeWhizFeatures
28
Online DDLs
drop index i1 online;
alter table t1 drop constraint c1 online;
alter table t1 set unused column col1 online;
alter index i1 unusable online;
alter index i1 [in]visible;
Oracle12c:GeeWhizFeatures
29
files
Replay
workload
Capture
workload
files
Replay
workload
Oracle12c:GeeWhizFeatures
30
files
Replay
workload
Capture
workload
files
Replay
workload
Oracle12c:GeeWhizFeatures
31
Workload Characteristics #1
Load
Capacity
DB2
DB1
Time
Oracle12c:GeeWhizFeatures
32
Workload Characteristics #2
Load
Capacity
DB2
DB1
Time
Oracle12c:GeeWhizFeatures
33
Load
Capacity
DB2
DB1
Time
Oracle12c:GeeWhizFeatures
34
12. Miscellaneous
Temporary Undo
Put the undo information in TEMP tablespace
alter session set temp_undo_enabled=true;
V$TEMPUNDOSTAT view gives the details
35
Thank You!
My Blog: arup.blogspot.com
My Tweeter: arupnanda
Oracle12c:GeeWhizFeatures
36