Container and Pluggable Databases are the New future of 12c Databases.
We can give the name of pluggable while installing 12c
[root@logisticdev ~]# su - oracle
[oracle@logisticdev ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Wed Jan 21 13:40:33 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> select banner from v$version; BANNER ---------------------------------------------------------- Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production PL/SQL Release 12.1.0.2.0 - Production CORE 12.1.0.2.0 Production TNS for Linux: Version 12.1.0.2.0 - Production NLSRTL Version 12.1.0.2.0 - Production
On Container Database
SQL> select sys_context('userenv','con_name') from dual; SYS_CONTEXT('USERENV','CON_NAME') ---------------------------------------------------------- CDB$ROOT
SQL> select con_id, name, open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 2 PDB$SEED READ ONLY 3 PD1 READ WRITE
SQL> select name from v$tablespace; NAME ------------------------------ SYSAUX SYSTEM UNDOTBS1 USERS TEMP SYSTEM SYSAUX TEMP SYSTEM SYSAUX TEMP NAME ------------------------------ USERS EXAMPLE 13 rows selected.
On Pluggable Database
SQL> alter session set container =PD1; Session altered.
SQL> select sys_context('userenv','con_name') from dual; SYS_CONTEXT('USERENV','CON_NAME') ---------------------------------------------------------- PD1
SQL> select con_id, name, open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 3 PD1 READ WRITE
SQL> select name from v$tablespace; NAME ------------------------------ UNDOTBS1 SYSTEM SYSAUX TEMP USERS EXAMPLE 6 rows selected.
SQL> exit Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt ions
Cloning Pluggable Database
[oracle@logisticdev ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Wed Jan 21 13:48:29 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 opt ions
SQL> select sys_context('userenv','con_name') from dual; SYS_CONTEXT('USERENV','CON_NAME') --------------------------------------------------- CDB$ROOT
SQL> select con_id, name, open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 2 PDB$SEED READ ONLY 3 PD1 READ ONLY
SQL> alter pluggable database pd1 close; Pluggable database altered.
SQL> select con_id, name, open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 2 PDB$SEED READ ONLY 3 PD1 MOUNTED
SQL> alter pluggable database pd1 open read only; alter pluggable database pd1 Pluggable database altered.
SQL> select con_id, name, open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 2 PDB$SEED READ ONLY 3 PD1 READ ONLY
SQL> create pluggable database PD2 from PD1 file_name_convert=('/ora12c/oracle/a pp/oracle/oradata/TEST/pd1','/ora12c/oracle/app/oracle/oradata/TEST/pd2'); Pluggable database created.
SQL> select con_id, name, open_mode from v$pdbs; CON_ID NAME OPEN_MODE ---------- ------------------------------ ---------- 2 PDB$SEED READ ONLY 3 PD1 READ ONLY 4 PD2 MOUNTED
SQL> alter pluggable database PD1 close; Pluggable database altered.
SQL> alter pluggable database PD1 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 PD1 READ WRITE 4 PD2 MOUNTED
Uninstall 12c Database
$ cd <ORACLE_HOME>/deinstall $ ./deinstall
No comments:
Post a Comment