Pluggable Databases : What they will break and why you should use them anyway!

38 

Loading....

Loading....

Loading....

Loading....

Loading....

Full text

(1)

http://oracle-base.com

Pluggable  Databases  :  What  they  will  break  and  

why  you  should  use  them  anyway!  

Tim  Hall  

Oracle  ACE  Director   Oracle  ACE  of  the  Year  2006  

OakTable  Network  

OCP  DBA  (7,  8,  8i,  9i,  10g,  11g)   OCP  Advanced  PL/SQL  Developer   Oracle  Database:  SQL  CerTfied  Expert  

 

hWp://oracle-­‐base.com    

Books  

Oracle  PL/SQL  Tuning   Oracle  Job  Scheduling  

(2)
(3)
(4)

http://oracle-base.com

Agenda  

§  What  is  a  pluggable  database?  

§  What  they  will  break!  

(5)

http://oracle-base.com

What  is  a  pluggable  

database?  

(6)

http://oracle-base.com

(7)

http://oracle-base.com

(8)

http://oracle-base.com

(9)

http://oracle-base.com

(10)

http://oracle-base.com

(11)

http://oracle-base.com

(12)

http://oracle-base.com

Break?  

§  What  do  I  mean  by,  “What  they  will  break”?  

§  The  way  you  did  things  in  the  past  no  long  works!  

§  There  will  be  an  alternaTve  soluTon,  so  it's  not  really  broken.  

§  You  will  have  to  change!  

 

§  What  I’m  not  talking  about.  

§  Changes  that  affect  both  CDBs  and  non-­‐CDBs.  

(13)

http://oracle-base.com

OS  AuthenTcaTon  

§  OS  authenTcaTon  doesn't  work.  

 

§  Must  connect  using  services,  even  when  connecTng  to  sys@pdb.  

 

§  Those  CRON  jobs  you  use  are  probably  broken!  

 

(14)

http://oracle-base.com

OS  AuthenTcaTon  

ALTER  SESSION  SET  CONTAINER  

§  For  SYS  connecTons,  you  can  use  the  ALTER  SESSION  SET  CONTAINER  

command.    

sqlplus / as sysdba <<EOF

ALTER SESSION SET CONTAINER = pdb1; -- Do something.

EXIT; EOF

(15)

http://oracle-base.com

OS  AuthenTcaTon  

TWO_TASK  

§  For  non-­‐SYS  connecTons  that  include  a  password,  you  can  use  TWO_TASK.  

 

export TWO_TASK=pdb1

sqlplus test/test <<EOF -- Do something.

EXIT; EOF

(16)

http://oracle-base.com

OS  AuthenTcaTon  

Secure  External  Password  Store  

§  Specify  wallet  locaTon  in  "$ORACLE_HOME/network/admin/sqlnet.ora"  

file.     WALLET_LOCATION = (SOURCE = (METHOD = FILE) (METHOD_DATA = (DIRECTORY = /u01/app/oracle/wallet) ) ) SQLNET.WALLET_OVERRIDE = TRUE SSL_CLIENT_AUTHENTICATION = FALSE SSL_VERSION = 0

(17)

http://oracle-base.com

OS  AuthenTcaTon  

Secure  External  Password  Store  

§  Create  the  wallet.  

 

$ mkdir -p /u01/app/oracle/wallet

$ orapki wallet create wallet "/u01/app/oracle/wallet" -pwd "mypassword" -auto_login_local

Oracle Secret Store Tool : Version 12.1.0.1

Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.

Enter password:

Enter password again: $

(18)

http://oracle-base.com

OS  AuthenTcaTon  

Secure  External  Password  Store  

§  Set  the  credenTals.  

 

$ mkstore -wrl "/u01/app/oracle/wallet" -createCredential pdb1_test test test

Oracle Secret Store Tool : Version 12.1.0.1

Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.

Enter wallet password

Create credential oracle.security.client.connect_string1 $

(19)

http://oracle-base.com

OS  AuthenTcaTon  

Secure  External  Password  Store  

§  Add  an  entry  into  the  "$ORACLE_HOME/network/admin/tnsnames.ora"  

