gloc 2014 neooug - oracle database 12c new features

37
Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 1 Rest of the Database 12c Features for 11g DBA! Biju Thomas 14-May-14

Upload: biju-thomas

Post on 18-Nov-2014

500 views

Category:

Technology


1 download

DESCRIPTION

Rest of the Database 12c Features for 11g DBA! The lesser known or NOT TOP features...

TRANSCRIPT

Page 1: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 1

Rest of the Database 12c

Features for 11g DBA!

Biju Thomas 14-May-14

Page 2: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 2

Rest of the Database 12c

Features for 11g DBA!

Page 3: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 3

Speaker

• Oracle ACE

• Principal Solutions Architect with OneNeck® IT Solutions

• More than 20 years of Oracle database administration experience and over 7 years of E-Business Suite experience

• Author of Oracle12c OCA, Oracle11g OCA, co-author of Oracle10g, 9i, 8i certification books published by Sybex/Wiley.

• Presentations, Articles, Blog, Tweet

Page 4: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 4

Session Objectives

• As a 11g DBA, what you should know when

working with 12c database (changed behavior

or additional functionality)

• New Features – that will impact the traditional

way of administration and management

• High level – once you know what to look for,

“search” is always an option!

Page 5: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 5

ADMINISTRATION AND MANAGEABILITY

Page 6: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 6

Online Data File Move

• File move (rename) in 11g

– Take tablespace offline

– Use OS command to copy or move file

– Use SQL to update the controlfile – ALTER DATABASE

RENAME FILE or ALTER TABLESPACE … RENAME DATAFILE

– Bring tablespace online

• File move in 12c

– Just one step!

– ALTER DATABASE MOVE DATAFILE ‘x’ TO ‘y’

– The “TO” clause is optional – if omitted, file is moved to DB_CREATE_FILE_DEST as OMF.

1

Page 7: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 7

More to File Move…

• Files belonging to SYSTEM tablespace can be moved using ALTER DATABASE MOVE DATAFILE, online!

• MOVE DATAFILE syntax allows only 1 file move at a time. You can still move multiple files with ALTER DATABASE RENAME

FILE or ALTER TABLESPACE RENAME DATAFILE options –

but offline mode.

• File can be moved from file system to ASM disk group, and

vice versa.

• File can be moved from one diskgroup to another in ASM.

• Optional KEEP clause to keep copy of the data file at the

source.

Page 8: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 8

Temporary Undo

• By default, undo information on global temporary-table DML operations are stored in the undo tablespace, similar to undo operations on persistent tables.

• New parameter TEMP_UNDO_ENABLED

• Undo information generated by DML operations on temporary tables stored in the temporary tablespace; therefore, no redo is generated for the undo operation.

• Reduces the amount of undo data stored in the undo tablespaces, and the amount of redo from the undo.

• Parameter is session modifiable.

2

Page 9: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 9

Listener Registration

• New mandatory background process LREG

• Registers information about the database instance and dispatcher processes with the Oracle Net Listener

• When an instance starts, LREG polls the listener to determine whether it is running. If the listener is running, then LREG passes it relevant parameters. If it is not running, then LREG periodically attempts to contact it.

• Manual listener registration using ALTER SYSTEM REGISTER – same as in 11g.

• In 11g, PMON process had this responsibility.

3

Page 10: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 10

Limit PGA

• New parameter PGA_AGGREGATE_LIMIT

• Specifies a limit on the aggregate PGA memory consumed by the instance

• Default Value: – Greater of

• 2 GB

• 200% of PGA_AGGREGATE_TARGET

• 3 MB times the PROCESSES parameter.

– It will not exceed 120% of the physical memory size minus the total SGA size.

• PGA_AGGREGATE_TARGET maintains the same behavior as 11g

4

Page 11: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 11

DDL Logging

• ENABLE_DDL_LOGGING– Introduced in 11g

– Writes DDL statements to Alert log

• What’s different in 12c?– Instead of alert log, writes to

DDL log directory in ADR

– <ADR Home>/log/ddl

– File log.xml

• The Catch: – Either Database Lifecycle

Management Pack or Change Management Pack must be licensed

$ cat log.xml

<msg time='2014-04-29T16:48:23.352-07:00' org_id='oracle' comp_id='rdbms'

msg_id='opiexe:4181:2946163730' type='UNKNOWN' group='diag_adl'

level='16' host_id='emcc.example.com' host_addr='10.0.2.15'

version='1'>

<txt>create table biju_test (n number)

</txt>

</msg>

5

Page 12: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 12

Viewing DDL Log

• Use adrci : New option – SHOW LOG

• Default shows all logs – ddl, debug and test

• Filter ddl logs using –l. Further filter using the –p option

• Try “help show log” to see all predicate string options with -p

adrci> show log -l ddl -p "message_text like '%biju%'"

ADR Home = /u02/app/oracle/diag/rdbms/ocadb1/ocadb1:

****************************************************************

Output the results to file: /tmp/utsout_4170_140592_1.ado

adrci>

2014-04-29 16:48:23.352000 -07:00

