How to run a scheduled task in specific (current) edition

11.2.0.3

I use redefinition of the basis for the development of a database. So far, the experiences have been good with it.

We have three editions: ORA$ BASE = > BETA = > ALPHA

BETA is the default edition. Development of new packages for this in ALPHA and then copied to the BETA and ORA$ BASE.

We now want to carry out certain activities of pl/sql running for a long time as a background task.

However. When we create a job regular db in ALPHA, it will run in the DEFAULT edition (BETA).

I want to run a scheduled task in the same edition, where it was created from.

It is a way to run configure a job normal regular db to execute in a specific edition?

Example/demo

-- test case run dbms_job as background 
execute dbms_application_info.set_module('UT10_START_SESSION',null);
execute dbms_application_info.set_client_info(sys_context('userenv','current_edition_name'));

This test of construction scenario helped me narrow down the problem and find a solution.

I need to perform the task with a dedicated job class. Job classes can add a service_name. The name of service in turn can be connected to a specific edition.

first prepare the job classes

---Run as DBA
begin
  dbms_scheduler.create_job_class (
   job_class_name => 'JCED_DEV$ALPHA',
   service        => 'ALPHA'
   );
end;
/

begin
  dbms_scheduler.create_job_class (
   job_class_name => 'JCED_DEV$BETA',
   service        => 'BETA'
   );
end;
/

begin
  dbms_scheduler.create_job_class (
   job_class_name => 'JCED_ORA$BASE',
   service        => 'BASE'
   );
end;
/

grant execute any class to targetuserschema;

Service names were already in place (you can use dbms_service to create a service based from version 11.2.0 edition.3).

-- test case run dbms_job as background
declare
  v_jobname   varchar2(30) := 'TestEditioning_UT10' ;
  v_starttime timestamp := systimestamp;
begin
  dbms_scheduler.create_job(job_name            => v_jobname,
                            job_type            => 'PLSQL_BLOCK',
                            job_action          => q'[begin
  dbms_application_info.set_module('UT10_BACKGROUND_SESSION',null);
  dbms_application_info.set_client_info(sys_context('userenv','current_edition_name'));
  dbms_lock.sleep(60);
end;
]',
                            job_class           => 'JCED_'||sys_context('userenv','current_edition_name'),
                            number_of_arguments => 0,
                            start_date          => v_starttime,
                            enabled             => FALSE,
                            auto_drop           => true);

  dbms_scheduler.enable(v_jobname);
end;
/
commit;

SID CLIENT_INFO SERVICE_NAME LOGON_TIME ACTION MODULE

250 UT10_START_SESSION DEV$ ALPHA ALPHA 17.07.14 10:28:32

251 UT10_BACKGROUND_SESSION DEV$ ALPHA ALPHA 17.07.14 16:23:26

Success!

Tags: Database

