RAC job affinity

hi,
I am trying to submit a job on a 4 instance RAC through DBMS_JOB.
I am using INSTANCE and FORCE clause to specify the affinity of my job to a specific instance.
e.g.
INSTANCE =>1
FORCE =>FALSE
Say,instance 1 was up and the job was successfully submitted.
What happens when instance 1 goes down few days down the line ?
Will the job execute next time on the next available instance or will it throw an exception?
The instance itself has been specified as FAIL_OVER = true.
I do not have RAC in my development environment to test this out.Any insights into this will be highly appreciated.
Regards,
Ravi

I don't understant what is your problem Ravi...
Case 1.
If i need running job at some specific time and I need to ensure that the job will run when DB is up (wahtever instance of RAC is up & running) then I will NOT specify the instance number in dbms_job.submit.
That means my job will be executed once by some of (rest) running instances.
Case 2.
I need running job by specific instance but when that instance will be down at specific time (time of execution) then my job (of course) will be NOT executed. In this case I will specify instance number in dbms_job.submit.

Similar Messages

  • RAC instance affinity

    Hi,
    I have a Oracle 11gR2 2-node RAC setup. One of the applications that runs on this RAC setup is a DML with large number of INSERT. I would like to restrict this application to only one node, so as to avoid the Cluster waits. With that in mind, I created a Service and assigned Node_1 in the preferred list and Node_2 in the available list -
              srvctl add service -d orcl -s orcl_ins -r Node_1 -a Node_2
    The jdbc application connect string is setup as -
              public static String dburl = "jdbc oracle:thin (DESCRIPTION_LIST=(LOAD_BALANCE=off)(FAILOVER=on)(DESCRIPTION=(CONNECT_TIMEOUT=20)(TRANSPORT_CONNECT_TIMEOUT=10)(RETRY_COUNT=3)(ADDRESS_LIST=(LOAD_BALANCE=off)(ADDRESS=(PROTOCOL=TCP)(HOST=host01-scan)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=orcl_ins))))";
    But the application when it runs still ends up with connections (equal number) on both nodes. Can you please look at this setting and help me with why the instance affinity with the service_name defined is not working?
    Appreciate you help!
    Thanks
    Lalita

    Check the services parameter on all instances you should only have the service parameter set on the preferred instance. If the service parameter is set on all instances it will register with the listener and the connection can connect to any instance. The service parameter will automatically be changed to the available instance during a failover.

  • Oracle RAC (job distribution to indivisual node)

    Is it possible in Real application cluster to dedicate set of node for insertion job and set of node for searching job and set of node for Text indexing job.

    if you use job scheduler, you may assigne each job to a separate job class and for each job class you may assign different service which will be offered by different instances in cluster. when job starts, he will connect to the service defined for job class ... and there you go...

  • RAC Interview Questions

    Hi All
    i am a newbie in RAC and wants to appear in RAC Job Interviews.
    Pls give me questions which you have ever asked.
    Regards
    Naveen Chhibber

    Hi Naveenchhibber,
    I think basic tops about architecture, backup, load balance, interconnect.
    I found good questions in this blog http://dbaanswers.blogspot.com/2007/06/sroracle-dba-racdatagaurd-interview.html
    Regards,
    Rodrigo Mufalani
    http://mufalani.blogspot.com

  • Using DBMS_JOB,SUBMIT

    Hello,
    I would like to find out how to use DBMS_JOB.SUBMIT to run a certain procedure evry morning at say 5:00 AM
    Thanks
    Doug

    Hi,
    This info. taken from oracle documentation............... For more info look in oracle Documentation. I hope this will help you.
    DBMS_JOB subprograms schedule and manage jobs in the job queue.
    This chapter discusses the following topics:
    Requirements
    Using the DBMS_JOB Package with Oracle Real Application Clusters
    Summary of DBMS_JOB Subprograms
    Requirements
    There are no database privileges associated with jobs. DBMS_JOB does not allow a user to touch any jobs except their own.
    Using the DBMS_JOB Package with Oracle Real Application Clusters
    For this example, a constant in DBMS_JOB indicates "no mapping" among jobs and instances, that is, jobs can be executed by any instance.
    DBMS_JOB.SUBMIT
    To submit a job to the job queue, use the following syntax:
    DBMS_JOB.SUBMIT( JOB OUT BINARY_INTEGER,
    WHAT IN VARCHAR2, NEXT_DATE IN DATE DEFAULTSYSDATE,
    INTERVAL IN VARCHAR2 DEFAULT 'NULL',
    NO_PARSE IN BOOLEAN DEFAULT FALSE,
    INSTANCE IN BINARY_INTEGER DEFAULT ANY_INSTANCE,
    FORCE IN BOOLEAN DEFAULT FALSE)
    Use the parameters INSTANCE and FORCE to control job and instance affinity. The default value of INSTANCE is 0 (zero) to indicate that any instance can execute the job. To run the job on a certain instance, specify the INSTANCE value. Oracle displays error ORA-23319 if the INSTANCE value is a negative number or NULL.
    The FORCE parameter defaults to FALSE. If force is TRUE, any positive integer is acceptable as the job instance. If FORCE is FALSE, the specified instance must be running, or Oracle displays error number ORA-23428.
    DBMS_JOB.INSTANCE
    To assign a particular instance to execute a job, use the following syntax:
    DBMS_JOB.INSTANCE( JOB IN BINARY_INTEGER,
    INSTANCE IN BINARY_INTEGER,
    FORCE IN BOOLEAN DEFAULT FALSE)
    The FORCE parameter in this example defaults to FALSE. If the instance value is 0 (zero), job affinity is altered and any available instance can execute the job despite the value of force. If the INSTANCE value is positive and the FORCE parameter is FALSE, job affinity is altered only if the specified instance is running, or Oracle displays error ORA-23428.
    If the FORCE parameter is TRUE, any positive integer is acceptable as the job instance and the job affinity is altered. Oracle displays error ORA-23319 if the INSTANCE value is negative or NULL.
    DBMS_JOB.CHANGE
    To alter user-definable parameters associated with a job, use the following syntax:
    DBMS_JOB.CHANGE( JOB IN BINARY_INTEGER,
    WHAT IN VARCHAR2 DEFAULT NULL,
    NEXT_DATE IN DATE DEFAULT NULL,
    INTERVAL IN VARCHAR2 DEFAULT NULL,
    INSTANCE IN BINARY_INTEGER DEFAULT NULL,
    FORCE IN BOOLEAN DEFAULT FALSE )
    Two parameters, INSTANCE and FORCE, appear in this example. The default value of INSTANCE is NULL indicating that job affinity will not change.
    The default value of FORCE is FALSE. Oracle displays error ORA-23428 if the specified instance is not running and error ORA-23319 if the INSTANCE number is negative.
    DBMS_JOB.RUN
    The FORCE parameter for DBMS_JOB.RUN defaults to FALSE. If force is TRUE, instance affinity is irrelevant for running jobs in the foreground process. If force is FALSE, the job can run in the foreground only in the specified instance. Oracle displays error ORA-23428 if force is FALSE and the connected instance is the incorrect instance.
    DBMS_JOB.RUN( JOB IN BINARY_INTEGER,
    FORCE IN BOOLEAN DEFAULT FALSE)

  • Who has to solve?

    load balancing in two rac issue............who need to solve
    is it dba or architect level?
    who has decide sga_target=
    is it archtiect or dba

    1. RAC DBA is responsible.
    Oracle RAC job role best practices
    There is a perpetual conflict between systems administrators (SAs), who traditionally manage servers and disks, and the RAC DBAs who are responsible for managing the RAC database. There are also clearly defined job roles for network administrators, who are especially challenged in a RAC database environment to manage the cluster interconnect and packet shipping between servers.
    If your DBA is going to be held responsible for the performance of the RAC database, then it’s only fair that he be given root access to the servers and disk storage subsystem. However, not every DBA will have the required computer science skills to manage a complex server and SAN environment, so each shop makes this decision on a case-by-case basis.
    Source:http://searchoracle.techtarget.com/news/2240016536/Understanding-Oracle-Real-Application-Clusters-RAC-best-practices
    2. sga_target = Since it is related to SGA so its sole responsiblity of DBA. If there is any need regarding increasing RAM, CPU Usages, IO issues and if they find out as an OS issue; then SA is responsible.
    Regards
    Girish Sharma

  • Analyze job very slow in RAC environment

    Hi,
    I have an anlyze job which runs for 3 hrs in RAC environment (9.2.0.6).
    Earlier in NON-RAC environment it used to complete in 1 hrs.
    Need help in solving this issue.
    Ajoy Kumar Thapa

    hi,
    This database is used for query purpose mainly.
    we do huge data load during weekend into one of the table.
    This table is then exchange with one of the partition of a huge partitioned table.
    after that analyze job runs on this partitioned table.
    The command we use for analyze is given below:
    DBMS_STATS.GATHER_SCHEMA_STATS
    ownname => '<owner_name>'
    ,estimate_percent => 05
    ,cascade => true
    ,degree => 4
    ,granularity=>'ALL'
    I want to know, what can be the reason, this job, which runs fine in NON-RAC environment, is taking so long in RAC enviroment.
    Any help is highly appreciated.
    Ajoy Kumar Thapa

  • Running an external job at the specific node out of a 2 Node RAC database.

    Hi. all.
    I created a job , which runs an external script, by using dbms_scheduler.
    Our database is 2 node RAC database(10.2.0.2.0).
    The external script exists at a only one Node(Node 1).
    select status,instance_id, additional_info
    from dba_scheduler_job_run_details
    where job_name='TEST_EXPORT_JOB'
    shows that jobs which run on Node 2 failed.
    Of course, the external script does not exist on Node 2.
    I would like to force the job to ALWAYS run on Node 1.
    How can I do that? Is there any ideas?
    Locating the script on Node 2 is not the option.
    Best and Regards.

    Hi,
    In the upcoming 11g release there is an easy solution for this - a new attribute instance_id for a job.
    For 10g there is a workaround. Basically you create a service with just the one instance you want the job to run on. Then create a job class pointing to that service. Finally have your job be in the job class you just created.
    If you create a service and job class per instance you can get jobs to run under whichever instance you want.
    Hope this helps,
    Ravi.

  • Dbms_schduler job is not running on a 2 node rac when 1st node fails

    Hi,
    I want to create a dbms_scheduler job in a 2 node RAC and the job should always run on the node1 and if node1 is down then it should run on node2. This is Oracle 10gR2 (10.2.0.3 in WINDOWS) .In order to do the same I did following
    -- First Step
    Using DBCA- Service Managment - Created a service (BATCH_SERVICE) and given node1 as preferred and node2 as available. This created following entry in tnsnames.ora in both nodes.
    BATCH_SERVICE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = BATCH_SERVICE)
    (FAILOVER_MODE =
    (TYPE = SELECT)
    (METHOD = BASIC)
    (RETRIES = 180)
    (DELAY = 5)
    --- Step 2
    -- Created BATCH job classes.
    BEGIN
    DBMS_SCHEDULER.create_job_class(
    job_class_name => 'BATCH_JOB_CLASS',
    service => 'BATCH_SERVICE');
    END;
    -- Step 3 -- created a job using job_class as BATCH_JOB_CLASS
    begin
    dbms_scheduler.create_job(
    job_name => 'oltp_job_test'
    ,job_type => 'STORED_PROCEDURE'
    ,job_action => 'schema1.P1'
    ,start_date => systimestamp at time zone 'US/Central'
    ,repeat_interval => 'FREQ=DAILY;BYHOUR=11;BYMINUTE=30;'
    ,job_class => 'BATCH_JOB_CLASS'
    ,enabled => TRUE
    ,comments => 'New Job.');
    end;
    Now when I monitor this job it runs on node1. Now I started testing for failover. I manually shutdown 1st instance. Then as per my understanding job should run on 2nd node. But job is not picking up.
    when I run the followign command
    srvctl status service -d db -s BATCH_SERVICE
    service BATCH_SERVICE is running on instance node2.
    Any help is really appreciated.

    It does not show that whether job is running or broken.

  • PCP with RAC simulation of node affinity in EBS 12.0.6

    Hi ,
    We are on 12.0.6 with sindle node database with PCP configured.
    Migrating to 2 node RAC with 12.0.6 with PCP.
    Architecture is
    3 node application tier
    2 node RAC DB.
    all middlet tier services are enabled on the all 3 app nodes. concurrent managers are distrubuted across the 3 application nodes.
    Is any way that we can cofigure the managers running on a particular node should always connect to specific RAC instance.
    In 12.1.1 it is RAC affinity but in 12.0.6 how do we achvie it.
    Please advice. Your help is highlt appreciate.
    Thanks
    Jana.

    also as mentioned by Srini, even Oracle as suggested the same method when I raise a SR,
    From note: 1070621.1
    What is being requested is called Request Instance Affinity or Node Affinity. This feature is available on EBS Release 12.1.1; see Note 566521.1 "Oracle Application Object Library Release Notes, Release 12.1.1" and Note 1129203.1 "How to run a concurrent program against a specific RAC instance with PCP/RAC setup?"
    This feature is not available on earlier releases of EBS, however. As per a Concurrent Processing Developer the same effects can be simulated:
    "If configured for RAC and the manager(s) connect to a specific instance ONLY (meaning not using _balance), then setup a manager to run on a particular node and connecting to a particular instance. That means, make certain the program runs on that manager only by inclusion / exclusion rules."
    Thanks
    Jana

  • DBMS_SCHEDULAR JOB STICKINESS ON PARTICULAR NODE IN RAC

    Hi All,
    I am using 10g rac . We have scheduled gather stats on node 1 from OEM with instance stickiness is False.
    but it is  running on node2  sometimes  . When it runs on node 2 , node 1 is up and running with lightest load.
    I am confused why it is running on  node 2?
    Please help me out what are the possibilities for this issue.
    Thanks,
    Roopesh

    Doc for 10g say about instance_stickiness this:
    instance_stickiness
    This attribute should only be used for a database running in RAC mode. By default, it is set to TRUE. If you set instance_stickiness to TRUE, jobs start running on the instance with the lightest load and the Scheduler thereafter attempts to run on the instance that it last ran on. If that instance is either down or so overloaded that it will not start new jobs for a significant period of time, another instance will run the job. If the interval between runs is large, instance_stickiness will be ignored an the job will be handled as if it were a non-sticky job.If instance_stickiness is set to FALSE, each instance of the job runs on the first instance available.
    For non-RAC environments, this attribute is not useful because there is only one instance.
    So check you job repeat_interval.

  • Job Chain in RAC Environment

    Hi,
    i've a job chain defined in a RAC environment.
    I need that all the steps of my chain are performed on the same instance.
    How can i do this?
    Now stepA run on the instance 1 and stepB run on the instance 2.
    Thanks.

    Again, If it is a file system write issue, use ACFS (11.2.0.x) to create a shared file system that all nodes can see. What are you using to delete/create these files? A shell script?
    1) create an ACFS file system of sufficient size to handle your data
    2) mkdir /some/acfs/location
    3) using sqlplus create a database directory " create directory foo as '/some/acfs/location' "
    4) put the file in this location
    5) use UTL_FILE to delete AND create the file (see fremove() - http://docs.oracle.com/cd/E11882_01/appdev.112/e10577/u_file.htm)

  • Job Scheduling on Oracle 10g RAC

    Hi,
    If I want to run job on Oracle 10g RAC database having 2 instances suppose n1 and n2 separately and both instances are working/using same Service Name then how could i do this ??
    or how to use SID instead of Service Name in Job Class ???
    Please guide..... Replay awaited...........

    Priyanka,
    If you are a newcomer to the DBA, I would strongly suggest to invest at least time(if not money for training) in reading documentation related to fields in which you are working. For RAC, this should be a good start( V10.2) ,
    http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/toc.htm
    can we use these dynamic views in Procedure The counter question is, why? What exactly are you trying to accomplish? If you can tell us this, there may be a better way we may suggest doing that thing?
    Aman....

  • Jobs in RAC

    Hi
    I have a job created in my RAC database. I want my job always run from Node2. How I can set this ?
    Thanks

    11gR1. I forgot to show here the version. I already found the answer. With the attribute ( INSTANCE IN BINARY_INTEGER DEFAULT 0, ) I can do it.
    dbms_job.submit(
    JOB OUT BINARY_INTEGER,
    WHAT IN VARCHAR2,
    NEXT_DATE IN DATE DEFAULT SYSDATE,
    INTERVAL IN VARCHAR2 DEFAULT 'NULL',
    NO_PARSE IN BOOLEAN DEFAULT FALSE,
    INSTANCE IN BINARY_INTEGER DEFAULT 0,
    FORCE IN BOOLEAN DEFAULT FALSE);
    Thanks

  • How to get dbms_scheduler to run jobs on different RAC nodes

    lets say I have 3 jobs and I want to run each on different RAC nodes. How do I do this?

    Hi,
    Pierre's response shows the easiest way to do this on 10g (create a service for each instance, then a job class for each service, then assign jobs to specific job classes).
    In 11g there is a more direct method, you can just set the INSTANCE_ID attribute of a job using dbms_scheduler.set_attribute.
    Note that for PL/SQL jobs Oracle recommends using services instead of instance ids because they provide better availability if one instance goes down or has to be taken down.
    Hope this helps,
    Ravi.

Maybe you are looking for