Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2003
    Posts
    81

    Question Unanswered: Select from another database

    How do I (grant and) select from another database?

    i.e.:

    connect USER1/*****@DB1;
    grant select on TABLE1 to "USER2 in DB2";

    connect USER2/*****@DB2;
    select * from "TABLE1.USER1.DB1";

  2. #2
    Join Date
    Nov 2002
    Posts
    833
    you have to create a database link

  3. #3
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    Use either public or private database link ...
    You may have to set the global_name up properly prior to the
    links working (depending on your setting in the initxxx.ora)

    on db1
    sql> alter database rename global_name to db1.world;

    on db2
    sql> alter database rename global_name to db1.world;

    on db2 as user2
    sql> create database link db1.world connect to user1 identifed by xxxx
    using 'db1'

    xxxx is the password for user1
    using 'db1' - this is the service name that is used to connect to the
    database..

    Gregg

  4. #4
    Join Date
    Jun 2003
    Posts
    81

    Thumbs up You saved my day

    Exactly what I needed - thanks!

    Originally posted by gbrabham
    Use either public or private database link ...
    You may have to set the global_name up properly prior to the
    links working (depending on your setting in the initxxx.ora)

    on db1
    sql> alter database rename global_name to db1.world;

    on db2
    sql> alter database rename global_name to db1.world;

    on db2 as user2
    sql> create database link db1.world connect to user1 identifed by xxxx
    using 'db1'

    xxxx is the password for user1
    using 'db1' - this is the service name that is used to connect to the
    database..

    Gregg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •