SlideShare uma empresa Scribd logo
1 de 8
Baixar para ler offline
Pluggable Database tutorial Part 2
Osama Mustafa Page 1
In my Part 1 Tutorial for how to deal with Pluggable database 12c I mentioned how to use
pluggable database, How to create pluggable database, how to create table space, and how to
open/close pluggable database.
Please checks the Part (1) before continue reading this article here.
Welcome to Pluggable database Part 2
 Rename Pluggable Database
 Manage Pluggable database
 Drop Pluggable database
 Security In Pluggable database
SQL> select name, con_id from v$active_services order by 1;
NAME CON_ID
----------------------------- ----------
TEST 3
As you see in the above query, I already created pluggable database called test. and it's in Read
write Mode.
Rename Pluggable database
SQL> alter pluggable database TEST close immediate ;
Pluggable database altered.
SQL> alter pluggable database TEST open restricted ;
Pluggable database altered.
SQL> select name, open_mode from v$pdbs;
NAME OPEN_MODE
------------------------------ ----------
TEST READ WRITE
SQL> alter pluggable database TEST rename global_name to new ;
Pluggable database altered.
Pluggable Database tutorial Part 2
Osama Mustafa Page 2
SQL> select name, con_id from v$active_services order by 1;
NAME CON_ID
--------------------------------------- ----------
new 3
if you are not connected to pluggable database or set session container then you will receive error
message
ORA-65046: operation not allowed from outside a pluggable
SQL> alter pluggable database new close immediate;
Pluggable database altered.
SQL> alter pluggable database new open ;
Pluggable database altered.
Manage Pluggable Database
Back to root container using / as sysdba like below:
SQL> conn / as sysdba
Connected.
SQL> select name, con_id from v$active_services order by 1;
NAME CON_ID
--------------------------------------------------- ----------
SYS$BACKGROUND 1
SYS$USERS 1
db12c 1
db12cXDB 1
new 3
We Control which list for for tablespace & datafiles by using con_id.
 List tablespace in root container
Pluggable Database tutorial Part 2
Osama Mustafa Page 3
SQL> select tablespace_name, con_id from cdb_tablespaces where con_id=1;
TABLESPACE_NAME CON_ID
------------------------------ ----------
SYSTEM 1
SYSAUX 1
UNDOTBS1 1
TEMP 1
USERS 1
CDATA 1
 List Database In root Container
SQL> select file_name, con_id from cdb_data_files where con_id=1;
FILE_NAME CON_ID
--------------------------------------------------------------------- ----------
/u01/app/oracle/oradata/db12c/users01.dbf 1
/u01/app/oracle/oradata/db12c/undotbs01.dbf 1
/u01/app/oracle/oradata/db12c/sysaux01.dbf 1
/u01/app/oracle/oradata/db12c/system01.dbf 1
/u01/app/oracle/oradata/db12c/gls/test.dbf 1
 Temp Tablespace in root container
SQL> select file_name, con_id from cdb_temp_files where con_id=1;
FILE_NAME CON_ID
----------------------------------------------------------------------------- ----------
/u01/app/oracle/oradata/db12c/temp01.dbf 1
 Create Tablespace ( already mentioned in Part (1))
SQL> create tablespace test datafile '/u01/app/oracle/oradata/db12c/gls/test03.dbf' size 20M;
Tablespace created.
Pluggable Database tutorial Part 2
Osama Mustafa Page 4
SQL> select tablespace_name, con_id from cdb_tablespaces order by con_id;
TABLESPACE_NAME CON_ID
------------------------------ ----------
SYSTEM 1
TEST 1
CDATA 1
SYSAUX 1
TEMP 1
UNDOTBS1 1
USERS 1
SYSAUX 2
TEMP 2
SYSTEM 2
TEMP 3
SYSAUX 3
PDB_TEST 3
SYSTEM 3
14 rows selected.
 Create temp tablespace
SQL> create temporary tablespace temp_test tempfile
'/u01/app/oracle/oradata/db12c/gls/temp_test.dbf' size 20M ;
Tablespace created.
SQL> select file_name, con_id from cdb_temp_files where con_id=1;
FILE_NAME CON_ID
--------------------------------------------------------------------------- ----------
/u01/app/oracle/oradata/db12c/temp01.dbf 1
/u01/app/oracle/oradata/db12c/gls/temp_test.dbf 1
The Same Steps in root container for create tablespace and temp tablespace for pluggable
database.
Pluggable Database tutorial Part 2
Osama Mustafa Page 5
Security In Pluggable Database
In This Section we will discuss how to manage Users, roles and privileges.
before Demonstration you need to know what is the difference between two users type :
 Common: when you create this kind of users in root it's automatically replicated
