<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>TDE &#8211; Blog DBA Dutra</title>
	<atom:link href="https://www.dbadutra.com/tag/tde/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbadutra.com</link>
	<description></description>
	<lastBuildDate>Sat, 07 Sep 2019 22:28:27 +0000</lastBuildDate>
	<language>pt-BR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
<site xmlns="com-wordpress:feed-additions:1">170494511</site>	<item>
		<title>Configurando TDE em PDB com PLUG e UNPLUG do database.</title>
		<link>https://www.dbadutra.com/2019/09/configurando-tde-em-pdb-com-plug-e-unplug-do-database/</link>
					<comments>https://www.dbadutra.com/2019/09/configurando-tde-em-pdb-com-plug-e-unplug-do-database/#respond</comments>
		
		<dc:creator><![CDATA[André Luiz Dutra Ontalba]]></dc:creator>
		<pubDate>Sat, 07 Sep 2019 22:28:24 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[PDB]]></category>
		<category><![CDATA[TDE]]></category>
		<guid isPermaLink="false">https://www.dbadutra.com/?p=5676</guid>

					<description><![CDATA[Este artigo descreve o processo de configurar uma TDE no CDB e desconectar o PDB1 da instância CDB1 e conectar-se à instância CDB2 na mesma máquina com um novo nome de PDB2. 1 &#8211; Configurar TDE na Origem &#8211; CDB (cdb1) A) Criar diretórios [root@vm1 ~]# mkdir -p /etc/ORACLE/WALLETS/cdb1 [root@vm1 ~]# mkdir -p /etc/ORACLE/WALLETS/cdb2 [root@vm1 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Este artigo descreve o processo de configurar uma TDE no CDB e desconectar o PDB1 da instância CDB1 e conectar-se à instância CDB2 na mesma máquina com um novo nome de PDB2.</p>



<p>1 &#8211; Configurar TDE na Origem &#8211; CDB (cdb1)</p>



<p>A) Criar diretórios</p>



<pre class="wp-block-preformatted">[root@vm1 ~]# mkdir -p /etc/ORACLE/WALLETS/cdb1
 [root@vm1 ~]# mkdir -p /etc/ORACLE/WALLETS/cdb2
 [root@vm1 ~]# chown -R oracle:oinstall /etc/ORACLE
 [root@vm1 ~]# chmod -R 755 /etc/ORACLE</pre>



<p>B) Edite o sqlnet.ora para configurar o Wallet</p>



<pre class="wp-block-preformatted">ENCRYPTION_WALLET_LOCATION=
  (SOURCE=
   (METHOD=FILE)
    (METHOD_DATA=
     (DIRECTORY=/etc/ORACLE/WALLETS/$ORACLE_SID/)))</pre>



<p>C) Configure Database &#8211; cdb1</p>



<pre class="wp-block-preformatted">[oracle@vm1 ~]$ . oraenv &lt;&lt;&lt; cdb1
 ORACLE_SID = [db01] ? The Oracle base remains unchanged with value /u01/app/oracle
 [oracle@vm1 ~]$ sqlplus
 SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 3 20:58:03 2019
 Copyright (c) 1982, 2014, Oracle.  All rights reserved.
 Enter user-name: / as sysdba
 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>
 SQL>
 SQL>
 SQL> show pdbs
 <code>CON_ID CON_NAME                       OPEN MODE  RESTRICTED</code>
 
 <code>     2 PDB$SEED                       READ ONLY  NO      3 PDB1                           READ WRITE NO      4 PDB2                           READ WRITE NO</code>
 SQL> ADMINISTER KEY MANAGEMENT CREATE KEYSTORE '/etc/ORACLE/WALLETS/cdb1' IDENTIFIED BY oracle;
 keystore altered.
 SQL> ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY oracle container=all;
 keystore altered.
 SQL> ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY oracle  WITH BACKUP USING 'emp_key_backup'
 keystore altered.
 SQL> alter session set container=pdb1;
 Session altered.
 SQL> ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY oracle  WITH BACKUP USING 'emp_key_backup';
 keystore altered.
 SQL> set linesize 500
 SQL> select * from v$encryption_wallet;
 WRL_TYPE             WRL_PARAMETER                                      STATUS                         WALLET_TYPE          WALLET_OR FULLY_BAC     CON_ID
 
 FILE                 /etc/ORACLE/WALLETS/cdb1/                          OPEN                           PASSWORD             SINGLE    NO                 0
 SQL> create tablespace TESTE
   datafile '/u01/app/oracle/oradata/cdb1/pdb1/teste.dbf' size 10m
   encryption using 'AES256'
   default storage (encrypt);
 Tablespace created.</pre>



<p>D) Faça o export da key da Origem &#8211; PDB(pdb1) </p>



