Can't stop a job from plsql 27486 - stops fine from sql

Hi,
I'm trying to create a simple package that will stop known jobs that the user owns. (Same user owns the jobs and the package)
the code just does
dbms_scheduler.disable('JOB_EMAIL_QUEUE', TRUE);
dbms_scheduler.stop_job('JOB_EMAIL_QUEUE', TRUE);
At stop_job I get
ORA-27486 insufficient privilege
ORA-06512 at "SYS.DBMS_ISCHED", line 164
ORA-06512 at "SYS.DBMS_SCHEDULER", line 483
Yet if I put the exact same code in an anon block it runs fine in sqlplus for the same user. The user holds the role SCHEDULER_ADMIN but I have now granted him execute access on both dbms_isched and dbms_scheduler.
Whassup?
Thanks,
Steve

Hi,
I think what you're seeing is caused by the following two facts
- a user must have the manage scheduler system privilege to stop a job with force=>true
- definer's rights pl/sql stored procedures don't honour system privileges granted through roles. See
http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10807/08_subs.htm#sthref1072
The simplest solution is to grant MANAGE SCHEDULER directly to the definer of the definer's rights stored procedure.
Hope this helps,
Ravi.

Similar Messages

  • Can we extract blob objects from sql database to a human readable format?

    Hi All,
    I have question How can we extract
    blob objects from Sql database to human readable format ?
    Blob includes Images, text and docs.
    Thanks 
    Moug
    Best Regards Moug

    One thing you can do if its sql 2012 or later is to load the blob data to FileTable created in database. Then you would be able to physically browse to directory it points and see all files in its native format.
    see this for more details
    http://visakhm.blogspot.in/2012/07/working-with-filetables-in-sql-2012.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Can not see running jobs from, package

    I have a problem with processing parallely runing jobs:
    I am creating another immediately runned jobs in a main job. Those two parallel jobs (2 loads from different databases) have to be finished before I run next operation (working out loaded data). Problem is that, after starting those 2 parallel jobs, I can not see them by select from ALL_SCHEDULER_RUNNING_JOBS that is executed immediately after I create those jobs in a package. If I take a look into ALL_SCHEDULER_RUNNING_JOBS from anonymous statement I can see all my running jobs. Let's sum it up:
    1/ Start of main job
    2/ Running 2 immediately created jobs (load data)
    3/ Checking in loop if jobs created in step 2 are still running
    3.1/ Jobs are running (ALL_SCHEDULER_RUNNING_JOBS check) - sleep for a
    while - It never happens - can't see any running jobs from select executed in
    package but can see them in
    anonymous statement
    3.2/ Jobs finished - start processing loaded data
    Can somebody help me with this task?
    Thanks alot!
    Jakub

    Hi,
    There is no reason a job should be visible from an anonymous block but not from inside a job. There are two things that may be happening here.
    - jobs scheduled to run immediately my not start running as soon as they are created/enabled, you may need to wait a bit before they start running (they will appear in all_scheduler_jobs immediately but maybe not all_scheduler_running_jobs immediately)
    - you may be running into privilege issues. Is the user that executes the anonymous block the same as the user that the job is running as (the job's schema) ? If not maybe the job user does not have privileges to see the job (you can grant alter on the job to the user to ensure this).
    Can you see the jobs in the all_scheduler_jobs view from within the job with status RUNNING ? If you can see jobs in all_scheduler_jobs as RUNNING but not in all_scheduler_running_jobs then this is a bug of some sort.
    Thanks,
    Ravi.

  • Officejet Pro 8600 - Can't remove canceled job from print queue

    Hi there
    I canceled a print job from the print queue, but it refuses to budge! Everytime I try to remove it, I get this message:
    I can print other documents, but it's very irritating having this here all the time (and a big red blob on my dock icon announcing a phantom print job).
    Can anyone help me rid myself of this spectre of print purgatory?
    Cheers!

    Try downloading and running the HP Print and Scan doctor. This software is able to remove phantom print jobs for you automatically. The program can be downloaded from here.
    As well, for Windows based computers, restarting the computer can also help with this issue oftentimes. Hope this helps.
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------
    I am not an HP employee.

  • Can I cancel mail job from SOST queue and make its status to be error or red

    Do you have any idea to cancel mail job from SOST queue and make its status to be error or red (msgno = 806) by using coding ??

    veekwall wrote:
    Hi,
    I recently (over this past summer) updated my phone and plan with Verizon.  I'm from Pittsburgh, Pennsylvania, and I got the phone in Pittsburgh.  It is a Droid Eris and very nice.  I got it and a month later I moved to Olympia, Washington for school.  Since moving there, I have hardly been able to use it.  The service is terrible and its been impossible to keep in touch with my family, I wasn't even able to call them over Thanksgiving.  I'm also having to pay extra money so I can use the internet on my phone, but I can't even access the internet let alone make phone calls.  It's really frustrating.  I can't use my phone to keep in touch with everyone in Pittsburgh-and if I am ever in trouble I wouldn't be able to call for help, which makes me really nervous.  Is there a way I can cancel my 2yr contract?  Yes.  Just visit a Verizon store, or dial *611 from your phone and let them know you would like to cancel your account.  Would I have to pay a fee-and how much would that cost? Yes, Verizon no longer waives ETFs due to moving to an area without service, so you will probably have to pay an Early Termination Fee.  Since you have a smartphone, it will probably be $350 less $10 for each month of service you have completed.  The Customer Service rep you contact about cancelling will be able to tell you the exact amount.  Would I have to go to the Verizon store I bought the phone from to do this or would I have to do this in Washington-where I am now living and having the problems? You can do it over the phone, or at a corporate Verizon store.  Help!
    -Victoria

  • Can we change system date from sql prompt

    hi everyone
    can someone tell if we can change the system date from the sql
    prompt??
    Tariq.

    I don't think that the date/time last modified is accessible.  You could use the SummaryInfo of the report to maintain this information yourself.  This is part of the RAS SDK.  There is a comments section available that you could use for this.

  • How can I export image column from SQL Server 2000

    Hi everybody,could someone tell me how can I export an entire column( pictures type) to a folder on disk?I've tried the textcopy.exe under the SQL installation's binn folder,it can only export one picture a time,I'm trying to find an automated way to export
    the whole colum's images to a folder,I'm using SQL Server 2000.

    Vishal,thanks for the replay,I've tried the BCP method but it seems does not work on my Sql Server 2000,also the SSIS package method is demonstrated with Sql Server 2008 R2 and my machine does not have the visual application to try it.In the BCP method,I
    got prompt  indicating me that I wrote something wrong in the grammer,and I'm pretty sure that maybe I made something wrong in the below part,the grammer makes me confused
    INSERT
    INTO @sqlStatements
    SELECT 'BCP "SELECT Photograph_Data FROM [ALBSCH_Trial].[dbo].[Photograph] WHERE Photograph_ID = '''
    + CAST(Photograph_ID AS VARCHAR(500)) + '''" queryout ' + @OutputFilePath
    + CAST(Photograph_ID AS VARCHAR(500)) + '.jpg -S localhost\SQLEXPRESS2008 -T -f C:\SQLTest\Images.fmt'
    FROM dbo.Photograph

  • Can I uninstall a hotfix from SQL Server 2012?

    I need to apply CU 7 to some SQL Server 2012 instances.  If something goes wrong with this, can I uninstall CU7?

    I need to apply CU 7 to some SQL Server 2012 instances.  If something goes wrong with this, can I uninstall CU7?
    If you are looking for this as rollback plan then answer is Yes. But my advice would be to perform testing of any patch in QA/Dev before rolling out to production.
    Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Cannot remove clear a job from printer queue in Windows 7 Home Premium

    printed a word document.  document prints, but does not clear out of the printer queue.  i have cancelled the print several times, but the document remains in the printer queue and reprints every time the computer is restarted.  how can i clear this job from the printer queue?
    This question was solved.
    View Solution.

    Hi,
    From the Control Panel, open Administrative Tools and select Sevices.  Browse down to the print spooler service, right click it and select Properties then click on the Stop button.  Now browse to C:\Windows\System32\Spool\PRINTERS and delete the job inside this folder - You may need to click a prompt to gain the appropriate authority to open the PRINTERS folder.
    Restart the computer and you should find the document(s) have been removed.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • New Grid Installation & Copy/Migration Of Existing Jobs From Old Grid

    Existing Setup:*
    EM Grid Control: 10.2.0.2 Hosted on Windows 2003
    Repository Database: 10.2.0.3 Hosted on AIX 5.1
    Agent: 10.2.0.2
    Monitored Databases/servers: About 90 servers/databases are monitored which are on AIX and having 10g DB version and agant installed in 10.2.0.2
    Proposed Setup:_
    EM Grid Control: 10.2.0.5 Will be hosted on AIX 6.1
    Repository Database: 10.2.0.4 Will be hosted on AIX 6.1 (different server from EM Grid control server)
    Agent: 10.2.0.5
    Monitored Databases/servers: All the existing servers + Oracle E-business Application
    We are planing to install a new grid with option of installing with existing database(New 10.2.0.4 database will be installed). Once new grid start working properly, we will stop old grid.
    During this process we don't want to stop/modify/change the existing grid jobs..
    So, My questions are:
    1) Can we have two agents (both with different OS users and having different AGENT_HOMES) on each server, which will feed to different grids? Old one will be stopped eventually.
    2) How we can copy/migrate existing jobs from old grid to new grid ?

    Can you point me towards any document or link for same.
    Any idea for copy/migration of jobs from old grid to new grid....

  • Installing New Grid & Copy/Migrate Jobs From New Grid

    Existing Setup:_
    EM Grid Control: 10.2.0.2 Hosted on Windows 2003
    Repository Database: 10.2.0.3 Hosted on AIX 5.1
    Agent: 10.2.0.2
    Monitored Databases/servers: About 90 servers/databases are monitored which are on AIX and having 10g DB version and agant installed in 10.2.0.2
    Proposed Setup:_
    EM Grid Control: 10.2.0.5 Will be hosted on AIX 6.1
    Repository Database: 10.2.0.4 Will be hosted on AIX 6.1 (different server from EM Grid control server)
    Agent: 10.2.0.5
    Monitored Databases/servers: All the existing servers + Oracle E-business Application
    We are planing to install a new grid with option of installing with existing database(New 10.2.0.4 database will be installed). Once new grid start working properly, we will stop old grid.
    During this process we don't want to stop/modify/change the existing grid jobs..
    So, My questions are:
    1) Can we have two agents (both with different OS users and having different AGENT_HOMES) on each server, which will feed to different grids? Old one will be stopped eventually.
    2) How we can copy/migrate existing jobs from old grid to new grid ?

    >
    >
    We are planing to install a new grid with option of installing with existing database(New 10.2.0.4 database will be installed). Once new grid start working properly, we will stop old grid.
    During this process we don't want to stop/modify/change the existing grid jobs..
    ---- When you the existing database option , new repository will be created with user SYSMAN.
    So, My questions are:
    1) Can we have two agents (both with different OS users and having different AGENT_HOMES) on each server, which will feed to different grids? Old one will be stopped eventually.--- You have two different agents home on each server as source to different grids.
    2) How we can copy/migrate existing jobs from old grid to new grid ?--- You can clone the database and use the cloned database jobs for your new grid. Even cloned database can be used for your new grid.

  • How can I erase a job in SM35 using the job_open and job_close functions?

    Hi!
    I call and execute a job in the SM35 transaction with the functions below, but how can I erase the job from SM35. Because when the functions are executed in the JOB_CLOSE the variable jobrele return me an 'X' that means that the job is executed but I see that the job is not erased from the transaction.
    Thanks for the help.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobgroup         = bi
          jobname          = jname
        IMPORTING
          jobcount         = jnumb
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 99.
    CALL FUNCTION 'JOB_SUBMIT'
      EXPORTING
        authcknam                         = sy-uname
        jobcount                          = jnumb
        jobname                           = jname
        REPORT                            = sy-repid
    IMPORTING
       STEP_NUMBER                        = v_step_number.
    EXCEPTIONS
       BAD_PRIPARAMS                     = 1
       BAD_XPGFLAGS                      = 2
       INVALID_JOBDATA                   = 3
       JOBNAME_MISSING                   = 4
       JOB_NOTEX                         = 5
       JOB_SUBMIT_FAILED                 = 6
       LOCK_FAILED                       = 7
       PROGRAM_MISSING                   = 8
       PROG_ABAP_AND_EXTPG_SET           = 9
       OTHERS                            = 10
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount                   = jnumb
          jobname                    = jname
          strtimmed                  = 'X'
          targetsystem               = batchsys
        IMPORTING
          job_was_released           = jobrele
        EXCEPTIONS
          cant_start_immediate       = 1
          invalid_startdate          = 2
          jobname_missing            = 3
          job_close_failed           = 4
          job_nosteps                = 5
          job_notex                  = 6
          no_release_privilege_given = 7
          OTHERS                     = 99.

    hi
    try this FM
    <b>BP_JOB_DELETE</b>
    the same  FM is also called in
    <b>
    SCMA_DELETE_JOB</b>
    plz reward if useful

  • Do we have the option to copy all the jobs from one OEM admin to other ?

    Hi Experts,
    I have a number of jobs created under one administrator account in OEM 10g. And now my requirement is to re-create these jobs under some other adminstrator User account.
    So, is there any process in OEM , where we can copy all the jobs from one user account to the other user accounts.
    I guess create like option can be only Helpful if you are planning to copy a single OEM job. And also , administrator who will copying the jobs , should have a super admins assigned so that the job is visible for him.
    So, can someone Help me out in letting me if there is a process for doing this in a single shot ?
    Thank you very much for your Help.
    Thanks,
    NAV.

    Do you need the jobs to be OWNED by the new admin or just accessible and modified? You can edit the job and grant the user Full permissions in the Access tab. Otherwise, the only option is to Create Like as you mentioned. No batch method.

  • Starting the datapump jobs from client side

    sir
    please make me understand
    datapump is server side utility means we can not invoke it from client. but in documents (oracle).
    they r talking that we can start the datapump job from client(Sqlplus) but the dmp files will be saved and the process will run on the server side
    so how can invoke the datapump from the client side (SQL Plus) ?

    user13014926 wrote:
    sir
    please make me understand
    datapump is server side utility means we can not invoke it from client.That's wrong to say and understand. The correct understanding should be that it's configured only for server side which means, that the folder where the dump files would be created would be available on a folder which must be there on the server side and over which, proper permissions must be available to you in the form of Directory object. There is no such thing that it can't be invoked sitting on the client side. It surely can but unlike the traditional export, there is no facility available anymore to give absolute file paths which would store the file on the local client machine.
    but in documents (oracle).
    they r talking that we can start the datapump job from client(Sqlplus) but the dmp files will be saved and the process will run on the server sideAll what they are saying is that since the datapump's API, DBMS_DATAPUMP , is completely exposed and is documented, it can be used by the client and as like any other package, either stored or created, can be invoked from the sqlplus session. The dump files location would indeed be on the server side only.
    so how can invoke the datapump from the client side (SQL Plus) ?As mentioned already by Srini, using the API .
    Aman....

  • Copying jobs from production to test server

    Hello,
    there are some jobs that are run at particular time in the productive system, the same jobs are not available in the test system.
    can someone tell me, how can i copy these jobs from productive to test system.
    thanks
    Arun

    Hi,
    I dont think SAP has provided any feature to copy job.
    Check the details of job scheduled in prodution & goto SM36 in Test system to create your own job with same details.
    Best regards,
    Prashant

  • Calling a function from SQL prompt that returns a record

    Hi,
    I've been trying to execute a function that is present on a different database. for eg. I am loged on to a database say 'A' and trying to execute a function present in database 'B'. this function is present in a package 'X' which has 2 functions and two procedures. From the packages i am able to execute the two procedures and one of the function.
    So i guess it is not a problem with the access permissions. The function that i am trying to call say function I has got 3 OUT
    parameters and 1 IN parameter. the Function returns a record. When i try to execute this function i get an error. Can you please let me know as to how exactly i need to call this function from the SQL prompt...
    thanx in advance
    null

    Hi Anand,
    As your function has 3 OUT parameters and it returns a record you can not just call it from SQL Plus. You need to write small PL/SQL program and use variables to hold the OUT values and the returned record.
    Good Luck,
    RajKiran
    null

Maybe you are looking for