in all Pluggable database.
 Local: this kind of users only created on pluggable database that you are
connected to it now. and dose not effect on others pluggable database.
To Create Common Users you need to be connected to root container.
SQL> conn / as sysdba
Connected.
SQL> create user c##osama identified by osama ;
User created.
SQL> select username, common, con_id from cdb_users where username like 'C##%';
USERNAME COM CON_ID
------------------------------------ --- ----------
C##TEST YES 1
C##OSAMA YES 1
C##TEST YES 3
C##OSAMA YES 3
SQL> grant create session to c##osama ;
Grant succeeded.
SQL> conn c##osama/osama@test12c:1521/db12c ;
Connected.
Pluggable Database tutorial Part 2
Osama Mustafa Page 6
Let's connect to pluggable database :
The user i will created it here will not appear in root container.
SQL> conn sys/sys@test12c:1521/new as sysdba
Connected.
SQL> create user test identified by test ;
User created.
SQL> grant create session to test ;
Grant succeeded.
SQL> select username, common, con_id from cdb_users where username ='TEST';
USERNAME COM CON_ID
------------------ ----------
TEST NO 3
SQL> conn test/test@test12c:1521/new ;
Connected.
Same rules and conditions applied on Roles if you created in Root Container it will be replicated
to pluggable database, on other hand if you created in Pluggable database it will be local without
effecting Container.
Let's connect to Root Container
SQL> conn / as sysdba
Connected.
SQL> create role c##root_role ;
Role created.
Pluggable Database tutorial Part 2
Osama Mustafa Page 7
SQL> select role, common, con_id from cdb_roles where role='C##ROOT_ROLE';
ROLE COM CON_ID
--------------------- --- ----------
C##ROOT_ROLE YES 1
C##ROOT_ROLE YES 3
SQL> conn sys/sys@test12c:1521/new as sysdba
Connected.
SQL> create role test2;
Role created.
SQL> select role, common, con_id from cdb_roles where role='TEST2';
ROLE COM CON_ID
---------------- --- ----------
TEST2 NO 3
SQL> create role hr container=all ;
create role hr container=all
*
ERROR at line 1:
ORA-65050: Common DDLs only allowed in CDB$ROOT
SQL> create user hr identified by hr container=all ;
create user hr identified by hr container=all
*
ERROR at line 1:
ORA-65050: Common DDLs only allowed in CDB$ROOT
---> you cannot create a common role inside a PDB.
Pluggable Database tutorial Part 2
Osama Mustafa Page 8
Check user privileges:
SQL> select grantee, privilege, common, con_id from cdb_sys_privs
where privilege='CREATE SESSION' and grantee='TEST';
GRANTEE PRIVILEGE COM CON_ID
-------------- ---------------------------------------
TEST CREATE SESSION NO 3
Drop Pluggable Database
SQL > drop pluggable database new including datafiles;
Pluugable database dropped.

Mais conteúdo relacionado

Mais procurados

Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Vasudeva Rao
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationN/A
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cuzzal basak
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11guzzal basak
 
Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysqlVasudeva Rao
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GN/A
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productionsOsama Mustafa
 
Are You Ready for 12c? Data Migration and Upgrade Best Practices
Are You Ready for 12c? Data Migration and Upgrade Best PracticesAre You Ready for 12c? Data Migration and Upgrade Best Practices
Are You Ready for 12c? Data Migration and Upgrade Best PracticesPerformance Tuning Corporation
 
Oracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create DatabaseOracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create DatabaseMonowar Mukul
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission processK Kumar Guduru
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Alex Zaballa
 
Database administration commands
Database administration commands Database administration commands
Database administration commands Varsha Ajith
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12cuzzal basak
 
Oracle Database 11g Product Family
Oracle Database 11g Product FamilyOracle Database 11g Product Family
Oracle Database 11g Product FamilyN/A
 
