All in Oracle database.

Thursday, August 13, 2009

How to Create an Encrypted Tablespace in Oracle11g R1

August 13, 2009
1. Create a Wallet
  Before you can create an Encrypted tablespace, there must be a wallet.
 
  1.1. specify the wallet location in $ORACLE_HOME/network/admin/sqlnet.ora file.
       So the first step is to know where Oracle finds a wallet, wallet searching path.
  ##################sqlnet.ora#######################
  ENCRYPTION_WALLET_LOCATION =(
     SOURCE=(METHOD=FILE)(METHOD_DATA= (DIRECTORY=/u01/oracle/admin/sindb1/wallet/))
     )
  ##################sqlnet.ora#######################
 
  1.2. create a wallet.
      SQL>CONNECT /AS SYSDBA;
      SQL>ALTER SYSTEM SET ENCRYPTION WALLET OPEN IDENTIFIED BY "U83j10LLt8v";
      You will find a file named ewallet.p12 in /u01/oracle/admin/sindb1/wallet directory.
      You should back it up to an safe place.
     
  1.3. open&close a wallet.
      SQL>ALTER SYSTEM SET WALLET OPEN IDENTIFIED BY "U83j10LLt8v";
      SQL>ALTER SYSTEM SET WALLET CLOSE;
 
2. Create an encrypted tablespace.
  Issue the following SQL:
  SQL> create tablespace tsdata9 datafile '/u01/oracle/oradata/sindb1/tsdata09.dbf' size 16M reuse
       encryption using 'AES256' default storage(encrypt);
  Now, you can create objects in this tablespace just like in a normal tablespace.
  But the content in the datafiles of this tablespace has been encrypted.


No comments:

Post a Comment