SlideShare uma empresa Scribd logo
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Oracle Database 12c
Novas Características para DBAs e
Desenvolvedores
Presented by:
Alex Zaballa, Oracle DBA
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Alex Zaballa
http://alexzaballa.blogspot.com/
@alexzaballa
145 and counting…
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Worked 8 years for the Ministry of Finance
March - 2007 until March - 2015
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
ORACLE ACE PROGRAM
http://www.oracle.com/technetwork/community/oracle-ace/index.html
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
https://community.oracle.com/community/other-languages/portuguese
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Oracle Database 12c
Novas Características para DBAs e
Desenvolvedores
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Documentação Oficial - 12.1.0.2
• http://docs.oracle.com/database/121/NEWFT
/chapter12102.htm
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Artigos – 12c
• https://oracle-base.com/articles/12c/articles-
12c
• http://www.oraclealchemist.com/news/install
-oracle-12c-12-1/
• http://www.profissionaloracle.com.br/
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
“With more than 500 new features, Oracle
Database 12c is designed to give Oracle
customers exactly what they’ve told us they
need for cloud computing, big data, security,
and availability.”
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Multitenant
OTN - Artigo do Carlos Henrique Yakithi
Furushima
http://www.oracle.com/technetwork/pt/articles
/database-performance/database-multitenant-
oracle-12cr1-2555858-ptb.html
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Multitenant
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Fonte: Oracle Documentation
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Multitenant
Fonte: https://blogs.oracle.com/UPGRADE/entry/non_cdb_architecture_of_oracle
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Multitenant
Fonte: https://blogs.oracle.com/UPGRADE/entry/non_cdb_architecture_of_oracle
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Multitenant
Fonte: https://blogs.oracle.com/UPGRADE/entry/non_cdb_architecture_of_oracle
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Memory
OTN - Artigo do Flávio Soares
http://www.oracle.com/technetwork/pt/articles
/database-performance/oracle-database-12c-in-
memory-2595527-ptb.html
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Memory
Fonte: Oracle Documentation
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SIMD Vector Processing
Fonte: http://www.oracle.com/technetwork/database/in-memory/overview/twp-
oracle-database-in-memory-2245633.html
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Memory
In-Memory Area – Pool estático que faz parte
da SGA
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Memory
Fonte: OracleBase.com
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Memory
Alter table hr.EMPLOYEES inmemory;
ALTER TABLE sales MODIFY PARTITION SALES_Q1_1998
NO INMEMORY;
ALTER TABLE sales INMEMORY NO INMEMORY(prod_id);
CREATE TABLESPACE tbs_test
DATAFILE '+DG01 SIZE 100M
DEFAULT INMEMORY;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Memory
Fonte: http://www.oracle.com/technetwork/database/in-memory/overview/twp-
oracle-database-in-memory-2245633.html
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
JSON
OTN - Artigo do Alex Zaballa
http://www.oracle.com/technetwork/pt/articles
/sql/json-oracle-database-12c-2378776-
ptb.html
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
JSON
• No Oracle Database 12c (12.1.0.2), foi
adicionado o suporte nativo ao JavaScript
Object Notation (JSON).
• O JSON é um formato leve para intercâmbio
de dados que é relativamente fácil para o ser
humano ler e escrever, além de ser fácil para
os softwares analisarem e gerarem.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
JSON
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
JSON
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Data Redaction
OTN - Artigo do Alex Zaballa
http://www.oracle.com/technetwork/pt/articles
/idm/funcionalidade-data-redaction-12c-
2209076-ptb.html
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Data Redaction
• Parte do pacote Advanced Security
• Proteção em tempo real, sem a
necessidade de alterar a aplicação
• Foi portado para o Oracle Database
11.2.0.4
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Data Redaction
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Data Redaction
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL Query Row Limits and Offsets
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL Query Row Limits and Offsets
create table tabela_teste (codigo number, nome varchar2(20), salario
number);
insert into tabela_teste values (1,'Alex' ,100);
insert into tabela_teste values (2,'Joao' ,200);
insert into tabela_teste values (3,'Maria' ,300);
insert into tabela_teste values (4,'Pedro',400);
insert into tabela_teste values (5,'Paulo',500);
insert into tabela_teste values (6,'Fernando',600);
insert into tabela_teste values (7,'Rafael',700);
insert into tabela_teste values (8,'Samuel',700);
insert into tabela_teste values (9,'Daniel',800);
insert into tabela_teste values (10,'Luciano',1000);
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL Query Row Limits and Offsets
Top-N Queries – Pré 12c
select * from ( select codigo, nome, salario
from tabela_teste
order by salario desc)
where rownum <= 5
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL Query Row Limits and Offsets
select codigo, nome, salario
from tabela_teste
order by salario desc
FETCH FIRST 5 ROWS ONLY
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL Query Row Limits and Offsets
select codigo, nome, salario
from tabela_teste
order by salario
FETCH FIRST 30 PERCENT ROWS ONLY
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL Query Row Limits and Offsets
select codigo, nome, salario
from tabela_teste
order by salario desc
OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Invisible Columns
CREATE TABLE tabela_teste
(
coluna1 NUMBER,
coluna2 NUMBER,
coluna3 NUMBER INVISIBLE,
coluna4 NUMBER
);
SQL> desc tabela_teste
Name
-----------------------------------------
COLUNA1 NUMBER
COLUNA2 NUMBER
COLUNA4 NUMBER
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Invisible Columns
INSERT INTO tabela_teste
(coluna1,coluna2,coluna3,coluna4) VALUES
(1,2,3,4);
INSERT INTO tabela_teste VALUES (1,2,4);
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Invisible Columns
SET COLINVISIBLE ON
SQL> desc tabela_teste
Name
-----------------------------------------
COLUNA1 NUMBER
COLUNA2 NUMBER
COLUNA4 NUMBER
COLUNA3 (INVISIBLE) NUMBER
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Invisible Columns
ALTER TABLE tabela_teste MODIFY coluna3 VISIBLE;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Approximate Count Distinct
Uma alternativa para a função COUNT (DISTINCT expr)
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL Text Expansion
SQL> variable retorno clob
SQL> begin
dbms_utility.expand_sql_text( input_sql_text
=> 'select * from emp', output_sql_text=>
:retorno );
end;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL Text Expansion
• Views
• VPDs
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
PL/SQL From SQL
with
function Is_Number
(x in varchar2) return varchar2 is
Plsql_Num_Error exception;
pragma exception_init(Plsql_Num_Error, -06502);
begin
if (To_Number(x) is NOT null) then
return 'Y';
else
return '';
end if;
exception
when Plsql_Num_Error then
return 'N';
end Is_Number;
select rownum, x, is_number(x) is_num from t;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Session Level Sequences
Session level sequences são utilizadas para
produzir valores únicos dentro de uma sessão.
Assim que a sessão termina, a sequence é
reinicializada.
Elas são muito utilizadas para gerar valores de
Primary Keys em Global Temporary Tables.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Session Level Sequences
CREATE SEQUENCE sequence_teste
START WITH 1
INCREMENT BY 1
SESSION
/
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Session Level Sequences
ALTER SEQUENCE sequence_teste
SESSION;
ALTER SEQUENCE sequence_teste
GLOBAL;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Extended Data Types
SQL> create table tabela_teste(campo01
varchar2(4001));
*
ERROR at line 1:
ORA-00910: specified length too long for its
datatype
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Extended Data Types
- VARCHAR2 : 32767 bytes
- NVARCHAR2 : 32767 bytes
- RAW : 32767 bytes
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Extended Data Types
SHUTDOWN IMMEDIATE;
STARTUP UPGRADE;
ALTER SYSTEM SET max_string_size=extended;
@?/rdbms/admin/utl32k.sql
SHUTDOWN IMMEDIATE;
STARTUP;
**Após aumentar o tamanho máximo dos tipos de dados, não é possível desfazer
esta alteração.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Session private statistics for Global
Temporary Tables
Até o 12c, as estatísticas para tabelas
temporárias globais (GTTs) eram comuns para
todas as sessões.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Session private statistics for Global
Temporary Tables
SELECT
DBMS_STATS.get_prefs('GLOBAL_TEMP_TABLE_STATS')
Stats FROM dual;
STATS
------------------------------------------------------------------------------
SESSION
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Session private statistics for Global
Temporary Tables
BEGIN
DBMS_STATS.set_global_prefs (
pname => 'GLOBAL_TEMP_TABLE_STATS',
pvalue => 'SHARED');
END;
/
BEGIN
DBMS_STATS.set_global_prefs (
pname => 'GLOBAL_TEMP_TABLE_STATS',
pvalue => 'SESSION');
END;
/
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Session private statistics for Global
Temporary Tables
BEGIN
dbms_stats.set_table_prefs('SCOTT','GTT_TESTE','GLOB
AL_TEMP_TABLE_STATS','SHARED');
END;
BEGIN
dbms_stats.set_table_prefs('SCOTT','GTT_TESTE','GLOB
AL_TEMP_TABLE_STATS','SESSION');
END;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Temporary Undo
Uma Global Temporary Table armazena seus dados
em uma temporary tablespace e estes dados são
mantidos durante a transação ou durante toda a
sessão (ON COMMIT DELETE ROWS ou ON COMMIT
PRESERVE ROWS).
Instruções DML em Global Temporary Tables não
geram REDO, devido ao fato destes dados estarem
armazenados em uma temporary tablespace, mas
geram UNDO e isto sim implicará na geração de
REDO.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Temporary Undo
alter session set temp_undo_enabled=true;
**pode ser alterado a nível de banco de dados
ou de sessão.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Multiple Indexes on the same set of
Columns
Pré 12c:
ORA-01408: such column list already indexed
error.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Multiple Indexes on the same set of
Columns
No 12c é possível ter vários índices em uma
mesma coluna ou lista de colunas.
A criação de um índice sobre uma coluna ou lista
de colunas que já foram indexadas é simples e
você tem que garantir que apenas um índice
será visível.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Multiple Indexes on the same set of
Columns
• Unique versus nonunique
• B-tree versus bitmap
• Different partitioning strategies
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
READ Object Privilege and READ ANY
TABLE System Privilege
Qual a diferença para SELECT e SELECT ANY
TABLE?
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
READ Object Privilege and READ ANY
TABLE System Privilege
O privilégio de objeto SELECT e o privilégio de
sistema SELECT ANY TABLE permitem bloquear
as linhas de uma tabela através da execução das
seguintes operações:
LOCK TABLE table_name IN EXCLUSIVE MODE;
SELECT ... FROM table_name FOR UPDATE;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
READ Object Privilege and READ ANY
TABLE System Privilege
SQL> grant select on scott.emp to teste;
Grant succeeded.
SQL> lock table scott.emp in exclusive mode;
Table(s) Locked.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
READ Object Privilege and READ ANY
TABLE System Privilege
SQL> grant read on scott.emp to teste;
Grant succeeded.
SQL> lock table scott.emp in exclusive mode;
lock table scott.emp in exclusive mode
*
ERROR at line 1:
ORA-01031: insufficient privileges
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Truncate Cascade
SQL> truncate table scott.dept;
truncate table scott.dept
*
ERROR at line 1:
ORA-02266: unique/primary keys in table
referenced by enabled foreign keys
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Truncate Cascade
SQL> truncate table scott.dept cascade;
Table truncated.
A constraint deve ser do tipo ON DELETE
CASCADE.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL*Loader Express
• No modo express, não é necessário criar o
arquivo de controle.
• O objetivo principal é salvar tempo e diminuir
o esforço.
• O express mode pode ser utilizado quando
todas as colunas são do tipo character,
number ou datetime
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL*Loader Express
[oracle@oracle01 tmp]$ cat EMPRESA.dat
1,Empresa 1
2,Empresa 2
3,Empresa 3
4,Empresa 4
5,Empresa 5
6,Empresa 6
7,Empresa 7
8,Empresa 8
9,Empresa 9
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQL*Loader Express
[oracle@oracle01 tmp]$ sqlldr teste/teste TABLE=EMPRESA
SQL*Loader: Release 12.1.0.1.0 - Production on Sat Jan 11 12:16:28 2014
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
Express Mode Load, Table: EMPRESA
Path used: External Table, DEGREE_OF_PARALLELISM=AUTO
Table EMPRESA:
9 Rows successfully loaded.
Check the log files:
EMPRESA.log
EMPRESA_%p.log_xt
for more information about the load.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Limit the PGA
SQL> show parameter pga
NAME TYPE VALUE
-------------------------- ------------- ----------------------
pga_aggregate_limit big integer 2G
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Limit the PGA
PGA_AGGREGATE_LIMIT é setado como default
para o maior valor entre:
- 2 GB (valor default)
- 200% do valor do parâmetro
PGA_AGGREGATE_TARGET
- 3 MB multiplicado pelo valor do parâmetro
PROCESSES
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Statistics During Loads
O banco de dados irá coletar estatísticas
automaticamente das tabelas durante os
seguintes tipos de operações bulk load:
- CREATE TABLE AS SELECT
- INSERT INTO ... SELECT into an empty table
using a direct path insert
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Partial Indexes for Partitioned Table
• Você pode criar os índices (globais ou locais)
para partições ou sub-partições específicas,
isto é, os índices serão criados apenas para
partições/sub-partições que você deseja.
• Este recurso não é suportado para índices
únicos, ou seja, para índices utilizados para
impor restrições exclusivas.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Partial Indexes for Partitioned Table
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Full Database Caching
Este novo recurso permite armazenar todos os
segmentos do banco de dados em memória
(quando os segmentos forem acessados).
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Recuperando Tabelas com o RMAN
• Utilizado para recuperação de tabelas/partições
de um backup realizado pelo RMAN.
• Este comando, diminui o tempo e a complexidade
da restauração, permitindo a recuperação “point-
in-time” apenas da tabela/partição, ao invés de
toda tablespace como era nas versões anteriores.
• É muito útil quando não temos informações
suficientes no UNDO para utilizar o Flashback
Table.
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Recuperando Tabelas com o RMAN
RMAN> RECOVER TABLE HR.REGIONS
UNTIL TIME "TO_DATE('01/10/2013
09:33:39','DD/MM/RRRR HH24:MI:SS')"
AUXILIARY DESTINATION '/tmp/backups'
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Identity Columns
CREATE TABLE tabela_teste (
id NUMBER GENERATED ALWAYS AS IDENTITY,
coluna1 VARCHAR2(30));
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Identity Columns
CREATE TABLE tabela_teste (
id NUMBER GENERATED BY DEFAULT AS IDENTITY,
coluna1 VARCHAR2(30));
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Identity Columns
CREATE TABLE tabela_teste (
id NUMBER GENERATED BY DEFAULT ON NULL AS
IDENTITY,
coluna1 VARCHAR2(30));
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Database Archiving
SQL> create table tabela_teste(coluna1 number)
row archival;
insert into tabela_teste values(1);
insert into tabela_teste values(2);
insert into tabela_teste values(3);
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Database Archiving
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Database Archiving
update tabela_teste
set ora_archive_state=DBMS_ILM.ARCHIVESTATENAME(1)
where coluna1=3;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
In-Database Archiving
alter session set row archival visibility=all;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Heat Map, Automatic Data
Optimization and ILM
OTN - Artigo do Alex Zaballa e Daniel Da Meda
http://www.oracle.com/technetwork/pt/articles
/database-performance/ilm-e-automatic-data-
optimization-2601873-ptb.html
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Heat Map, Automatic Data
Optimization and ILM
• Heat Map: Oracle Database 12c feature that stores system-
generated data usage statistics at the block and segment
levels. Automatically tracks modification and query
timestamps at the row and segment levels.
• Automatic Data Optimization (ADO): automatically moves
and compresses data according to user-defined policies
based on the information collected by Heat Map
• ILM: Heat Map and Automatic Data Optimization make
Oracle Database 12c ideal for implementing ILM
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Heat Map, Automatic Data
Optimization and ILM
Habilitando o Heat Map
SQL> alter system set heat_map = on;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Heat Map, Automatic Data
Optimization and ILM
As estatísticas de Heat Map visualizadas
graficamente através do EM Cloud Control:
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Heat Map, Automatic Data
Optimization and ILM
Criando políticas ADO
Comprimir a tablespace USER_DATA e todos os seus
segmentos utilizando compressão OLTP após 30 dias de
baixo acesso:
ALTER TABLESPACE USER_DATA ILM ADD POLICY
ROW STORE COMPRESS ADVANCED
SEGMENT AFTER 30 DAYS OF LOW ACCESS;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Heat Map, Automatic Data
Optimization and ILM
Criando políticas ADO
Comprimir a tabela ORDER_ITEMS incluindo qualquer
SecureFile LOB utilizando compressão OLTP após 90 dias sem
modificações.
ALTER TABLE ORDER_ITEMS ILM ADD POLICY
ROW STORE COMPRESS ADVANCED
GROUP AFTER 90 DAYS OF NO MODIFICATION;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
DDL LOGGING
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
DDL LOGGING
/u01/app/oracle/diag/rdbms/orcl/orcl/log/ddl/log.xml
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Direct SQL statement execution in
RMAN
Pré 12c:
RMAN> SQL ‘SELECT sysdate FROM dual’;
12c:
RMAN> SELECT sysdate FROM dual;
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
SQLcl
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
Thank You

Mais conteúdo relacionado

PPTX
Oracle Database 12c - Novas Características para DBAs e Desenvolvedores
PPTX
BD I - Aula 15 A - Comandos DML
PPTX
SQL Server ES - Escrevendo queries rápidas (Performance/Query Tuning)
PDF
ODI Tutorial - Configuração Topologia
PDF
Views Oracle Database
DOC
160 erp605 bpd_pt_br
DOC
Javafree
PPTX
Oracle Database 12.1.0.2 New Features
Oracle Database 12c - Novas Características para DBAs e Desenvolvedores
BD I - Aula 15 A - Comandos DML
SQL Server ES - Escrevendo queries rápidas (Performance/Query Tuning)
ODI Tutorial - Configuração Topologia
Views Oracle Database
160 erp605 bpd_pt_br
Javafree
Oracle Database 12.1.0.2 New Features

Destaque (10)

PPTX
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
PDF
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
PPTX
SQLT XPLORE: The SQLT XPLAIN hidden child
PPTX
SQL Tuning made easier with SQLTXPLAIN (SQLT)
PPTX
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
PPTX
Using SQL Plan Management (SPM) to balance Plan Flexibility and Plan Stability
PPSX
How a Developer can Troubleshoot a SQL performing poorly on a Production DB
PPSX
Introducing the eDB360 Tool
PPSX
Oracle Performance Tuning Fundamentals
PPSX
Oracle Performance Tools of the Trade
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
SQLT XPLORE: The SQLT XPLAIN hidden child
SQL Tuning made easier with SQLTXPLAIN (SQLT)
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Using SQL Plan Management (SPM) to balance Plan Flexibility and Plan Stability
How a Developer can Troubleshoot a SQL performing poorly on a Production DB
Introducing the eDB360 Tool
Oracle Performance Tuning Fundamentals
Oracle Performance Tools of the Trade
Anúncio

Semelhante a Oracle Database 12c - Novas Características para DBAs e Desenvolvedores - GUOB - OTN TOUR LA - 2015 (20)

PDF
How to become an Oracle Certified Master - GUOB Tech Day - OTN TOUR LA Brazil...
PPTX
Os melhores recursos novos do Oracle Database 12c para desenvolvedores e DBAs...
PPTX
Os melhores recursos novos do Oracle Database 12c para desenvolvedores e DBAs...
PPTX
2013 - GUOB Tech Day / OTN Tour LAD - Installation Prereqs
PDF
14-programacao-bd-Object Relational Mapper.pdf
PDF
Oracle para Desenvolvedores - recursos e técnicas - visões gerais (Uninove 2016)
PPTX
Fundamentos de Banco de Dados Relacionais
PDF
MySQL replicação e cluster - GUOB Tech Day 2011
PPTX
Otimizando a performance com in-memory no SQL 2016
PPTX
Novidades do Sql Server 2016
PDF
NoSQL + SQL = PostgreSQL (TDC2014 - Porto Alegre/RS)
PDF
Big data e PostgreSQL
PPS
Advanced compression external_tables
PDF
Curso SQL Server 2005
PDF
NoSQL + SQL = PostgreSQL (PGDay Campinas 2014)
PDF
MySQL Cluster e Big Data
PDF
Semana acadêmica UFRGS 2014
PPTX
Otimizando a performance com in memory no sql 2016
PDF
Introdução ao SQL
PDF
6338 111121071604-phpapp01
How to become an Oracle Certified Master - GUOB Tech Day - OTN TOUR LA Brazil...
Os melhores recursos novos do Oracle Database 12c para desenvolvedores e DBAs...
Os melhores recursos novos do Oracle Database 12c para desenvolvedores e DBAs...
2013 - GUOB Tech Day / OTN Tour LAD - Installation Prereqs
14-programacao-bd-Object Relational Mapper.pdf
Oracle para Desenvolvedores - recursos e técnicas - visões gerais (Uninove 2016)
Fundamentos de Banco de Dados Relacionais
MySQL replicação e cluster - GUOB Tech Day 2011
Otimizando a performance com in-memory no SQL 2016
Novidades do Sql Server 2016
NoSQL + SQL = PostgreSQL (TDC2014 - Porto Alegre/RS)
Big data e PostgreSQL
Advanced compression external_tables
Curso SQL Server 2005
NoSQL + SQL = PostgreSQL (PGDay Campinas 2014)
MySQL Cluster e Big Data
Semana acadêmica UFRGS 2014
Otimizando a performance com in memory no sql 2016
Introdução ao SQL
6338 111121071604-phpapp01
Anúncio

Mais de Alex Zaballa (20)

PDF
Migrating Oracle Databases from AWS to OCI
PPTX
Exploring All options to move your Oracle Databases to the Oracle Cloud
PPTX
Moving Your Oracle Databases To The Oracle Cloud
PPTX
SQL TUNING 101
PPTX
SQL TUNING 101
PPTX
DBA Commands and Concepts That Every Developer Should Know - Part 2
PPTX
DBA Commands and Concepts That Every Developer Should Know
PPTX
LET’S GET STARTED WITH ORACLE DATABASE CLOUD
PPTX
DBA Commands and Concepts That Every Developer Should Know
PPTX
Oracle Database 12c - New Features for Developers and DBAs
PPTX
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
PPTX
Moving your Oracle Databases to the Oracle Cloud
PPTX
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
PDF
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Fea...
PDF
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
PPTX
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
PPTX
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
PPT
Oracle SQL Tuning
PPTX
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
PPTX
DBA Commands and Concepts That Every Developer Should Know
Migrating Oracle Databases from AWS to OCI
Exploring All options to move your Oracle Databases to the Oracle Cloud
Moving Your Oracle Databases To The Oracle Cloud
SQL TUNING 101
SQL TUNING 101
DBA Commands and Concepts That Every Developer Should Know - Part 2
DBA Commands and Concepts That Every Developer Should Know
LET’S GET STARTED WITH ORACLE DATABASE CLOUD
DBA Commands and Concepts That Every Developer Should Know
Oracle Database 12c - New Features for Developers and DBAs
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Moving your Oracle Databases to the Oracle Cloud
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c Tuning Fea...
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
Oracle SQL Tuning
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
DBA Commands and Concepts That Every Developer Should Know

Último (19)

PDF
Fullfilment AI - Forum ecommerce 2025 // Distrito e Total Express
PDF
Mergulho profundo técnico para gestão de transportes no SAP S/4HANA, S4TM6 Col14
PDF
Fundamentos de gerenciamento de ordens e planejamento no SAP TransportationMa...
PPTX
Aula16ManipulaçãoDadosssssssssssssssssssssssssssss
PDF
Processos na gestão de transportes, TM100 Col18
PDF
Gestão de transportes básica no SAP S/4HANA, S4611 Col20
PPTX
Gestao-de-Bugs-em-Software-Introducao.pptxxxxxxxx
PDF
Apple Pippin Uma breve introdução. - David Glotz
PPTX
Informática Aplicada Informática Aplicada Plano de Ensino - estudo de caso NR...
PPTX
Aula 18 - Manipulacao De Arquivos python
PPTX
Programação - Linguagem C - Variáveis, Palavras Reservadas, tipos de dados, c...
PDF
Custos e liquidação no SAP Transportation Management, TM130 Col18
PDF
Otimizador de planejamento e execução no SAP Transportation Management, TM120...
PPTX
Como-se-implementa-um-softwareeeeeeeeeeeeeeeeeeeeeeeee.pptx
PPTX
BANCO DE DADOS - AULAS INICIAIS-sgbd.pptx
PDF
Custos e faturamento no SAP S/4HANA Transportation Management, S4TM3 Col26
PDF
Aula04-Academia Heri- Tecnologia Geral 2025
PDF
COBITxITIL-Entenda as diferença em uso governança TI
PDF
20250805_ServiceNow e a Arquitetura Orientada a Serviços (SOA) A Base para Ap...
Fullfilment AI - Forum ecommerce 2025 // Distrito e Total Express
Mergulho profundo técnico para gestão de transportes no SAP S/4HANA, S4TM6 Col14
Fundamentos de gerenciamento de ordens e planejamento no SAP TransportationMa...
Aula16ManipulaçãoDadosssssssssssssssssssssssssssss
Processos na gestão de transportes, TM100 Col18
Gestão de transportes básica no SAP S/4HANA, S4611 Col20
Gestao-de-Bugs-em-Software-Introducao.pptxxxxxxxx
Apple Pippin Uma breve introdução. - David Glotz
Informática Aplicada Informática Aplicada Plano de Ensino - estudo de caso NR...
Aula 18 - Manipulacao De Arquivos python
Programação - Linguagem C - Variáveis, Palavras Reservadas, tipos de dados, c...
Custos e liquidação no SAP Transportation Management, TM130 Col18
Otimizador de planejamento e execução no SAP Transportation Management, TM120...
Como-se-implementa-um-softwareeeeeeeeeeeeeeeeeeeeeeeee.pptx
BANCO DE DADOS - AULAS INICIAIS-sgbd.pptx
Custos e faturamento no SAP S/4HANA Transportation Management, S4TM3 Col26
Aula04-Academia Heri- Tecnologia Geral 2025
COBITxITIL-Entenda as diferença em uso governança TI
20250805_ServiceNow e a Arquitetura Orientada a Serviços (SOA) A Base para Ap...

Oracle Database 12c - Novas Características para DBAs e Desenvolvedores - GUOB - OTN TOUR LA - 2015

  • 1. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Oracle Database 12c Novas Características para DBAs e Desenvolvedores Presented by: Alex Zaballa, Oracle DBA
  • 2. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Alex Zaballa http://alexzaballa.blogspot.com/ @alexzaballa 145 and counting…
  • 3. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
  • 4. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Worked 8 years for the Ministry of Finance March - 2007 until March - 2015
  • 5. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
  • 6. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
  • 7. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP ORACLE ACE PROGRAM http://www.oracle.com/technetwork/community/oracle-ace/index.html
  • 8. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
  • 9. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP https://community.oracle.com/community/other-languages/portuguese
  • 10. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Oracle Database 12c Novas Características para DBAs e Desenvolvedores
  • 11. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Documentação Oficial - 12.1.0.2 • http://docs.oracle.com/database/121/NEWFT /chapter12102.htm
  • 12. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Artigos – 12c • https://oracle-base.com/articles/12c/articles- 12c • http://www.oraclealchemist.com/news/install -oracle-12c-12-1/ • http://www.profissionaloracle.com.br/
  • 13. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP “With more than 500 new features, Oracle Database 12c is designed to give Oracle customers exactly what they’ve told us they need for cloud computing, big data, security, and availability.”
  • 14. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Multitenant OTN - Artigo do Carlos Henrique Yakithi Furushima http://www.oracle.com/technetwork/pt/articles /database-performance/database-multitenant- oracle-12cr1-2555858-ptb.html
  • 15. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Multitenant
  • 16. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Fonte: Oracle Documentation
  • 17. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Multitenant Fonte: https://blogs.oracle.com/UPGRADE/entry/non_cdb_architecture_of_oracle
  • 18. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Multitenant Fonte: https://blogs.oracle.com/UPGRADE/entry/non_cdb_architecture_of_oracle
  • 19. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Multitenant Fonte: https://blogs.oracle.com/UPGRADE/entry/non_cdb_architecture_of_oracle
  • 20. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Memory OTN - Artigo do Flávio Soares http://www.oracle.com/technetwork/pt/articles /database-performance/oracle-database-12c-in- memory-2595527-ptb.html
  • 21. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Memory Fonte: Oracle Documentation
  • 22. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SIMD Vector Processing Fonte: http://www.oracle.com/technetwork/database/in-memory/overview/twp- oracle-database-in-memory-2245633.html
  • 23. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Memory In-Memory Area – Pool estático que faz parte da SGA
  • 24. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Memory Fonte: OracleBase.com
  • 25. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Memory Alter table hr.EMPLOYEES inmemory; ALTER TABLE sales MODIFY PARTITION SALES_Q1_1998 NO INMEMORY; ALTER TABLE sales INMEMORY NO INMEMORY(prod_id); CREATE TABLESPACE tbs_test DATAFILE '+DG01 SIZE 100M DEFAULT INMEMORY;
  • 26. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Memory Fonte: http://www.oracle.com/technetwork/database/in-memory/overview/twp- oracle-database-in-memory-2245633.html
  • 27. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP JSON OTN - Artigo do Alex Zaballa http://www.oracle.com/technetwork/pt/articles /sql/json-oracle-database-12c-2378776- ptb.html
  • 28. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP JSON • No Oracle Database 12c (12.1.0.2), foi adicionado o suporte nativo ao JavaScript Object Notation (JSON). • O JSON é um formato leve para intercâmbio de dados que é relativamente fácil para o ser humano ler e escrever, além de ser fácil para os softwares analisarem e gerarem.
  • 29. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP JSON
  • 30. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP JSON
  • 31. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Data Redaction OTN - Artigo do Alex Zaballa http://www.oracle.com/technetwork/pt/articles /idm/funcionalidade-data-redaction-12c- 2209076-ptb.html
  • 32. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Data Redaction • Parte do pacote Advanced Security • Proteção em tempo real, sem a necessidade de alterar a aplicação • Foi portado para o Oracle Database 11.2.0.4
  • 33. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Data Redaction
  • 34. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Data Redaction
  • 35. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL Query Row Limits and Offsets
  • 36. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL Query Row Limits and Offsets create table tabela_teste (codigo number, nome varchar2(20), salario number); insert into tabela_teste values (1,'Alex' ,100); insert into tabela_teste values (2,'Joao' ,200); insert into tabela_teste values (3,'Maria' ,300); insert into tabela_teste values (4,'Pedro',400); insert into tabela_teste values (5,'Paulo',500); insert into tabela_teste values (6,'Fernando',600); insert into tabela_teste values (7,'Rafael',700); insert into tabela_teste values (8,'Samuel',700); insert into tabela_teste values (9,'Daniel',800); insert into tabela_teste values (10,'Luciano',1000);
  • 37. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL Query Row Limits and Offsets Top-N Queries – Pré 12c select * from ( select codigo, nome, salario from tabela_teste order by salario desc) where rownum <= 5
  • 38. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL Query Row Limits and Offsets select codigo, nome, salario from tabela_teste order by salario desc FETCH FIRST 5 ROWS ONLY
  • 39. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL Query Row Limits and Offsets select codigo, nome, salario from tabela_teste order by salario FETCH FIRST 30 PERCENT ROWS ONLY
  • 40. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL Query Row Limits and Offsets select codigo, nome, salario from tabela_teste order by salario desc OFFSET 2 ROWS FETCH NEXT 2 ROWS ONLY;
  • 41. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Invisible Columns CREATE TABLE tabela_teste ( coluna1 NUMBER, coluna2 NUMBER, coluna3 NUMBER INVISIBLE, coluna4 NUMBER ); SQL> desc tabela_teste Name ----------------------------------------- COLUNA1 NUMBER COLUNA2 NUMBER COLUNA4 NUMBER
  • 42. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Invisible Columns INSERT INTO tabela_teste (coluna1,coluna2,coluna3,coluna4) VALUES (1,2,3,4); INSERT INTO tabela_teste VALUES (1,2,4);
  • 43. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Invisible Columns SET COLINVISIBLE ON SQL> desc tabela_teste Name ----------------------------------------- COLUNA1 NUMBER COLUNA2 NUMBER COLUNA4 NUMBER COLUNA3 (INVISIBLE) NUMBER
  • 44. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Invisible Columns ALTER TABLE tabela_teste MODIFY coluna3 VISIBLE;
  • 45. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Approximate Count Distinct Uma alternativa para a função COUNT (DISTINCT expr)
  • 46. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL Text Expansion SQL> variable retorno clob SQL> begin dbms_utility.expand_sql_text( input_sql_text => 'select * from emp', output_sql_text=> :retorno ); end;
  • 47. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL Text Expansion • Views • VPDs
  • 48. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP PL/SQL From SQL with function Is_Number (x in varchar2) return varchar2 is Plsql_Num_Error exception; pragma exception_init(Plsql_Num_Error, -06502); begin if (To_Number(x) is NOT null) then return 'Y'; else return ''; end if; exception when Plsql_Num_Error then return 'N'; end Is_Number; select rownum, x, is_number(x) is_num from t;
  • 49. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Session Level Sequences Session level sequences são utilizadas para produzir valores únicos dentro de uma sessão. Assim que a sessão termina, a sequence é reinicializada. Elas são muito utilizadas para gerar valores de Primary Keys em Global Temporary Tables.
  • 50. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Session Level Sequences CREATE SEQUENCE sequence_teste START WITH 1 INCREMENT BY 1 SESSION /
  • 51. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Session Level Sequences ALTER SEQUENCE sequence_teste SESSION; ALTER SEQUENCE sequence_teste GLOBAL;
  • 52. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Extended Data Types SQL> create table tabela_teste(campo01 varchar2(4001)); * ERROR at line 1: ORA-00910: specified length too long for its datatype
  • 53. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Extended Data Types - VARCHAR2 : 32767 bytes - NVARCHAR2 : 32767 bytes - RAW : 32767 bytes
  • 54. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Extended Data Types SHUTDOWN IMMEDIATE; STARTUP UPGRADE; ALTER SYSTEM SET max_string_size=extended; @?/rdbms/admin/utl32k.sql SHUTDOWN IMMEDIATE; STARTUP; **Após aumentar o tamanho máximo dos tipos de dados, não é possível desfazer esta alteração.
  • 55. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Session private statistics for Global Temporary Tables Até o 12c, as estatísticas para tabelas temporárias globais (GTTs) eram comuns para todas as sessões.
  • 56. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Session private statistics for Global Temporary Tables SELECT DBMS_STATS.get_prefs('GLOBAL_TEMP_TABLE_STATS') Stats FROM dual; STATS ------------------------------------------------------------------------------ SESSION
  • 57. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Session private statistics for Global Temporary Tables BEGIN DBMS_STATS.set_global_prefs ( pname => 'GLOBAL_TEMP_TABLE_STATS', pvalue => 'SHARED'); END; / BEGIN DBMS_STATS.set_global_prefs ( pname => 'GLOBAL_TEMP_TABLE_STATS', pvalue => 'SESSION'); END; /
  • 58. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Session private statistics for Global Temporary Tables BEGIN dbms_stats.set_table_prefs('SCOTT','GTT_TESTE','GLOB AL_TEMP_TABLE_STATS','SHARED'); END; BEGIN dbms_stats.set_table_prefs('SCOTT','GTT_TESTE','GLOB AL_TEMP_TABLE_STATS','SESSION'); END;
  • 59. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Temporary Undo Uma Global Temporary Table armazena seus dados em uma temporary tablespace e estes dados são mantidos durante a transação ou durante toda a sessão (ON COMMIT DELETE ROWS ou ON COMMIT PRESERVE ROWS). Instruções DML em Global Temporary Tables não geram REDO, devido ao fato destes dados estarem armazenados em uma temporary tablespace, mas geram UNDO e isto sim implicará na geração de REDO.
  • 60. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Temporary Undo alter session set temp_undo_enabled=true; **pode ser alterado a nível de banco de dados ou de sessão.
  • 61. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Multiple Indexes on the same set of Columns Pré 12c: ORA-01408: such column list already indexed error.
  • 62. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Multiple Indexes on the same set of Columns No 12c é possível ter vários índices em uma mesma coluna ou lista de colunas. A criação de um índice sobre uma coluna ou lista de colunas que já foram indexadas é simples e você tem que garantir que apenas um índice será visível.
  • 63. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Multiple Indexes on the same set of Columns • Unique versus nonunique • B-tree versus bitmap • Different partitioning strategies
  • 64. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP READ Object Privilege and READ ANY TABLE System Privilege Qual a diferença para SELECT e SELECT ANY TABLE?
  • 65. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP READ Object Privilege and READ ANY TABLE System Privilege O privilégio de objeto SELECT e o privilégio de sistema SELECT ANY TABLE permitem bloquear as linhas de uma tabela através da execução das seguintes operações: LOCK TABLE table_name IN EXCLUSIVE MODE; SELECT ... FROM table_name FOR UPDATE;
  • 66. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP READ Object Privilege and READ ANY TABLE System Privilege SQL> grant select on scott.emp to teste; Grant succeeded. SQL> lock table scott.emp in exclusive mode; Table(s) Locked.
  • 67. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP READ Object Privilege and READ ANY TABLE System Privilege SQL> grant read on scott.emp to teste; Grant succeeded. SQL> lock table scott.emp in exclusive mode; lock table scott.emp in exclusive mode * ERROR at line 1: ORA-01031: insufficient privileges
  • 68. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Truncate Cascade SQL> truncate table scott.dept; truncate table scott.dept * ERROR at line 1: ORA-02266: unique/primary keys in table referenced by enabled foreign keys
  • 69. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Truncate Cascade SQL> truncate table scott.dept cascade; Table truncated. A constraint deve ser do tipo ON DELETE CASCADE.
  • 70. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL*Loader Express • No modo express, não é necessário criar o arquivo de controle. • O objetivo principal é salvar tempo e diminuir o esforço. • O express mode pode ser utilizado quando todas as colunas são do tipo character, number ou datetime
  • 71. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL*Loader Express [oracle@oracle01 tmp]$ cat EMPRESA.dat 1,Empresa 1 2,Empresa 2 3,Empresa 3 4,Empresa 4 5,Empresa 5 6,Empresa 6 7,Empresa 7 8,Empresa 8 9,Empresa 9
  • 72. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQL*Loader Express [oracle@oracle01 tmp]$ sqlldr teste/teste TABLE=EMPRESA SQL*Loader: Release 12.1.0.1.0 - Production on Sat Jan 11 12:16:28 2014 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. Express Mode Load, Table: EMPRESA Path used: External Table, DEGREE_OF_PARALLELISM=AUTO Table EMPRESA: 9 Rows successfully loaded. Check the log files: EMPRESA.log EMPRESA_%p.log_xt for more information about the load.
  • 73. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Limit the PGA SQL> show parameter pga NAME TYPE VALUE -------------------------- ------------- ---------------------- pga_aggregate_limit big integer 2G
  • 74. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Limit the PGA PGA_AGGREGATE_LIMIT é setado como default para o maior valor entre: - 2 GB (valor default) - 200% do valor do parâmetro PGA_AGGREGATE_TARGET - 3 MB multiplicado pelo valor do parâmetro PROCESSES
  • 75. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Statistics During Loads O banco de dados irá coletar estatísticas automaticamente das tabelas durante os seguintes tipos de operações bulk load: - CREATE TABLE AS SELECT - INSERT INTO ... SELECT into an empty table using a direct path insert
  • 76. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Partial Indexes for Partitioned Table • Você pode criar os índices (globais ou locais) para partições ou sub-partições específicas, isto é, os índices serão criados apenas para partições/sub-partições que você deseja. • Este recurso não é suportado para índices únicos, ou seja, para índices utilizados para impor restrições exclusivas.
  • 77. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Partial Indexes for Partitioned Table
  • 78. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Full Database Caching Este novo recurso permite armazenar todos os segmentos do banco de dados em memória (quando os segmentos forem acessados).
  • 79. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Recuperando Tabelas com o RMAN • Utilizado para recuperação de tabelas/partições de um backup realizado pelo RMAN. • Este comando, diminui o tempo e a complexidade da restauração, permitindo a recuperação “point- in-time” apenas da tabela/partição, ao invés de toda tablespace como era nas versões anteriores. • É muito útil quando não temos informações suficientes no UNDO para utilizar o Flashback Table.
  • 80. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Recuperando Tabelas com o RMAN RMAN> RECOVER TABLE HR.REGIONS UNTIL TIME "TO_DATE('01/10/2013 09:33:39','DD/MM/RRRR HH24:MI:SS')" AUXILIARY DESTINATION '/tmp/backups'
  • 81. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Identity Columns CREATE TABLE tabela_teste ( id NUMBER GENERATED ALWAYS AS IDENTITY, coluna1 VARCHAR2(30));
  • 82. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Identity Columns CREATE TABLE tabela_teste ( id NUMBER GENERATED BY DEFAULT AS IDENTITY, coluna1 VARCHAR2(30));
  • 83. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Identity Columns CREATE TABLE tabela_teste ( id NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY, coluna1 VARCHAR2(30));
  • 84. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Database Archiving SQL> create table tabela_teste(coluna1 number) row archival; insert into tabela_teste values(1); insert into tabela_teste values(2); insert into tabela_teste values(3);
  • 85. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Database Archiving
  • 86. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Database Archiving update tabela_teste set ora_archive_state=DBMS_ILM.ARCHIVESTATENAME(1) where coluna1=3;
  • 87. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP In-Database Archiving alter session set row archival visibility=all;
  • 88. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Heat Map, Automatic Data Optimization and ILM OTN - Artigo do Alex Zaballa e Daniel Da Meda http://www.oracle.com/technetwork/pt/articles /database-performance/ilm-e-automatic-data- optimization-2601873-ptb.html
  • 89. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Heat Map, Automatic Data Optimization and ILM • Heat Map: Oracle Database 12c feature that stores system- generated data usage statistics at the block and segment levels. Automatically tracks modification and query timestamps at the row and segment levels. • Automatic Data Optimization (ADO): automatically moves and compresses data according to user-defined policies based on the information collected by Heat Map • ILM: Heat Map and Automatic Data Optimization make Oracle Database 12c ideal for implementing ILM
  • 90. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Heat Map, Automatic Data Optimization and ILM Habilitando o Heat Map SQL> alter system set heat_map = on;
  • 91. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Heat Map, Automatic Data Optimization and ILM As estatísticas de Heat Map visualizadas graficamente através do EM Cloud Control:
  • 92. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Heat Map, Automatic Data Optimization and ILM Criando políticas ADO Comprimir a tablespace USER_DATA e todos os seus segmentos utilizando compressão OLTP após 30 dias de baixo acesso: ALTER TABLESPACE USER_DATA ILM ADD POLICY ROW STORE COMPRESS ADVANCED SEGMENT AFTER 30 DAYS OF LOW ACCESS;
  • 93. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Heat Map, Automatic Data Optimization and ILM Criando políticas ADO Comprimir a tabela ORDER_ITEMS incluindo qualquer SecureFile LOB utilizando compressão OLTP após 90 dias sem modificações. ALTER TABLE ORDER_ITEMS ILM ADD POLICY ROW STORE COMPRESS ADVANCED GROUP AFTER 90 DAYS OF NO MODIFICATION;
  • 94. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP DDL LOGGING
  • 95. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP DDL LOGGING /u01/app/oracle/diag/rdbms/orcl/orcl/log/ddl/log.xml
  • 96. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Direct SQL statement execution in RMAN Pré 12c: RMAN> SQL ‘SELECT sysdate FROM dual’; 12c: RMAN> SELECT sysdate FROM dual;
  • 97. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP SQLcl
  • 98. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP
  • 99. 08 de Agosto de 2015 no Hotel Blue Tree Morumbi, São Paulo - SP Thank You

Notas do Editor

  • #2: 96 slides Questions at the END please!!!