DBA Hub

📋Steps in this guide1/2

How to create a pluggable database in oracle 12c - DBACLASS DBACLASS

We can create a pluggable database in an existing multitenant database either using dbca or manually. Here we will show how to do it manually.   STEPS: Connect to the container database:(ROOT)   [oracle@localhost ~]$ sqlplus sys/oracle@cdb1 as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Sun Aug 23 10:27:08 2015 Copyright (c) 1982, 2014, Oracle. All […]

oracle clusteringintermediate
by OracleDba
12 views
1

Overview

We can create a pluggable database in an existing multitenant database either using dbca or manually. Here we will show how to do it manually. STEPS: Connect to the container database:(ROOT) While creating PDB if you don’t mention FILE_NAME_CONVERT paramter then below error will come

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[oracle@localhost ~]$ sqlplus sys/oracle@cdb1 as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sun Aug 23 10:27:08 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
2

Section 2

Create PDB:(correct command)

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
SQL> create pluggable database PROD admin user dbaclass identified by dbaclass;
create pluggable database PROD admin user dbaclass identified by dbaclass
                                                                        *
ERROR at line 1:
ORA-65016: FILE_NAME_CONVERT must be specified

SQL> create pluggable database PROD admin user dbaclass identified by dbaclass FILE_NAME_CONVERT=('/home/oracle/app/oracle/oradata/cdb1/pdbseed','/home/oracle/app/oracle/oradata/cdb1/prod');


Pluggable database created.


SQL> select con_id,name,open_mode from v$Pdbs;

    CON_ID NAME 			  OPEN_MODE
---------- ------------------------------ ----------
	 2 PDB$SEED			  READ ONLY
	 3 ORCL 			  READ WRITE
	 4 PROD 			  MOUNTED
-- Open the PDB
SQL> alter pluggable database PROD open;

Pluggable database altered.



SQL> select con_id,name,open_mode from v$pdbs; 

    CON_ID NAME 			  OPEN_MODE
---------- ------------------------------ ----------
	 2 PDB$SEED			  READ ONLY
	 3 ORCL 			  READ WRITE
	 4 PROD 			  READ WRITE



SQL> alter session set container=PROD;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PROD
SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/cdb1/prod/system01.dbf
/home/oracle/app/oracle/oradata/cdb1/prod/sysaux01.dbf

SQL>

Comments (0)

Please to add comments

No comments yet. Be the first to comment!