Update statement  works in oracle RAC

Hi Experts,
How the update statement works in oracle RAC environment.
And why we need a separate redo for each instance what will happen if we wont give.
Regrds
Suneel

user1175505 wrote:
Hi Experts,
How the update statement works in oracle RAC environment.UPDATE does not know or care if it on RAC or single instance.
And why we need a separate redo for each instance what will happen if we wont give.you can't start Oracle DB without any REDO.
Handle:     user1175505
Status Level:     Newbie
Registered:     Jun 9, 2010
Total Posts:     610
Total Questions:     249 (182 unresolved)
WOW! Why do you waste your time here when you rarely get answers to your questions?

Similar Messages

  • How update statement works

    Hi all,
    can you guys help me in understanding how an update statement works in oracle...
    Thanks
    Rajesh

    i mean what happens in background in oracle server
    when i fire a update statement.The oracle server puts the old data (i.e before updation) into the RBS and then updates the rows with the new data.
    Regards
    Amit Raghuvanshi

  • How a update statement works internally in oracle

    Hi,
    I just wanted to know when a user issues a update (any DML) statement, what are all the steps involved?
    Like when user updated some statement, the modified block goes to the undo tablespace and new data will be stored in the user PGA and when user issues a commit statement.Does it delinked it from the uno tablespace and lgwr flushed the block to the redo logfile(does the lgwr also flushed the uncommited changes to the logfile as datafile stores the committed as well as uncomitted data).Can anybody suggest me how all the things work internally?

    Hi,
    Many of the people post across the same questions and lot of discussions carried out. You can you answer straight from Oracle Docs.
    Any how refer to the following below links
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:288016031632
    Update Statement-10G
    - Pavan kumar N

  • Update Statement Works Differently on Two Different Systems

    I write the code
    Data:  it_eaus like eaus occurs 0 with header line,
            wa_eaus type eaus.
    select * from eaus into table it_eaus where auszbeleg = '000000000001'  and storausz = 'X'.
    if sy-subrc = 0 .
    wa_eaus-aedat = ''.
    wa_eaus-aenam = ''.
    wa_eaus-storausz = ''.
    modify it_eaus from wa_eaus transporting aedat aenam storausz where auszbeleg = '000000000001'.
    update eaus from table it_eaus.
    endif.
    Data:  it_eausv like eausv occurs 0 with header line,
            wa_eausv type eausv.
    select * from eausv into table it_eausv where auszbeleg = '000000000001'  and storausz = 'X'.
    if sy-subrc = 0 .
    wa_eausv-aedat = ''.
    wa_eausv-aenam = ''.
    wa_eausv-storausz = ''.
    modify it_eausv from wa_eausv transporting aedat aenam storausz where auszbeleg = '000000000001'.
    update eausv from table it_eausv.
    endif.
    In One system Update Statement Updates the EAUS Table after Update Statement and
    in other system Update Statement Updates the EAUS Table after completion of all the code.
    Will you please help me on that?

    Hi Prashant,
    Thanks for your reply
    But the issue is the above code is working in one system and update the table after
    staement 
    update eaus from table it_eaus.
    But in another system it is not updated at this system it updates the record after completion on program.

  • Select statement after Update statement under autocommit with RAC

    Hi,
    I've met a problem when developing my application with 10g RAC (3 machines). I am using open jdk 1.6.0 on linux platform with kernel release 2.6.18-128.e15PAE, my app using spring with oracledatasource to establish the database connection with autocommit. The situation as below:
    my application sends SMPP requests and receives SMPP responses, when receiving SMPP responses, my app update the response details to related record in DB. For some concatenated messages, my app need to check whether all responses of the related concatenated message are received, if all received, my app update the final status of the message.
    it is found that for some concatenated messages, all responses are received successfully, i.e. can be found in the database that the details of the responses are updated, however the final status of the message is not updated as expected. After further investigations to the database records and application logs, those cannot be updated with response returning almost at the same second, however they are manipulated one by one, not multi-thread. From the log of my app, it shown the dealing of the second response is started in the same second when the dealing of the first response is completed. It seems like when dealing the second response, it cannot "see" the first response is updated such that both responses find the message is not completed.
    Wonder under what condition would this happen? my db config as below:
    <bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close">
    <property name="driverType" value="oracle.jdbc.driver.OracleDriver" />
    <property name="URL" value="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost2)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost3)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVICE_NAME=ha_bss)(SERVER=DEDICATED)))" />
    <property name="user" value="dbuser" />
    <property name="password" value="dbpassword" />
    <property name="connectionCachingEnabled" value="true" />
    <property name="connectionCacheProperties">
    <props merge="default">
    <prop key="InitialLimit">10</prop>
    <prop key="MinLimit">10</prop>
    <prop key="MaxLimit">2000</prop>
    <prop key="AbandonedConnectionTimeout">0</prop>
    <prop key="ConnectionWaitTimeout">120</prop>
    <prop key="validate-connection">true</prop>
    <prop key="validate-connection-statement">SELECT SYSDATE FROM DUAL</prop>
    <prop key="factory-class">oracle.jdbc.pool.OracleDataSourceFactory</prop>
    </props>
    </property>
    <property name="ONSConfiguration" value="nodes=dbhost1:6200,dbhost2:6200,dbhost3:6200"/>
    <property name="fastConnectionFailoverEnabled" value="true"/>
    </bean>
    thanks

    This is not likely to be a JDBC issue at all. It is likely that separate connections are being used
    for the separate threads, and they may be to different RAC nodes. You must configure your
    DBMS so there is zero latency between the nodes, else there may be some delay between
    when one node changes data and another can see it.
    HTH,
    Joe

  • Simple insert, delete and update not working after oracle 10g installation

    Hello,
    I made a new installation of Oracle 10g (10.2.0.1.0) and created a schema . Now i try to insert or update data using simple queries, but unfortunately nothing happens. I tried inserting or updating data even via sqlplus, but unfortunately the same result. Query takes infinite time to end, so i had to manually end it every time... No errors... No warnings... but takes long time... I have given all the required permissions to the schema but the same result. Can somebody help me figure out the problem?
    Tried creating a new table and the insert and delete are working fine... think the problem is with this table... Imported the rows of the table from another online database. I dont understand how this might be a problem.
    Edited by: user13333704 on Mar 15, 2011 1:26 AM

    However how do you generate awr reports and how to find the session wait?TO generate the AWR report
    sql> ?/rdbms/admin/awrrpt
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/autostat.htm#BABDHAGF
    The event column in v$session , in v$active_session_wait will show you the session wait event.What the session was actually waiting for.
    HTH
    Anand

  • Oracle RAC and Solid State Drive

    Can we use Solid state Drive with Oracle RAC as a replacement to SAN?
    Regards,
    RJiv.

    burleson wrote:
    Hi,
    Can we use Solid state Drive with Oracle RAC as a replacement to SAN?Yes, and it works especially great for RAC clusters:
    http://www.rampant-books.com/t_rssd_12_removing_bandwidth_saturation.htm
    BTW, SSD is now offered by Sun, EMC, and lots of other mainstream vendors, and the prices are falling rapidly:
    http://www.dba-oracle.com/include_ssd.htm
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference"
    http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm
    Don,
    I know you and your company has done lot of research on (RamSan+Oracle RAC), but it will be nice if you can comment on (FusionIO+RAC) solution. I know no one has used it so far, but I think it is viable, so what do you think?
    The reason why I think FusionIO is a good solution for small DBs because it's not a Flash Drive and it costs less than the other SSD solutions available in the market. Also you do not want to buy SAN for small DBs (<250 GB).
    But I am too sure about the actual configuration at this point like - gigabit vs 10 gigi NIC, type of interconnect, Fiber Channel, etc.
    So I would really appreciate if you can provide some insight.
    Thanks in advance....
    Disclaimer: I do not work for FusionIO - http://www.fusionio.com/

  • HOW UPDATE INTERNAL WORKS

    Hi,
    My question is related to the architecture. I don't find much information on google.
    The question is how Oracle update statement works on the background? My friend and myself had a debate that update works internally as delete and insert statements. It means when you run update, first it deletes the row and insert the row with new update values.
    But I don't agree his view on this.
    Can anyone of you clarify how oracle update statement works internally? Thanks in advance..
    Regards,
    Robin

    >
    It means when you run update, first it deletes the row and insert the row with new update values.
    But I don't agree his view on this.
    >
    But you didn't say what your view is!
    Generally speaking this doesn't happen unless the ROWID is changing. This can happen for an update of the partition key of a partitioned table that moves the row to a different partition (and maybe even a different tablespace and file. For that case Oracle WILL delete the record and reinsert it in the new location.
    Rows are stored in row pieces. So when a row is updated then one or more pieces have to be updated. Depending on which row piece is affected and what, if anything is in the block after that row piece the row piece may need to be moved (rewritten) to another location in the block or even to another block.
    See How Table Data Is Stored in the Database Concepts doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28318/schema.htm

  • Updating a table from Oracle Report

    This is on Report 6i. How do I achieve this? I need to pass UPDATE statement on an oracle database table based on a condition from report formula.
    Thanks,
    R

    So, there is no difficulty in this. As normal DML are working. You can perform also UPDATE/INSERT from report on your condition. So, you can use where you want.
    Or you want to know something else?
    -Ammad

  • Update statement takes too long to run

    Hello,
    I am running this simple update statement, but it takes too long to run. It was running for 16 hours and then I cancelled it. It was not even finished. The destination table that I am updating has 2.6 million records, but I am only updating 206K records. If add ROWNUM <20 to the update statement works just fine and updates the right column with the right information. Do you have any ideas what could be wrong in my update statement? I am also using a DB link since CAP.ESS_LOOKUP table resides in different db from the destination table. We are running 11g Oracle Db.
    UPDATE DEV_OCS.DOCMETA IPM
    SET IPM.XIPM_APP_2_17 = (SELECT DISTINCT LKP.DOC_STATUS
    FROM [email protected] LKP
    WHERE LKP.DOC_NUM = IPM.XIPM_APP_2_1 AND
    IPM.XIPMSYS_APP_ID = 2
    WHERE
    IPM.XIPMSYS_APP_ID = 2;
    Thanks,
    Ilya

    matthew_morris wrote:
    In the first SQL, the SELECT against the remote table was a correlated subquery. the 'WHERE LKP.DOC_NUM = IPM.XIPM_APP_2_1 AND IPM.XIPMSYS_APP_ID = 2" means that the subquery had to run once for each row of DEV_OCS.DOCMETA being evaluated. This might have meant thousands of iterations, meaning a great deal of network traffic (not to mention each performing a DISTINCT operation). Queries where the data is split between two or more databases are much more expensive than queries using only tables in a single database.Sorry to disappoint you again, but with clause by itself doesn't prevent from "subquery had to run once for each row of DEV_OCS.DOCMETA being evaluated". For example:
    {code}
    SQL> set linesize 132
    SQL> explain plan for
    2 update emp e
    3 set deptno = (select t.deptno from dept@sol10 t where e.deptno = t.deptno)
    4 /
    Explained.
    SQL> @?\rdbms\admin\utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 3247731149
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
    | 0 | UPDATE STATEMENT | | 14 | 42 | 17 (83)| 00:00:01 | | |
    | 1 | UPDATE | EMP | | | | | | |
    | 2 | TABLE ACCESS FULL| EMP | 14 | 42 | 3 (0)| 00:00:01 | | |
    | 3 | REMOTE | DEPT | 1 | 13 | 0 (0)| 00:00:01 | SOL10 | R->S |
    PLAN_TABLE_OUTPUT
    Remote SQL Information (identified by operation id):
    3 - SELECT "DEPTNO" FROM "DEPT" "T" WHERE "DEPTNO"=:1 (accessing 'SOL10' )
    16 rows selected.
    SQL> explain plan for
    2 update emp e
    3 set deptno = (with t as (select * from dept@sol10) select t.deptno from t where e.deptno = t.deptno)
    4 /
    Explained.
    SQL> @?\rdbms\admin\utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 3247731149
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
    | 0 | UPDATE STATEMENT | | 14 | 42 | 17 (83)| 00:00:01 | | |
    | 1 | UPDATE | EMP | | | | | | |
    | 2 | TABLE ACCESS FULL| EMP | 14 | 42 | 3 (0)| 00:00:01 | | |
    | 3 | REMOTE | DEPT | 1 | 13 | 0 (0)| 00:00:01 | SOL10 | R->S |
    PLAN_TABLE_OUTPUT
    Remote SQL Information (identified by operation id):
    3 - SELECT "DEPTNO" FROM "DEPT" "DEPT" WHERE "DEPTNO"=:1 (accessing 'SOL10' )
    16 rows selected.
    SQL>
    {code}
    As you can see, WITH clause by itself guaranties nothing. We must force optimizer to materialize it:
    {code}
    SQL> explain plan for
    2 update emp e
    3 set deptno = (with t as (select /*+ materialize */ * from dept@sol10) select t.deptno from t where e.deptno = t.deptno
    4 /
    Explained.
    SQL> @?\rdbms\admin\utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 3568118945
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
    | 0 | UPDATE STATEMENT | | 14 | 42 | 87 (17)| 00:00:02 | | |
    | 1 | UPDATE | EMP | | | | | | |
    | 2 | TABLE ACCESS FULL | EMP | 14 | 42 | 3 (0)| 00:00:01 | | |
    | 3 | TEMP TABLE TRANSFORMATION | | | | | | | |
    | 4 | LOAD AS SELECT | SYS_TEMP_0FD9D6603_1CEEEBC | | | | | | |
    | 5 | REMOTE | DEPT | 4 | 80 | 3 (0)| 00:00:01 | SOL10 | R->S |
    PLAN_TABLE_OUTPUT
    |* 6 | VIEW | | 4 | 52 | 2 (0)| 00:00:01 | | |
    | 7 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6603_1CEEEBC | 4 | 80 | 2 (0)| 00:00:01 | | |
    Predicate Information (identified by operation id):
    6 - filter("T"."DEPTNO"=:B1)
    Remote SQL Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    5 - SELECT "DEPTNO","DNAME","LOC" FROM "DEPT" "DEPT" (accessing 'SOL10' )
    25 rows selected.
    SQL>
    {code}
    I do know hint materialize is not documented, but I don't know any other way besides splitting statement in two to materialize it.
    SY.

  • How to install oracle rac on linux using virtualbox

    Hi,
    I have recently started working on oracle rac
    I have system with 64 bit os windows 7 installed
    core i3 processor with 6 gb of ram
    I want to install grid infrastructure on linux running as a virtual machine
    how can I install and configure it? Please help me .
    can ubuntu  work as a virtual machine for oracle rac?

    Hi,
    I suggest you use Oracle Enterprise Linux on your lab.  There are a lot of step-by-step guide to install RAC on OEL.  A good example is by Tim Hall, search Google for "Tim Hall Oracle Database RAC Installation".

  • How to configure sun application server 8.2 for Oracle RAC 10g

    Hello,
    We have numerous boxes running the sun platform application server 8.2 and 2 boxes running enterprise version 8.2 all connecting to a 4 node Oracle RAC 10 G release 2 database. We have the system up and working. The application servers are connecting just fine to the database and the apps don't have any problems querying, inserting, etc. However, when we try to do failover testing of situations when a node or nodes of the Oracle RAC database goes down the application server does not gain new valid connections. Our configuration is this, OracleDataSource for the data source, table validation turned on with a valid table, ONS configuration set in properties, connectionCache enabled, and fastconnectionfailover enabled as well in the properties. We have that long oracle rac url with load balancing turned on set fot the database URL. We have the checkbox checked to fail all connections on any failure. ONS is configured properly within the database because we have a java application that runs outside of the application server that uses all the same settings described above (only set manually in our code for the OracleDataSource). This application works seemlessly when DB nodes are shutdown. We can shutdown all but one node and it's still humming along without skipping a beat. Start up one of the others, kill the last node, it still hums along nicely without skipping a beat. We'd really like to get the applications running in the application server to work the same way. Any help would be greatly appreciated. We've tried all the combinations that we can think of with configuration settings in the application server and it never works. Am tempted to rip out the database connection pool from inside the application server and configure it manually in the code but we are using entity beans and this is the much easier approach, if it will work. It's down to the point of does sun application server actually work with oracle RAC for connection failovers.

    Hi,
    We are also facing similar execption. Here is the error, we are getting, when a node is failed on RAC.
    [#|2007-11-11T12:43:53.685+0000|WARNING|sun-appserver-ee8.1_02|javax.enterprise.system.core.transaction|_ThreadID=38;|JTS5041: The resource manager is doing work outside a global transaction
    oracle.jdbc.xa.OracleXAException
    at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1270)
    at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:318)
    at com.sun.gjc.spi.XAResourceImpl.start(XAResourceImpl.java:184)
    at com.sun.jts.jta.TransactionState.startAssociation(TransactionState.java:258)
    at com.sun.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:181)
    at com.sun.enterprise.distributedtx.J2EETransaction.enlistResource(J2EETransaction.java:397)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.enlistResource(J2EETransactionManagerImpl.java:312)
    at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.enlistResource(J2EETransactionManagerOpt.java:114)
    at com.sun.enterprise.resource.ResourceManagerImpl.registerResource(ResourceManagerImpl.java:113)
    at com.sun.enterprise.resource.ResourceManagerImpl.enlistResource(ResourceManagerImpl.java:71)
    at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:176)
    at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:268)
    at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:193)
    at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:122)
    at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:70)
    at com.syntegra.nasp.etp.dax.DBManager.getConnection(DBManager.java:192)
    at com.syntegra.nasp.etp.dax.DBManager.createDBCommand(DBManager.java:241)
    at com.syntegra.nasp.etp.dax.DBManager.createDBCommand(DBManager.java:251)
    at com.syntegra.nasp.etp.dax.sp.SPS_PRESCRIPTION_GUID_PROC.getCommand(SPS_PRESCRIPTION_GUID_PROC.java:31)
    at com.syntegra.nasp.etp.dax.sp.SPS_PRESCRIPTION_GUID_PROC.execute(SPS_PRESCRIPTION_GUID_PROC.java:23)
    at com.syntegra.nasp.etp.dax.PrescriptionBaseDataMapper.loadPresciptionByGUID(PrescriptionBaseDataMapper.java:203)
    at com.syntegra.nasp.etp.model.PrescriptionBase.findByPrescriptionGUID(PrescriptionBase.java:176)
    at com.syntegra.nasp.etp.messages.PatientPrescriptionReleaseRequest.execute(PatientPrescriptionReleaseRequest.java:120)
    at com.syntegra.nasp.etp.service.ETPSLBean.processMessage(ETPSLBean.java:159)
    at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:147)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:128)
    at $Proxy6.processMessage(Unknown Source)
    at com.syntegra.nasp.etp.listener.RequestListener.onRequest(RequestListener.java:204)
    at com.syntegra.spine.csf.consumer.mdb.CSFListenerRegisteringConsumer.onRequest(CSFListenerRegisteringConsumer.java:54)
    at com.syntegra.spine.csf.consumer.mdb.CSFConsumerBase.invokeListener(CSFConsumerBase.java:267)
    at com.syntegra.spine.csf.consumer.mdb.CSFConsumerBase.processMessage(CSFConsumerBase.java:180)
    at com.syntegra.spine.csf.consumer.mdb.CSFConsumerBase.onMessage(CSFConsumerBase.java:102)
    at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:153)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:955)
    at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:158)
    at com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:956)
    at com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:42)
    at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:130)
    at $Proxy9.onMessage(Unknown Source)
    at com.sun.genericra.inbound.DeliveryHelper.deliverMessage(DeliveryHelper.java:183)
    at com.sun.genericra.inbound.DeliveryHelper.deliver(DeliveryHelper.
    Regards
    Selvan.

  • Case in Update statement

    hi,
    How to use the case or decode statement in Update statement.

    Welcome to Oracle Technology network!
    This forum is for SQL*Developer issues - things realed directly to Oracle's SQL*Developer product. Your quesiton about CASE statements in UPDATES is a general SQL question. You will get a better answer if you close this thread and open it again in the SQL and PL/SQL forum which is for SQL questions

  • UPDATE statement in Receiver JDBC adapter

    Hi all,
    I would like to use UPDATE statement in my receiver JDBC adapter and would like to know how this UPDATE statement works in following case.
    1) If i have 10 records to be updated in database, whether Commit happens at the end of all 10 records updation OR it will be for every record update?
    Regards

    Hi,
    Then let me construct my query this way...
    i have 10 records that needs to be updated to database, say For Ex: 7 records are updated successfully and 8th record has issue in updating the table.
    In this case i would like to ROLLBACK entire 10 records with out committing any thing.
    So if i use your 2nd option, it should perform as i expected right?
    Regards

  • Update Statement Help Please

    I'm coming from the MS SQL world LOL
    and Im trying to write an update statement but in Oracle there is no INNER JOIN.
    Can you give me some advice on how to do this please?
    UPDATE employee
    SET employee.name = tmpuser.name
    FROM employee
    INNER JOIN tmpuser
    on tmpuser.emp_id = employtee.emp_id
    Thank you for you help.
    P

    Hi,
    AJR wrote:
    Frank,
    But when we are using the where condition it should update records with the matching ids. right?What your query should do is entirely up to you; I can't answer any questions about that, only you can.
    I have faced this issue earlier.
    WHERE       tmpuser.emp_id = employee.emp_idCan you explain?Not out of context. Post a complete statement.
    If this isn't directly related to user9170886's problem, then it's better to start your own thread.
    I can say a few things about UPDATE statements in general:
    The WHERE clause governs which rows will be UPDATEd. If there is no WHERE clause, all rows in the table will be UPDATEd.
    So
    UPDATE     employee
    SET     employee_name = ( <subquery> )
    ;UPDATEs every row in employee, because the UPDATE statement does not have a WHERE clause. Nothing in the sub-query can change that.
    A sub-query can reference values from its immediate parent, but a parent can't reference values from a sub-query (other than the values actually returned by the sub-query, of course).
    So
    UPDATE     employee
    SET     employee_name = ( <subquery> )
    WHERE     tmpuser.emp_id     = employee.emp_id
    ;causes an error, because there is no table called tmpuser in the main UPDATE statement. Nothing in the sub-query can change that.

Maybe you are looking for