-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcsenc_master.sql
38 lines (33 loc) · 1.52 KB
/
csenc_master.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--------------------------------------------------------------------------------
-- OraDBA - Oracle Database Infrastructure and Security, 5630 Muri, Switzerland
--------------------------------------------------------------------------------
-- Name......: csenc_master.sql
-- Author....: Stefan Oehrli (oes) [email protected]
-- Editor....: Stefan Oehrli
-- Date......: 2023.08.30
-- Revision..:
-- Purpose...: Create master encryption key for TDE configured keystore must be
-- set before hand. Works for CDB as well PDB.
-- Notes.....:
-- Reference.: Requires SYS, SYSDBA or SYSKM privilege
-- License...: Apache License Version 2.0, January 2004 as shown
-- at http://www.apache.org/licenses/
--------------------------------------------------------------------------------
-- format SQLPlus output and behavior
SET LINESIZE 160 PAGESIZE 200
SET FEEDBACK ON
COLUMN wrl_type FORMAT A8
COLUMN wrl_parameter FORMAT A75
COLUMN status FORMAT A18
COLUMN wallet_type FORMAT A15
COLUMN con_id FORMAT 99999
-- start to spool
SPOOL csenc_master.log
-- set master key
PROMPT == Configure the master encryption key ==================================
ADMINISTER KEY MANAGEMENT SET KEY FORCE KEYSTORE IDENTIFIED BY EXTERNAL STORE WITH BACKUP;
-- list wallet information
PROMPT == Encryption wallet information from v$encryption_wallet ===============
SELECT * FROM v$encryption_wallet;
SPOOL OFF
-- EOF -------------------------------------------------------------------------