I got the reason why its behaving like this. PS below demoQuote:
Originally posted by nir_s
Still does not working:
SQL> desc VW_HADAS_KABLANIM;
ERROR:
ORA-02019: connection description for remote database not found
Actually Desc is taking the table name from the datadictionary of the remote DB and describing the current DB table.Code:SQL> alter table emp3 rename to emp;
Table altered.
SQL> select * from dba_synonyms where synonym_name='TEST_DESC'; -- Synonym Test_Desc created as test_desc@oemrep
OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME DB_LINK
------------------------------ ------------------------------ ------------------------------ ------------------------------ -------------------------
PUBLIC TEST_DESC TEST_DESC OEMREP
SQL> desc emp -- Current DB
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
ID NUMBER
EMP_NAME VARCHAR2(11)
ADDRESS VARCHAR2(100)
NICK_NAME VARCHAR2(15)
SQL> desc test_desc -- this is describing current DB's emp table ( but table name taking from remote DB )
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
ID NUMBER
EMP_NAME VARCHAR2(11)
ADDRESS VARCHAR2(100)
NICK_NAME VARCHAR2(15)
SQL> select * from dba_synonyms@oemrep where synonym_name='TEST_DESC'; -- Remote DB's synonym Test_Desc
OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME DB_LINK
------------------------------ ------------------------------ ------------------------------ ------------------------------ -------------------------
SCOTT TEST_DESC SCOTT EMP
SQL> desc test_desc@oemrep -- This will give you correct description coz u r using @
Name
----------------------------------------------------------------------------------------------------------------------------------------------------
EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
SQL> desc emp@oemrep -- Table on remote DB.
Name
----------------------------------------------------------------------------------------------------------------------------------------------------
EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
SQL> select count(*) from emp; -- Current DB count
COUNT(*)
--------------------
1000001
SQL> select count(*) from test_desc; -- Giving correct results as that of remote DB.
COUNT(*)
--------------------
14
SQL> select count(*) from emp@oemrep;
COUNT(*)
--------------------
14
SQL> alter table emp rename to emp3;
Table altered.
-- Now i desc the synonym
SQL> desc test_desc
-- Other oracle DB goes down...saying windows has generated errors for Oracle.exe.
Atleast U r lucky u r not getting other DB down as in my case....
regards
Abhay.