CREATE TABLESPACE tdedata
DATAFILE '/u01/app/oracle/oradata/db121s/tdedata.dbf'SIZE1000M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE1M
SEGMENT SPACE MANAGEMENT AUTO
ENCRYPTION USING'AES256'DEFAULTSTORAGE (ENCRYPT);
Verify Tablespace Encryption
set pages 2000 lin 2000col TABLESPACE_NAME for a15
col EXTENT_MANAGEMENT for a17
col ALLOCATION_TYPE for a15
col SEGMENT_SPACE_MANAGEMENT for a25
col BIGFILE for a6
col ENCRYPTEDfor a9
SELECT TABLESPACE_NAME
,INITIAL_EXTENT
,MAX_SIZE
,STATUS
,EXTENT_MANAGEMENT
,ALLOCATION_TYPE
,SEGMENT_SPACE_MANAGEMENT
,BIGFILE
,ENCRYPTEDFROM DBA_TABLESPACES
where TABLESPACE_NAME='TDEDATA'ORDERBY1;
Create User for Data Migration
createuser iko identified by oracle DEFAULT TABLESPACE TDEDATA;
grant dba to iko;
Create Test Table for Migration and Insert Test Data
conn iko/oracle
createtable t1(a numberprimarykey,b number ,c varchar2(30));
declare v_c1 number;
v_c2 number;
v_c3 varchar2(30);
begin dbms_random.seed(uid);
for i in1..1000 loop
v_c1 := i;
v_c2 := i;
v_c3 := dbms_random.string('x', 16);
insertinto t1 (a, b, c) values (v_c1, v_c2, v_c3);
if (mod(i, 100) =0) thencommit;
endif;
end loop;
commit;
end;
/selectcount(*) from iko.t1;
exit
Export Master Encryption Key
sqlplus /as sysdba
select*from v$encryption_wallet;
select ACTIVATING_PDBNAME,tag,key_id,con_id,CREATION_TIME,ACTIVATION_TIME from v$encryption_keys;
administer key management export encryption keys with secret "my_secret"to'/home/oracle/export_TDE.exp' identified by oracle;
Set Migration Tablespace to Read Only
alter tablespace tdedata readonly;
exit
Run expdp with transport_tablespaces (Export Metadata)