Database link dblink connects to ho.world
when I set global_name to true this error appear
CREATE PUBLIC DATABASE LINK sqllink CONNECT TO
"sa" IDENTIFIED BY "asd" USING 'dg4msql';
SELECT * FROM DUAL@dblink;
//error
database link dblink connects to ho.world
what the solve for this is there any global name for Microsoft SQL server
I found the answer
the solve is
CREATE PUBLIC DATABASE LINK ho.world CONNECT TO
"sa" IDENTIFIED BY "asd" USING 'dg4msql';
SELECT * FROM [email protected];
Similar Messages
-
Using database link to connect to two databases
Hi guys,
Here's my question. I need to give a contractor Select rights on tables located in two schemas located on two different servers. One server is dev and one is prod. Let's say we have schema user: EMPLOYEE on dev and schema user: DEPARTMENT on prod. The outside contractor needs select rights on all tables in DEPARTMENT schema but only needs select on a few tables ( 4 to be exact) from EMPLOYEE schema.
My initial train of thougth is: CREATE a user named: TEST (random name of course, just used for an example) for contractor on prod. Give user TEST select rights on all tables in DEPARTMENT schema.
Create database link to dev server so user TEST can access EMPLOYEE schema.
How do i go about limiting the user TEST via the database link to only view the 4 tables from EMPLOYEE instead of all teh tables?
Should I also consider doing this scenario in reverse? Creating user TEST on dev, giving TEST rights to the 4 tables in EMPLOYEE, then creating the database link to connect to department schema on prod database??
Any help will be appreciated. Thanks in advance.zephyr223 wrote:
Hi guys,
Here's my question. I need to give a contractor Select rights on tables located in two schemas located on two different servers. One server is dev and one is prod. Let's say we have schema user: EMPLOYEE on dev and schema user: DEPARTMENT on prod. The outside contractor needs select rights on all tables in DEPARTMENT schema but only needs select on a few tables ( 4 to be exact) from EMPLOYEE schema.
My initial train of thougth is: CREATE a user named: TEST (random name of course, just used for an example) for contractor on prod. Give user TEST select rights on all tables in DEPARTMENT schema.
Create database link to dev server so user TEST can access EMPLOYEE schema.
How do i go about limiting the user TEST via the database link to only view the 4 tables from EMPLOYEE instead of all teh tables? Only grant them access to those four tables from EMPLOYEE. You have to explicitly grant privileges anyways, and since there is no GRANT SELECT ON <SCHEMA> ability it should not be that difficult.
Should I also consider doing this scenario in reverse? Creating user TEST on dev, giving TEST rights to the 4 tables in EMPLOYEE, then creating the database link to connect to department schema on prod database?? Are you creating database links as the EMPLOYEE and DEPARTMENT users? If so, I would caution against that. Create a "current user" database link for TEST. I think you can manage privileges better that way.
HTH!
HTH! -
To create database link to connect to remote database
Hi all
I am using 10g with apex4.
My apex application is running on our server.
I need to connect to a remote server to get data from there.for that i need to create a database link from apex.
When i tried to create a database link from apex sql commands window it is showing insufficient privilages.
So i created one database link from back end but it is not accessible from apex...
can some one help me in this...
its urgent.....
thanks in advanceHi,
You need create database link to schema that is assigned to your workspace (application parsing schema)
Schema need have CREATE DATABASE LINK system privilege.
Regards,
Jari
Edited by: jarola on Aug 1, 2011 3:34 PM
See documentation
http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/advnc.htm#BABBFICH -
How to create a database link to connect to Progress
I using 10g (10.2.0.4) and want to connect to progress 9.x using a databaselink.
Which are the steps, examples to acomplish this?.You have to use the 11g Database Gateway for ODBC (DG4ODBC) to connect from Oracle 10.2.0.4 to Postgres.There's a note on My Oracle Support how to configure the gateway - please have a look at:
How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install (Doc ID 561033.1)
I would recommend you to use the latest gateway release (11.2.0.3) which can be downloaded from My Oracle Support portal as well. Just click on Patches and Updates and look for the 11.2.0.3 patch set:
Patch 10404530: 11.2.0.3.0 PATCH SET FOR ORACLE DATABASE SERVER
Although it is a patch set this software can also be used to install the gateway from scratch.
Check out the readme as it lists which ZIP file contains the gateway software you have to download.
The DG4ODBC gateway is for free and its license is included in the Oracle database license. You only need to make sure you have a suitable ODBC driver which is able to connect to your Postgres database.
Best regards,
Klaus -
Not able to create a database link using the database gateway of oracle 11g
HI,
While trying to create a database link to SQL server from Oracle ,using the database gateway provided with 11g, i am getting the following error while making use of it in selecting columns from tables :
Error starting at line 1 in command:
select * from test1@dblink
Error at Command Line:1 Column:20
Error report:
SQL Error: ORA-28513: internal error in heterogeneous remote agent
ORA-02063: preceding line from DBLINK
These are the steps i have followed for setting up:
1.Ran the set up for the Database gateway.and mentioned the SQL server name and database .ALos set up a listener.
2. Added the following in the Listener.ora of Oraclehome 11/NETWORK/ADMIN:
LISTENER_SQL_FCD =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =localhost) (PORT = 1541)
SID_LIST_LISTENER_SQL_FCD =
(SID_LIST =
(SID_DESC =
(SID_NAME=dg4msql)
(ORACLE_HOME= D:\app\20537\product\11.1.0\db_3)
(PROGRAM=dg4msql)
3.Added the following in tnsnames.ora inOracle home/NETWORK/ADMIN:
dg4msql=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1541))
(CONNECT_DATA=(SID=dg4msql))
(HS=OK)
4. Following is the entry in initdg4msql.ora in C:\product\11.1.0\tg_5\dg4msql\admin:
HS_FDS_CONNECT_INFO=10.148.45.242:1433//SalesDemo
HS_FDS_TRACE_LEVEL=DEBUG
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
5. Created the database link :
create database link dblink
connect to "sa" identified by "<pswd>"
using 'dg4msql'
On running :select * from test1@dblink i get the following error:
Error starting at line 1 in command:
select * from test1@dblink
Error at Command Line:1 Column:20
Error report:
SQL Error: ORA-28513: internal error in heterogeneous remote agent
ORA-02063: preceding line from DBLINK
Is there any issue with the set or definition that I get the above error?What is the version of the Oracle database in which you have specified/and use the database link?
If it is for example 10.2.0.3.0 you need to apply the mandatory patch for RDBMS bug 5965763 first before being able to use an 11g gateway. Have a look at MetaLink note 457808.1 for details about this patch.
Regards,
Ed -
Database link not working properly
I have to link to another database...I have created an entry in my TNS names on the oracle server and have used the following script to create the link:
CREATE PUBLIC DATABASE LINK DATA
CONNECT TO USERNAME IDENTIFIED BY PASSWORD
USING 'DATA';
Data is the name of the database sid, and I am able to connect to the server using the username/password@sid in sqlplus. Oracle tells me that the link is created successfully, however if I try to describe user_tables@data I get the following error:
SQL> desc user_tables@data;
ERROR:
ORA-02085: database link DATA connects to DATA.WORLD
Please help!
JesYou will see this error when the global name of the remote database does not match what you have in your link. Although the link name might match the SID, the fully qualified link name does not.
You can either:
1) Set the GLOBAL_NAMES parameter to FALSE in the database in which you have created the database link.
2) Recreate the link so that the full link matches the global name of the remote db (query GLOBAL_NAME in the remote db if you don't know it)
Good luck! -
Database link with the alias and full description in the connect string
Hi,
i have created database link with alias in tnsentry and full description
and suppose i have removed the tnsnames.ora file what will be the impact on the database link that is whether database link will work or not i am sure db link created with alias won't work and how about db link created with full description and which one you prefer
Thanks# Parameter file initora for Database prd
### Global database name is db_name.db_domain
global_names = TRUE
db_name = prd
db_domain = world
# TNSNAMES.ORA for prd ###############################
prd.world = (DESCRIPTION = (ADDRESS = (COMMUNITY = tcp.world)
(PROTOCOL = TCP) (Host = 100.10.100.1) (Port = 1521))
(CONNECT_DATA = (SID = prd) (GLOBAL_NAME = prd.world)
(SERVER = DEDICATED)))
Our database link points from the local database test to the remote database prd. Therefore we need the global database name for prd. Ask the remote database administrator for these information or connect to prd and execute the following query on prd:
SQL> select GLOBAL_NAME from GLOBAL_NAME;
GLOBAL_NAME
prd.WORLD
CREATE DATABASE LINK prd
CONNECT TO system IDENTIFIED BY system_passwd
USING 'prd';--- alias
so the connection description will be ---select ename from [email protected]
useful link
http://www.akadia.com/services/ora_dblinks.html -
8.1.7 connectivity using database link
I can't get my database link to work. It fails with ORA-12154: TNS:count not resolve service name
I have set up an entry in tnsnames that allows me to successfully tnsping the target database and I can connect via SQL*Plus using user/password@service_name.
I have successfully created a fixed user database link. The database link has the same name as the service name, although global_names is false in both Oracle instances.
Here's the tnsnames entry:
service_name =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 000.000.000.000) -- can't reveal the IP address
(Port = 1521))
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 000.000.000.000) -- can't reveal the IP address
(Port = 1576))
(CONNECT_DATA = (SID = sid)))
and here's the database link definition:
create database link service_name
connect to user identified by password
using 'service_name';
Am I missing something???Is this tnsnames.ora that you sent is from the server or from your computer ? Because you need to set up an entry in the tnsnames from the server where the database link is created.
-
Problem connecting DataBase Link from windows oracle to oracle on Linux
I'm facing a problem with database links from windows oracle to Oracle hosted on Linux server.
I'm able to successfully create the Database Link using the following query on oracle database hosted on a windows server
CREATE DATABASE LINK SampleDB
CONNECT TO myuser IDENTIFIED BY password
USING 'sample';
The tns names entry on windows for database in Linux server is as follows
DSOFT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = sample)
But while executing the query "select count(*) from doctor@SampleDB;" in sql developer on windows, I'm getting the following error
SQL Error: ORA-12154: TNS:could not resolve the connect identifier specified
12154. 00000 - "TNS:could not resolve the connect identifier specified"
*Cause: A connection to a database or other service was requested using
a connect identifier, and the connect identifier specified could not
be resolved into a connect descriptor using one of the naming methods
configured. For example, if the type of connect identifier used was a
net service name then the net service name could not be found in a
naming method repository, or the repository could not be
located or reached.
Using the above tns entries, i'm successfully able to connect to the database in Linux server through sql developer installed on the windows machine. Then why i'm getting this error while executing the query on Database Link?. Can any one help me?1005745 wrote:
I'm facing a problem with database links from windows oracle to Oracle hosted on Linux server.
I'm able to successfully create the Database Link using the following query on oracle database hosted on a windows server
CREATE DATABASE LINK SampleDB
CONNECT TO myuser IDENTIFIED BY password
USING 'sample';
The tns names entry on windows for database in Linux server is as follows
DSOFT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = sample)
But while executing the query "select count(*) from doctor@SampleDB;" in sql developer on windows, I'm getting the following error
SQL Error: ORA-12154: TNS:could not resolve the connect identifier specified
12154. 00000 - "TNS:could not resolve the connect identifier specified"
*Cause: A connection to a database or other service was requested using
a connect identifier, and the connect identifier specified could not
be resolved into a connect descriptor using one of the naming methods
configured. For example, if the type of connect identifier used was a
net service name then the net service name could not be found in a
naming method repository, or the repository could not be
located or reached.
Using the above tns entries, i'm successfully able to connect to the database in Linux server through sql developer installed on the windows machine. Then why i'm getting this error while executing the query on Database Link?. Can any one help me?A database link is acting as a client to the target, remote database in exactly the same fashion and using exactly the same tns infrastructure as any other client trying to connect to that remote database. your ORA-12154 when querying a db link means exactly the same as if you had gotten it trying to connect with sqlplus, from the same server. Check the link SB provided. Keep in mind that the tnsnames file of concern is the one on the source database server. -
How to connect APEX with MYSQL via Apex's Database link
How do i connect APEX with MYSQL via Apex's Database link? The OBE doesn't go into specific detail about how to link the two.
can someone please elaborate on what these are and where i can find them in mysql:
Database Link Name
Connect To Schema
Password
Remote Hostname or IP
Remote Host Port
SID or Service Name
I need to link to mysql database so I can set up a 3D pie chart in apexHi jononioo
A database link is a device for connecting between Oracle database instances only. Oracle does have a method for connecting to other database systems (Transparent Gateway) but this is restricted to other commercial databases and I don't believe there is a gateway for Mysql. (I could be wrong)
I don't know Mysql but maybe there is some way to push data to the Oracle instance. Other than that, is there any reason why the data has to reside in the Mysql database?
Regards
Andre -
Hi all,
To create a Database Link, is it necessary to enter the connection in TNSNAMES.ORA....?
create database link linkname connect to ORA_USER identified by pwd using 'Connection name in TNSNAMES';
In Place of Connection name, if i gave IP Address OR Computer name also, without entering connection in TNSNAMES.ORA, it is creating database LINK.
Thanks in advance,
PalYou can bypass the tnsnames.ora file by specifying the description in the create statement;
SQL> select distinct username from user_sys_privs
USERNAME
MSCALLION
1 row selected.
SQL> create database link dblink1
connect to user1
identified by "user1"
using '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME = XE)))'
External database created.
SQL> select distinct username from user_sys_privs@dblink1
USERNAME
USER1 -
I have two oracle databases which I want to connect,
these are the entries in tnsnames.ora
UAT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.16.72.166)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = uat849)
itdev6 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.16.72.167)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = itdev6)
)I logged into UAT and create the link.
this is my sql for dblink creation
CREATE public DATABASE LINK test1 CONNECT TO username IDENTIFIED BY password USING 'itdev6';
this database link created successfully. But when I try to run a query against it I'm getting an error
select * from kh_gps_email_info_tab@test1
ORA-12154: TNS:could not resolve the connect identifier specified
Can anyone help me on this please?Try this
itdev6.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.16.72.167)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = itdev6.world)
CREATE public DATABASE LINK test1 CONNECT TO username IDENTIFIED BY password USING 'itdev6.world'; -
Execute procedure over database link
Hi,
I''m working on a package where you can select the required database, paste some query and with clicking on a button it will execute and create an explain plan for this query.
Therefore i've create a procedure on each database that put's the explain plan in the PLAN_TABLE.
To do this i need to execute this prodecure from the package. I use the following code:
DBA_OWNER.DB_PCD_EXPLAIN_PLAN@DBA_LINK_533.WORLD(p_query);
This is working fine as this database link allready exists to the required database. But i want to make the database link name variable. I've allready created the dynamic database link:
l_link varchar2(20) := 'DBA_LINK';
l_link_nr number(4) := dbms_random.value(0,1000);
l_db varchar2(20) := l_link||'_'||l_link_nr;
l_statement varchar2(4000);
begin
l_statement := 'create database link '||l_db||' connect to **** identified by ***** using '''||p_database||'.WORLD''';
execute immediate l_statement ;
So now i have the dynamic databaselink that is created each time i call the package.
now i want to use this databaselink to call the procedure. this is where it goes wrong.
The code i'm using:
DBA_OWNER.DB_PCD_EXPLAIN_PLAN@l_db(p_query);
is not acceoted when i build the package.
The follwoing error message is showed.
PACKAGE BODY DBA_OWNER.PCK_EXPLAIN_PLAN
On line: 66
PLS-00352: Unable to access another database 'L_DB'
Does someone know how to use this variable to execute the procedure on the remote db?Any procedures you call have to be accessible at compile time, so the database link must also exist at compile time.
You can get around this by putting your procedure call to DB_PCD_EXPLAIN_PLAN inside dynamic SQL, the same as you are doing to create the database link. Dynamic SQL is not checked until runtime.
Think about the risk if this procedure is exploited. You are creating a way for someone to run arbitrary code in an any database in your environment, with presumably a highly-privileged ID, if it can run an explain plan against any schema in any target database.
This is exposing some significant security issues. Read up on SQL injection, and have someone else review the code for security issues before deploying this. -
How to Create Public database link in oracle 9i?
Friends,
OS: RHEL AS 3
DB: 9iR2
database name 1 = nubul
database name 2 = test
in the 'nubul' database server using system user.
i created a database link to connect the 'test' database
sql> create public database link test using 'test';
database link created.
then i logged in as normal user....
sql> select count(*) from employee@test
Error at line 1:
ORA-12154: TNS: could not resolve service name
where i am making mistake?
i gave the linkname as my remote database name.
am i have to make any entry in the tnsnames.ora?
thanks & regardsYou have to remember that when you access a dblink, the database where the link is defined is acting as a client to the database to which the link points ... exactly the same as if you you were using sqlplus on the machine hosting the db where the link is defined. In other words, given:
Host 'Host-src', with database 'db-src', with a dblink 'lk_target'
Host 'host-trgt', with database 'db-trgt'
When you connect to db-src and access lk-target, db-src is now acting as a client to db-trgt. Exactly as if you had opened sqlplus on host-src and connected directly to db-trgt. So, given the above scenario
host-src$> sqlplus scott/tiger@db-src
sql> select * from emp@lk_target;when you execute that SELECT to the link, the same tns considerations are in effect as if you had
host-src$> sqlplus scott/tiger@db-trgtThe same tnsnames.ora entry, on the source machine, is required for both. -
Failed to create Database Link in OWB 9.2 for remote SQL Server
Hi,
I have to create Database link for connecting to SQL server in a different machine.I am using OWB 9.2 and XP.
Dataserver is the machine name which is running SQL Server
I included follwing lines in TNSNAMES.ORA file
hsodbc.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dataserver)(PORT = 1433)
(CONNECT_DATA = (SID=hsodbc.world)
(HS =OK)
I included follwing lines in Listener.ORA file
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dataserver)(PORT = 1433)
(SID_DESC=
(SID_NAME=hsodbc.world)
(ORACLE_HOME=C:\ora92)
(PROGRAM=hsodbc)
I included follwing lines in inithsodbc.ORA file
HS_FDS_CONNECT_INFO = testdsn
HS_FDS_TRACE_LEVEL = 0
While creating new database link I gave the follwing values
DB Link Name : Mylink
SQL * Net Connect String: hsodbc
User Name: sa
password:<my password>
Then clicked "Create and Test" button to get the follwing error message
Testing...
Failed.
ORA-12154 TNS:could not resolve service name
*Cause: The service name specified is not defined correctly in the TNSNAMES.ORA file
*Action: Make the following checks and correct the error:
- Verify that a TNSNAMES.ORA file exists on your repository server
in the proper place and is accessible. See the operating
system specific manual for details on the required name and location.
- Check to see that the service name exists in one of the
TNSNAMES.ORA files and add it if necessary.
- Make sure there are no syntax errors in the file.
Particularly look for unmatched parentheses or stray characters.
Any error in a TNSNAMES.ORA file makes it unusable. See
Chapter 4 in the SQL*Net V2 Administrator's Guide. If possible,
regenerate the configuration files using the Oracle Network Manager.
Is there anything wrong in my configuration. Please help me in getting out of this problem.
Thanks in advance
AndyHi Mark,
Thanks Mark.I did the changes in the specified .ora file but now it shows a different error message.
The error is
Testing...
Failed.
Cwm Error Message: SQL Exception
Cwm Error: SQL Exception
Class Name: CacheMediator
Method Name: getDDEntryFromDB
Repository Error Message: ORA-28545: error diagnosed by Net8 when connecting to an agent
NCRO: Failed to make RSLV connection
ORA-02063: preceding 2 lines from MYLINK
Query: select 1 from dual@MyLink
I got the same error when i tried manually in sql plus.
Please help me in getting out of thid problem
Thanks in advance
Andy
Maybe you are looking for
-
Im almost out of space on my Air 16GB. trying to figure out if it makes more fiscal sense to buy one with more memory, but I heard you can add to the memory space on the device, rather than buying a new devide altogether. anyone help me with how i
-
Text messages are not being delivered from iPhone 4s
Why aren't my messages being delivered from my iPhone 4S?
-
Getting ORA-13000 error using SDO_DISTANCE.
Hi! I am having problem executing query with SDO_DISTANCE function. System is Windows XP SP2, Oracle 10g latest version. First tables creation codes: CREATE TABLE BUILDINGS B_NUM NUMBER CONSTRAINT C_PK_BUILDINGS PRIMARY KEY, BUILDING MDSYS.SDO_GEOMET
-
Hi all, long time no talk... I was fortunate enough to get the CS6 just now, and I still way prefer working in PS than AI... for simple shapes and text, can PS CS6 save all vector info and export to PDF for the printer? If so, I couldnt find any "Pr
-
ACE: URL redirect - not working
Hi, I've to do url redirection from port 80 to port 443. I've following configured: rserver redirect url.test.com-rd webhost-redirection https://url.test.com/ inservice serverfarm redirect url.test.com:80 description url.test.com - port 80 redi