Create Oracle DB LINK to a database with no DB_DOMAIN I'm trying to create a database link between this two DBs.

My local DB is 11.2.0.3.

SQL&gt; select * from global_name;


GLOBAL_NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
MYDB.DOMAINNAME


SQL&gt; select name, value from v$parameter where name in ('db_name', 'db_domain', 'global_names');
NAME                 VALUE
-------------------- ----------------------------------------
db_domain
global_names         TRUE
db_name              mydb


The remote DB is 11.2.0.2 configured as follows:

SQL&gt; select * from global_name;


GLOBAL_NAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
myremotedb

SQL&gt; select name, value from v$parameter where name in ('db_name', 'db_domain', 'global_names');

NAME                 VALUE
-------------------- ----------
db_domain
global_names         FALSE
db_name              myremotedb


I want to create a DBLINK in the local database to the remote database.

I have my tnsnames (mydb's machine) configured as follows:

REMOTE-DATABASE =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(Host = 192.168.1.2)(Port = 1521))
    )
    (CONNECT_DATA =
      (SID = myremotedb)
    )
  )


Then, when I try to create a database link in my local database, since global_names parameter is set to true, oracle appends the local domain name to the database link name

SQL&gt; create database link myremotedb@myuser connect to myuser identified by mypasswd using 'REMOTE-DATABASE';


Enlace con la base de datos creado.


SQL&gt; select db_link from user_db_links;


DB_LINK
------------------------------
MYREMOTEDB.DOMAINNAME@MYUSER


and if I try to use it, it fails

SQL&gt; select * from dual@MYREMOTEDB@MYUSER;
select * from dual@MYREMOTEDB@MYUSER
                   *
ERROR en línea 1:
ORA-02085: database link MYREMOTEDB.DOMAINNAME@MYUSER connects to MYREMOTEDB




SQL&gt; select * from dual@MYREMOTEDB.DOMAINNAME@MYUSER;
select * from dual@MYREMOTEDB.DOMAINNAME@MYUSER
                   *
ERROR en línea 1:
ORA-02085: database link MYREMOTEDB.DOMAINNAME@MYUSER connects to MYREMOTEDB


How can I create this database link in this scenario?

The remote db doesn't have a db_domain. How can I force oracle to create a DBLINK with no domain name?

Regards!
Can you show us the content of your sqlnet.ora file ? 
The domain name should be listed there :


NAMES.DEFAULT_DOMAIN = domain.com.xxx




In case you don't have one , create a new sqlnet.ora file using the netca tool. 
- after you create that file edit it and add the entry with you domain name!