Saturday 7 January 2017

How to create database link in oracle

Database link Details:
Database link is a schema object in one database which enables us to access objects on another databases.And the other databases not need to be an Oracle Database system.But here, to access non-Oracle systems we should use Oracle different Services.

Then we have created a database link after that we can use it to refer to tables and views on the other databases. As in SQL statements, we can refer to a table or view on our other database by appending @dblink to the table or view name. And we can query a table or view on the other database with the SELECT command. We can access remote tables and views using any of INSERT, UPDATE, DELETE, or LOCK TABLE DML command.

There are some below points which we should notice before starting creation of DB link:

1. For private database link:
    We should have the CREATE DATABASE LINK system privilege.

2. For public database link:
   We should have the CREATE PUBLICDATABASE LINK system privilege. And   also, we must have the CREATE SESSION system privilege on the remote Oracle database.

And oracle Net also must be installed on both the local and remote Oracle databases

Please follow the below steps to DBLINK Creation :
User/Password: abc/abc

TNS Setting:
ORA-DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ora-data.blogspot.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora-data)
(SRVR = DEDICATED)
)

Now, Check the Instance details:

SQL> select open_mode,name from v$database;
OPEN_MODE NAME
---------- ---------
READ WRITE SKU

SQL> create public database link ORA-DATA.blogspot.com
connect to username identified by password
 using 'ORA-DATA';
Database link created.

Note: We need to use password for target instance (i.e. If we need to create DB link from abc to xyz on abc instance then we need to use apps password for xyz.

If there is mentioned OWNER, then we need to connect with that user and then create db links.

SQL> select owner||','||db_link||','||username||','||host||','||from dba_db_links;
OWNER||','||DB_LINK||','||USERNAME||','||HOST
---------------------------------------------
PUBLIC,ORA-DATA.BLOGSPOT.COM,ABC,ORA-DATA,

  

Now, we will check the working status of dblink.
$ tnsping ORA-DATA
Server, date and time details
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/u01/oracle/ora-data/admin/ora-data/sqlnet_ifile.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ora-data.blogspot.com)(PORT = 1521))) (CONNECT_DATA = (SID=ORA-DATA))).

Now, We can see TNSPING is working is working fine.

$ tnsping ORA-DATA
TNS Ping Utility for date and time
Server, date and time details
Used parameter files:
/u01/oracle/ora-data/admin/ora-data/sqlnet_ifile.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=ora-data.blogspot.com)(PORT=1521)) (CONNECT_DATA= (SID=ORA-DATA)))
OK (10 msec)
$
Now, we can check the dblink that it is working fine.
 
SQL> select sysdate from dual@ORA-DATA.BLOGSPOT.COM;
SYSDATE
---------
07-JAN-17

Some more useful links:
Compile JSPs Manually Steps and Concepts
R12.1 Vs R12.2 Technical
R12.2 Architecture and Concepts
Interviews Questions and Answers
Important SQL Scripts
Hope this is useful and helpful, please let us know for any more details and information.