create table biju_test (n number)

2014-04-29 16:48:31.853000 -07:00

drop table biju_test

6

Page 13: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 13

Last Login Time

• Security related values in the USER$ table are [as existed in 11gR2]:

– CTIME: Date & Time when user was created

– PTIME: Date & Time when user password was last changed

– LTIME: Date & Time when the user account was locked

– LCOUNT: Number of failed login attempts

• Added in Oracle Database 12c:

– SPARE6: Last login time of the user.

• Displayed when you invoke SQL*Plus

$ sqlplus hr/hr

SQL*Plus: Release 12.1.0.1.0 Production on Tue Jul 9 23:34:32 2013

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Last Successful login time: Tue Dec 09 2013 23:34:22 -05:00Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL>

7

Page 14: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 14

Cascaded TRUNCATE

• New CASCADE clause for TRUNCATE

• Truncates all child tables that reference

truncated table.

• Foreign key must be defined with ON

DELETE CASCADE option

• Foreign key must be in ENABLED status.

• Children, grand children are truncated

8

Page 15: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 15

Do More w/o Waiting

• More DDL statements support ONLINE – Dropping an index (DROP INDEX ... ONLINE)

– Marking an index as UNUSABLE (using ALTER INDEX ... UNUSABLE ONLINE)

– Marking a column as UNUSED (ALTER TABLE ... SET UNUSED ... ONLINE)

– Dropping a constraint (ALTER TABLE ... DROP ... ONLINE)

– Moving a table partition (ALTER TABLE ... MOVE PARTITION ... ONLINE)

– Moving a table subpartition (ALTER TABLE ... MOVE SUBPARTITION ... ONLINE)

9

Page 16: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 16

Multiple Partition Management

• Merge Multiple Partitions

• Split Multiple Partitions

10

Page 17: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 17

More Partition Management

• Add Multiple partitions

• Drop Multiple Partitions

• Truncate Multiple Partitions

Page 18: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 18

Bigger VARCHAR2

• VARCHAR2 [and NVARCHAR2, RAW] column width up to 32767 bytes

• Parameter MAX_STRING_SIZE = EXTENDED –must change only when the database is started in UPGRADE mode

• Once enabled, no going back

• Invalidates views and materialized views, compile after change.

• Individual PDBs in a CDB can have different setting

11

Page 19: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 19

Changing MAX_STRING_SIZE

• ALTER PLUGGABLE DATABASE CLOSE [IMMEDIATE]

• ALTER PLUGGABLE DATABASE OPEN UPGRADE

• Change the setting of MAX_STRING_SIZE to EXTENDED

• Run the ?/rdbms/admin/utl32k.sql script as SYSDBA.

• ALTER PLUGGABLE DATABASE CLOSE

• ALTER PLUGGABLE DATABASE OPEN

• Shutdown database • Start the database in

UPGRADE mode• Change the setting of

MAX_STRING_SIZE to EXTENDED

• Run the ?/rdbms/admin/utl32k.sql script as SYSDBA.

• Restart the database in normal mode.

Page 20: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 20

Multi-threaded Processes

• New Parameter: THREADED_EXECUTION (YES/NO)

• Allows multiple background processes to share a single OS process on Unix, similar to Windows.

• In default process models, SPID and STID columns of V$PROCESS will have the same values, whereas in multithreaded models, each SPID (process) will have multiple STID (threads) values.

• The EXECUTION_TYPE column in V$PROCESS will show THREAD.

• V$BGPROCESS shows the background processes.

• Listener.ora should have DEDICATED_THROUGH_BROKER_<listener-name>=ON

• Cannot Login ‘/ AS SYSDBA’– Must use SYS AS SYSDBA

12

Page 21: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 21

Row Limiting Clause

• New clause in SELECT statement

• Follows the ORDER BY clause[ OFFSET offset { ROW | ROWS } ]

[ FETCH {FIRST | NEXT} [ {rowcount | percent PERCENT} ]

{ ROW | ROWS } { ONLY | WITH TIES } ]

• OFFSET clause is used to skip the specified number of rows before the limiting begins.

• FETCH clause can specify the number of rows to return or a percentage of rows to return.

• ONLY specifies to return exact number or percent of rows to return.

• WITH TIES specifies to return all rows that have the same sort keys as the last row of the row-limited result set.

http://bijoos.com/oraclenotes/2013/95

13

Page 22: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 22

Row Limiting Examples

Page 23: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 23

Invisible Columns

• Columns can be invisible (ALTER TABLE, CREATE TABLE syntax – INVISIBLE)

• Column Order changes when you make column invisible (and visible again!)

• Not supported on temporary and external tables

• Specify explicitly in INSERT, SELECT clauses

• SQL*Plus: SET COLINVISIBLE ON

14

Page 24: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 25

ENHANCEMENTS TO TOOLS AND UTILITIES

Page 25: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 26

Database Express 12c

• Database Control is history…

• Requires XDB. EM Express is a servlet built on top of Oracle XML DB.