Steps to Create odbc connection linux
Steps to Create odbc connection linuxSteps to Create odbc connection linux
Steps to Create odbc connection linuxOsama Mustafa
 
Inno db datafiles backup and retore
Inno db datafiles backup and retoreInno db datafiles backup and retore
Inno db datafiles backup and retoreVasudeva Rao
 

Mais procurados (20)

Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10
 
Rac&asm
Rac&asmRac&asm
Rac&asm
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition Presentation
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12c
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
 
Mater,slave on mysql
Mater,slave on mysqlMater,slave on mysql
Mater,slave on mysql
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11G
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productions
 
Are You Ready for 12c? Data Migration and Upgrade Best Practices
Are You Ready for 12c? Data Migration and Upgrade Best PracticesAre You Ready for 12c? Data Migration and Upgrade Best Practices
Are You Ready for 12c? Data Migration and Upgrade Best Practices
 
Oracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create DatabaseOracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create Database
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission process
 
oracle dba
oracle dbaoracle dba
oracle dba
 
12c on RHEL7
12c on RHEL712c on RHEL7
12c on RHEL7
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
 
Database administration commands
Database administration commands Database administration commands
Database administration commands
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12c
 
Oracle Database 11g Product Family
Oracle Database 11g Product FamilyOracle Database 11g Product Family
Oracle Database 11g Product Family
 
Steps to Create odbc connection linux
Steps to Create odbc connection linuxSteps to Create odbc connection linux
Steps to Create odbc connection linux
 
Inno db datafiles backup and retore
Inno db datafiles backup and retoreInno db datafiles backup and retore
Inno db datafiles backup and retore
 

Destaque

25605 tutorial migrasi database dari my sql ke oracle ( kelompok 9 )
25605 tutorial migrasi database dari my sql ke oracle ( kelompok 9 )25605 tutorial migrasi database dari my sql ke oracle ( kelompok 9 )
25605 tutorial migrasi database dari my sql ke oracle ( kelompok 9 )Hendry Aryadi
 
competitive pricing in business market
competitive pricing in business marketcompetitive pricing in business market
competitive pricing in business marketwelcometofacebook
 
Database reports generation(database)
Database reports generation(database)Database reports generation(database)
Database reports generation(database)welcometofacebook
 
firm performance presentation(INDUSTRAT)
firm performance presentation(INDUSTRAT)firm performance presentation(INDUSTRAT)
firm performance presentation(INDUSTRAT)welcometofacebook
 
Migrasi database mysql ke oracle-sql developer
Migrasi database mysql ke oracle-sql developerMigrasi database mysql ke oracle-sql developer
Migrasi database mysql ke oracle-sql developerIqbal Arfandi
 
Oracle smart flash cache
Oracle smart flash cacheOracle smart flash cache
Oracle smart flash cachexiangrong
 
Exadata Smart Scan - What is so smart about it?
Exadata Smart Scan  - What is so smart about it?Exadata Smart Scan  - What is so smart about it?
Exadata Smart Scan - What is so smart about it?Uwe Hesse
 
Tutorial Migrasi Database dari Microsoft SQL Server ke Oracle Database
Tutorial Migrasi Database dari Microsoft SQL Server ke Oracle DatabaseTutorial Migrasi Database dari Microsoft SQL Server ke Oracle Database
Tutorial Migrasi Database dari Microsoft SQL Server ke Oracle DatabaseHari Kurnia
 
Oracl DBA lab manual
Oracl DBA lab manualOracl DBA lab manual
Oracl DBA lab manualAbdulla Shaik
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorialMohd Tousif
 
Migrating to Oracle Database 12c: 300 DBs in 300 days.
Migrating to Oracle Database 12c: 300 DBs in 300 days.Migrating to Oracle Database 12c: 300 DBs in 300 days.
Migrating to Oracle Database 12c: 300 DBs in 300 days.Ludovico Caldara
 
Add target manually em12c
Add target manually em12cAdd target manually em12c
Add target manually em12cOsama Mustafa
 

Destaque (17)

25605 tutorial migrasi database dari my sql ke oracle ( kelompok 9 )
25605 tutorial migrasi database dari my sql ke oracle ( kelompok 9 )25605 tutorial migrasi database dari my sql ke oracle ( kelompok 9 )
25605 tutorial migrasi database dari my sql ke oracle ( kelompok 9 )
 