<pre class="wp-block-preformatted">SQL>ADMINISTER KEY MANAGEMENT EXPORT ENCRYPTION KEYS WITH SECRET "oracle" TO '/home/oracle/export.p12' IDENTIFIED BY oracle;
 keystore altered.
 SQL> !
 [oracle@vm1 ~]$ ls -ltr export.p12
 -rw-r--r--. 1 oracle oinstall    2612 Sep  3 21:08 export.p12
 [oracle@vm1 ~]$ exit</pre>



<p>E) Unplug e DROP PDB(pdb1)</p>



<pre class="wp-block-preformatted">SQL> alter pluggable database close immediate;
 Pluggable database altered.
 SQL> conn / as sysdba
 Connected.
 SQL> alter pluggable database pdb1 unplug into '/home/oracle/pdb1.xml';
 Pluggable database altered.
 SQL> drop pluggable database pdb1 keep datafiles;
 Pluggable database dropped.
 SQL> exit
 Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
 With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options</pre>



<p>2 &#8211; Configure o TDE no Destino &#8211;  CDB(cdb2)</p>



<pre class="wp-block-preformatted">[oracle@vm1 ~]$ . oraenv &lt;&lt;&lt; cdb2
 ORACLE_SID = [cdb1] ? The Oracle base remains unchanged with value /u01/app/oracle
 [oracle@vm1 ~]$ ls /etc/ORACLE/WALLETS/
 cdb1  cdb2
 [oracle@vm1 ~]$ sqlplus
 SQL*Plus: Release 12.1.0.2.0 Production on Tue Sep 3 21:13:12 2019
 Copyright (c) 1982, 2014, Oracle.  All rights reserved.
 Enter user-name: / as sysdba
 Connected to an idle instance.
 SQL> startup
 ORACLE instance started.
 Total System Global Area 1241513984 bytes
 Fixed Size                  2923872 bytes
 Variable Size             452985504 bytes
 Database Buffers          771751936 bytes
 Redo Buffers               13852672 bytes
 Database mounted.
 Database opened.
 SQL> show pdbs
 <code>CON_ID CON_NAME                       OPEN MODE  RESTRICTED</code>
 
 <code>     2 PDB$SEED                       READ ONLY  NO      3 PDB1                           MOUNTED</code>
 SQL>
 SQL> ADMINISTER KEY MANAGEMENT CREATE KEYSTORE '/etc/ORACLE/WALLETS/cdb2' IDENTIFIED BY oracle;
 keystore altered.
 SQL> ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY oracle;
 keystore altered.
 SQL> ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY oracle WITH BACKUP USING 'emp_key_backup';
 keystore altered.
 SQL>
 SQL></pre>



<p>F) PLUG PDB(pdb2) usando Unplugged pdb1</p>



<pre class="wp-block-preformatted">SQL> create pluggable database pdb2 as clone using '/home/oracle/pdb1.xml'
   2  file_name_convert=('/u01/app/oracle/oradata/cdb1/pdb1/','/u01/app/oracle/oradata/cdb2/pdb2/');
 Pluggable database created.
 SQL> alter pluggable database pdb2 open;
 Warning: PDB altered with errors.</pre>



<p>G) Importe a key da Origem PDB(pdb1) no Destino PDB(pdb2)</p>



<pre class="wp-block-preformatted">SQL> alter session set container=pdb2;
 Session altered.
 SQL> ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY oracle;
 keystore altered.
 SQL> ADMINISTER KEY MANAGEMENT IMPORT ENCRYPTION KEYS WITH SECRET "oracle" FROM '/home/oracle/export.p12' IDENTIFIED BY oracle WITH BACKUP;
 keystore altered.
 SQL> shut immediate;
 Pluggable Database closed.
 SQL> startup
 Pluggable Database opened.</pre>



<p>H) Valide o PDB se está totalmente integrado com CDB2</p>



<pre class="wp-block-preformatted">SQL> conn / as sysdba
 Connected.
 SQL> select message,status from pdb_plug_in_violations where status &lt;> 'RESOLVED';
 SQL> /
 no rows selected
 SQL> show pdbs
 <code>CON_ID CON_NAME                       OPEN MODE  RESTRICTED</code>
 
 <code>     2 PDB$SEED                       READ ONLY  NO      3 PDB1                           MOUNTED      4 PDB2                           READ WRITE NO</code>
 SQL></pre>



<p></p>



<p>Espero ter ajudado !!!</p>



<p>Até a próxima</p>



<p>Este artigo foi escrito por André Ontalba e Rodrigo Mufalani</p>



<p><strong><br>Disclaimer:</strong> “The postings on this site are my own and don’t necessarily represent may actual employer positions, strategies or opinions. The information here was edited  to be useful for general purpose, specific data and identifications was removed to allow reach generic audience and to be useful.” </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbadutra.com/2019/09/configurando-tde-em-pdb-com-plug-e-unplug-do-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">5676</post-id>	</item>
	</channel>
</rss>
