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.
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.
After setting to container to CDB$ROOT now check again
Hope this post Helps
Leave a Reply