12c-Creating Pluggable Database Inside in Container Database-PART5   Leave a comment

AS you all know I have created a root container in my previous post named CDB$ROOT.

https://oracleappsdbar12.wordpress.com/2013/10/09/creating-a-container-database-in-12c/

The root contains the master set of data dictionary views, which have metadata regarding the root as well as every child pluggable database within the CDB.

With Container we have a Seeded Pluggable database it exists solely as a template for providing data files and metadata used to create new pluggable databases within the CDB. Each pluggable database is self-contained and functions like an isolated non-CDB database. Additionally, each pluggable database contains its own data files and application objects (users, tables, indexes
and so on). When connected to a pluggable database, there is no visibility to the root container or any other pluggable databases present within the CDB.

pdb1

 

 

 

 

 

 

Cloning the Seed Database
The CREATE PLUGGABLE DATASE statement can be used to create a pluggable database by copying the seed database’s data files. To do this, first connect to the root container database as the SYS user:

[ora12c@xxxxxx admin]$ sqlplus '/as sysdba'
SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 10 07:43:41 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> select con_id, name from v$containers;
CON_ID NAME
---------- ------------------------------
 1 CDB$ROOT
 2 PDB$SEED
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[ora12c@xxxxx admin]$ cd /u01/dbfile/CDB/pdbseed
[ora12c@xxxxx pdbseed]$ ls
sysaux01.dbf system01.dbf temp01.dbf users01.dbf
[ora12c@xxxxx pdbseed]$ cd
[ora12c@xxxxxx ~]$ vi testpdb1.sql
[ora12c@xxxxxx ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 10 07:50:57 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> @testpdb1.sql
FILE_NAME_CONVERT = ('/u01/dbfile/CDB/pdbseed','/u01/app/oracle/oradata/CDB/testpdb1,''/u01/dbfile/CDB','/u01/app/oracle/oradata/CDB/testpdb1')
 *
ERROR at line 3:
ORA-02000: missing , keyword
vi testpdb1.sql
CREATE PLUGGABLE DATABASE testpdb1
ADMIN USER testdba IDENTIFIED BY oracle
FILE_NAME_CONVERT = ('/u01/dbfile/CDB/pdbseed','/u01/app/oracle/oradata/CDB/testpdb1','/u01/dbfile/CDB','/u01/app/oracle/oradata/CDB/testpdb1');
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

Note : The FILE_NAME_CONVERT clause in this example has two strings. One specifies the location of the seed database data files:
/u01/app/oracle/oradata/CDB/pdbseed

The second string is the location where you want the new pluggable database’s data files created:

/u01/app/oracle/oradata/CDB/testpdb1

[ora12c@xxxxx ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 12.1.0.1.0 Production on Thu Oct 10 07:51:55 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> @testpdb1.sql
Pluggable database created.
pdb2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After setting to container to CDB$ROOT now check again

pdb3

 

 

 

 

 

 

Hope this post Helps

Advertisements

Posted October 10, 2013 by balaoracledba.com in 12cDatabase, Oracle DBA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: