oracle加密存储过程(函数、包)
生活随笔
收集整理的這篇文章主要介紹了
oracle加密存储过程(函数、包)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
oracle提供了一個叫wrap的操作系統(tǒng)命令行工具,用來加密存儲過程、函數(shù)、包等PL/SQL源代碼。防止其他用戶對商業(yè)邏輯的偷窺,幫助保守商業(yè)密碼。
語法
input_file為輸入文件的名字,該文件含有源代碼,output_file為輸出文件的名字,oname可選,如果不帶oname選項,則生成名字跟輸入文件相同,文件后綴為.plb。
示例:
在/home/oracle目錄下創(chuàng)建存儲過程源文件pro_source.sql,內容為如下:
create or replace procedure hbk_secret is begindbms_output.put_line('I Love you,zhanglulu,My wife'); end;使用wrap命令生成加密,加密后的文件為pro_pwd.sql
[root@test11g oracle]# pwd /home/oracle [root@test11g oracle]# ll |grep pro_source.sql -rw-r--r-- 1 root root 108 7月 10 17:08 pro_source.sql [root@test11g oracle]# cat pro_source.sql create or replace procedure hbk_secret is begindbms_output.put_line('I Love you,zhanglulu,My wife'); end;[root@test11g oracle]# wrap iname=/home/oracle/pro_source.sql oname=/home/oracle/pro_pwd.sqlPL/SQL Wrapper: Release 11.2.0.1.0- 64bit Production on Wed Jul 10 17:09:47 2019Copyright (c) 1993, 2009, Oracle. All rights reserved.Processing /home/oracle/pro_source.sql to /home/oracle/pro_pwd.sql執(zhí)行加密后的存儲過程文件,將創(chuàng)建相對應的存儲過程。
[oracle@test11g ~]$ sqlplus hbk/hbkSQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 10 17:10:23 2019Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> @ /home/oracle/pro_pwd.sqlProcedure created.執(zhí)行存儲過程
SQL> set serveroutput on; SQL> execute hbk_secret; I Love you,zhanglulu,My wifePL/SQL procedure successfully completed.查看存儲過程的源代碼:
SQL > select name,text from all_source where type='PROCEDURE' and name='HBK_SECRET';查看的結果跟直接使用操作系統(tǒng)命令查看相同,已經(jīng)加密了。
[root@test11g oracle]# cat pro_pwd.sql create or replace procedure hbk_secret wrapped a000000 1 abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd 7 5b 9e Iglb06MHVSiBupA9nP6gE08Pj34wg5nnm7+fMr2ywFyFWpdKltwu0fJizKV0i8DAMv7Shgb1 UpuySv4osr3nsrMdBjAsriTqsjKuRE/kwsMCl+QJkOVf2zTSbiVuCaSa8gKbR6DDMi720eok H/bROaY2dP0C/總結
以上是生活随笔為你收集整理的oracle加密存储过程(函数、包)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Hadoop集群时间同步NTP
- 下一篇: OpenCV python 播放视频文件