Created the database
using DBCA then
tried to create a pluggable database by issuing the following command:
SQL> CREATE PLUGGABLE DATABASE dyx_db ADMIN USER dyx IDENTIFIED BY dyx
2 STORAGE (MAXSIZE 2G MAX_SHARED_TEMP_SIZE 100M)
3 DEFAULT TABLESPACE dyx
4 DATAFILE '/u01/oracle/oradata/dyx_pdb/dyx.dbf' SIZE 25M AUTOEXTEND ON
5 PATH_PREFIX = '/u01/oracle/oradata/dyx_pdb/'
6 FILE_NAME_CONVERT = ('/u01/oracle/oradata/pdbseed/', '/u01/oracle/oradata/dyx_pdb/');
CREATE PLUGGABLE DATABASE dyx_db ADMIN USER dyx IDENTIFIED BY dyx
*
ERROR at line 1:
ORA-65090: operation only allowed in a container database
Cause
Now before you can create a pluggable database, there are some prerequisites. The most important one is that you have to create the database with the “ENABLE PLUGGABLE DATABASE” clause ():
To create a CDB, the CREATE DATABASE statement must
include the ENABLE PLUGGABLE DATABASE clause. When this clause is
included, the statement creates a CDB with the root and the seed.
When the ENABLE PLUGGABLE DATABASE clause is not included in the
CREATE DATABASE statement, the newly created database is a non-CDB. The
statement does not create the root and the seed, and the non-CDB can
never contain PDBs.
If you did not specify the above clause, you will not be able to create a PDB. Also, make sure the ENABLE_PLUGGABLE_DATABASE initialization parameter is set to “TRUE”. To find out wherever a database was created as a Container Database, check the v$database dynamic performance view:
SQL> select cdb from v$database;
CDB
---
NO
1 row selected.
SQL>
Resolution
1. Re-create DataBase with
sqlplus with "ENABLE_PLUGGABLE_DATABASE " initialization parameter to TRUE in your SPFILE, Such as:
CREATE DATABASE kdb121 ....
ENABLE PLUGGABLE DATABASE
.....; Note: After the creation of the database and creation of the catalog (Important: Run the catalog.sql, catproc.sql and pupbld.sql script provided by Oracle)
2. Re-create DataBase with DBCA with "Create a Empty Container Database" Auch as below:
we can check if the database was indeed created as a CDB:
SQL> select cdb from v$database;
CDB
---
YES
Tags:
Container Database,
Linux,
New Features,
Optimization,
Oracle 12c,
Oracle Database,
Pluggable Database,
SQL,
Troubleshooting
阅读(13292) | 评论(0) | 转发(0) |