competitive pricing in business market
competitive pricing in business marketcompetitive pricing in business market
competitive pricing in business market
 
Database reports generation(database)
Database reports generation(database)Database reports generation(database)
Database reports generation(database)
 
Oracle tutorial
Oracle tutorialOracle tutorial
Oracle tutorial
 
firm performance presentation(INDUSTRAT)
firm performance presentation(INDUSTRAT)firm performance presentation(INDUSTRAT)
firm performance presentation(INDUSTRAT)
 
Migrasi database mysql ke oracle-sql developer
Migrasi database mysql ke oracle-sql developerMigrasi database mysql ke oracle-sql developer
Migrasi database mysql ke oracle-sql developer
 
Oracle Database View
Oracle Database ViewOracle Database View
Oracle Database View
 
Oracle smart flash cache
Oracle smart flash cacheOracle smart flash cache
Oracle smart flash cache
 
Exadata Smart Scan - What is so smart about it?
Exadata Smart Scan  - What is so smart about it?Exadata Smart Scan  - What is so smart about it?
Exadata Smart Scan - What is so smart about it?
 
Tutorial Migrasi Database dari Microsoft SQL Server ke Oracle Database
Tutorial Migrasi Database dari Microsoft SQL Server ke Oracle DatabaseTutorial Migrasi Database dari Microsoft SQL Server ke Oracle Database
Tutorial Migrasi Database dari Microsoft SQL Server ke Oracle Database
 
AWR & ASH Analysis
AWR & ASH AnalysisAWR & ASH Analysis
AWR & ASH Analysis
 
Oracl DBA lab manual
Oracl DBA lab manualOracl DBA lab manual
Oracl DBA lab manual
 
Oracle sql tutorial
Oracle sql tutorialOracle sql tutorial
Oracle sql tutorial
 
Oracle Tablespace - Basic
Oracle Tablespace - BasicOracle Tablespace - Basic
Oracle Tablespace - Basic
 
Oracle Database Trigger
Oracle Database TriggerOracle Database Trigger
Oracle Database Trigger
 
Migrating to Oracle Database 12c: 300 DBs in 300 days.
Migrating to Oracle Database 12c: 300 DBs in 300 days.Migrating to Oracle Database 12c: 300 DBs in 300 days.
Migrating to Oracle Database 12c: 300 DBs in 300 days.
 
Add target manually em12c
Add target manually em12cAdd target manually em12c
Add target manually em12c
 

Semelhante a Pluggable database tutorial 2

br_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docbr_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docLucky Ally
 
Oracle12c Pluggable Database Hands On - TROUG 2014
Oracle12c Pluggable Database Hands On - TROUG 2014Oracle12c Pluggable Database Hands On - TROUG 2014
Oracle12c Pluggable Database Hands On - TROUG 2014Özgür Umut Vurgun
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4uzzal basak
 
The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...
The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...
The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...Marco Vigelini
 
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobsMonowar Mukul
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guideSeungmin Shin
 
Security Multitenant
Security MultitenantSecurity Multitenant
Security MultitenantArush Jain
 
Create user database management security
Create user  database management securityCreate user  database management security
Create user database management securityGirija Muscut
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly databaseAnar Godjaev
 
kill_session_procedure.docx
kill_session_procedure.docxkill_session_procedure.docx
kill_session_procedure.docxSUNIL884268
 
Dba 3+ exp qus
Dba 3+ exp qusDba 3+ exp qus
Dba 3+ exp quskrreddy21
 
Rman backup and recovery 11g new features
Rman backup and recovery 11g new featuresRman backup and recovery 11g new features
Rman backup and recovery 11g new featuresNabi Abdul
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi TenantRed Stack Tech
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_pptmaclean liu
 
SQLMAP Tool Usage - A Heads Up
SQLMAP Tool Usage - A  Heads UpSQLMAP Tool Usage - A  Heads Up
SQLMAP Tool Usage - A Heads UpMindfire Solutions
 

Semelhante a Pluggable database tutorial 2 (20)

br_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docbr_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.doc
 
Oracle12c Pluggable Database Hands On - TROUG 2014
Oracle12c Pluggable Database Hands On - TROUG 2014Oracle12c Pluggable Database Hands On - TROUG 2014
Oracle12c Pluggable Database Hands On - TROUG 2014
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4
 
The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...
The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...
The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...
 
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
 
Less04 Instance
Less04 InstanceLess04 Instance
Less04 Instance
 
Firebird
FirebirdFirebird
Firebird
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guide
 
Security Multitenant
Security MultitenantSecurity Multitenant
Security Multitenant
 
Create user database management security
Create user  database management securityCreate user  database management security
Create user database management security
 
Database upgradation
Database upgradationDatabase upgradation
Database upgradation
 
Plsql
PlsqlPlsql
Plsql
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly database
 
Rmoug ashmaster
Rmoug ashmasterRmoug ashmaster
Rmoug ashmaster
 
kill_session_procedure.docx
kill_session_procedure.docxkill_session_procedure.docx
kill_session_procedure.docx
 
Dba 3+ exp qus
Dba 3+ exp qusDba 3+ exp qus
Dba 3+ exp qus
 
Rman backup and recovery 11g new features
Rman backup and recovery 11g new featuresRman backup and recovery 11g new features
Rman backup and recovery 11g new features
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi Tenant
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
 
SQLMAP Tool Usage - A Heads Up
SQLMAP Tool Usage - A  Heads UpSQLMAP Tool Usage - A  Heads Up
SQLMAP Tool Usage - A Heads Up
 

Mais de Osama Mustafa

Case study for software architect
Case study for software architectCase study for software architect
Case study for software architectOsama Mustafa
 
Does cloud mean the end of the dba
Does cloud mean the end of the dbaDoes cloud mean the end of the dba
Does cloud mean the end of the dbaOsama Mustafa
 
Using git hub for your code
Using git hub for your codeUsing git hub for your code
Using git hub for your codeOsama Mustafa
 
Java business service
Java business serviceJava business service
Java business serviceOsama Mustafa
 
Steps creating data_integration_services
Steps creating data_integration_servicesSteps creating data_integration_services
Steps creating data_integration_servicesOsama Mustafa
 
Build, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using DockerBuild, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using DockerOsama Mustafa
 
Oracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single nodeOracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single nodeOsama Mustafa
 
Helping implementer dealing with famous siebel based system messages and er...
Helping implementer dealing with famous siebel   based system messages and er...Helping implementer dealing with famous siebel   based system messages and er...
Helping implementer dealing with famous siebel based system messages and er...Osama Mustafa
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dbaOsama Mustafa
 
Oracle obia 11.1.1.10.1 installation
Oracle obia 11.1.1.10.1 installation Oracle obia 11.1.1.10.1 installation
Oracle obia 11.1.1.10.1 installation Osama Mustafa
 
Oracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOsama Mustafa
 
Erp installation r12.2
Erp installation r12.2Erp installation r12.2
Erp installation r12.2Osama Mustafa
 
Eouc 12 on 12c osama mustafa
Eouc 12 on 12c osama mustafaEouc 12 on 12c osama mustafa
Eouc 12 on 12c osama mustafaOsama Mustafa
 
Install oracle siebel on windows 2008 r2
Install oracle siebel on windows 2008 r2Install oracle siebel on windows 2008 r2
Install oracle siebel on windows 2008 r2Osama Mustafa
 

Mais de Osama Mustafa (20)

Case study for software architect
Case study for software architectCase study for software architect
Case study for software architect
 
DevOps for database
DevOps for databaseDevOps for database
DevOps for database
 
Does cloud mean the end of the dba
Does cloud mean the end of the dbaDoes cloud mean the end of the dba
Does cloud mean the end of the dba
 
Using git hub for your code
Using git hub for your codeUsing git hub for your code
Using git hub for your code
 
DevOps Project
DevOps Project DevOps Project
DevOps Project
 
Java business service
Java business serviceJava business service
Java business service
 
Steps creating data_integration_services
Steps creating data_integration_servicesSteps creating data_integration_services
Steps creating data_integration_services
 
Build, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using DockerBuild, Deploy and Run Node Js Application on Azure using Docker
Build, Deploy and Run Node Js Application on Azure using Docker
 
Oracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single nodeOracle api gateway installation as cluster and single node
Oracle api gateway installation as cluster and single node
 
Helping implementer dealing with famous siebel based system messages and er...
Helping implementer dealing with famous siebel   based system messages and er...Helping implementer dealing with famous siebel   based system messages and er...
Helping implementer dealing with famous siebel based system messages and er...
 
