Exclude ENCRYPTION Clause on Import in Oracle Database 19c
This article demonstrates how to use the OMIT_ENCRYPTION_CLAUSE of the import TRANSFORM parameter in Oracle database 19c.
oracle 19cconfigurationintermediate
by OracleDba
15 views
This article demonstrates how to use the OMIT_ENCRYPTION_CLAUSE of the import TRANSFORM parameter in Oracle database 19c.
1234
conn sys/SysPassword1@//localhost:1521/cdb1 as sysdba
create user c##km_user identified by MyPassword1;
grant syskm to c##km_user container=all;12345678910111213141516171819202122232425262728
mkdir -p /u01/wallets/cdb1
ENCRYPTION_WALLET_LOCATION =
(SOURCE =(METHOD = FILE)(METHOD_DATA =
(DIRECTORY = /u01/wallets/cdb1/)))
-- Normal Oracle home.
$ORACLE_HOME/network/admin/sqlnet.ora
-- Read-only Oracle home.
$(orabasehome)/network/admin/sqlnet.ora
conn c##km_user/MyPassword1@//localhost:1521/cdb1 as syskm
administer key management create keystore '/u01/wallets/cdb1' identified by "WalletPassword1";
administer key management set keystore open identified by "WalletPassword1" container=all;
administer key management set encryption key identified by "WalletPassword1" with backup container=all;
column wrl_parameter format a20
select wallet_type, wrl_parameter, status
from v$encryption_wallet;
WALLET_TYPE WRL_PARAMETER STATUS
-------------------- -------------------- ------------------------------
PASSWORD /u01/wallets/cdb1/ OPEN
SQL>123456789
conn testuser1/testuser1@pdb1
create table t1 (
id number(10),
data varchar2(50) encrypt
);
insert into t1 values (1, 'This is a secret!');
commit;12345678910
conn sys/SysPassword1@//localhost:1521/pdb1 as sysdba
create or replace directory tmp_dir as '/tmp/';
grant read, write on directory tmp_dir to testuser1;
expdp testuser1/testuser1@pdb1 \
tables=t1 \
directory=tmp_dir \
logfile=t1-exp.log \
dumpfile=t1.dmp1234567
impdp testuser1/testuser1@pdb1 \
tables=t1 \
directory=tmp_dir \
logfile=t1-imp.log \
dumpfile=t1.dmp \
remap_table=testuser1.t1:t2 \
transform=omit_encryption_clause:y123456789101112131415161718192021222324252627282930313233343536373839404142
SQL> desc t1
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NUMBER(10)
DATA VARCHAR2(50) ENCRYPT
SQL> desc t2
Name Null? Type
----------------------------------------- -------- ----------------------------
ID NUMBER(10)
DATA VARCHAR2(50)
SQL>
column table_name format a20
column column_name format a20
select table_name, column_name
from user_encrypted_columns;
TABLE_NAME COLUMN_NAME
-------------------- --------------------
T1 DATA
SQL>
select * from t1;
ID DATA
---------- --------------------------------------------------
1 This is a secret!
SQL>
select * from t2;
ID DATA
---------- --------------------------------------------------
1 This is a secret!
SQL>Please to add comments
No comments yet. Be the first to comment!