Remote access with Oracle dblink global_names or without

"Without knowing how easy the item may seem difficult"

Creating a database link to point to an oracle database to another in principle is easier, if you read the post dataprix Remote access through Oracle dblink . The pity is that in this post do not say anything about the global_names of each database and rename the dblink as if global_names are active.

Example.

  1. We created the dblink to a dummy database hr (after having configured tnsnames ...):
    create database link connect to rrhh dblinkrrhh recursoshumanos IDENTIFIED BY USING 'HR';
  2. Consult your name and surprise is not called if DBLINKRRHH.REGRESS.RDBMS.DEV.US.ORACLE.COM dblinkrrhh. We can see with the following query:
    select * from dba_db_links;

    Now what?

 

Creating a database link to

Creating a database link to point to an oracle database to another in principle is easier, if you read the post dataprix Remote access through Oracle dblink . The pity is that in this post do not say anything about the global_names of each database and rename the dblink as if global_names are active.

 

Cheap Air Tickets

 

Google
 
     

Similar entries

  • The easiest way to access from an Oracle database to objects of another Oracle database is using a DBLink (this does not mean that it is always the most desirable, abuse of DBLinks can generate both performance as security problems).

    First, you need a user who holds the create database link privilege. Then, you can create DBLink in source database (A) through this simple sentence:

    • create database link lnk_from_A_a_B connect to user identified by password using 'B';

    - 'lnk_from_A_a_B ' is the link name,

    - 'user' and 'password' are the user identifiers who will use the link to connect.

    - 'B' is the SID of the target database.

    Through this DBLink you can connect with objects in the remote database with privileges owned by the user of the creation sentence.

    To reference an object of the remote database should indicate object name concatenated with '@' and the DBLink name.

    Example: select * from mytable@lnk_from_A_a_B

  • The easiest way to access from an Oracle database objects from another Oracle database is using a DBLINK (being the easiest does not mean that it is always the most desirable, the abuse of DBLINKS can create many problems, both of performance and safety)

    To do this it's necessary a user with CREATE DATABASE LINK privilege, and create a DBLINK in the source database (A) by a simple statement such as:


    Create database link LNK_from_A_to_B connect to USER identified by PASSWORD USING 'B'; 

    'LNK_from_A_to_B' is the name of the link, 'USER' and 'PASSWORD' are the IDs of the user who will use the link to connect, which will inherit the permissions of all access through the link, and B is the name of the database's instance.

    Using the DBLINK we can connect to the objects with the remote database's permissions that user has been provided in the creation statement.

    To reference an object from the remote database should indicate the name of the object, concatenated with the character '@' and the name that we had given to the DBLINK.

    Example: 

    select * from TABLA@LNK_from_A_to_B 

  •  

    MySQL has some special features when making a connection from a remote client that if we do not know can complicate access to a MySQL database from a different machine that hosts the database.

    With other databases such as Oracle or SQL Server, once that no firewall or anything like that prevents us from the client machine access to the server, using normally data acces from a database user we can 'enter'.

    With MySQL, although access to the port, usually 3306, is open, the database can be configured to shut out external connections, and the result is the same as if the port was closed by a firewall:

     

    telnet mysql.dataprix.es 3306
    Trying 188.166.233.199...
    telnet: connect to address 188.166.233.199: Connection refused
    telnet: Unable to connect to remote host

     

    If you get this result should consult the file /etc/my.cnf, and checking for bind-address variable or skip-networking.

    If skip-networking is and is not discussed, edit the file and delete it, or make a comment to have no effect and allow external connections:

     

  • API Calling Twitter from stored procedures PL / SQL can send status updates to a Twitter account. Apart from the funny thing it may be, can be a very effective method to warn us or our users of any event occurring in the database.

    Twitter can easily convert an additional warning system for when we have problems in our Oracle database, or you simply want to learn or inform others automatically upon completion of certain processes, such as Enterprise Data Warehouse charges .

    Twitteando desde un procedure de Oracle PL/SQL

    Remember that Twitter accounts can be configured to be open to any user, or can be secured so that only users to access Twitter to be granted permission to 'follow'.

    You can find the code and a detailed explanation on how to create a package for Twittering from PL / SQL in the Database Geek Blog , and updated source code in ORA_Tweet project has created the same Lewis Cunningham on Sourceforge.