设为首页 收藏本站
查看: 1240|回复: 0

[经验分享] SAP HANA AFL插件库升级后之前生成的存储过程升级方法(PAL升级方法)

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-9-19 12:35:42 | 显示全部楼层 |阅读模式
  在AFL库升级之后,之前创建的存储过程需要进行相应的升级,这个时候一般需要重新运行AFL_WRAPPER_GENERATOR。在前面的例子中,我们知道在重新运行该存储过程的时候,因为之前已经生成相应的存储过程,则一定会报错。如何应对这种情况?
  之前已生成的实例: http://www.cnblogs.com/omygod/archive/2013/05/03/3056971.html
  
  SAP HANA提供两种方法:
  1. 手工删除之前的存储过程及表类型,再重新运行AFL_WRAPPER_GENERATOR。该方法在之前的文章中已有提及:
  http://www.cnblogs.com/omygod/archive/2013/05/04/3059728.html
  DROP PROCEDURE _SYS_AFL.PAL_TS_S;
DROP TYPE _SYS_AFL.PAL_TS_S__TT_P1;
DROP TYPE _SYS_AFL.PAL_TS_S__TT_P2;
DROP TYPE _SYS_AFL.PAL_TS_S__TT_P3;
  CALL SYSTEM.AFL_WRAPPER_GENERATOR ('PAL_TS_S', 'AFLPAL', 'SINGLESMOOTH', PAL_TS_SIGNATURE);
  

  2. SAP Note 1830239提供解决方法,该文主要从该方法进行探讨
  SAP Note 1830239具体内容为:
Summary

Symptom
  
You run AFL_WRAPPER_GENERATOR and get an error like:

"SAP DBTech JDBC: [423]: liveCache error: [423] SYSTEM.AFL_WRAPPER_GENERATOR: line 35 col 1 (at pos 1718): liveCache error exception: liveCache error: registration finished with errors, see indexserver trace"

And in the indexserver trace there is a message like:

"cannot use duplicate user-defined type name - PAL_TS_S__TT_P2: line 1 col 22 (at pos 21): line 1 col 22 (at pos 21)"



Other terms
  
AFL error, PAL


Reason and Prerequisites
  
You are using AFL_WRAPPER_GENERATOR to generate a procedure to call a PAL Application Function. The procedure was already generated before in a previous call to the wrapper generator. Now you are facing duplicates.

The PAL manual describes how all tables types and the procedure itself have to be dropped manually in advance. But this step  was not perfomed (successfully).



Solution
  
Instead of dropping all relevant table types and the procedure manually the counter part to AFL_WRAPPER_GENERATOR called AFL_WRAPPER_ERASER can be used.

Please proceed as follows:

    1. Connect to the database as user SYSTEM via Hana Studio.
    2. Copy the attached file afl_wrapper_eraser.txt to a sql window and execute it.
    3. Grant the execution of afl_wrapper_eraser to the relevant user:
             grant execute on system.afl_wrapper_eraser to ...
    4. Connect as this user and run system.afl_wrapper_eraser for the procedure causing trouble.
  



Header Data
Release Status:Released for Customer
Released on:05.04.2013  11:20:16
Master Language:English
Priority:Correction with medium priority
Category:Program error
Primary Component:BC-DB-HDB-AFL SAP HANA Application Function Library
Affected Releases
Release-Independent
  
  
  该Note所阐释的方法如下:
  1. 生成系统存储过程AFL_WRAPPER_ERASER。sql语句如下:
CREATE PROCEDURE afl_wrapper_eraser(IN procOrig VARCHAR(100)) LANGUAGE SQLSCRIPT
AS
v_num integer := 0;
v_sqlscript VARCHAR(32767) := '';
proc VARCHAR(32767) := UPPER(:procOrig);
CURSOR c_parameter_table_name FOR
SELECT TABLE_NAME
FROM "SYS"."TABLES"
WHERE SCHEMA_NAME = '_SYS_AFL'
AND TABLE_NAME like :proc || '__TT_P%';
BEGIN
-- proc
select count(1) into v_num from SYS.PROCEDURES where SCHEMA_NAME = '_SYS_AFL' and PROCEDURE_NAME = :proc;
if :v_num > 0 then
v_sqlscript := 'drop procedure _SYS_AFL.' || proc;
exec :v_sqlscript;
end if;
-- type
select count(1) into v_num from SYS.TABLES where SCHEMA_NAME = '_SYS_AFL' and TABLE_NAME like :proc || '__TT_P%';
if :v_num > 0 then
v_sqlscript := 'drop type _SYS_AFL.';
FOR cur_row_detail AS c_parameter_table_name DO
v_sqlscript := :v_sqlscript || cur_row_detail.TABLE_NAME;
exec :v_sqlscript;
v_sqlscript := 'drop type _SYS_AFL.';
END FOR;
end if;
END; 2. 如果运行该存储过程的为其他用户,我们需要对其他用户进行授权:
  GRANT EXECUTE ON SYSTEM.AFL_WRAPPER_ERASER TO User1;
  该方法会删除方法及相应的table type。
  3. 重新运行AFL_WRAPPER_GENERATOR。
  
  实例如下:
  CALL SYSTEM.AFL_WRAPPER_ERASER ('PAL_TS_S');
  CALL SYSTEM.AFL_WRAPPER_GENERATOR ('PAL_TS_S', 'AFLPAL', 'SINGLESMOOTH', PAL_TS_SIGNATURE);

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-115820-1-1.html 上篇帖子: C#如何通过NCO3.0来连接SAP并调用SAP中的RFC 下篇帖子: SAP Validation和Substitution
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表