Sie sind auf Seite 1von 51

ORACLE 12C

NEW FEATURES

Ishtiaq Hussain

Sr.Technical Consultant Information Architects

Agenda

Oracle Database Administration New features

Oracle Database Developer New features

Oracle Database Administration New features

What is New in Oracle Database Administration

Multitenant Architecture?

Multitenant benefits

Shared Resources

Files in PDBs

RMAN

Backup types

Data Pump

Changing init.ora Paramters

Automatic Diagonistic Reporsitory

Oracle Flashback Technology

What is New in Oracle Database - Develope

Increase the Size limit

Invisible columns

DDL logging

Sql Identity Columns

Sequence in Oracle 12c

FETCH FIRST

Database Cloud & Consolidation Architectures

Virtual

Machines

Cloud & Consolidation Architectures Virtual Machines Share servers with “ VM isolation ” Multiple DB
Cloud & Consolidation Architectures Virtual Machines Share servers with “ VM isolation ” Multiple DB
Cloud & Consolidation Architectures Virtual Machines Share servers with “ VM isolation ” Multiple DB

Share servers with VM isolation

Multiple DB Instances

servers with “ VM isolation ” Multiple DB Instances Share servers and OS with “ DB

Share servers and OS with DB Instance Isolation

Schema

Consolidation

OS with “ DB Instance Isolation ” Schema Consolidation Share servers, OS and database with “

Share servers, OS and database with Schema Isolation

NEW DB 12c Multitenant

with “ Schema Isolation ” NEW DB 12c Multitenant Share servers, OS and database with “

Share servers, OS and database with

Pluggable DB Isolation

Oracle Database Architecture

Each Databases requires memory, processes and database files

System Resources

Oracle Database Architecture Each Databases requires memory, processes and database files System Resources

New Multitenant Architecture

Memory and processes required at container level only

System Resources

New Multitenant Architecture Memory and processes required at container level only System Resources

New Multitenant Architecture

Memory and processes shared and managed at container level

System Resources

New Multitenant Architecture Memory and processes shared and managed at container level System Resources

Managing Shared Resources

Resource management for consolidated databases

Managing Shared Resources Resource management for consolidated databases Low Priority Medium Priority High Priority
Managing Shared Resources Resource management for consolidated databases Low Priority Medium Priority High Priority

Low Priority

Managing Shared Resources Resource management for consolidated databases Low Priority Medium Priority High Priority

Medium Priority

High Priority

Database Consolidation Requirements

No performance degradation

Centralized resource management

Simplify patching and upgrades

 No performance degradation  Centralized resource management  Simplify patching and upgrades ERP CRM BI
ERP CRM BI DW
ERP
CRM
BI
DW

Benefit: Manage Many Databases as One

Backup databases as one, recover at pluggable database Level

Backup databases as one, recover at pluggable database Level One Backup Point-in-time recovery at pluggable database
One Backup Point-in-time recovery at pluggable database level
One Backup
Point-in-time recovery
at pluggable database level
databases as one, recover at pluggable database Level One Backup Point-in-time recovery at pluggable database level

Benefit: Manage Many Databases as One

One standby database covers all pluggable databases

Benefit: Manage Many Databases as One One standby database covers all pluggable databases

Benefit: Simplified Patching

Apply changes once, all pluggable databases updated

Upgrade

in-place

Benefit: Simplified Patching Apply changes once, all pluggable databases updated Upgrade in-place

Benefit: Simplified Upgrades

Flexible choice when patching & upgrading databases

Benefit: Simplified Upgrades Flexible choice when patching & upgrading databases
Benefit: Simplified Upgrades Flexible choice when patching & upgrading databases

Benefit: Creating Databases for Test and Development

Fast, flexible copy and snapshot of pluggable databases

Benefit: Creating Databases for Test and Development Fast, flexible copy and snapshot of pluggable databases
Benefit: Creating Databases for Test and Development Fast, flexible copy and snapshot of pluggable databases

Benefit: Oracle Database 12c Multitenant Architecture

Reduced TCO

Administrative costs

Operational costs

Data Center costs

Storage costs

Improved …

Resource utilization

Manageability

ERP CRM BI DW
ERP
CRM
BI
DW

Shared Resources

Shared Resources • Background processes • Shared/process memory • Oracle metadata • Control files • Redo

Background processes

Shared/process memory

Oracle metadata

Control files

Redo Log files

Files in PDBs