Similar Questions

  • whenever I start my pc it automatically opens the disc clean up, I don't want that. How to stop this scheduled task?

    whenever I start my pc it automatically opens the disc clean up, I don't want that. How to stop this scheduled task?

    Ive tried to delete, but I don't think that it wrks. It appears again on the performance of the tasks. I actually put it to daily nd now I can't undo this action. is it possible to change the disc clean up [Settings?] I can't find it. Ive tried properties, but it will not let u

    Hello

    read this information on the Defender:

    ·                         If you use microsoft security essentials avg avira mcafee norton etc they disable the vista version of windows defender by default

    the basics of Microsoft security has its own version of windows defender

    and other anti-virus programs use their own particular type of application to scan for spyware and malware

    It of nothing to worry and is the default action, which is designed for them to do

    and if you need to change startup programs read this information on the other methods of doing it without using defender

    using msconfig read this tutorial:

    How to use MSCONFIG in Windows Vista

    Here's how to use MSCONFIG in Windows Vista to disable some unnecessary programs that load automatically at startup

    http://netsquirrel.com/Msconfig/msconfig_vista.html

    and also try this FREE program Autoruns:

    This utility, which has a knowledge of auto-starting locations of any startup monitor, shows you what programs configured to run at system startup or login and that the entries in the order of processing windows. These programs include those in your startup folder, Run, RunOnce, and other registry keys. You can configure Autoruns to show other locations, including Explorer shell, toolbar extensions, helper objects to the browser, Winlogon notifications, auto and many start-up services more

    http://TechNet.Microsoft.com/en-us/sysinternals/bb963902

  • services that run via scheduled task

    Hi all

    I am creating a task scheduled to start/stop services. the scheduled task must be run under the service account with minimal rights, as rights of the user or the user rights of maximum power.
    I created the scheduled task running under the account of service with power user rights to stop a service, but unfortunately the task was doing what it suppose to do.
    I did some troubleshooting and investigated as shown below:
    1. I used the runas command to run net stop under the service account that runs the scheduled task, the service is stopped, as it is assumed
    2. I connect to the server using the account service and disconnected (the session will be shown in the disk for the service account) and at the same time open a session to the server with a different account performed the scheduled task, the task does what it is supposed to do. (the service is stopped)
    Note: the scheduled task is set to enabled (scheduled task to run at a specified time)
    3 when I changed the rights on behalf of rights of administrator power user rights service and perform scheduled task, the task runs correctly and does what he must do.
    4. the service was set to be managed by the user with power, which means that if a user opens a session on the server and try to start/stop the service, he will be able to action and is successful.
    my questions will be as shown below:
    1. to start/stop the service via a scheduled task, the service account needs a session to be able to perform the task?
    2 must. the service account the highest privileges to perform the task?
    3. is there a way to avoid to run the scheduled task to run with minimum privileges? What kind of things need to be done.
    Thanks in advance for your answer.

    I would look at the link below.  This should answer all these questions.

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/sag_tsconcepts03.mspx?mfr=true

  • IOM api to run a scheduled task

    Hello

    I use OIM 11.1.2.2.

    I run a scheduled task with the api and a failed idea. I saw this api Thor.API.Operations.tcuserOperationsIntf and that have what I need.

    Can you help me?

    SchedulerService (Oracle Fusion Middleware Java QAnywhere for Oracle Identity Manager), APIs will do it.

    triggerNow

    void triggerNow(java.lang.String jobName) throws SchedulerException, SchedulerAccessDeniedException
    
    Runs the specified job
    Parameters:
    jobName-The work that needs to be triggered
    Throws:
    SchedulerException -when an error occurs in the Quartz engine or Scheduler is not running.
    SchedulerAccessDeniedException -This exception will be thrown if the access permission for the operation is not available for the user

    -Kevin

  • How to force the display of user account control to run the scheduled task

    I have User Account Control setting on notify me when a program wants to make changes to my computer (the recommended setting).

    I created a scheduled task: create a restore point, using a software called Quick Restore Maker. User accounts in the program control screen comes up and stays on, ends by closes but ends the program. As I'm not at the computer when running task, I can't cancel the screen. The display ends by disappears, but the program itself does not run.

    So the question is: How can I force screen UAC a program to run without changing the UAC universal computer settings that would allow any program to change my computer without any intervention from me?

    Thanks for your help.

    There is no way around the need for approval of Admin indicated by the parameter of the UAC.

    Reduce the level of UAC would be the only thing you can try, but I understand that this would not be a safe way to proceed for normal operation.

  • How to get a scheduled task to run when disconnected, but do not run hidden

    Under XP, I had an installation where I created a scheduled task to open a playlist of music at 07:00 every day which was basically I woke up.  In the evening, I would put my computer to sleep and in the morning, the scheduled task would automatically wake the computer, log in my user account and open the playlist with my music program.   In Windows 7, it's is not possible because:

    1. If I put the "execute task if the user is connected or not," the music program opened by the task is hidden, and I can't control or turn off the music player, because it is hidden.

    2. If I put the task 'Run only when the user is connected', the music player is is more hidden when it is launched, but it does not work in my situation because my computer is configured to automatically disconnect when it goes into sleep mode, and which is usually the case when I want the scheduled task to run.

    It worked perfectly well under XP but under Windows 7 it is broken, because, for some reason if a scheduled task is set on "Run If the user is logged in or not ', the window opened by the scheduled task is always hidden.  This was not the case in XP.  Why is this the case in Windows 7, and is there a way to make it work like it did in XP?

    It's a real shame, because it worked perfectly under XP without the need of any additional software overhead.

    It is the same for Vista. The cause is SECURITY!

    Learn more about it here:
    http://windowsteamblog.com/Windows/b/developers/archive/2009/10/01/session-0-isolation.aspx

    André

    "A programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/

  • How to make a scheduled task to close after 5 minutes?

    I have a program that should run for a minute or two, but sometimes crashes.  I created a scheduled task to run every hour, 10-minute course.  Everyonce in a while, however, he crashes and prevents it from running again the next time.  How can I stop the program after 5 minutes?

    Hello

    1. Are what program you referring?
    2. What scheduled task you are trying to run for each hour, 10-minute courses?

    You will get an adjustment to close the task if it runs for more than an hour.

    I suggest you try these methods and check the status of the issue.

    Method 1:

    I would say allows you to delete a scheduled task, restart the computer and re-scheduled task and check the status of the issue.

    Schedule a task.

    http://Windows.Microsoft.com/en-us/Windows7/schedule-a-task

    Method 2:

    Keep the computer in a clean boot and check the status of the issue.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7.

    http://support.Microsoft.com/kb/929135

    Note: Please, go to step 7 of the Kb to maintain the computer to a normal startup after you fix the problem.

  • Permission to create/run the scheduled task

    Hello

    I'm running Windows 7 Pro RTM and I try to use my normal user account to create and run a new scheduled task, but whenever I try to save the task, I get an error msg saying "Task Scheduler cannot create the task.» Does not know the user account, the password is incorrect or the user account doesn't have permission to create this task".

    I have no problems running tasks under my admin account, but I don't want to use it for everyday purposes. I'm also sure that this error must be because of permissions problems, so can I know what is the privilege that a user must have to create/run one account task?

    Thank you very much

    Hi hifer,.

    Please use the forum for answers,

    If your account is a standard account, you will not have permission to create a task or schedule task.  Your account must be an administrator account to schedule the task for the system or it must be run as an administrator.

    It have additional permissions, you can add standard user profile to allow the profile to create the task.  But this option is not available in all versions of Windows and rather complicated.  You can try to add these groups to your profile using computer management in administrative tools.  User with power and Backup administrator can provide you with the authorization that you need if the groups are available with your version of Windows 7.

    Hope this helps,

    Kevin
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Impossible to run a scheduled task of PowerCLI on Windows 7

    Hello

    I try to perform a task of scehduled on Windows 7...

    What I tried:

    AgConfigVirtual.bat

    C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe - PSConsoleFile "C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\vimaxx.psc1"-command '& {C:\VMware\AgConfigVirtual.ps1} '.

    vimaxx.psc1 (necessary to create another as the other file was giving me an error on the psmodules section, so I removed the in this new file)

    <? XML version = "1.0" encoding = "utf-8"? >

    < PSConsoleFile ConsoleSchemaVersion = "1.0" >

    < > 1.0 PSVersion < / PSVersion >

    < PSSnapIns >

    < PSSnapIn Name = "VMware.VimAutomation.License" / > "

    < PSSnapIn Name = "VMware.DeployAutomation" / > "

    < PSSnapIn Name = "VMware.ImageBuilder" / > "

    < PSSnapIn Name = "VMware.VimAutomation.Core" / > "

    < / PSSnapIns >

    < / PSConsoleFile >

    AgConfigVirtual.ps1

    $pwd = get-Content C:\VMware\powerclicred | ConvertTo-SecureString

    $cred = New - Object System.Management.Automation.PSCredential 'user', $pwd

    SE connect-VIServer-Server Server1 Server2, serveur3, server4, Server5-Credential $cred

    $ESXiServers = get-VMHost | Name sort

    $Excel01 = new-Object - ComObject Excel.Application

    $Excel01.Visible = $False

    $Workbook01 = $Excel01.Workbooks.Open("Z:\Servers\ConfigVirtual.xlsx")

    (rest of the script)...

    Ok... When I opened a cmd and run beats, it works normally... connection to all servers and then run Excel to do the rest of the script.

    When I schedule it, it just does not take into account the part of connection and opens the Excel process...

    What I am doing wrong?

    PS: The user has permissions to run as a batch process

    LucD,

    Thanks for your time and your attention =]

    I got it to work... There is a bug when opening Excel using PowerShell files scheduled tasks...

    All I had to do is create the Desktop folder on the recommended way and work for the task.

    Sources:

    Excel - Powershell script cannot access a file when it is run as a scheduled task - Stack Overflow

    https://social.technet.Microsoft.com/forums/WindowsServer/en-us/aede572b-4c1f-4729-bc9d-899fed5fad02/run-PowerShell-script-as-scheduled-task-that-uses-Excel-COM-object?Forum=winserverpowershell

    Thank you once again!

  • Need to update a user existing in the IOM by running the scheduled task.

    Hi all

    I configured the GTC connector for flat file with which I am able to create users in the IOM successfully. Here is an example of flat file

    ##hRDB
    UserID, firstname, lastname, Manager, EmployeeType, Org, role, service, location, position
    AWinslet, Aate, Winslet, null, full-time, Xellerate users, end-user, engineering, Mumbai, Software Engineer

    and now, I'm not trying to update service user attribute by changing (financial engineering) Department in a flat as file below.

    ##hRDB
    UserID, firstname, lastname, Manager, EmployeeType, Org, role, service, location, position
    AWinslet, Aate, Winslet, null, full-time, Xellerate users, the end user, finance, Mumbai, Software Engineer

    When I ran a task scheduled for the resource to flat file GTC I get below error.


    WARN, January 5, 2011 23:26:29, 354, [XELLERATE. DCM PROVIDER. RECONCILIATIONTRANSPORT], FILE ARCHIVED successfully: C:\HRFeed\staging\identities 20110105.txt
    ERROR, January 5, 2011 23:26:34, 588, [XELLERATE. SERVER], class/method: tcUSR/verifyUserLogin error: User Loginid is doubled.
    ERROR, January 5, 2011 23:26:34, 744, [XELLERATE. SERVER], class/method: tcUSR/eventPreInsert error: user login is not correct.
    ERROR, January 5, 2011 23:26:34, 760, [XELLERATE. SERVER], class/method: tcDataObj/save error: wrong to save SQL operation
    ERROR, January 5, 2011 23:26:35, 088, [XELLERATE. DATABASE], class/method: tcDataBase/rollbackTransaction some problems: Rollback performed
    java.lang.Exception: Rollback performed

    Errors, that I got to know which scheduled task to the resource of flat file GTC tries to create the new user but not to update existing user. I want to update the attributes of the user for existing users by running the flat file GTC

    Please provide your valuable contributions

    Kind regards
    Madhu

    Check the indicator "Matching" only in the management section BMS. This indicator is as a rule of reconciliation and should be checked for the primary key for example attribute emp number or the connection. Please let me know if the corresponding flag setting is correct in your environment.

  • Running the Scheduler tasks.

    Hello friends,

    How to find currently running tasks scheduled with query!

    --
    Kind regards
    Pradip Patel

    Select * from dba_scheduler_running_jobs;

  • How to use the scheduled tasks in Windows Vista Home Premium 64-bit?

    We bought a new computer with Windows Vista, at our previous computer (Windows XP) planned to tasks in the control panel to stop future elements at the start of the system, how to keep the elements that it slows down my computer to come at the start of the system

    1. use Windows Defender to manage startup programs.

    2. http://netsquirrel.com/msconfig/msconfig_vista.html

    Read the above info.

    3 use this program:

    http://TechNet.Microsoft.com/en-us/sysinternals/bb963902.aspx

    This utility, which has a knowledge of auto-starting locations of any startup monitor, shows you what programs configured to run at system startup or login and that the entries in the order of processing windows. These programs include those in your startup folder, Run, RunOnce, and other registry keys. You can configureAutoruns to show other locations, including Explorer shell, toolbar extensions, helper objects to the browser, Winlogon notifications, auto and many start-up services even more. Autoruns goes way beyond the MSConfig utility bundled with Windows Me and XP.

    4. go into each program > tools > Options > see if you can disable the startup when Windows starts.

    See you soon.

    Mick Murphy - Microsoft partner

  • How to create the scheduled task oracle

    DECLARE
    jobno NUMBER;
    BEGIN
    SYS. DBMS_JOB. Send
    (work = > jobno)
    , this = > 'DEL_HIST_TABLE ';
    , next_date = > to_date (September 4, 2009 18:23 ',' dd/mm/yyyy hh24:mi:ss')
    , interval = > 'null '.
    , no_parse = > TRUE
    );
    SYS. DBMS_OUTPUT. Put_line (' job number is: ' | to_char (jobno));
    END;
    commit;


    I wrote the above work to operate on specific date and time

    but I want to convert the same to run

    everyday @ 01:00 using oracle 10 g

    Published by: [email protected] on May 17, 2009 23:39

    Hello

    You must set the interval then:

    MHO%xe> select trunc(sysdate) + 1/24 + 1 from dual;
    
    TRUNC(SYSDATE)+1/24
    -------------------
    19-05-2009 01:00:00
    
    1 rij is geselecteerd.
    
    MHO%xe> DECLARE
      2  jobno NUMBER;
      3  BEGIN
      4  SYS.DBMS_JOB.SUBMIT
      5  ( job => jobno
      6  ,what => 'begin null; end;'
      7  ,next_date => to_date('09/04/2009 18:23:00','dd/mm/yyyy hh24:mi:ss')
      8  ,interval => 'trunc(sysdate) + 1/24 + 1'
      9  ,no_parse => TRUE
     10  );
     11  SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(jobno));
     12  END;
     13  /
    Job Number is: 21
    
    PL/SQL-procedure is geslaagd.
    
    Verstreken: 00:00:11.39
    MHO%xe> commit;
    
    Commit is voltooid.
    MHO%xe> select interval from user_jobs where job = 21;
    
    INTERVAL
    ----------------------------------------------------------
    trunc(sysdate) + 1/24 + 1
    
    1 rij is geselecteerd.
    

    Published by: hoek on May 18, 2009 08:49 added to example

  • [SOLVED] How to completely stop scheduled tasks?

    In Windows XP, there is an option to stop regular tasks completely witout changing setting of the task.

    However, I can't find this option in window 7, does anyone have any suggestions?

    I get 2 more sets of tasks on different countries. in window 7, will stop certain tasks in country A and I activate certain tasks, while I find in country B.  Y at - he features on the establishment of group in tasks planned for window 7?

    Does anyone have any suggestions?

    Thanks in advance for your suggestions

    Perhaps, I try the following approach instead, which is easy, sort by name to enable / disable using the same account.

    Task of 1000 US

    Task 1200 US B

    CA 1100 task has

    CA 1300 task B

    Thanks a lot for the suggestions

  • Discoverer privileges to run a scheduled task

    Hello
    Planning a workbook, but when it's time to run, I get the error "not enough priivileges.
    Should what privielges I do?

    Thank you for your help

    Siegwin

    Hello

    It would also be the user doesn't have the required database privileges. For a user who is planning they need these privileges:

    connect
    resources
    analyze a
    Create the procedure
    create sequences
    create session
    create table
    create view
    run a procedure
    global query rewrite
    Select any table
    Unlimited tablespace
    run on sys.dbms_job
    Select on sys.v_$ parameter

    Rod West