file.     PDB1_TEST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = ol6-121) (PORT = 1521) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pdb1) ) )

(20)

http://oracle-base.com

OS  AuthenTcaTon  

Secure  External  Password  Store  

§  Now  you  can  connect  without  the  password.  

 

sqlplus /@pdb1_test <<EOF -- Do something.

EXIT; EOF

(21)

http://oracle-base.com

OS  AuthenTcaTon  

DBMS_SCHEDULER  -­‐  Script  Jobs  

§  New  jobs  in  12c  

§  EXTERNAL_SCRIPT  :  Commands  in  file  or  PL/SQL  variable  run  in  shell.  

§  SQL_SCRIPT  :  Commands  in  file  or  PL/SQL  variable  run  using  SQL*Plus  from  

shell.  

§  BACKUP_SCRIPT  :  Commands  in  file  or  PL/SQL  variable  run  using  RMAN  from  

shell.  

§  Variants  of  external  jobs.  

§  All  jobs  use  credenTals  to  connect  to  the  proper  OS  and  database  users.  

(22)

http://oracle-base.com

Running  $ORACLE_HOME/rdbms/admin  

built-­‐in  scripts  

§  Built-­‐in  funcTonality  open  requires  scripts  to  be  run  in  CDB  and  all  PDBs.  

§  Example  of  installing  "catblock.sql".  

 

$ cd $ORACLE_HOME/rdbms/admin/

$ perl catcon.pl -d $ORACLE_HOME/rdbms/admin -b / tmp/catblock_output catblock.sql

$ ls /tmp/catblock_output*

catblock_output0.log catblock_output1.log catblock_output2.log catblock_output3.log $

(23)

http://oracle-base.com

catcon.pl  (conTnued)  

§  Can  use  catcon.pl  to  run  a  query  in  all  PDBs.  

 

$ cd $ORACLE_HOME/rdbms/admin/

$ perl catcon.pl -e -b /tmp/query_output -- --x"SELECT SYS_CONTEXT('USERENV', 'CON_NAME') FROM dual“

$ ls /tmp/query_output*

/tmp/query_output0.log /tmp/query_output1.log /tmp/ query_output2.log /tmp/query_output3.log

$

§  Use  "-­‐c"  flag  for  include  list  or  "-­‐C"  for  exclude  list.  

 

$ rm -f /tmp/select_output* $ cd $ORACLE_HOME/rdbms/admin/

$ perl catcon.pl -e -C 'CDB$ROOT PDB$SEED' -b /tmp/select_output -- --x"SELECT SYS_CONTEXT('USERENV', 'CON_NAME') FROM dual“

(24)

http://oracle-base.com

Redo  and  Undo  Management  

§  Undo  and  Redo  belong  to  the  CDB.  PDBs  have  no  direct  control  over  Undo  

and  Redo.    

§  Remember  to  perform  maintenance  of  these  at  the  CDB  level.  

 

§  ConsolidaTng  mulTple  redo-­‐intensive  PDBs  into  one  CDB  may  be  unwise.  

 

§  Shared  undo  means  undo-­‐based  flashback  operaTons  may  be  affected  if  

(25)

http://oracle-base.com

Backup  and  Recovery  

§  Backup/Recovery  of  CDB  is  similar  to  non-­‐CDB,  but  affects  all  PDBs.  

 

§  Backup/Recovery  of  PDBs  is  available.  

 

§  PITR  of  a  PDB  possible,  similar  to  tablespace  PITR.  Does  PITR  of  CDB  to  in  

auxiliary  instance.    

§  If  you  do  PITR  of  a  PDB,  you  can't  flashback  the  CDB  before  that  Tme.  

 

(26)

http://oracle-base.com

Flashback  Database  

§  You  can't  use  FLASHBACK  DATABASE  for  a  PDB.  

 

§  FLASHBACK  DATABASE  only  works  with  CDB.  

 

§  If  you  do  PITR  of  a  PDB,  you  can't  flashback  the  CDB  before  that  Tme.  

 

(27)

http://oracle-base.com

ApplicaTon  Express  (APEX)  

§  By  default  APEX  installaTons  are  split  between  the  CDB  and  PDB.  

