国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 绥棱县| 重庆市| 文水县| 临江市| 竹北市| 武鸣县| 广饶县| 淮北市| 清水县| 青铜峡市| 商洛市| 原阳县| 南部县| 饶阳县| 房产| 石河子市| 吴桥县| 汉中市| 贺兰县| 武安市| 郑州市| 唐海县| 佛山市| 富蕴县| 扎囊县| 阿拉善左旗| 马龙县| 崇明县| 濉溪县| 华安县| 安陆市| 夏邑县| 内乡县| 建瓯市| 云林县| 贺兰县| 乌鲁木齐市| 汝南县| 合作市| 黄浦区| 蓬安县|