38
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://oraclebase.com Books Oracle PL/SQL Tuning Oracle Job Scheduling

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

Embed Size (px)

Citation preview

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

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  

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

http://oracle-base.com

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

http://oracle-base.com

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

http://oracle-base.com

Agenda  

§  What  is  a  pluggable  database?  

§  What  they  will  break!  

§  Why  you  should  use  them  anyway!  

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

http://oracle-base.com

What  is  a  pluggable  database?  

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

http://oracle-base.com

What  is  a  Pluggable  Database  

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

http://oracle-base.com

Create  a  new  PDB  

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

http://oracle-base.com

Unplug/Plugin  PDB  

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

http://oracle-base.com

Clone  a  PDB  

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

http://oracle-base.com

Clone  a  Remote  PDB  

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

http://oracle-base.com

What  they  will  break!  

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

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.  §  Oracle  12c  is  very  different.  There  is  a  lot  to  learn!  

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

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!    

§  What  can  we  do  about  this?  

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

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

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

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

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

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

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

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: $

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

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 $

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

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) ) )

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

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

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

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.  §  CredenTals  held  in  the  database.

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

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 $

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

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“ $

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

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  undo  is  not  sized  properly.  Consider  Flashback  Data  Archive  (FDA).  

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

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.    

§  You  will  have  to  relearn  B&R,  especially  caveats.  

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

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.    

§  Flashback  of  a  PDB  may  be  coming!  

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

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.    

§  Must  remove  it  first,  then  build  PDBs  with  separate  APEX  installaTons.  

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

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.    

§  You  need  to  relearn  it!  

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

http://oracle-base.com

DBA_%  and  DBA_%_AE  Views  

§  This:    DBA_% ALL_% USER_%  

§  Has  become  this:    CDB_% DBA_% ALL_% USER_%

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

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  

 §  If  you  need  them,  use  non-­‐CDB  architecture.  

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

http://oracle-base.com

Why  you  should  use  pluggable  databases  

anyway!  

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

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  release  aper  Oracle  Database  12c  Release  2.  Oracle  recommends  use  of  the  CDB  architecture..“    hWps://docs.oracle.com/database/121/UPGRD/deprecated.htm#BABDBCJI  

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

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

§  Lone-­‐PDB  allows  you  to  get  used  to  MulTtenant  at  no  extra  cost.  

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

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/‘ ); ALTER PLUGGABLE DATABASE pdb5 OPEN READ WRITE;

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

http://oracle-base.com

Get  Started  Now!  Release Schedule of Current Database Releases (Doc ID 742060.1)

12.2?

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

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.    

§  Put  the  effort  in  now!  

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

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.    

§  Make  yourself  stand  out!  

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

http://oracle-base.com

The  End…    

§  Slides  and  Demos:    hWp://oracle-­‐base.com/workshops    

§  QuesTons?