oracle12c學習之三nocdb轉換成pdb
01:23:06 sys@orcl> select name, decode(cdb, 'YES', 'Multitenant Option enabled', 'Regular 12c Database: ') "Multitenant Option" , open_mode, con_id from v$database;
NAME Multitenant Option OPEN_MODE CON_ID
--------- -------------------------- -------------------- -------------
ORCL Regular 12c Database: READ WRITE 0
可見該數據庫是傳統的數據庫,不是cdb
下面我們把這個數據庫轉換成cdb
01:27:24 sys@orcl> select name from v$datafile;
NAME
----------------------------------------------------------------------------------------------------------------------------------
+DATA/ORCL/DATAFILE/system.354.874717421
+DATA/ORCL/DATAFILE/undotbs2.352.874718065
+DATA/ORCL/DATAFILE/sysaux.322.874717327
+DATA/ORCL/DATAFILE/undotbs1.326.874717527
+DATA/ORCL/DATAFILE/kiwi.328.874718845
+DATA/ORCL/DATAFILE/users.329.874717527
6 rows selected.
Elapsed: 00:00:00.01
01:27:33 sys@orcl> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
01:28:46 sys@orcl> startup restrict mount exclusive;
ORACLE instance started.
Total System Global Area 2488635392 bytes
Fixed Size 2291424 bytes
Variable Size 721422624 bytes
Database Buffers 1744830464 bytes
Redo Buffers 20090880 bytes
Database mounted.
01:29:11 sys@orcl> alter database open read only;
Database altered.
Elapsed: 00:00:04.42
01:30:28 sys@orcl> begin
01:32:27 2 dbms_pdb.describe(PDB_DESCR_FILE => '/u02/noncdb/orcl.xml');
01:32:27 3 end;
01:32:27 4 /
create pluggable database orcl using '/u02/noncdb/orcl.xml' copy;
alter session set container=orcl;
在執行這個腳本轉換成pdb
@?/rdbms/admin/noncdb_to_pdb.sql