当我收到此错误时,我试图导出在Oracle 11g上创建的完整调度程序链(包括步骤,规则等):
ORA-31600: invalid input value CHAIN for parameter OBJECT_TYPE in function GET_DDL
ORA-06512: at "SYS.DBMS_METADATA", line 5805
ORA-06512: at "SYS.DBMS_METADATA", line 8344
ORA-06512: at line 1
消息含义
31600. 00000 - "invalid input value %s for parameter %s in function %s"
*Cause: A NULL or invalid value was supplied for the parameter.
*Action: Correct the input value and try the call again.
查询失败:
select dbms_metadata.get_ddl('CHAIN','RUN_SERVICE_IP') from dual;
我们能够为链条导出(获取DDL)吗?导出整个链设置的替代方法是什么?
答案 0 :(得分:2)
Oracle 12c上的情况如下,我无法测试早期版本。
您需要将'PROCOBJ'
指定为OBJECT_TYPE,因此:
select dbms_metadata.get_ddl('PROCOBJ','RUN_SERVICE_IP') from dual;
这适用于程序,作业和链。作业定义将包括属性。链定义将包括连锁步骤,但奇怪的不是连锁规则。这些只能从视图*_SCHEDULER_CHAIN_RULES
中获取,例如
select 'dbms_scheduler.define_chain_rule(
chain_name => ''' || chain_name || ''',
condition => ''' || condition || ''',
action => ''' || action || ''',
rule_name => ''' || rule_name || ''',
comments => ''' || comments || '''
);'
from user_scheduler_chain_rules;