Oracle encryption Stored Procedure Method 1. oracle built-in tools 1. c: \> set NLS_LANG = AMERICAN_AMERICA.USACII7 or c: \> set NLS_LANG = AMERICAN_AMERICA.WE8ISO8859P1 or c: \> set NLS_LANG = AMERICAN_AMERICA.ZHS16GBK (this can be used when an encryption error is reported and Chinese characters exist) 2. Save the stored procedure as an SQL file 3. c:> wrap iname = Procedures. SQL edebug = wrap_new_ SQL generates Procedures in the directory. plb file, 4. @ Procedures in SQL PLUS. plb can complete encryption SQL> @ c: \ Procedures. plboracle provides wrap tools to encrypt PL/SQL source code wrap commands including procedure, function, and package. Syntax in the row environment: wrap iname = input_file [oname = output_file] restrictions: strings, numbers, variable names, table names, and field names are stored in the encrypted file, only encrypt the algorithm rules and restrict decryption. Therefore, it is impossible to hide some new SQL syntax such as table name or password, you need to specify the option edebug = wrap_new_ SQL, otherwise the PLS-00753 cannot be supported: the incorrect packaging unit format is generally caused by pl/SQL compilation in sqlplus SQL> @ c: \ Procedures. plb, select the process or method test. Note: 1. wrap can only detect basic syntax errors, but it cannot check semantic errors because it does not log on to the database. 2. It is compatible with up, but not backward compatible, that is, the encryption process of the earlier version can be compiled on the later version. Otherwise, it cannot be performed. 3. The encryption package only encrypts the package body, but does not encrypt the package declaration. 4. An error is displayed when the package is executed on the windows platform: kgepop: no error frame to pop to for error 1801 you must first define the set NLS_LANG = AMERICAN_AMERICA.ZHS16GBK encrypted file name. If this parameter is not specified, it is the main file of the original file. after plb is encrypted, use SQL> @ to encrypt the file name and compile it into the database, the encrypted storage is displayed. For example, in pl/SQL developer, the encrypted storage process is displayed./* Source is wrapped */method 2.
[SQL] CREATE OR REPLACE PROCEDURE p_wraped_user (p_packename in varchar default '') AUTHID CURRENT_USER AS -- p_packename: name of the stored PROCEDURE encrypted -- For: Batch encrypts all codes of the current user, including stored procedures, functions, and packages. V_procs dbms_ SQL .varchar2a; BEGIN IF p_packename IS NULL THEN FOR n IN (SELECT DISTINCT NAME, type from user_source where name <> 'P _ WRAPED_USER 'and type <> 'type' and name = 'pack _ JC_LPRY_T' minus select distinct name, type from user_source WHERE line = 1 AND instr (text, 'wrapped')> 0 -- where name = 'get _ cler' -- AND -- TYPE = 'package body' order by type) loop for I IN (SELECT rownum rn, text FROM (SELECT decode (line, 1, 'create or replace ') | text FROM user_source WHERE NAME = n. name and type = n. type order by line) LOOP v_procs (I. rn): = I. text; end loop; dbms_ddl.create_wrapped (v_procs, 1, v_procs.COUNT); v_procs.DELETE; end loop; else for n IN (select distinct name, type from user_source where name <> 'P _ WRAPED_USER 'and type <> 'type' and name = p_packename minus select distinct name, type from user_source WHERE line = 1 AND instr (text, 'wrapped')> 0 -- where name = 'get _ cler' -- AND -- TYPE = 'package body' order by type) loop for I IN (SELECT rownum rn, text FROM (SELECT decode (line, 1, 'create or replace ') | text FROM user_source where name = n. name and type = n. type order by line) LOOP v_procs (I. rn): = I. text; end loop; dbms_ddl.create_wrapped (v_procs, 1, v_procs.COUNT); v_procs.DELETE; end loop; end if; END;