1. If you set up a server database connection in the local "D:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora", you must set up the same name configuration for the server:
For example:
Local
1 Prepaid = 2 (DESCRIPTION =3 (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.100.4) (PORT = 1521))4
(Connect_data =
5
(SERVER = dedicated)
6
(SID = Prepaid)
7
)
8 )
Server
1 Prepaid = 2 (DESCRIPTION =3 (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521))4 ( Connect_data =5 (SERVER = dedicated)6 (SID = Prepaid)7 ) /c13>8 )
Create a Dblink statement
1 Create Public Database to by ' Prepaid ';
If only locally created, the query is an error:
SQL>Select* from scott.emp@mylink; Select * error from scott.emp@mylink *1 line: ORA- 12154: TNS: Unable to resolve the specified connection identifier
---------------------------------------------------------------
2. Do not set, specify directly in the CREATE statement
Create Public Database to by '(DESCRIPTION = (Address_list = (ADDRESS = (PROTOCOL = TCP) (HOST = database_ip) (PORT = 1521))) ( Connect_data = (service_name =servicename))';
Oracle creates Dblink issues