New Features for Database Administrator of Oracle 12c Database. Here are some of excellent Oracle 12c new features with examples for learning purpose. SQL,Backup and recovery, Database management, Oracle RAC, Oracle ASM included.
How to Troubleshoot Apps for the Modern Connected Worker
Oracle database 12c new features
1. Oracle Database 12c
New Features
Prepared by
www.dbametrix.com
A world class Leader in Remote DBA Services
2. What are new features of Oracle 12
database?
•
•
•
•
•
•
•
SQL Enhancement
Backup and Recovery
Database Management Enhancement
Oracle Networking Enhancement
Oracle Performance Tuning
Oracle ASM new Features
Oracle RAC new features
3. SQL Enhancement – New Features
• Now you can use TRUNCATE table CASCADE for
truncating primary and dependent table data as following
command.
• SQL> TRUNCATE TABLE <table_name> CASCADE;
• You can use above command in table partition too.
Above command will be truncating table data including
child records too.
4. SQL Enhancement – New Features
• Output Rows restricting using FETCH FIRST N ROWS
ONLY in SQL statement.
• SELECT empno,ename,sal FROM emp ORDER BY
deptno DESC FETCH FIRST 5 ROWS ONLY;
• You can use 10 percent or 20 percent ROWS only
parameter in same SQL with limitation of N percent.
5. SQL Enhancement – New Features
• You can create INVISIBLE column in table or modify
column to make INVISIBLE. Invisible column never
shows in general select * queries but it shows in result
where mention column in select query.
• SQL> CREATE TABLE test (testno number, t_name
varchar2(30), t_dept number(2) INVISIBLE);
• After creating above TEST table, you cannot see t_dept
column in select * query but able to see result in select
t_dept from test query.
6. SQL Enhancement – New Features
• Invisible column can show via COLINVISIBLE SQL*Plus
command as following.
• SQL> SET COLINVISIBLE ON
7. SQL Enhancement – New Features
• You can create session level SEQUENCE for testing. Which
will be deleted automatically after session log off.
• SQL> CREATE SEQUENCE test_seq START WITH 10
INCREMENT BY 10 SESSION;
• You can also modify SEQUENCE to make it session level
using ALTER command.
• SQL> ALTER SEQUENCE test_seq SESSION;
• For removing session parameter of sequence you should
need to execute ALTER SEQUENCE test_seq GLOBAL;
8. SQL Enhancement – New Features
• You can extend datatype of VARCHAR2,RAW, and
NVARCHAR2 from 4000 bytes to 32,767 bytes.
• For using this feature, you should need to change
initialization parameter
MAX_STRING_SIZE=EXTENDED and restart database
in upgrade mode. After that you need to execute
• SQL> @?/rdbms/admin/utl32k.sql
9. SQL Enhancement – New Features
• From Oracle database 12c, you can create multiple
indexes on column.
• This feature is available for composite columns and
single index both.
10. Backup and Recovery – New
Features
• New Backup privilege introduced called SYSBACKUP.
• It means now there is no need to give SYSDBA privilege
for performing backup and recovery tasks.
• Sample command is following.
• $ ./rman target “rman/rman as SYSBACKUP"
11. Backup and Recovery – New
Features
• Real time Apply redo log to Data Guard.
• In previous release of Oracle 12c, default option was
apply redo from archived log files on the standby
database.
• In Oracle Database 12c Release, the default
configuration is to use real-time apply so that redo is
applied directly from the standby redo log file.
• This new feature helps to maintain minimum or zero data
loss.
12. Backup and Recovery – New
Features
• Active DATA GUARD is now accepting DML operations
on Global temporary tables.
• Active standby database can be open in read only mode.
• Active standby database is now supported DML
operations on Global Temporary Tables.
• This feature enhances reporting facility and performance
of primary database.
13. Backup and Recovery – New
Features
• Direct SQL statement execution in RMAN utility. Now no
need of any prefix like “sql” in RMAN command line.
• RMAN> SELECT sid,serial#,status FROM v$session;
14. Backup and Recovery – New
Features
• Table level recovery is now possible using RMAN. In
prior versions this feature didn‟t available.
• RECOVER TABLE username.tablename UNTIL TIME
„<TIMESTAMP>…' AUXILIARY DESTINATION
'/u01/backup' DATAPUMP DESTINATION '/u05/dumpdir'
DUMP FILE 'tablename.dmp' NOTABLEIMPORT
• REMAP TABLE „<username.tablename>':
„<username.new_table_name>';
15. Backup and Recovery – New
Features
• In Datapump, new parameter introduced called
TRANSFORM with DISABLE_ARCHIVE_LOGGING.
This option will disable archive log generation during
import process.
• impdp directory=dpump dumpfile=test.dmp
logfile=test.log
TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y
16. Database Management– New
Features
• Now you can move active data file online without
copying to another destination as following command.
• ALTER DATABASE MOVE DATAFILE
'/u01/data/test_tbs01.dbf' TO '/u02/data/test_tbs01.dbf';
• You can monitor above ongoing process using dynamic
data dictionary view V$SESSION_LONGOPS
17. Database Management– New
Features
• New Feature called PLUGGABLE database and
CONTAINER database introduced in Oracle 12c.
• Container database contains pluggable database. You
can say database in database. Pluggable database
plugs in to container database.
• This feature helps to better database administration and
management tasks. It shorten memory usage and disk
usage.
• You can plug in pluggable database into any container
database. Single container database contains many
pluggable database.
18. Database Management– New
Features
• Now you can enable logging mode of every Data
Definition Language (DDL). Every DDL command will be
logged in trace file at operating system disk.
• For enabling this feature, you should need to enable
parameter ENABLE_DDL_LOGGING=TRUE.
• Trace files would be generating in following directory
• $ORACLE_BASE/diag/rdbms/DBNAME/log/ddl
19. Database Management– New
Features
• You can merge/split/add table partitions in single SQL
command.
•
•
•
•
ALTER TABLE test_p
ADD PARTITION
PARTITION part11 VALUES LESS THAN (120000),
PARTITION part12 VALUES LESS THAN (130000);
20. Database Management– New
Features
• You can move table partition online or offline using
following command.
• Offline command=>
• ALTER TABLE table_name MOVE
PARTITION|SUBPARTITION <partition_name> TO
tablespace <tablespace_name>;
• Online command=>
• ALTER TABLE table_name MOVE
PARTITION|SUBPARTITION <partition_name> TO
tablespace <tablespace_name> UPDATE INDEXES
ONLINE;
21. Database Management– New
Features
• You can truncate/drop multiple partitions in single DDL
command as following.
• ALTER TABLE test_p DROP PARTITIONS part7,part9
UPDATE GLOBAL INDEXES;
• ALTER TABLE test_p TRUNCATE PARTITIONS
part7,part9 UPDATE GLOBAL INDEXES;
22. Database Management– New
Features
• Preupgrade script is now available in Oracle 12c
database for investigating preupgrade issues to fix.
• Preupgrade script called preupgrd.sql is available in
rdbms/admin folder.
• Preupgrade_fixup.sql log file will be generated in
$ORACLE_BASE/cfgtoollogs directory.
• This script helps to investigation of certain issues of
upgrade process and we can easily resolve issue using
preupgrade_fixup.sql. This feature can save our time of
database upgrade activity.
23. Oracle Networking Enhancement –
New Features
• In Oracle 12c database, you can restore and recover
data file over through net. Means you can
restore/recover data file from standby database to
primary database vice versa using service option with
following command in RMAN.
• RMAN> RECOVER DATABASE FROM SERVICE
prod_service USING COMPRESSED BACKUPSET;
24. Oracle Performance Tuning – New
Features
• You can gather object or database statistics
concurrently. This feature generates statistics multiple
tables/indexes simultaneously.
• For using this feature, you should have nonzero value in
parameter JOB_QUEUE_PROCESSES and you need to
set following parameters.
• EXEC
DBMS_STATS.SET_GLOBAL_PREFS('CONCURRENT'
, 'ALL');
25. Oracle Performance Tuning – New
Features
• Excellent feature of Temporary Undo.
• In Oracle 12c, now temporary undo would be generated
in temporary tablespace. This feature eliminates
unnecessary redo generation of temp tablespace usage.
• For enabling temporary undo, you need to make sure to
set initialization parameter
TEMP_UNDO_ENABLED=true.
26. Oracle Performance Tuning – New
Features
• Program Global Area (PGA) Limitation.
• You can restrict PGA allocation in to database. In prior
version this feature wasn‟t available.
• You can use parameter
PGA_AGGREGATE_LIMIT=<some value> to enable this
limitation of PGA.
• Once you define this value then Oracle won‟t expand
more than this size of PGA. This feature helps to avoid
paging/swapping and memory bottleneck issues.
27. Oracle Performance Tuning – New
Features
• Real Time Automatic Database Diagnostic Monitor
ADDM.
• This feature available with Oracle EM control of 12c only.
• In OEM portal, you can select real time ADDM in
performance option for investigating findings of
production database.
• This feature is absolutely new and present there is no
another command line option available. Means you need
OEM control for using this option.
28. Oracle ASM – New Features
• ASM Disk Rebalance Estimation
• Like EXPLAIN PLAN FOR, new command introduced as
EXPLAIN WORK FOR. Using this statement, Oracle
gathers and shows ASM disk rebalance estimation in
V$ASM_ESTIMATE view.
• Example:
• EXPLAIN WORK FOR ALTER DISKGROUP DS_DATA1
ADD DISK dsd_03;
• After successfully execution of above command you can
check estimation cost in V$ASM_ESTIMATE for setting
proper value of POWER limit for faster task.
29. Oracle ASM – New Features
• New feature introduced called FLEX ASM.
• When any instance terminated in ASM, then any survival
ASM instance will be up within flex cluster to maintain
high availability.
• For enabling this feature, we need to install flex cluster
using Oracle clusterware and this option automatically
install flex ASM option at node.
• You can enable flex ASM using ASMCA utility in your
cluster environment.
30. Oracle ASM – New Features
• For checking and repairing logical corruption of disks,
new facility introduced called ASM DISK Scrubbing.
• Using this facility, now you can check and repair disk for
getting rid of logical corruption.
• Example:
• ALTER DISKGROUP DS_DATA1 SCRUB POWER
LOW:HIGH:AUTO:MAX;
• ALTER DISKGROUP DS_DATA1 SCRUB FILE
'+DG_DATA/TEST/DATAFILE/test.xxxx.xxxx' REPAIR
POWER AUTO;
31. Oracle RAC – New Features
• Now Flex Cluster supported in Oracle 12c.
• Flex cluster architecture contains hub and leaf nodes.
• Hub nodes are regular RAC nodes which are having
DIRECT access of storage and directly read/write.
• Leaf nodes are not having DIRECT access of storage
and they will get access through HUB node.
• It means you can have HUB nodes without leaf nodes
but You cannot have leaf nodes without hub nodes.
• You can convert any node as leaf node as following.
• $ ./crsctl get node role config
• $ ./crsctl set node role hub|leaf
32. Oracle RAC – New Features
• Now you can start instance or database as NO MOUNT,
MOUNT, and OPEN stage using SRVCTL command.
• This facility doesn‟t available in prior of Oracle 12c.
• Example command is following….
• srvctl start|stop database|instance –startoption
NOMOUNT|MOUNT|OPEN
33. Oracle 12 Database New
Features
Prepared By
http://www.dbametrix.com
A world class Leader in Remote DBA Services