Está en la página 1de 10

Oracle 12c database

New Features

Table of Contents:
1.

PLUGABLE DATABASE................................................................................................3

2.

ONLINE DATAFILE MOVE.............................................................................................. 7

3.

DATABASE HEATMAPS................................................................................................ 0

4.

ADATABASE CONSOLIDATED REPLAY............................................................................0

5.

AUTOMATICDATA OPTIMIZATION ..................................................................................0

6.

TEMPORAL HISTORY.................................................................................................. 0

7.

ROW ARCHIVAL......................................................................................................... 0

8.

UNIFIED AUDITING...................................................................................................... 0

9.

ADMINISTRATIVE PRIVILEGES......................................................................................0

10.

DATA REDACTION ..................................................................................................... 0

11.

ADAPTIVE EXECUTION PLANS......................................................................................0

12.

SQL PLAN DIRECTIVEL............................................................................................... 0

13.

REAL TIME ADDM....................................................................................................... 0

14.

COMPARE PERIOD ADDM.............................................................................................0

15.

DATA PUMP............................................................................................................... 0

16.

PARTITIONING........................................................................................................... 0

Pluggable Databases
In a pluggable database environment, you create a single database container, and plug multiple databases
into this container. They key design feature here is that, all these databases then share the exact same
oracle server processes (aka background processes) and memory (Unlike in the previous versions where
each database got its own set of background processes and shared memory allocation).

Database Environment before Database Consolidation

Large enterprises may use hundreds or thousands of databases. Often these databases run on different
platforms on multiple physical servers. Because of improvements in hardware technology, especially the
increase in the number of CPUs, servers are able to handle heavier workloads than before. A database
may use only a fraction of the server hardware capacity. This approach wastes both hardware and human
resources.
For example, 100 servers may have one database each, with each database using 10% of hardware
resources and 10% of an administrator's time. A team of DBAs must manage the SGA, database files,
accounts, security, and so on of each database separately, while system administrators must maintain 100
different computers.
To show the problem in reduced scale, above figure depicts 11 databases, each with its own application
and server. A head DBA oversees a team of four DBAs, each of whom is responsible for two or three
databases.
Using the multitenant architecture for database consolidation has the following benefits:

Cost reduction
Easier and more rapid movement of data and code
Easier management and monitoring of the physical database
Separation of data and code
Secure separation of administrative duties

Ease of performance tuning


Support for Oracle Database Resource Manager
Fewer database patches and upgrades

Single CDB

Creation of a CDB

CREATE DATABASE ... ENABLE PLUGGABLE DATABASE SQL statement creates


a new CDB. If you do not specify the ENABLE PLUGGABLE DATABASE clause, then
the newly created database is a non-CDB and can never contain PDBs.

SQL> SELECT NAME, CDB, CON_ID FROM V$DATABASE;


NAME
CDB
CON_ID
--------- --- ---------CDB1
YES
0
Creation of a PDB
The CREATE PLUGGABLE DATABASE SQL statement creates a PDB. This PDB
automatically includes a full data dictionary including metadata and internal links

to system-supplied objects in the root. You can only create a PDB in a CDB and not
within another PDB.

Connecting to a Container Database (CDB)


Connecting to the root of a container database is the same as that of any previous database instance. On the
database server you can use OS Authentication.

The V$SERVICES views can be used to display available services from the database.
SELECT name, pdb FROM

v$services ORDER BY name;

NAME
PDB
------------------------------ -----------------------------SYS$BACKGROUND
CDB$ROOT
SYS$USERS
CDB$ROOT
cdb1.localdomain
CDB$ROOT
cdb1XDB
CDB$ROOT
pdb1.localdomain
PDB1
pdb2.localdomain
PDB2
6 rows selected.
SQL>

Connections using services are unchanged from previous versions.


SQL> -- EZCONNECT
SQL> CONN system/password@//localhost:1521/cdb1.localdomain
Connected.
SQL>
SQL> -- tnsnames.ora
SQL> CONN system/password@cdb1
Connected.
SQL>

Displaying the Current Container


