国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > Oracle > 正文

Oracle中使用同義詞

2019-11-02 15:54:09
字體:
供稿:網(wǎng)友

   一、背景

  有兩個(gè)sid:Asid,Bsid,在Asid下有兩個(gè)用戶Auser1,Auser2,在Bsid下有一個(gè)用戶Buser1。其中Auser2和Buser1建立了dblink。現(xiàn)希望通過登錄Buser1訪問Auser1上的三張表table1,table2,table3信息和函數(shù)function1。

  二、步驟

  ①登錄Auser1對Auser2授權(quán)(若需要?jiǎng)h除則加上delete)

  grant insert,select,update on table1 to Auser2;

  grant insert,select,update on table2 to Auser2;

  grant insert,select,update on table3 to Auser2;

  grant execute on function1 to Auser2;

  ②登錄Auser2建立同義詞

  create synonym table1 for Auser1.table1;

  create synonym table2 for Auser1.table1;

  create synonym table3 for Auser1.table1;

  create synonym function1 for Auser1.function1;

  ③登錄Buser1查找db_link名(例如查出來的db_link名為mydblink1)

  select username,db_link from user_db_links

  ④建立Buser1的同義詞

  creat

7788電影網(wǎng)[www.aikan.tv/special/7788dianyingwang/]
e synonym table1 for [email protected];

  create synonym table2 for [email protected];

  create synonym table3 for [email protected];

  create synonym function1 for [email protected];

  ⑤測試

  此時(shí)登錄Buser1通過select * from table1就可以訪問table1了。

  三、注意點(diǎn)

  也可以建立procedure的同義詞,但是這樣執(zhí)行的過程中不允許commit。如果要提交的話請?jiān)谌鏙DBC中commit()。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 益阳市| 竹北市| 洛隆县| 漳平市| 新沂市| 岳阳市| 宿州市| 揭西县| 调兵山市| 夏河县| 海阳市| 江津市| 盐亭县| 蒲江县| 开平市| 河南省| 淮南市| 固安县| 会东县| 休宁县| 全南县| 玉门市| 清河县| 铁岭县| 平顺县| 陇川县| 阆中市| 鹤壁市| 惠州市| 大姚县| 佳木斯市| 建平县| 普安县| 新乡县| 临洮县| 昭苏县| 呼玛县| 太原市| 晋江市| 曲沃县| 资中县|