[20210723]Database link and user defined datatypes.txt
[20210723]Database link and user defined datatypes.txt
--//如何透過db link訪問使用者定義型別.按照連結做測試.
1.環境:
SCOTT@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
2.測試:
create type tt as object (x number);
/
create table t (x tt);
insert into t values (tt(1));
commit;
SCOTT@book> select t.x.x from t t;
X.X
----------
1
--//OK,本地訪問沒有問題.
CREATE PUBLIC DATABASE LINK LOOPBACK USING 'localhost:1521/book';
SCOTT@book> select t.x.x from t@LOOPBACK t;
X.X
----------
1
--//採用本地loopback測試不出來.
3.繼續:
CREATE PUBLIC DATABASE LINK L78
CONNECT TO SCOTT
IDENTIFIED BY <Password>
USING '192.168.100.78:1521/book';
SCOTT@test> select sysdate from dual@l78;
SYSDATE
-------------------
2021-07-23 09:47:24
--//OK.
SCOTT@test> select t.x.x from t@L78 t;
select t.x.x from t@L78 t
*
ERROR at line 1:
ORA-22804: remote operations not permitted on object tables or user-defined type columns
SCOTT@test> select type_name,TYPE_OID from user_types@L78;
TYPE_NAME TYPE_OID
------------------------------ --------------------------------
TT C7C175F2E6ED5C33E0534E64A8C010B5
SCOTT@test> create type tt oid 'C7C175F2E6ED5C33E0534E64A8C010B5' as object(x number)
2 /
Type created.
--//視乎建立的type不指定可以唯一.
SCOTT@test> select t.x.x from t@L78 t;
X.X
----------
1
--//感覺type的東西很少用,做一個記錄.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2782847/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- User defined table type and table valued parameters
- database link概述Database
- CREATE DATABASE LINKDatabase
- Database Link使用Database
- 建立Database LinkDatabase
- oracle database linkOracleDatabase
- Management on database linkDatabase
- Database Link的建立Database
- Oracle Database Link ProblemsOracleDatabase
- Oracle database link 詳解OracleDatabase
- oracle database link 應用OracleDatabase
- oracle database link 的使用OracleDatabase
- Azure 使用者自定義路由 (User Defined Route)路由
- Can one rename a database user (schema)?Database
- oracle database link (dblink) 工作原理OracleDatabase
- Oracle Database Link Problems【Blog 搬家】OracleDatabase
- database link 關閉session問題DatabaseSession
- Database Link 建立注意的兩點Database
- Oracle 12.2 使用Database Link優化Standby Database WorkloadOracleDatabase優化
- 關於database link的物件型別Database物件型別
- create database link中的identified by valuesDatabaseIDE
- 分散式資料庫元件——Database Link分散式資料庫元件Database
- ORA-02085 - database linkDatabase
- database link故障處理一例Database
- Database link 明文密碼bug 更正了Database密碼
- Access denied for user 'default'@'%' to database 'shop'報錯Database
- user database的initial size和dbcc shrinkfileDatabase
- 資料庫連結(database link)小結資料庫Database
- Administrative User Accounts Provided by Oracle DatabaseIDEOracleDatabase
- ORA-02024: database link not foundDatabase
- ORACLE實驗(move表空間和database link)OracleDatabase
- Database Link 建立注意的兩點【Blog 搬家】Database
- How to move Oracle Spatial objects from SYSAUX tablespace to a user defined tablespace [ID 1119758.1OracleObjectUX
- oracle database backup and recovery user's guide part IVOracleDatabaseGUIIDE
- oracle database backup and recovery user's guide part IIIOracleDatabaseGUIIDE
- EXP-00106:Invalid Database Link PasswordsDatabase
- Oracle11gr2新增ALTER DATABASE LINK語法OracleDatabase
- User Defined Runtime Attributes (使用者定義的執行時屬性)