Maybe you are looking for

  • Why the TB think the 0Auth2 problem is fixed at 38.1.0

    I put on 38.0.1, then I rebooted. I changed to "do not allow", then tried to retrieve messages. I always get the mossage error ridiculously inappropriate to have the wrong password. I had to change to 'allow' to retrieve messages. The release notes f

  • HP dv4 1506tx: upgrade to windows 7-10 laptop

    How to upgrade my cnd94627d3 hp windows 7 to windows 10, kindly asist... as it is downloaded in my computer, but does not update and install here

  • Satellite A105-S4254: several keyboard keys stop working after startup

    Hey I have a laptop A105-S4254, which is less than a year.When I boot it upward a few minutes most of the keys stopped working.The F keys will however continue to work.I can laugh with the brightness and activate / disable the num lock and scroll but

  • Sansa view 8 GB and firmware update

    HI I am a newbie so sorry if this has been posted before, I used my sansa view 8 gb mp3 and added lots of music, he loved, in any case now I decided to download the firmware update when I made it to my pc with windows 7, my mp3 player has been assign

  • MD3200i storage - battery has failed

    Buon giorno, Service Tag BSFHG42, pulito in co by single party di ricambio. Riporto sui sotto dal Storage Manager error: Storage array: MD3200i_01 Component problem statement: battery Status: failed Location: Box RAID 0, RAID at location 0 controller