domingo, 21 de setembro de 2014

12c - Full Database Caching Mode

Um novo recurso chamado Full database caching foi introduzido na versão 12.1.0.2. Este novo recurso permite armazenar todos os segmentos do banco de dados em memória (quando os segmentos forem acessados). Ele deve ser usado quando o tamanho do buffer cache do banco de dados da instância for maior do que o tamanho total do banco de dados.

Com esta opção ativa, Full scans e NOCACHE LOBs, também serão carregados e armazenados no buffer cache.  Nas versões anteriores não era garantido que os segmentos seriam mantidos em cache, ao menos que fosse usado o KEEP.

Habilitando o recurso:

[oracle@oracle01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 17 16:59:56 2014
Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> startup mount
ORACLE instance started.

Total System Global Area 2499805184 bytes
Fixed Size 2927480 bytes
Variable Size 486540424 bytes
Database Buffers 922746880 bytes
Redo Buffers 13848576 bytes
In-Memory Area 1073741824 bytes
Database mounted.

SQL> ALTER DATABASE FORCE FULL DATABASE CACHING;

Database altered.

SQL> SELECT force_full_db_caching FROM v$database;

FOR
---
YES


Referências:




Abraço,

sábado, 20 de setembro de 2014

Oracle Open World 2014

De 28/9 à 02/10 acontece o Oracle Open World em San Francisco.

Felizmente já estou com visto, inscrição, passagens, hotel e scheduler prontos.


Quem for, não deixe de participar também dos eventos abaixo:

Oracle User Groups  - domingo - 8:00 –16:30hrs

OOW 2014 RAC ATTACK - domingo - 9:00hrs

#CloneAttack and #RepAttack

Oracle Technology Network's Tech Fest - segunda - 19:00 - 21:00 hrs

Oracle OpenWorld 2014 – Bloggers Meetup - quarta - 17:30hrs

domingo, 14 de setembro de 2014

12c - Preserving or Discarding the Open Mode of PDBs When the CDB Restarts

Antes do 12.1.0.2, quando um CDB era inicializado, todos PDBs permaneciam em modo mount, exceto o PDB$SEED, que deve ficar em Read only.

Para resolver isso, era necessário criar uma trigger para abrir os PDBs.

CREATE OR REPLACE TRIGGER ABRIR_TODOS_PDBS
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
END;
/


No patchset 12.1.0.2, foi introduzida a capacidade de preservar o estado de inicialização dos PDBs.

[oracle@oracle01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 8 16:26:37 2014

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> SELECT name, open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1                           READ WRITE
PDB2                           MOUNTED
PDB3                           MOUNTED

Agora vamos salvar o estado atual:

ALTER PLUGGABLE DATABASE pdb1 SAVE STATE;


Verificando os estados salvos:

[oracle@oracle01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 8 16:32:37 2014

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

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> SELECT con_name, instance_name, state FROM dba_pdb_saved_states;

CON_NAME             INSTANCE_NAME        STATE
-------------------- -------------------- --------------
PDB1                 cdb1                 OPEN


Restartando o CDB:

[oracle@oracle01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 8 16:36:35 2014

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 626327552 bytes
Fixed Size 2291472 bytes
Variable Size 276826352 bytes
Database Buffers 339738624 bytes
Redo Buffers 7471104 bytes
Database mounted.
Database opened.

SQL> SELECT name, open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB1 
                          READ WRITE
PDB2 
                          MOUNTED
PDB3 
                          MOUNTED

Para descartar o estado atual:

ALTER PLUGGABLE DATABASE pdb1 DISCARD STATE;

[oracle@oracle01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon Sep 8 16:38:37 2014

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

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SQL> SELECT con_name, instance_name, state FROM dba_pdb_saved_states;

no rows selected


Referências:



Abraço,

Alex Zaballa.

quinta-feira, 4 de setembro de 2014