Files in PDBs • Each PDB has its own set of tablespaces including SYSTEM and SYSAUX

Each PDB has its own set of tablespaces including SYSTEM

and SYSAUX

PDBs share UNDO, REDO and control files

By default the CDB has a single TEMP tablespace, but PDBs may create their own

Files of CDB & PDBs

Container Database (CDB) : On the surface this seems very similar to a conventional Oracle database, as it contains most of the working parts we will be already familiar with (controlfiles, datafiles, undo, tempfiles, redo logs etc.) Pluggable Database (PDB) : it is just made up of datafiles and tempfiles to handle it's own objects. This includes it's own data dictionary, containing information about only those objects that are specific to the PDB.

Files in CDB & PDBs

Files in CDB & PDBs

Oracle 12c Backup Types

Container Database (CDB) Backup

It backups datafiles associated with the CBD (cdb1) and

all the PDBs (pdb1, pdb2

)

are included in the backup.

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

RMAN

SQL Interface Improvements

SYSBACKUP Privilege

Support for multitenant container and pluggable databases.

RMAN

SQL Interface Improvements

In Oracle 12c, we can run SQL commands in RMAN without preceding the command with the SQL keyword. We also no longer need to enclose the SQL command in quotes. The RMAN DESCRIBE provides the same functionality of SQL*Plus DESCRIBE:

RMAN> desc dba_profiles;

Name ------------- PROFILE RESOURCE_NAME RESOURCE_TYPE LIMIT COMMON

Null?

Type ---------------------------- --------

NOT NULL

VARCHAR2(128)

VARCHAR2(32)

VARCHAR2(8)

---------------

NOT NULL

VARCHAR2(128)

VARCHAR2(3)

RMN

cont

SYSBACKUP Privilege

Prior to 12c, users needed SYSDBA privilege to backup the database. The new SYSBACKUP privilege allows the user the permissions to perform only backup operations.

The SYSBACKUP privilege allows the DBA to perform RMAN backup commands without additional privileges. Using this new role in 12c, we can segregate Administration and Backup operations. To Connect to RMAN using Password file Authentication Authentication with the SYSBACKUP Privilege use:

$ rman target1 „ “bkpadm@DB1 as sysbackup” „

• Root Container Backup It will backup datafiles associated with the CBD (cdb1) are included,

Root Container Backup It will backup datafiles associated with the CBD (cdb1) are included, but all the PDBs (pdb1, pdb2, pdb$seed) are not included in the backup. Command RMAN> BACKUP DATABASE ;

• Pluggable Database (PDB) Backup • $ rman target=sys@pdb1 RMAN> BACKUP TABLESPACE system, sysaux, users;

Pluggable Database (PDB) Backup

$ rman target=sys@pdb1 RMAN> BACKUP TABLESPACE system, sysaux, users;

DATAPUMP

Datapump is a server based bulk data movement infrastructure that supersedes the old import and export utilities. The old export/import tools are still available, but do not support all Oracle 10g, 11g and12c features. The new utilities are named expdp and impdp.

available, but do not support all Oracle 10g , 11g and 12c features. The new utilities

DATAPUMP

Enables very high-speed movement of bulk data and metadata

Enhanced version of original/legacy import (imp) and export (exp) utilities

Simplest approach to export objects from source to target

Performed as a server side job and hence more efficient (unlike legacy exp/imp where dump file is created at the client location)

Expdp and impdp are the command line utilities for Data Pump.

DATAPUMP

# Features

Description

1 Tuning

Automatically tunes the export and import processes. Tuning parameters like BUFFER,COMMIT,COMPRESS,DIRECT and RECORDLENGTH are not required

2 Parallelism

Being a server side job,parallel processing can be done to make data export and import more efficient

3 REMAP

Tables can be imported into a different tablespace from the source database

Changing init.ora Paramters

In Oracle8i, Oracle instances were always started using a text file called an init<SID>.ora. This file is by default located in the "$ORACLE_HOME/dbs" directory. In Oracle 9i, Oracle has also introduced the 'SPFILE', which is a binary file stored on the database Server. Changes which are applied to the instance parameters may be persistent across all startup/shutdown procedures. In now , we can startup the instance using either an spfile or an init.ora file. The default initialization files must are located as follows:

- on Unix ---> $ORACLE_HOME/dbs

ADR

Automatic Diagnostic Repository ADR is a file-based repository for database diagnostic data such as traces, incident dumps and packages, the alert log, Health Monitor reports, core dumps, and more. It has a unified directory structure across multiple instances and multiple products stored outside of any database. It is, therefore, available for problem diagnosis when the database is down.

