如何通过PLSQL

如何通过PLSQL

问题描述:

调用参数shell脚本有shell脚本:如何通过PLSQL

#Note: If you see # in front of any line it means that it’s a comment line not the actual code 
#** ******************************************************************** 
# 
#** ******************************************************************** 
#Parameters from 1 to 4 i.e $1 $2 $3 $4 are standard parameters 
# $1 : username/password of the database 
# $2 : userid 
# $3 : USERNAME 
# $4 : Concurrent Request ID 
config_id=$5 
extract_id=$6 
# exit 1 represents concurrent program status. 1 for error, 2 for warning 0 for success 
echo “****************************************************************” 

我不得不从PLSQL过程中调用该主机类型的节目。这可以做到吗?

是的,通过DBMS_Scheduler。

  1. 创建程序,用DBMS_SCHEDULER.CREATE_PROGRAM
  2. 创建作业引用程序,用DBMS_SCHEDULER.CREATE_JOB
  3. 执行作业。

这里有一个演练:http://www.databasejournal.com/features/oracle/article.php/3365371/Executing-External-Programs-From-Within-Oracle.htm

而看到文档这里https://docs.oracle.com/cd/B28359_01/server.111/b28310/schedadmin006.htm#ADMIN12062