SQL> SHOW CON_NAME

CON_NAME
-----------------------------CDB$ROOT
SQL>

Switching Between Containers


SQL> ALTER SESSION SET container = pdb1;
Session altered.
SQL> SHOW CON_NAME
CON_NAME
-----------------------------PDB1
SQL> ALTER SESSION SET container = cdb$root;
Session altered.
SQL> SHOW CON_NAME
CON_NAME
-----------------------------CDB$ROOT
SQL>

Connecting to a Pluggable Database (PDB)


Direct connections to pluggable databases must be made using a service. Each pluggable database
automatically registers a service with the listener. This is how any application will connect to a pluggable
database, as well as administrative connections.

PDB users with the SYSDBA, SYSOPER, SYSBACKUP, or SYSDG privilege can connect to a closed PDB. All
other PDB users can only connect when the PDB is open. As with regular databases, the PDB users require the
CONNECT SESSION privilege to enable connections.

Online Data-file Move


Prior to Oracle 12c, moving datafiles has always been an offline task. There were certain techniques you could
employ to minimize that downtime, but you couldn't remove it completely. Oracle 12c includes an enhancement
to the ALTER DATABASE command to allow datafiles to be moved online.

ALTER DATABASE MOVE DATAFILE ( 'filename' | 'ASM_filename' | file_number )


[ TO ( 'filename' | 'ASM_filename' ) ]
[ REUSE ] [ KEEP ]
The source file can be specified using the file number or name, while the destination file must be specified by the
file name.
The REUSE keyword indicates the new file should be created even if it already exists. The KEEP keyword
indicates the original copy of the datafile should be retained.

SELECT file_id, file_name FROM dba_data_files ORDER BY file_id;


FILE_ID
---------1
3
4
6

FILE_NAME
---------------------------------------------------------------------/u01/app/oracle/oradata/cdb1/system01.dbf
/u01/app/oracle/oradata/cdb1/sysaux01.dbf
/u01/app/oracle/oradata/cdb1/undotbs01.dbf
/u01/app/oracle/oradata/cdb1/users01.dbf

SQL> ALTER DATABASE MOVE DATAFILE '/u01/app/oracle/oradata/cdb1/system01.dbf' TO


'/tmp/system01.dbf';

Database altered.
SQL>
SQL> SELECT file_id, file_name FROM dba_data_files WHERE file_id = 1;
FILE_ID FILE_NAME
---------- ---------------------------------------------------------------------1 /tmp/system01.dbf
SQL>
SQL> HOST ls -al /u01/app/oracle/oradata/cdb1/system01.dbf
ls: cannot access /u01/app/oracle/oradata/cdb1/system01.dbf: No such file or
directory
SQL> HOST ls -al /tmp/system01.dbf
-rw-r-----. 1 oracle oinstall 838868992 Oct

8 22:48 /tmp/system01.dbf

The next example uses the file number for the source file and keeps the original file.
SQL> ALTER DATABASE MOVE DATAFILE 1 TO '/u01/app/oracle/oradata/cdb1/system01.dbf'
KEEP;
Database altered.
SQL>
SQL> SELECT file_id, file_name FROM dba_data_files WHERE file_id = 1;
FILE_ID FILE_NAME
---------- ---------------------------------------------------------------------1 /u01/app/oracle/oradata/cdb1/system01.dbf
SQL>
SQL> HOST ls -al /u01/app/oracle/oradata/cdb1/system01.dbf
-rw-r-----. 1 oracle oinstall 838868992 Oct 8 22:48
/u01/app/oracle/oradata/cdb1/system01.dbf
SQL> HOST ls -al /tmp/system01.dbf
-rw-r-----. 1 oracle oinstall 838868992 Oct

8 22:49 /tmp/system01.dbf

The container database (CDB) can not move files that belong to a pluggable database. The following query
displays all the datafiles for the CDB and the PDBs.

If we switch to the PDB container, the datafile can be moved as normal.

Tempfiles
Not surprisingly, the ALTER DATABASE MOVE DATAFILE syntax does not work for temporary files.

También podría gustarte