DBMS_SCHEDULER执行PERL脚本加载数据

php中文网
发布: 2016-06-07 16:08:01
原创
1431人浏览过

例子利用oracle 11g 的dbms_scheduler包执行perl脚本加载数据文件,其中主要用到三个过程分别为SET_JOB_ARGUMENT_VALUE,CREATE_JO

1.例子利用oracle 11g 的dbms_scheduler包执行perl脚本加载数据文件,其中主要用到三个过程分别为set_job_argument_value,create_job,run_job三个过程,其中三个过程的参数说明如下:

create_job参数:

AttributeDescription

job_name

Name of the job

job_class

Name of the job class

job_style

Style of the job:

  • REGULAR

  • LIGHTWEIGHT

  • program_name

    Name of the program that the job runs

    job_action

    Inline action of the job. This is either the code for an anonymous PL/SQL block or the name of a stored procedure, external executable, or chain.

    job_type

    Job action type ('PLSQL_BLOCK', 'STORED_PROCEDURE', 'EXECUTABLE', or 'CHAIN')

    schedule_name

    Name of the schedule that specifies when the job has to execute

    repeat_interval

    Inline time-based schedule

    schedule_limit

    Maximum delay time between scheduled and actual job start before a job run is canceled

    start_date

    Start date and time of the job

    end_date

    End date and time of the job

    event_condition

    Event condition for event-based jobs

    queue_spec

    File watcher name or queue specification for event-based jobs

    number_of_arguments

    Number of job arguments

    arguments

    Array of job arguments

    job priority

    Job priority

    job_weight

    *** Deprecated in Oracle Database 11gR2. Do not change the value of this attribute from the default, which is 1.

    Weight of the job for parallel execution.

    max_run_duration

    Maximum run duration of the job

    max_runs

    Maximum number of runs before the job is marked as completed

    max_failures

    Maximum number of failures tolerated before the job is marked as broken

    logging_level

    Job logging level

    restartable

    Indicates whether the job is restartable (TRUE) or not (FALSE)

    stop_on_window_exit

    Indicates whether the job is stopped when the window that it runs in ends (TRUE) or not (FALSE). Equivalent to thestop_on_window_close job attribute described in the SET_ATTRIBUTE Procedure.

    raise_events

    State changes that raise events

    comments

    Comments on the job

    拍客piikee竞拍系统
    拍客piikee竞拍系统

    拍客竞拍系统是一款免费竞拍网站建设软件,任何个人可以下载使用,但未经商业授权不能进行商业活动,程序源代码开源,任何个人和企业可以进行二次开发,但不能以出售和盈利为目的。安装方法,将www文件夹里面的所有文件上传至虚拟主机,在浏览器执行http://你的域名/install.php或者直接导入数据库文件执行。本次升级优化了一下内容1,程序和模板完美分离。2,优化了安装文件。3,后台增加模板切换功能。

    拍客piikee竞拍系统 0
    查看详情 拍客piikee竞拍系统

    auto_drop

    If TRUE (the default), indicates that the job should be dropped once completed

    enabled

    Indicates whether the job should be enabled immediately after creating it (TRUE) or not (FALSE)

    follow_default_timezone

    If TRUE and if the job start_date is null, then when thedefault_timezone scheduler attribute is changed, the Scheduler recomputes the next run date and time for this job so that it is in accordance with the new time zone.

    parallel_instances

    For event-based jobs only.

    If TRUE, on the arrival of the specified event, the Scheduler creates a new lightweight job to handle that event, so multiple instances of the same event-based job can run in parallel.

    If FALSE, then an event is discarded if it is raised while the job that handles it is already running,

    aq_job

    For internal use only

    instance_id

    The instance ID of the instance that the job must run on

    credential_name

    The credential to use for a single destination or the default credential for a group of destinations

    destination

    The name of a single external destination or database destination, or a group name of type external destination or database destination

    database_role

    In an Oracle Data Guard environment, the database role ('PRIMARY' or 'LOGICALSTANDBY') for which the job runs

    allow_runs_in_restricted_mode

    If TRUE, the job is permitted to run when the database is in restricted mode, provided that the job owner is permitted to log in during this mode

    SET_JOB_ARGUMENT_VALUE参数:

    ParameterDescription

    job_name

    The name of the job to be altered

    argument_name

    The name of the program argument being set

    argument_position

    The position of the program argument being set

    argument_value

    The new value to be set for the program argument. To set a non-VARCHAR value, use theSET_JOB_ANYDATA_VALUE procedure.

    RUN_JOB参数:

     

    ParameterDescription

    job_name

    A job name or a comma-separate list of entries, where each is the name of an existing job, optionally preceded by a schema name and dot separator.

    If you specify a multiple-destination job, the job runs on all destinations. In this case, theuse_current_session argument must be FALSE.

    use_current_session

    This specifies whether or not the job run should occur in the same session that the procedure was invoked from.

    When use_current_session is set to TRUE:

  • The job runs as the user who called RUN_JOB, or in the case of a local external job with a credential, the user named in the credential.

  • You can test a job and see any possible errors on the command line.

  • run_count, last_start_date, last_run_duration, andfailure_count are not updated.

  • RUN_JOB can be run in parallel with a regularly scheduled job run.

  • When use_current_session is set to FALSE:

  • The job runs as the user who is the job owner.

  • You need to check the job log to find error information.

  • run_count, last_start_date, last_run_duration, andfailure_count are updated.

  • RUN_JOB fails if a regularly scheduled job is running.

  • For jobs that have a specified destination or destination group, or point to chains or programs with the detached attribute set toTRUE, use_current_session must be FALSE

    由于本例中是调用操作系统的sqlldr命令去实现数据文件的加载,所以要用到create_job过程创建的job_type为'EXECUTABLE'的job去实现,其中job_type含义如下

     

  • 'PLSQL_BLOCK'

  • 最佳 Windows 性能的顶级免费优化软件
    最佳 Windows 性能的顶级免费优化软件

    每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

    下载
    来源:php中文网
    本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
    最新问题
    开源免费商场系统广告
    热门教程
    更多>
    最新下载
    更多>
    网站特效
    网站源码
    网站素材
    前端模板
    关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
    php中文网:公益在线php培训,帮助PHP学习者快速成长!
    关注服务号 技术交流群
    PHP中文网订阅号
    每天精选资源文章推送

    Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号