Two alert log files are generated. We can view the alert log in text format (with the XML tags stripped) with

Enterprise Manager and with the ADR Command Interpreter (ADRCI) utility.

ADR File Types

Log: High-level information of activity

• Trace:

Background trace files

SQL trace files

• Dump:

Specific type of trace file

Detailed point-in-time information of an incident

• Core:

Memory dump

All-binary, port-specific format

ADR

ADR

Oracle Flashback Technology

Flashback Query, the first Flashback Technology, was introduced in Oracle 9i. When?

Accidentally updated a table with wrong values !!

Performed a batch update that went wrong - due to logical errors in the code !! Dropped a table !!

• Database level • Table level • Row level

Database level

Table level

Row level

Important. Tips

There is a separate SYSTEM and SYSAUX tablespace for the root container of the CDB and each PDB

Thee is only one UNDO tablespace for the entire CDB

There is only one set of control files and online redo logs files for the entire CDB. Individual PDB‟s have their own data files (which contain the user data), but do not have

distinct redo log or control files.

We can create on default temporary tablespace for the entire CDB or each PDB can have its own additional temporary tablespaces.

Important. Tips

There is single network administration files like listener.ora, tnsnames.ora, and sqlnet.ora file for an entire CDB. All of the PDBs in the CDB use the same files.

There is only one set of background processes shared by the root and all PDBs

There is a single SGA shared by all PDB‟s

When the CDB is shut down then all PDB‟s are also automatically shut down

What is New in Oracle 12C for

Developer

What's New Oracle Database 12c

Increase the Size limit

Invisible columns

DDL logging

Sql Identity Columns

Sequence in Oracle 12c

FETCH FIRST

Increase the Size limit

Increased size limit for VARCHAR2, NVARCHAR2 datatypes to 32K from 4k.

Invisible columns

In Oracle 12c , we can now have an invisible column in a table. When a column is defined as invisible, the column won‟t appear in generic queries, unless the column is explicitly referred to in the SQL statement or condition, or DESCRIBED in the table definition. It is pretty easy to add or modify a column to be invisible and vice versa.

Example:

SQL> CREATE TABLE emp (eno number(6), ename name varchar2(40), sal number(9)

INVISIBLE);

DDL logging

In 12cR1, we can now log the DDL action into xml and log files. This will be very useful to know when the drop or create command was executed and by who. The ENABLE_DDL_LOGGING initiation parameter must be configured in order to turn on this feature. The parameter can be set at the database or session levels. When this parameter is enabled, all DDL commands are logged in an xml and a log file under the $ORACLE_BASE/diag/rdbms/DBNAME/log|ddl location. An

xml file contains information, such as DDL command, IP address,

timestamp etc.

Sql Identity Columns

Oracle Database 12c has new feature called "Identity Columns" which are auto-incremented at the time of insertion (like in MySQL).

Example:

SQL> create table dept (dept_id number generated as

identity, dept_name varchar);

SQL> create table dept (dept_id number generated as identity (start with 1 increment by 1 cache 20 noorder), dept_name varchar);

Sequence in Oracle 12c

Default column value to a sequence in Oracle 12c Database.

Oracle Database 12c allows developers to default a column directly to a sequence-generated value.

The DEFAULT clause of a table column can be assigned to SEQUENCE.CURRVAL or SEQUENCE.NEXTVAL

Example:

/*Create a sequence*/ CREATE SEQUENCE seq START WITH 100 INCREMENT BY 10 /

/*Create a table with a column defaulted to the sequence value*/

CREATE TABLE t_def_cols ( id number default seq.nextval primary key, name varchar2(30), doj date default on null '01-Jan-2000' )

FETCH FIRST

Row limiting using FETCH FIRST Oracle Database 12c introduces a new clause, FETCH FIRST, to simplify the code and comply with ANSI SQL standard guidelines. The clause is used to limit the number of rows returned by a query. The new clause can be used in conjunction with ORDER BY to retrieve Top- N results.

Multiple Indexes on same column

Now, We can multiple Indexes on same column or same set of columns as long as some characteristics of Index/Indexes are different.

Unique and non Unique

B*Tree and Bitmap

Partitioning Strategies like Local and Global.

One of the Index needs to be Invisible.

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 us 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.

We cannot move datafile of a pluggable database from container database.

Contd.

Contd.

Thanks