本篇內(nèi)容主要講解“怎么解決ERROR中JOB執(zhí)行DDL語句報(bào)錯(cuò)ORA-06550”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“怎么解決ERROR中JOB執(zhí)行DDL語句報(bào)錯(cuò)ORA-06550”吧!
創(chuàng)新互聯(lián)建站成立與2013年,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目網(wǎng)站設(shè)計(jì)制作、成都網(wǎng)站制作網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢想脫穎而出為使命,1280元零陵做網(wǎng)站,已為上家服務(wù),為零陵各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:028-86922220一、問題描述
需求要通過JOB定時(shí)執(zhí)行DDL語句(purge recyclbin),來實(shí)現(xiàn)清空回收站。簡單的問題,由于語法不了解所以報(bào)錯(cuò):ORA-06550 & PLS-00103。讓我們來看一下如何在JOB中執(zhí)行DDL語句的正確語法。
二、測試
1.建立JOB
BEGIN DBMS_SCHEDULER.CREATE_JOB ( job_name => '"TEST_USER"."PURGE_RECYCLBIN_TEST"', job_type => 'PLSQL_BLOCK', job_action => 'begin purge recyclebin; end; ', number_of_arguments => 0, start_date => NULL, repeat_interval => 'FREQ=WEEKLY;BYDAY=SUN;BYHOUR=0;BYMINUTE=0;BYSECOND=0', end_date => NULL, enabled => FALSE, auto_drop => FALSE, comments => '每周清理回收站'); DBMS_SCHEDULER.SET_ATTRIBUTE( name => '"TEST_USER"."PURGE_RECYCLBIN_TEST"', attribute => 'logging_level', value => DBMS_SCHEDULER.LOGGING_OFF); DBMS_SCHEDULER.enable( name => '"TEST_USER"."PURGE_RECYCLBIN_TEST"'); END; /
2.執(zhí)行該JOB報(bào)錯(cuò)
BEGIN DBMS_SCHEDULER.RUN_JOB(job_name => '"TEST_USER"."PURGE_RECYCLBIN_TEST"', USE_CURRENT_SESSION => FALSE); END; 報(bào)錯(cuò)信息如下: ORA-06550: line 2, column 7: PLS-00103: Encountered the symbol "RECYCLEBIN" when expecting one of the following: := . ( @ % ; result_cache The symbol ":=" was substituted for "RECYCLEBIN" to continue.
3.修改為正確執(zhí)行方式,重點(diǎn)修改job_action內(nèi)容
BEGIN DBMS_SCHEDULER.set_attribute( name => '"TEST_USER"."PURGE_RECYCLBIN_TEST"', attribute => 'job_action', value => 'begin execute immediate ''purge recyclebin''; end; '); END; /
4.再次執(zhí)行完成(無報(bào)錯(cuò))
BEGIN DBMS_SCHEDULER.RUN_JOB(job_name => '"TEST_USER"."PURGE_RECYCLBIN_TEST"', USE_CURRENT_SESSION => FALSE); END; /
到此,相信大家對“怎么解決ERROR中JOB執(zhí)行DDL語句報(bào)錯(cuò)ORA-06550”有了更深的了解,不妨來實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!