I am using oracle 12c. We have an oracle view ALL_SCHEUDLER_JOBS. As we will loosing the access to this table, I create a view on it as below :

the below function is placed inside a package called PCK_SUP which is in SCH1

function read_scheduler_jobs return t_scheduler_jobs pipelined
    l_scheduler_jobs all_scheduler_jobs%ROWTYPE;
    cursor c
    is select * from all_scheduler_jobs where owner in ('SCH1', 'SCH2');
      open c ;
        fetch c into l_scheduler_jobs;
        exit when c%NOTFOUND;
        pipe row(l_scheduler_jobs);
      end loop;
      close c;
    end read_scheduler_jobs;

create or replace view vis_scheduler_jobs as

We have two schemas SCH1 and SCH2. I created the above function and view in SCH1. If I run "select distinct owner from ALL_SCHEDULER_JOBS", I can see both SCH1 and SCH2. But, when I do the same from VIS_SCHEDULER_JOBS, I cannot see SCH2. I only see SCH1.

Thanks for your help

2 Answers 2


Creating this custom view makes no sense. The view ALL_SCHEDULER_JOBS is accessible to everyone. You will not lose access to it, so creating VIS_SCHEDULER_JOBS is just pointless. ALL_SCHEDULER_JOBS lists the jobs the current user can access. You may lose access to the jobs, but not to ALL_SCHEDULER_JOBS view.



If the Permission for the ALL_SCHEUDLER_JOBS is removed, i guess you will not be able to access inside the function as well. So make sure that the function is created in a schema that has the access to ALL_SCHEUDLER_JOBS and provide an execute privilege to SCH1 schema.

  • I did select distinct owner from ALL_SCHEDULER_JOBS. it will give you both the owner. Please check again the description. You can try and see that. May 30, 2019 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.