Quality Testing

Quality is delighting customers

Hi ,

 How to test when database is set to GLOBAL_NAMES equal true

Views: 453

Reply to This

Replies to This Discussion

We had a webinar on database testing. Here's the link of webinar recorded video - Database Testing

It has been this way and it depends on the database or session setting of GLOBAL_NAMES. 

(and it really truely is a feature, not a limitation)... 

 

If global_names is true -- then the database link must be named AFTER the global name of

the database it connects to.  This prevents ambiguity in a replication environment (which

must have global_names=true) and is in general a good thing to do.  You can still have

many dblinks to the same database -- as long as they all incorporate the global name (see

second point below)

 

So, what can you do:

 

o alter session set global_names=false;

  in your session, dblinks no longer have to be the global_name.

  You can use your existing naming convention.  Not recommended.

 

o leave global_names on but use @ in the dblink name.  Put the

  global name first in the dblink name and then extra stuff

  after an @

 

For example, I have a database whose global name is ora8i.world.  I'll create three db

links to it -- one won't work since it doesn't use the global_name, the other 2 will --

they use the global name and then extra qualifiers after the global name to distinguish

between them -- allowing me to have >1 link to the same database with different

authorizations:

 

scott@ORA816> create database link wont_work

  2  using 'ora8i.world'

  3  /

 

Database link created.

 

scott@ORA816> create database link ora8i.world@current_user

  2  using 'ora8i.world'

  3  /

 

Database link created.

 

scott@ORA816> create database link ora8i.world@scott_user

  2  connect to scott

  3  identified by tiger

  4  using 'ora8i.world'

  5  /

 

Database link created.

 

scott@ORA816> select * from dual@wont_work

  2  /

select * from dual@wont_work

                   *

ERROR at line 1:

ORA-02085: database link WONT_WORK.US.ORACLE.COM connects to ORA8I.WORLD

 

 

scott@ORA816> select * from dual@ora8i.world@current_user

  2  /

 

D

-

X

 

scott@ORA816> select * from dual@ora8i.world@scott_user

  2  /

 

D

-

X

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2020   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service