§  CDB  holds  common  components.  

§  PDB  holds  database-­‐specific  components  and  applicaTon  metadata.  

 

§  All  APEX  installaTons  must  be  maintained  at  the  same  version.  

 

§  Once  a  PDB  is  present,  you  *can't*  remove  shared  APEX  installaTon.  

 

(28)

http://oracle-base.com

Transparent  Data  EncrypTon  (TDE)  

§  The  key  management  has  changed  in  12c,  which  affects  TDE.  

 

§  ADMINISTER  KEY  MANAGEMENT  replaces  the    

ALTER  SYSTEM  SET  ENCRYPTION  KEY  and    

ALTER  SYSTEM  SET  ENCRYPTION  WALLET  commands.  

§  Under  mulTtenant,  some  operaTons  have  to  be  performed  at  CDB  before  

PDB.    

(29)

http://oracle-base.com

DBA_%  and  DBA_%_AE  Views  

§  This:     DBA_% ALL_% USER_%  

§  Has  become  this:  

 

CDB_% DBA_% ALL_%

(30)

http://oracle-base.com

Features  Not  Available  With  MulTtenant  

§  Not  currently  supported  under  mulTtenant  in  12.1.0.2.  

§  DBVERIFY  

§  Data  Recovery  Advisor  

§  Flashback  Pluggable  Database  

§  Flashback  TransacTon  Backout  

§  Database  Change  NoTficaTon  

§  ConTnuous  Query  NoTficaTon  (CQN)  

§  Client  Side  Cache  

§  Heat  map  

§  AutomaTc  Data  OpTmizaTon  

§  Oracle  Streams  

 

(31)

http://oracle-base.com

Why  you  should  use  

pluggable  databases  

(32)

http://oracle-base.com

Non-­‐CDB  Deprecated  

§  From  12.1.0.2  the  non-­‐CDB  architecture  is  deprecated.  

 

"The  non-­‐CDB  architecture  is  deprecated  in  Oracle  Database  12c,  and  may   be  desupported  and  unavailable  in  a  later  Oracle  Database  release.  Oracle   recommends  use  of  the  CDB  architecture.“  

 

(33)

http://oracle-base.com

Lone-­‐PDB  is  free!  

§  A  CDB  with  a  single  PDB  (Lone-­‐PDB,  Single  Tenant)  is  free  and  available  in  

all  ediTons.    

§  You  can  have  mulTple  CDBs  on  a  server,  each  with  one  PDB.  

 

§  A  CDB  with  mulTple  PDBs  costs  $.  

 

(34)

http://oracle-base.com

Patching,  Upgrading  and  Cloning  

§  "PotenTal"  improvements  in  the  speed  of  patching  and  upgrades.  

 

§  Transfers  using  Unplug/Plugin  are  simple.  

 

§  Cloning  a  PDB  between  local  and  remote  CDBs  is  awesome.  (Hot-­‐Cloning  

coming?)    

CREATE PLUGGABLE DATABASE pdb5 FROM remote_pdb5@remotecdb1 FILE_NAME_CONVERT=(

'/u01/app/oracle/oradata/cdb1/remote_pdb5/', '/u01/app/oracle/oradata/cdb1/pdb5/‘

);

(35)

http://oracle-base.com

Get  Started  Now!  

Release Schedule of Current Database Releases (Doc ID 742060.1)

(36)

http://oracle-base.com

Get  Started  Now!  

§  MulTtenant  introduces  a  lot  of  changes  for  DBAs.  

 

§  If  you  upgrade  to  non-­‐CDB  in  12.1,  you  may  be  forced  to  change  to  CDB  in  

12.2.    

§  That  makes  12.2  a  big  upgrade.  

 

(37)

http://oracle-base.com

Future-­‐Proof  Yourself  

§  This  is  the  future  of  the  Oracle  Database.  

 

§  Lots  of  the  old-­‐guard  DBAs  will  be  in  denial  and  struggle  to  get  up  to  

speed.    

(38)

http://oracle-base.com

The  End…    

§  Slides  and  Demos:  

 

hWp://oracle-­‐base.com/workshops    

Figure

Updating...

References

Updating...

Related subjects :