• Deafult port is 5500, can be changed using DBMS_XDB_CONFIG.setHTTPsPort (<port>) procedure

• URL is https://<hostname>:5500/em

• Available only when the database is open

• The EM_EXPRESS_BASIC role enables users to connect to EM Express and to view the pages in read-only mode.

• The EM_EXPRESS_ALL role enables users to connect to EM Express and use all the functionality.

Page 26: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 27

Database Express Home

Page 27: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 28

Enhanced Patching

• “datapatch” to run post patch scripts

– Will automatically determine post scripts and actions

– MOS Note “Datapatch: Database 12c Post Patch SQL Automation (Doc ID 1585822.1)”

• Queryable patch inventory using DBMS_QOPATCH Package

– Shows all the patch information available as part of the OPATCH LSINVENTORY -XML command.

– Queryable Patch Inventory requies Oracle database instance to be open in read/write mode.

– MOS Note “Oracle Database 12.1 : FAQ on QueryablePatch Inventory (Doc ID 1530108.1)”

Page 28: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 29

Data Pump NOLOGGING Import

• Import without generating archived logs– TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y[:TABLE|INDE

X]

• Sets object to NOLOGGIG before import and reverts to original setting after import.

• Choose to disable logging for tables (Y:TABLE), indexes (Y:INDEX), or both (Y).

$ impdp DIRECTORY=dump_dir DUMPFILE=ex2.dmp LOGFILE=ex2.log SCHEMAS=ball TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y:TABLE

$ impdp DIRECTORY=dump_dir DUMPFILE=ex1.dmp LOGFILE=ex1.log SCHEMAS=basket TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y TRANSFORM=DISABLE_ARCHIVE_LOGGING:N:INDEX

Page 29: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 30

Data Pump Export Views As Tables

• Export one or more views as tables– VIEWS_AS_TABLES=[schema_name.]view_na

me[:table_name], ...

• table_name specifies the name of a table to serve as the source of the metadata for the exported view (mainly for RO db).

• Data Pump performs a table-mode export.

• Useful to get a subset of data exported.

• Also available in “impdp” to use in the network mode of import.

Page 30: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 31

RMAN Notables

• “Describe” in RMAN, similar to SQL*Plus.

• Most SQL statements can be run in RMAN

without the “SQL” prefix (and messing with

quotes around the SQL!!).

• SYSBACKUP Administration Role – Start

replacing scripts where SYSDBA is used

Page 31: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 32

RMAN Restore Table

• The biggest RMAN feature is restore table from backup.

RECOVER TABLE SCOTT.EMP, SCOTT.DEPT

UNTIL TIME 'SYSDATE-1'

AUXILIARY DESTINATION '/t1/tdb'

DATAPUMP DESTINATION '/t1/dump'

DUMP FILE 'emp_dept_dump.dat'

REMAP TABLE 'HR'.'EMP':'EMP_RECVR';

--NOTABLEIMPORT;

Page 32: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 34

What Else…

• Documentation (docs.oracle.com)– New Features Guide

– First chapter in most books

• Oracle Database 12c New Features Series

• Oracle Database 12c Learning Library

Page 33: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 35

TechNet Interactive Reference

• http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/12c/r1/poster/OUTPUT_poster/poster.html#

Page 34: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 36

Database 12c Learning Library

Page 35: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 37

OLL- 12c New Features Series

Page 36: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 38

New Features on Biju’s Blog

http://bijoos.com/oraclenotes

• OracleDB12c New Feature: ASMCMD Commands for Password File Management

• OracleDB12c New Feature: Password File in ASM

• OracleDB12c New Feature: Exporting View Data

• OracleDB12c New Feature: Misc Security Changes

• OracleDB12c New Feature: Rename and Replace ASM Disk(s) in Diskgroup

• OracleDB12c New Feature: Last Login Time of User

• OracleDB12c New Feature: No Logging Option in Data Pump Import

• OracleDB12c New Feature: Added Administrative Privileges

• OracleDB12c New Feature: Adding, Dropping, Truncating Multiple Partitions

• OracleDB12c New Feature: Merging and Splitting Multiple Partitions

• OracleDB12c New Feature: Use of Sequence Value in Column DEFAULT

• OracleDB12c New Feature: Identity Column

• OracleDB12c New Feature: SQL*Plus NOLOGINTIME Option

• OracleDB12c New Feature: More to Online Data file Move

• OracleDB12c New Feature: RMAN Describe

• OracleDB12c New Feature: Cascaded Truncate

• OracleDB12c New Feature: Store More in VARCHAR2

• OracleDB12c New Feature: New Row Limiting Clause in SELECT

• Oracle Database 12c – Few Links

• OracleDB12c New Feature: Capture Privilege Usage

Page 37: GLOC 2014 NEOOUG - Oracle Database 12c New Features

Copyright © 2013 OneNeck IT Services Corporation. All Rights Reserved. 39

Thank you!

Thank you for your time…

Contact:Tweets: @Biju_ThomasFacebook: OracleNotes

Blog: bijoos.com/oraclenotes

Please Complete “Feedback” on Guidebook