শুক্রবার, ১৯ এপ্রিল, ২০২৪

Oracle Wallet Setup

 select * from v$encryption_wallet


mkdir -p /home/oracle/wallet

export TNS_ADMIN=/u01/app/oracle/product/19.0.0/dbhome_1/network/admin


Add the following entries into the client "/u01/app/oracle/product/19.0.0/dbhome_1/network/admin" file, with your preferred wallet location.


WALLET_LOCATION =
   (SOURCE =
     (METHOD = FILE)
     (METHOD_DATA =
       (DIRECTORY = /home/oracle/wallet)
     )
   )
SQLNET.WALLET_OVERRIDE = TRUE
SSL_CLIENT_AUTHENTICATION = FALSE
SSL_VERSION = 0


orapki wallet create -wallet "/home/oracle/wallet" -pwd "password" -auto_login

or 

mkstore -wrl "/home/oracle/wallet" -create

orapki wallet add -wallet D:\app\oracle\admin\orcl\wallet -trusted_cert -cert D:\app\oracle\admin\orcl\wallet\WE2.crt -pwd password

orapki wallet display -wallet D:\app\oracle\admin\orcl\wallet -pwd password

mkstore -wrl "/home/oracle/wallet" -createCredential orcl test test

mkstore -wrl "/home/oracle/wallet" -createCredential orcl2 test2 test2

mkstore -wrl "/home/oracle/wallet" -listCredential

mkstore -wrl <wallet_location> -modifyCredential <dbase_alias> <username> <password>

mkstore -wrl <wallet_location> -deleteCredential <db_alias>

administer key management create keystore 'C:\wallet' identified by password;

administer key management set keystore open identified by password container=all

Connection syntax "/@db_alias"

sqlplus /@orcl

sqlplus /@orcl2

begin
apex_instance_admin.validate_email_config;
end;

BEGIN
  DBMS_NETWORK_ACL_ADMIN.create_acl (
    acl          => 'mail.xml', 
    description  => 'Allow connections using UTL_TCP',
    principal    => 'APEX_240200',
    is_grant     => TRUE, 
    privilege    => 'connect');
end;

begin
  DBMS_NETWORK_ACL_ADMIN.assign_acl (
    acl         => 'mail.xml',
    host        => '*'
);
end;

BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
 host => '*',
 ace  =>  xs$ace_type(privilege_list => xs$name_list('connect'),
                      principal_name => 'APEX_240200',
                      principal_type => xs_acl.ptype_db)); 
END;

declare
l_body_html clob;
l_body clob;
begin
l_body:='<p>This is Header</p>';
l_body_html:='<html><head></head><body>'||
'<p>This is paragraph</p>'||'<br>
<h1>This is a header</h1>'||
'</body></html>';
  apex_mail.send(
    p_to   => 'mdalamin@lantaburgroup.com',
    p_from => 'mdalamin@lantaburgroup.com',
    p_body=>l_body,
    p_body_html => l_body_html,
    p_subj => 'Test Mail '||to_char(SYSDATE,'YY.MM.DD HH12AM:MI:SS'));
  apex_mail.push_queue();  
end;