Para crear una nueva base de datos acoplada dentro de un contenedor de Oracle Database 21c XE, podrá hacerlo de la siguiente manera:
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 XEPDB1 READ WRITE NO
SQL> show parameter create
NAME TYPE VALUE
------------------------------------ ----------- --------------------
create_bitmap_area_size integer 8388608
create_stored_outlines string
db_create_file_dest string
db_create_online_log_dest_1 string
db_create_online_log_dest_2 string
db_create_online_log_dest_3 string
db_create_online_log_dest_4 string
db_create_online_log_dest_5 string
SQL> host
[oracle@servidor-pruebas-oracle-database-18c ~]$ cd $ORACLE_BASE/oradata2
[oracle@servidor-pruebas-oracle-database-18c oradata2]$ cd XE21C/
[oracle@servidor-pruebas-oracle-database-18c XE21C]$ ls -la
drwxr-x---. 4 oracle oinstall 4096 Sep 22 04:40 .
drwxr-xr-x. 3 oracle oinstall 19 Sep 22 05:03 ..
-rw-r-----. 1 oracle oinstall 18726912 Sep 22 05:03 control01.ctl
-rw-r-----. 1 oracle oinstall 18726912 Sep 22 05:03 control02.ctl
drwxr-x---. 2 oracle oinstall 4096 Sep 22 04:41 pdbseed
-rw-r-----. 1 oracle oinstall 209715712 Sep 22 04:57 redo01.log
-rw-r-----. 1 oracle oinstall 209715712 Sep 22 04:57 redo02.log
-rw-r-----. 1 oracle oinstall 209715712 Sep 22 05:02 redo03.log
-rw-r-----. 1 oracle oinstall 587210752 Sep 22 05:02 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 1394614272 Sep 22 05:02 system01.dbf
-rw-r-----. 1 oracle oinstall 248520704 Sep 22 04:43 temp01.dbf
-rw-r-----. 1 oracle oinstall 125837312 Sep 22 05:02 undotbs01.dbf
-rw-r-----. 1 oracle oinstall 5251072 Sep 22 04:57 users01.dbf
drwxr-x---. 2 oracle oinstall 104 Sep 22 04:45 XEPDB1
[oracle@servidor-pruebas-oracle-database-18c XE21C]$ du -h
726M ./XEPDB1
701M ./pdbseed
4.0G .
[oracle@servidor-pruebas-oracle-database-18c XE21C]$ pwd
/opt/oracle/oradata2/XE21C
[oracle@servidor-pruebas-oracle-database-18c XE21C]$ exit
exit
SQL> show parameter create
NAME TYPE VALUE
------------------------------------ ----------- --------------------
create_bitmap_area_size integer 8388608
create_stored_outlines string
db_create_file_dest string
db_create_online_log_dest_1 string
db_create_online_log_dest_2 string
db_create_online_log_dest_3 string
db_create_online_log_dest_4 string
db_create_online_log_dest_5 string
SQL> alter system set db_create_file_dest='/opt/oracle/oradata2/XE21C' scope=both;
System altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 XEPDB1 READ WRITE NO
SQL> create pluggable database lab1 from xepdb1;
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 XEPDB1 READ WRITE NO
4 LAB1 MOUNTED
SQL> alter pluggable database lab1 open;
Pluggable database altered.
SQL> alter pluggable database lab1 save state;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 XEPDB1 READ WRITE NO
4 LAB1 READ WRITE NO
SQL> alter session set container=LAB1;
Session altered.
SQL> show con_id
CON_ID
------------------------------
4
SQL>
No hay comentarios:
Publicar un comentario
Te agradezco tus comentarios. Te esperamos de vuelta.