01:23:06 [email protected]> 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 [email protected]> 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 [email protected]> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. 01:28:46 [email protected]> 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 [email protected]> alter database open read only; Database altered. Elapsed: 00:00:04.42 01:30:28 [email protected]> 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
时间: 2024-10-08 10:19:40