關於database link的物件型別

jichengjie發表於2017-12-27
SQL> col OBJECT_NAME format a30
SQL> col OBJECT_TYPE format a20
SQL> select object_name,OBJECT_TYPE
  2  FROM user_objects
  3  where object_name like 'CIQUS%';


OBJECT_NAME                    OBJECT_TYPE
------------------------------ --------------------
CIQUSR_SYNC.168.3.9            DATABASE LINK
CIQUSR_SYNC.US.ORACLE.COM      DATABASE LINK


SQL> select DBMS_METADATA.GET_DDL ('DATABASE LINK','CIQUSR_SYNC.US.ORACLE.COM')
  2  from dual;
ERROR:
ORA-31600: invalid input value DATABASE LINK for parameter OBJECT_TYPE in
function GET_DDL
ORA-06512: at "SYS.DBMS_METADATA", line 3773
ORA-06512: at "SYS.DBMS_METADATA", line 3828
ORA-06512: at "SYS.DBMS_METADATA", line 5678
ORA-06512: at line 1


no rows selected


SQL> select DBMS_METADATA.GET_DDL ('DB_LINK','CIQUSR_SYNC.US.ORACLE.COM')
  2  FROM DUAL;


DBMS_METADATA.GET_DDL('DB_LINK','CIQUSR_SYNC.US.ORACLE.COM')
--------------------------------------------------------------------------------


  CREATE DATABASE LINK "CIQUSR_SYNC.US.ORACLE.COM"
   CONNECT TO "ITOWM" IDENTI




SQL> SELECT *
  2  from user_db_links;


DB_LINK
--------------------------------------------------------------------------------
USERNAME                       PASSWORD
------------------------------ ------------------------------
HOST
--------------------------------------------------------------------------------
CREATED
------------
CIQUSR_SYNC.168.3.9
ITOWM
oral_sz
06-SEP-17




DB_LINK
--------------------------------------------------------------------------------
USERNAME                       PASSWORD
------------------------------ ------------------------------
HOST
--------------------------------------------------------------------------------
CREATED
------------
CIQUSR_SYNC.US.ORACLE.COM
ITOWM
oral_sz
06-SEP-17

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26870952/viewspace-2149370/,如需轉載,請註明出處,否則將追究法律責任。

相關文章