Weblogic and docker
Weblogic and dockerWeblogic and docker
Weblogic and docker
 
Weblogic 101 for dba
Weblogic  101 for dbaWeblogic  101 for dba
Weblogic 101 for dba
 
Ebs clone r12.2.4
Ebs clone r12.2.4Ebs clone r12.2.4
Ebs clone r12.2.4
 
Oracle obia 11.1.1.10.1 installation
Oracle obia 11.1.1.10.1 installation Oracle obia 11.1.1.10.1 installation
Oracle obia 11.1.1.10.1 installation
 
Oracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c InstallationOracle Enterprise manager 13c Installation
Oracle Enterprise manager 13c Installation
 
Erp installation r12.2
Erp installation r12.2Erp installation r12.2
Erp installation r12.2
 
OBIA Installation
OBIA Installation OBIA Installation
OBIA Installation
 
Eouc 12 on 12c osama mustafa
Eouc 12 on 12c osama mustafaEouc 12 on 12c osama mustafa
Eouc 12 on 12c osama mustafa
 
Install oracle siebel on windows 2008 r2
Install oracle siebel on windows 2008 r2Install oracle siebel on windows 2008 r2
Install oracle siebel on windows 2008 r2
 
Oracle autovue
Oracle autovueOracle autovue
Oracle autovue
 

Último

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 

