1 vitalsofttech.com copyright 2014 by natik ameen
TRANSCRIPT
![Page 1: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/1.jpg)
1
12c DBA Beginners SeriesOracle Database in the Cloud
VitalSoftTech.com Copyright 2014
By Natik Ameen
![Page 2: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/2.jpg)
2
My Introduction
Production DBA 15+ years RAC, Exadata & GoldenGate OCP 8 thru 11g OCE RAC Free Articles at
www.vitalsofttech.com/articles/
![Page 3: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/3.jpg)
3
Free DBA Training Series
Evolution of Databases 12c Features What does multitenacy offer? Multitenant Architecture Getting Started Basic Administration
![Page 4: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/4.jpg)
4
Free DBA Training Series
Security Backup and Recovery Views Upgrade
![Page 5: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/5.jpg)
5
Evolution of Databases
![Page 6: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/6.jpg)
6
History of Oracle
7, 8i, 9i, 10g,11g and 12c i=internet g=grid c=cloud
![Page 7: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/7.jpg)
7
DB Growth
DB Size in MB’s Then Gigabytes Then Terabytes Now Petabytes and growing … DB Sizes doubled in last 2 years
alone!
![Page 8: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/8.jpg)
8
Hardware
CPU’s Disk Speed Networks
![Page 9: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/9.jpg)
9
Database Progression
RDBMS Licensed Open Source
SQL NoSQL Reduce/Mapped
![Page 10: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/10.jpg)
10
12cConsolidation, Flexibility & ROI
![Page 11: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/11.jpg)
11
12c
Mutlitenancy Plug-in, Plug-out In-memory Cloning
![Page 12: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/12.jpg)
12
Why Oracle added Multitenancy feature?
Consolidation, Flexibility & ROI
![Page 13: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/13.jpg)
13
Challenges
Many servers Dedicated resources Long provisioning time Data Segregation requirements Large Databases Size Costly
![Page 14: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/14.jpg)
14
Definition of Multitenancy
More than …
![Page 15: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/15.jpg)
15
Consolidation
Database consolidation vs Server consolidation
Reduced resource usage Separation of User Data Fewer servers
![Page 16: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/16.jpg)
16
Flexibility
Easier, faster DB deployments Fast Cloning for Dev/QA Quick patching and upgrades Separation of duties
![Page 17: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/17.jpg)
17
High ROI
Hardware, Software Cost Reduction Fewer support hours
![Page 18: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/18.jpg)
18
Basics of Multitenancy
How are container DB’sdifferent from non-container DB’s?
![Page 19: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/19.jpg)
19
Multitenant Architecture
![Page 20: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/20.jpg)
20
Components
CDB Instance CDB$ROOT Container PDB$SEED PDBs
![Page 21: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/21.jpg)
21
CDB Instance
Consolidation at Database Level Share SGA with other PDBs Share Background processes
![Page 22: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/22.jpg)
22
CDB Shared Resources
SGA Buffer Cache Log buffer Cache Shared Pool
Redo Logs SYSTEM, SYSAUX & UNDO DBWR, LGWR, ARCH background
processes
![Page 23: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/23.jpg)
23
CDB$ROOT Database
System Data Dictionary One root Plugin a PDB Holds common users CDB Resource Plan Upto 252 PDB’s
![Page 24: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/24.jpg)
24
PDB Local Data Dictionary Metadata link (Data
Dictionary Pointer) Object Link (Data link) Local Users Common Users SYSTEM & SYSAUX
![Page 25: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/25.jpg)
25
PDB$SEED
PDB Template Rapid DB creation SYSTEM,
SYSAUX,TEMP Common User
![Page 26: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/26.jpg)
26
Getting StartedCreate CDB and PDB’s
![Page 27: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/27.jpg)
27
Create CDB Container
![Page 28: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/28.jpg)
28
Create PDB Databases using PDB$SEED
Connect to CDB as sysdba No need to create and initialize
instance Copies datafiles and creates service Very fast
![Page 29: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/29.jpg)
29
Basic AdministrationConnect, Start and shutdown CDB and PDBs
![Page 30: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/30.jpg)
30
Connecting to CDB's
Export ORACLE_SID – CDB Instance name
Connect normally using sqlplust p://www.vitalsofttech.com/managing-oracle-12c-pdbs-and-cdbs-getting-started/
![Page 31: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/31.jpg)
31
Connecting to a PDB's
Export CDB ORACLE_SID Instance name always CDB instance PDB created has own Service name Connect using Service Name
![Page 32: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/32.jpg)
32
Connecting to PDB- Use Service Name
![Page 33: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/33.jpg)
33
Connecting to a PDB - Switch from CDB
![Page 34: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/34.jpg)
34
Starting up a CDB
Export ORACLE_SID – CDB Instance name
Connect Normally using sqlplus Run STARTUP
racle-12c-pdbs-and-cdbs-getting-started/
![Page 35: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/35.jpg)
35
Opening a PDB
Not automatically started Even if CDB is up
PDBs in-accessible. In MOUNT mode
![Page 36: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/36.jpg)
36
Opening a PDB
Open all pluggable databases
![Page 37: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/37.jpg)
37
Closing a PDB
Closing all pluggable databases
![Page 38: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/38.jpg)
38
Shutdown a CDB
Shutdown in normal way All PDB’s shut down automatically
![Page 39: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/39.jpg)
39
Plug-in and unplug PDB
![Page 40: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/40.jpg)
40
SecurityIs my PDB Really Secure?
![Page 41: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/41.jpg)
41
Common Users
Users created in the CDB User name will always start with
C##
![Page 42: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/42.jpg)
42
Common Roles
Works the same way as users Roles created in the CDB Role names will always start with
C##
![Page 43: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/43.jpg)
43
Privileges to Common Users
Common users need Privs to connect to each container
Grant Privs to a user cascade Privs across all PDBs
Exception is SEED database
![Page 44: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/44.jpg)
44
Local Users
Created inside a specific PDB database Cannot connect to other PDB’s or CDB C## in name not required/allowed?
■ Cannot connect to CDB as users are local to PDB only
![Page 45: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/45.jpg)
45
Local Users
Follows same convention as local users Can only be created in PDBs Limited to container where created
![Page 46: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/46.jpg)
46
Local Privileges
Can be granted to local or Common users
Below privilege granted in PDB, not cascaded to CDB
![Page 47: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/47.jpg)
47
Backup and RecoveryNow, do I have to learn how to backup the Database?
![Page 48: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/48.jpg)
48
Backup of CDB/PDB’s Connect to the CDB Same as a non-container backup One command backs up CDB and
ALL PDBsrman target /Recovery Manager: Release 12.1.0.1.0 Production on Thu Sep 5 13:13:23 2013…… RMAN> backup database;Starting backup at 05-SEP-13….….
![Page 49: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/49.jpg)
49
Backup of Only CDB or Root
Connect to the CDB
RMAN> backup database root;Starting backup at 05-SEP-13….….
![Page 50: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/50.jpg)
50
Backup of Single PDB Connect to CDB use pluggable database
■ Connect to PDB and run backup or
RMAN> backup database;Starting backup at 05-SEP-13….
RMAN> backup pluggable database pdb12c;
Starting backup at 05-SEP-13….
![Page 51: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/51.jpg)
51
Backup of Archive Logs Archive logs can ONLY be backed while connected to CDB Connect to the CDB
RMAN> BACKUP DATABASE PLUSARCHIVE LOG;
![Page 52: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/52.jpg)
52
Flashback for a CDB All databases attached can be flashed back Except past the previous SCN Recovery time of the database Work around is to offline the datafiles
ORA-39866: Data files for pluggable database must be offline to flashback across a PDB point-in-time recovery
![Page 53: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/53.jpg)
53
Flashback for a CDB
Connect to CDB Flashback the CDB and ALL PDB’s to
same point in time
![Page 54: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/54.jpg)
54
Views
Where do I connect to look at DB info? CDB or PDB?
![Page 55: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/55.jpg)
55
CDB_xxx and DBA_xxx views
New Views start with CDB_* Only visible when connected to CDB
![Page 56: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/56.jpg)
56
CDB Specific Views V$ views GV$ views CDB_ views DBA_HIST*
views
![Page 57: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/57.jpg)
57
CDB Specific ViewsCON_ID References
0 Entire CDB1 Root2 SEED
3-254 PDB's
Is this a CDB? select CDB from V$DATABASE;
Container List >select NAME, CON_ID, DBID, CON_UID, GUID from V$CONTAINERS order by CON_ID;
![Page 58: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/58.jpg)
58
PDB Specific Views Container History
select DB_NAME, CON_ID, PDB_NAME, OPERATION, OP_TIMESTAMP, CLONED_FROM_PDB_NAME from CDB_PDB_HISTORY where CON_ID > 2 order by CON_ID;
![Page 59: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/59.jpg)
59
UPGRADE
Ready to upgrade?
![Page 60: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/60.jpg)
60
Direct Upgrade Supported or not?
Source Release
Source Patch Set
Direct Upgrade Support?
11gr2 11.2.0.2 and later
Yes
11.2.0.1 No
11gr1 11.1.0.7 Yes
11.1.0.6 No
10g 10.2.0.5 Yes
10.2.0.4 and earlier
No.
9i and earlier All No
![Page 61: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/61.jpg)
61
Plan Stability
SQL Plan Management Base Evolve Plans Don’t forget to test in non-production
![Page 62: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/62.jpg)
62
Using DBUA
![Page 63: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/63.jpg)
63
Manual Upgrade
Install 12c Oracle binaries
Run catupgrd.sql
![Page 64: 1 VitalSoftTech.com Copyright 2014 By Natik Ameen](https://reader036.vdocuments.us/reader036/viewer/2022062322/56649e905503460f94b95151/html5/thumbnails/64.jpg)
64
About Us
LinkedIn - http://www.linkedin.com/in/nameen
Google + - http://plus.google.com/+Vitalsofttech/posts
My blog - http://www.vitalsofttech.com/blogs
Email - [email protected]
We provide 24hrs Remote DBA Support Oracle Online Training
Worked with Sony America UCSD George Washington University
Phone: (800) 515-8174 Skype: ORACLE_IT
Oracle 12c Articleswww.vitalsofttech.com/articles/12c/