ORA says NO DATA FOUND
Linked servers always have a surprise error hidden under its selvee, Managing these issue magnets is a huge task for a DBA , recently i was stumbled upon a same suprise invloving a oracle linked server.
The linked server "oracle_db" is present on my prod db server essentially for select and insert purposes, Developers tested the linked server with couple of select querries and all was fine until the deployed a procedure on server and executing the same gave a alien error
OLE DB provider "OraOLEDB.Oracle" for linked server "oracle_db" returned message "ORA-01403: no data found"
inspecting the code it was seen that the table from linkedserver was directly involved in a " inner join" and other joins ,re running the same satement produced the given error . The code snippet was pinned, diagnosis and resolution was underway
After a thorogh R&D it was found that either taking the whole oracle side output into a #Temp table and then using that #temp table in join would solve it and other was using join hints.
Join Hints helps sql server to enforce a join between two tables. As being a remote query involved in the troublesome part of code the Join Hint 'Remote' fit the discription well.
Remote Join Hint specifies the join operation is performed on the server of the right table, useful when the left table is a local table and the right table is a remote table.
- If the right table is local, the join is performed locally.
- If both tables are remote but from different data sources, REMOTE causes the join to be performed on the site of the right table.
- If both tables are remote tables from the same data source, REMOTE is not required.
REMOTE can be used only for INNER JOIN operations. we used the REMOTE clause in the query where the oracle table was called and it worked smoothly.

Comments
Post a Comment