Último (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 

Pluggable database tutorial 2

  • 1. Pluggable Database tutorial Part 2 Osama Mustafa Page 1 In my Part 1 Tutorial for how to deal with Pluggable database 12c I mentioned how to use pluggable database, How to create pluggable database, how to create table space, and how to open/close pluggable database. Please checks the Part (1) before continue reading this article here. Welcome to Pluggable database Part 2  Rename Pluggable Database  Manage Pluggable database  Drop Pluggable database  Security In Pluggable database SQL> select name, con_id from v$active_services order by 1; NAME CON_ID ----------------------------- ---------- TEST 3 As you see in the above query, I already created pluggable database called test. and it's in Read write Mode. Rename Pluggable database SQL> alter pluggable database TEST close immediate ; Pluggable database altered. SQL> alter pluggable database TEST open restricted ; Pluggable database altered. SQL> select name, open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- TEST READ WRITE SQL> alter pluggable database TEST rename global_name to new ; Pluggable database altered.
  • 2. Pluggable Database tutorial Part 2 Osama Mustafa Page 2 SQL> select name, con_id from v$active_services order by 1; NAME CON_ID --------------------------------------- ---------- new 3 if you are not connected to pluggable database or set session container then you will receive error message ORA-65046: operation not allowed from outside a pluggable SQL> alter pluggable database new close immediate; Pluggable database altered. SQL> alter pluggable database new open ; Pluggable database altered. Manage Pluggable Database Back to root container using / as sysdba like below: SQL> conn / as sysdba Connected. SQL> select name, con_id from v$active_services order by 1; NAME CON_ID --------------------------------------------------- ---------- SYS$BACKGROUND 1 SYS$USERS 1 db12c 1 db12cXDB 1 new 3 We Control which list for for tablespace & datafiles by using con_id.  List tablespace in root container
  • 3. Pluggable Database tutorial Part 2 Osama Mustafa Page 3 SQL> select tablespace_name, con_id from cdb_tablespaces where con_id=1; TABLESPACE_NAME CON_ID ------------------------------ ---------- SYSTEM 1 SYSAUX 1 UNDOTBS1 1 TEMP 1 USERS 1 CDATA 1  List Database In root Container SQL> select file_name, con_id from cdb_data_files where con_id=1; FILE_NAME CON_ID --------------------------------------------------------------------- ---------- /u01/app/oracle/oradata/db12c/users01.dbf 1 /u01/app/oracle/oradata/db12c/undotbs01.dbf 1 /u01/app/oracle/oradata/db12c/sysaux01.dbf 1 /u01/app/oracle/oradata/db12c/system01.dbf 1 /u01/app/oracle/oradata/db12c/gls/test.dbf 1  Temp Tablespace in root container SQL> select file_name, con_id from cdb_temp_files where con_id=1; FILE_NAME CON_ID ----------------------------------------------------------------------------- ---------- /u01/app/oracle/oradata/db12c/temp01.dbf 1  Create Tablespace ( already mentioned in Part (1)) SQL> create tablespace test datafile '/u01/app/oracle/oradata/db12c/gls/test03.dbf' size 20M; Tablespace created.
  • 4. Pluggable Database tutorial Part 2 Osama Mustafa Page 4 SQL> select tablespace_name, con_id from cdb_tablespaces order by con_id; TABLESPACE_NAME CON_ID ------------------------------ ---------- SYSTEM 1 TEST 1 CDATA 1 SYSAUX 1 TEMP 1 UNDOTBS1 1 USERS 1 SYSAUX 2 TEMP 2 SYSTEM 2 TEMP 3 SYSAUX 3 PDB_TEST 3 SYSTEM 3 14 rows selected.  Create temp tablespace SQL> create temporary tablespace temp_test tempfile '/u01/app/oracle/oradata/db12c/gls/temp_test.dbf' size 20M ; Tablespace created. SQL> select file_name, con_id from cdb_temp_files where con_id=1; FILE_NAME CON_ID --------------------------------------------------------------------------- ---------- /u01/app/oracle/oradata/db12c/temp01.dbf 1 /u01/app/oracle/oradata/db12c/gls/temp_test.dbf 1 The Same Steps in root container for create tablespace and temp tablespace for pluggable database.
  • 5. Pluggable Database tutorial Part 2 Osama Mustafa Page 5 Security In Pluggable Database In This Section we will discuss how to manage Users, roles and privileges. before Demonstration you need to know what is the difference between two users type :  Common: when you create this kind of users in root it's automatically replicated in all Pluggable database.  Local: this kind of users only created on pluggable database that you are connected to it now. and dose not effect on others pluggable database. To Create Common Users you need to be connected to root container. SQL> conn / as sysdba Connected. SQL> create user c##osama identified by osama ; User created. SQL> select username, common, con_id from cdb_users where username like 'C##%'; USERNAME COM CON_ID ------------------------------------ --- ---------- C##TEST YES 1 C##OSAMA YES 1 C##TEST YES 3 C##OSAMA YES 3 SQL> grant create session to c##osama ; Grant succeeded. SQL> conn c##osama/osama@test12c:1521/db12c ; Connected.
  • 6. Pluggable Database tutorial Part 2 Osama Mustafa Page 6 Let's connect to pluggable database : The user i will created it here will not appear in root container. SQL> conn sys/sys@test12c:1521/new as sysdba Connected. SQL> create user test identified by test ; User created. SQL> grant create session to test ; Grant succeeded. SQL> select username, common, con_id from cdb_users where username ='TEST'; USERNAME COM CON_ID ------------------ ---------- TEST NO 3 SQL> conn test/test@test12c:1521/new ; Connected. Same rules and conditions applied on Roles if you created in Root Container it will be replicated to pluggable database, on other hand if you created in Pluggable database it will be local without effecting Container. Let's connect to Root Container SQL> conn / as sysdba Connected. SQL> create role c##root_role ; Role created.
  • 7. Pluggable Database tutorial Part 2 Osama Mustafa Page 7 SQL> select role, common, con_id from cdb_roles where role='C##ROOT_ROLE'; ROLE COM CON_ID --------------------- --- ---------- C##ROOT_ROLE YES 1 C##ROOT_ROLE YES 3 SQL> conn sys/sys@test12c:1521/new as sysdba Connected. SQL> create role test2; Role created. SQL> select role, common, con_id from cdb_roles where role='TEST2'; ROLE COM CON_ID ---------------- --- ---------- TEST2 NO 3 SQL> create role hr container=all ; create role hr container=all * ERROR at line 1: ORA-65050: Common DDLs only allowed in CDB$ROOT SQL> create user hr identified by hr container=all ; create user hr identified by hr container=all * ERROR at line 1: ORA-65050: Common DDLs only allowed in CDB$ROOT ---> you cannot create a common role inside a PDB.
  • 8. Pluggable Database tutorial Part 2 Osama Mustafa Page 8 Check user privileges: SQL> select grantee, privilege, common, con_id from cdb_sys_privs where privilege='CREATE SESSION' and grantee='TEST'; GRANTEE PRIVILEGE COM CON_ID -------------- --------------------------------------- TEST CREATE SESSION NO 3 Drop Pluggable Database SQL > drop pluggable database new including datafiles; Pluugable database dropped.