29 comments:

  1. I have been examinating out many of your articles and it's nice stuff.
    I will surely bookmark your website.

    ReplyDelete
    Replies
    1. Dear User,
      Thank you for your feedback.

      Regards,
      ora-data Team

      Delete
  2. Hey just wanted to give you a quick heads up.
    The words in your article seem to be running off the screen in Safari.
    I'm not sure if this is a format issue or something
    to do with internet browser compatibility but I figured I'd post to let
    you know. The style and design look great though! Hope you get
    the issue solved soon. Cheers

    ReplyDelete
    Replies
    1. Dear User,
      Thank you very much for your feedback.
      We haven't tested or checked in Safari, sure we will check it...

      Regards,
      ora-data Team

      Delete
  3. Hello, yeah this post is genuinely fastidious and I have
    learned lot of things from it concerning blogging. thanks.

    ReplyDelete
    Replies
    1. Dear User,
      Thank you very much for your valuable words and feedback.

      Regards,
      ora-data Team

      Delete
  4. Dear User,
    Thank you very much for your feedback and kind words.
    Really these words make us smile and good feel

    Regards,
    ora-data Team

    ReplyDelete
  5. Yeah bookmaking this wasn't a high risk determination great
    post!

    ReplyDelete
    Replies
    1. Dear User,
      Thanks you very much for your comment.

      Regards,
      ora-data Team

      Delete
  6. Dear User,
    Thanks you very much for your comments.

    Regards,
    ora-data Team

    ReplyDelete
  7. Heya exceptional blog! Does running a blog like this take
    a massive amount work? I have no understanding of coding however I had been hoping to start my
    own blog in the near future. Anyhow, should you have any ideas or tips for new blog owners please share.
    I understand this is off topic but I just needed to ask.
    Many thanks!

    ReplyDelete
  8. I leave a response whenever I appreciate a article on a
    blog or if I have something to add to the discussion. Usually it's triggered by
    the fire displayed in the article I read. And after this post "How to create database link in oracle".
    I was moved enough to drop a comment :) I do have a couple of questions for you if it's allright.

    Could it be simply me or does it appear like a few of these responses look as if they are written by brain dead visitors?
    :-P And, if you are posting at other social sites, I would like to
    follow anything new you have to post. Could you make a list all of your
    shared pages like your linkedin profile, Facebook page or twitter feed?

    ReplyDelete
    Replies
    1. Dear User,
      Thank you for your feedback.
      Yes, we have Facebook page Our Facebook Page you can follow us on that.

      Regards,
      ora-data Team

      Delete
  9. Quality articles or reviews is the crucial to attract the
    users to pay a quick visit the web site, that's what this website is providing.

    ReplyDelete
  10. Very soon this website will be famous among all blogging and site-building people,
    due to it's pleasant articles or reviews

    ReplyDelete
  11. This page truly has all the information I needed concerning this
    subject and didn't know who to ask.

    ReplyDelete
    Replies
    1. Dear User,
      Thank you for your feedback...
      Please you can write if you need any more info or details...

      Regards,
      ora-data Team

      Delete
  12. What's up Dear, are you truly visiting this site on a regular basis, if
    so then you will absolutely get fastidious knowledge.

    ReplyDelete
    Replies
    1. Dear User,
      Thank you for your great feedback.

      Regards,
      ora-data Team

      Delete
  13. Informative article, just what I needed.

    ReplyDelete
    Replies
    1. Dear User,
      Thank you very much for your kind feedback.

      Regards,
      ora-data Team

      Delete
  14. Dear User,
    Thank you for your valuable feedback.
    We use yahoo(bing) webmaster tool, nothing else.

    Regards,
    ora-data Team

    ReplyDelete
  15. Hey there I am so happy I found your webpage, I really found you by mistake, while I was looking on Aol for something else, Nonetheless I am here now and would just like
    to say kudos for a fantastic post and a all round exciting blog (I also love the theme/design),
    I don’t have time to read through it all at the moment but I have saved it and also included your
    RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the superb jo.

    ReplyDelete
  16. Thanks for sharing your thoughts. I truly appreciate your efforts and I am waiting for your
    next post thanks once again.

    ReplyDelete
  17. The information provided by you is very useful, it helped our Remote Database Experts to do their job more perfectly.

    ReplyDelete
  18. No matter how big or small your Database Infrastructure can be, Genex DB Remote DBA service will satisfy the users. You’ll be able to focus on your clients while our experts manage the database platform 24#7.

    INCREASE EFFICIENCY
    Genex Database experts work together with your team to monitor, supervise, support and improve database infrastructure.
    Remote Database Support



    IMPROVE AVAILABILITY
    Genex DB offers 24#7 service coverage to improve availability of critical database infrastructure.

    ReplyDelete
  19. Database Remote Assitance

    Remote database access (RDA) is a protocol standard for database access produced in 1993 by the International Organization for Standardization (ISO). Despite early efforts to develop proof of concept implementations of RDA for major commercial remote database management systems (RDBMSs) (including Oracle, Rdb, NonStop SQL and Teradata),this standard has not found commercial support from database vendors. The standard has since been withdrawn,and replaced by ISO/IEC 9579:1999 - Information technology -- Remote Database Access for SQL, which has also been withdrawn, and replaced by ISO/IEC 9579:2000 Information technology -- Remote database access for SQL with security enhancement.Genexdbs Database


    The purpose of RDA is to describe the connection of a database client to a database server. It includes features forGenexdbs Database
    :

    communicating database operations and parameters from the client to the server,
    in return, transporting result data from the server to the client,
    database transaction management, and
    exchange of information.

    ReplyDelete

Thank you for your comments and suggestions. It's good to talk you.