Alter database link
Hi Team,
Can we alter a public database link to connect to a different db using the below statement?
Alter public database link link_name connect to schema identified by password using 'newdb';
Db version is 10.2.0.4
You can't change connection string.You have to create new database link.
http://docs.oracle.com/cd/E11882_01/server.112/e17118/statements_1005.htm
Also
user13364377
Newbie
Handle: user13364377
Status Level: Newbie (10)
Registered: Jul 5, 2010
Total Posts: 340
Total Questions: 151 (110 unresolved) Why you have so many unresolved thread???
Try to close your old threads.
Similar Messages
-
Drop or alter database link question...
I have a database that uses a dblink to connect to a remote database to use a sequence for id's. The remote database is a 12 node rac cluster and when the database link was initially created the admin that created it only specified one of the nodes in the rac cluster in the comnnection description for the database link.
We want to change the link to include both rac nodes but we have a bunch of synonyms that point to the database link and I do not want to invalidate the synonyms.
If I alter the dblink as opposed to drop and recreate then will the synonyms become unusable or invaildated?
Thanks.First, you cannot change the connection information for a database link using the ALTER DATABASE LINK statement. You'll need to drop and recreate the database link to do so. From the documentation
You cannot use this statement to change the connection or authentication user associated with the database link. To change user, you must re-create the database link.Second, are you saying that the TNS entry was specified explicitly in the CREATE DATABASE LINK statement rather than specifying a TNS alias (i.e. an entry in a tnsnames.ora file)? Normally, you'd specify a TNS alias when you create the database link in which case you could simply modify that alias rather than changing the database link.
Third, synonyms do not become unusable or invalid just because the underlying object does not exist
SQL> create synonym invalid_synonym
2 for not_a_user.not_a_table@not_a_link;
Synonym created.
SQL> select status from dba_objects where object_name = 'INVALID_SYNONYM';
STATUS
VALIDYou'll get an error if you try to use the synonym, of course, but it won't be invalid. As long as you fix the database link before someone tries to use the synonym, there is no issue.
Justin -
Database Link name altered automatically
Hi everybody,
I'm facing here some strange behavior when I'm trying to create a database link. Here's the statement for creating the database link:
CREATE DATABASE LINK "DEVELOP" CONNECT TO "XXX" IDENTIFIED BY XXX USING 'develop';
After starting Oracle's SQL Developer it turns out that the link is successfully created.
BUT it's not named 'DEVELOP' as expected! Instead the link is named 'DEVELOP.100.10.82.181'
This leads to problems with a DataPump-Job because of an "invalid argument" (I suppose in this case the wrong link name)
How can I avoid this behavior? Or is it possible to alter the name? So far I did not found a solution or comprehendible explanation.
Any help will be highly appreciated.
Kind regards
AlexRobert Geier wrote:
Database version ?
select db_link from dba_db_links;
Try removing some of the quotes.@Robert: removing the quotes did not solve the problem.
Operating System: Mac OS X 10.5.8
SQL> SELECT * from v$version;
BANNER
Oracle Database 10g Release 10.2.0.4.0 - Production
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for MacOS X Server: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> select db_link from dba_db_links;
DB_LINK
DEVELOP.100.10.82.181
SQL> SELECT * FROM GLOBAL_NAME;
GLOBAL_NAME
CORPUS.100.10.82.181
SQL> SHOW PARAMETER global;
NAME TYPE VALUE
global_context_pool_size string
global_names boolean FALSE
Thanks again
Edited by: user9253174 on 03.03.2010 01:41 -
Now connected to database B :
INSERT INTO abc_hesids
( abc_key,
hesid,
date_added,
date_updated,
dob,
sex,
newnhsno,
homeadd,
procode3,
lopatid
SELECT 'X',
0,
sysdate,
sysdate,
HES_Common.f_string_field('X', 1),
HES_Common.f_string_field('X', 2),
HES_Common.f_string_field('X', 3),
HES_Common.f_string_field('X', 4),
HES_Common.f_string_field('X', 5),
HES_Common.f_string_field('X', 6)
FROM dual
The above INSERT has been reduced down to bare minimum with the following error occurring :
HES_Common.f_string_field('X', 1),
ERROR at line 18:
ORA-02069: global_names parameter must be set to TRUE for this operation
SQL>
The abc_hesids table exists in database A and this insert is running in database B. A database link exists such that abc_hesids is a synonym for the table of the same name in database A.
I want Oracle to insert into the table in database A but use the package HES_Common in database B. I think this is possible but have not done this sort of thing for a while. Note : the package HES_Common exists in both databases A and B
Any ideas on how to get Oracle to use the local version of the package - do I have to get the DBA to change global_names to TRUE ??ORA-02069 global_names parameter must be set to TRUE for this operation
Cause: A remote mapping of the statement is required but cannot be achieved because GLOBAL_NAMES should be set to TRUE for it to be achieved.
Action: Issue ALTER SESSION SET GLOBAL_NAMES = TRUE if possible. -
Before creating the link, I went into my init.ora file and made sure the GLOBAL_NAMES entry was false.
I then created a database link using the following:
create public database link cindy_link
connect to system identified by syspswd
using 'PRECISEI';
My link was created, but when I attempt to use it, I get the error:
ORA-02085:database link CINDY_LINK.WORLD connects to PRECISEI.WORLD
Here is the entry from my tnsnames.ora file:
PRECISEI =
(DESCRIPTION =
(ADDRESS_LINK =
(ADDRESS =(PROTOCOL = TCP)(HOST = taurus)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = precisei.world)
Here is the entry from my listener.ora file:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = precisei.world)
(ORACLE_HOME = E:|oracle\ora81)
(SID_NAME = precisei)
(I must admit to not having a full understanding of SID_NAME vs SERVICE_NAME.) I looked in dba_db_links, and my db_link is named CINDY_LINK.WORLD instead of CINDY_LINK.
Do I have a problem in one of my files?
I would really appreciate any help.
Thanks.Well, I was facing the same problem but corrected it later on. Let me describe the solution is little detail.
You need to check few things before creating db link.
1) db_name and db_domain in init.ora file
2) global_name in listener.ora file
3) service name in tnsnames.ora file.
It seems to me that you have not specified the db_domain in init.ora file. And in that case, you need to follow these steps.
I am considering here that you have database A on server X and database B on server Y.
Go to the first server (server X).
set the global name in init.ora file by following
Global_name=true
db_domain=usa.com
Start and open the database.
connect as system user.
(if your oracle sid is orcl then)
svrmgr30>alter database rename global_name
to orcl.usa.com;
this will set the global_name as specified in init.ora file. Here, your SID is orcl and db_domain is usa.com so global_name will be orcl.usa.com.
svrmgr30>Select * from global_name;
You get the answer like this.
Orcl.usa.com
Now, go to Listener.ora file and change global_name to the new name (orcl.usa.com)
restart the listener.
WE WILL SEE ABOUT THE CHANGES OF TNSNAMES.ORA LITTLE LATER.
Now, go to second server(server Y) and perform the same operation as defined above. i.e. Specify the db_name, db_domain in init.ora file, execute "alter database.." command for setting global_name and edit listener.ora file for new global name.
Once you do all these you need to create service on server 1 to connect to server 2 and on server2 to connect to server1.
Go to server X.
Open tnsnames.ora file and create an entry like this.
P =
(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = IP address of B)(Port= 1521)))
(CONNECT_DATA = (SID = P))
Here, P is global name of P ( at both the places).
Now, go to server Y.
Open tnsnames.ora file and create an entry like this.
Q =
(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = IP address of A)(Port= 1521)))
(CONNECT_DATA = (SID = Q))
Here, Q is global name of Q ( at both the places).
you are all set now.
Create database link between 2 servers now.
Say these are all your settings..
Server X is having database A with global_name orcl.usa.com and server Y is having database B with global_name orcl2.us.com
Now go to server X and create db link to server Y
Create public database link orcl2.us.com using 'orcl2.us.com'
(Note. don't miss to create a service 'orcl2.us.com' in server X's tnsnames.ora file)
And go to server Y and create db link there.
Create public database link orcl.usa.com using 'orcl.usa.com'
(Note. don't miss to create a service 'orcl.usa.com' in server Y's tnsnames.ora file)
hope this helps,
If this doesn't work, feel free to contact me.
Kalpen
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by cindy spearman ([email protected]):
Before creating the link, I went into my init.ora file and made sure the GLOBAL_NAMES entry was false.
I then created a database link using the following:
create public database link cindy_link
connect to system identified by syspswd
using 'PRECISEI';
My link was created, but when I attempt to use it, I get the error:
ORA-02085:database link CINDY_LINK.WORLD connects to PRECISEI.WORLD
Here is the entry from my tnsnames.ora file:
PRECISEI =
(DESCRIPTION =
(ADDRESS_LINK =
(ADDRESS =(PROTOCOL = TCP)(HOST = taurus)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = precisei.world)
Here is the entry from my listener.ora file:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = precisei.world)
(ORACLE_HOME = E:|oracle\ora81)
(SID_NAME = precisei)
(I must admit to not having a full understanding of SID_NAME vs SERVICE_NAME.) I looked in dba_db_links, and my db_link is named CINDY_LINK.WORLD instead of CINDY_LINK.
Do I have a problem in one of my files?
I would really appreciate any help.
Thanks.<HR></BLOCKQUOTE>
null -
Using Database link to go from one database to another
Hi all,
I am trying to create a SQL-query which connects to two
different databases.
I have created a Database link, which points from on database to
the other, and have supplied the database name, username and
password.
when I try to run following query I get error ORA:02085, MY_LINK
is connecting to SIEBN1S.(domain).com
SELECT COUNT(*) FROM MY_TABLE@MYLINK;
additional info:
2 databases are exact copies on different servers (SIEBN1S and
N1SSIEB)
the MY_TABLE exists in both databases and I have rights on it in
both, I can separately connect to both databases and look into
MY_TABLE
I have created the database link using following statement (in
the N1SSIEB db):
create database link MYLINK connect to <usr> identified by <pwd>
using 'SIEBN1S'
any help is welcomeYou have set GLOBAL_NAMES to TRUE in your init.ora file. This
means your database link must have the same name as the database
you want to connect to ie SIEBN1S.(domain).com.
alternatively you can change GLOBAL_NAMES. to test this try
'ALTER SESSION SET GLOBAL_NAMES=FALSE'.
hth, APC -
Creating a Database link for a user
Hello All,
I am trying to create a database link for one of my users.
When I create it as sysdba the link gets created in the SYS schema which tells me that my syntax is working/fine.
But when I ALTER my SESSION and set my CURRENT_SCHEMA = <USER_NAME> I get ORA-00990: missing or invalid privilege
So I tried granting the user CREATE DATABASE LINK, CREATE PUBLIC DATABASE LINK, and DROP PUBLIC DATABASE LINK.
Same error.
Any ideas what I am missing?
Thanks,
CraigCraigBoyd wrote:
Hello All,
I am trying to create a database link for one of my users.
When I create it as sysdba the link gets created in the SYS schema which tells me that my syntax is working/fine.
But when I ALTER my SESSION and set my CURRENT_SCHEMA = <USER_NAME> I get ORA-00990: missing or invalid privilege
So I tried granting the user CREATE DATABASE LINK, CREATE PUBLIC DATABASE LINK, and DROP PUBLIC DATABASE LINK.
Same error.
Any ideas what I am missing?
Thanks,
Craigyou need to create a new session after the GRANT was issued. -
Create a database link to access SqlServer 2005 view from oracle 11gr2
Hi All,
Greetings for the day.
Though I have seen quite a few posts but just wanted to cross-verfiy and double check hence posting.
Oracle Database : 11gr2
OS :SOLARIS SPARC 64 Bit
SQL Server Database : Sql Server 2005
OS : Windows 2003 32 Bit
The requirement is to access a view residing in the SQL Server 2005 Database using the Oracle Database. This involves creation of a Database link in the Oracle Database to access the SQL Server.
Can you suggest which approach should i follow ( I am able to understand that both do the same job ):
How to Configure DG4MSQL (Oracle Database Gateway for MS SQL Server) 64bit Unix OS (Linux, Solaris, AIX,HP-UX) post install [ID 562509.1]or
How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install [ID 561033.1]Will they do the same job ? And can they be used on any OS and version of the SQL Server Database as version information for SQL Server is not specified anywhere?
Please let me know so that I can it forward with Business for approvals and budgetting.
Regards
KKYour question is similar to the post: Oracle 11gr2 connection to Sql Server using dg4msql problem
Please visit: http://stackoverflow.com/questions/4658942/oracle-11gr2-connection-to-sql-server-using-dg4msql-problem
Answer on the website:
You seem to be using the Gateway for MySQL set-up rather than the Heterogeneous Gateway (for ODBC connections). Here is an overview of the process
On SQL Server create a database user and give it read access to the database/tables you want to read via the Oracle database link.
In the gateway home each SQL Server database you want to access should have an init.ora located in $OH/dg4msql/admin in the form initsid.ora where sid is the name of the database to be used in the link (e.g. initbob.ora), so create one
HS_FDS_CONNECT_INFO=msserver1:1234//Example_Database
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
HS_TRANSACTION_MODEL=READ_ONLY
You must now add the new sid to the listener.ora in the gateway home using an additional SID_DESC section inside the existing SID_LIST, for example
(SID_DESC =
(SID_NAME=bob)
(ORACLE_HOME=/oracle/gateway/product/11.2.0)
(ENVS=LD_LIBRARY_PATH=/oracle/gateway/product/11.2.0/dg4msql/driver/lib;/oracle/gateway/product/11.2.0/lib)
(PROGRAM=dg4msql)
You should now stop and restart the gateway listener so that the new sid becomes active. NB a reload is not enough.
You must now add the new sid in the tnsnames.ora file for the listener of each database in which you will create a link. You don't need to do this in the gateway home unless it is also a database home in which you will create a database link.
bob =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = severname.example.com)(PORT = 1690))
(CONNECT_DATA = (SID = bob))
(HS = OK)
NB: The host and port are for the gateway not for the SQL Server database
In each database that requires a link to the MS-SQL database you should create a database link to your new gateway sid.
CREATE PUBLIC DATABASE LINK bob
CONNECT TO "ms_user" IDENTIFIED BY "ms-passwd" USING 'bob';
where ms-user and ms-password are the SQL Server user you created right at the start.
Now you can test the new database link
SELECT COUNT(*) FROM "Table_Name"@bob;
Once you have this working you can alter the initsid.ora file to add parameters to suit your connection. If you do it this way you can easily add and manage many different databases via the gateway.
Hip
Edited by: 1000595 on 04:58 17-04-2013 -
Hi
I try send data from DB1 to DB2 via dblink.
I created link
CREATE DATABASE LINK MED
CONNECT TO user IDENTIFIED BY pass
USING
'(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.255.134.30)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = med)
and I can select data from remote table without errors.
When I try Insert data to remote table (with PLSQL)
for xx in (select u.*, sm.nr_gm, sm.nazwa nazwa_miejsc from adresy u ,sl_miejscow@med sm where u.miasto=sm.ident and
not exists
(select * from PAC@med pk where pk.ident_pac=u.identyfikator and pk.jednoraz='K' )
and u.data_zap is not null)
loop
insert into PAC@MED
(ident_pac, od_daty, do_daty, adr_ulica, adr_kod, nr_domu, nr_lokalu, telefon, jednoraz,z_kim_mieszka,ident_miejsc,ident_poczty,ident_kraj, adr_gmina, WOJEW_KOD, ADR_MIEJSC)
values
( xx.identyfikator, sysdate, to_date('31/12/2099','dd/mm/yyyy'),xx.ULICA, xx.KOD,xx.DOM,xx.LOKAL,
xx.TELEFON,'K',82, xx.MIASTO, xx.MIASTO, xx.kraj, xx.nr_gm,99, xx.nazwa_miejsc);
end loop;
I have error ORA-04054: database link string does not exist.
Can you help me ??
Message was edited by:
AndyPolI found solution.
Main problem was in GLOBAL_NAMES parameter.
This description help me:
Problem Description:
====================
You receive an ORA-02069 error during an insert to a remote database through a
database link when the insert contained a local sequence.
ORA-02069: global_names parameter must be set to TRUE for this operation
Cause: A remote mapping of the statement is required but cannot be
achieved because global_names should be set to TRUE for it to
be achieved.
Action: Issue alter session set global_names = true if possible
Problem Explanation:
====================
This is expected behaviour.
The insert statement is transformed so that it can be executed at the remote
end of the dblink. The reference to the local sequence has to be qualified so
that the remote end knows to call back to the local instance. The qualification
is made by appending @local_dbname.domain to the sequence reference if
global_names=true. When global_names=false, the code cannot make the assumption
that the qualifier will be valid and reports the error ORA-02069 'global_names
parameter must be set to TRUE for this operation'.
Search Words:
=============
DBLINK SEQUENCE GLOBAL_NAMES ORA-2069
Solution Description:
=====================
Use the following workaround:
1. Create a 'temporary' table on the local database for holding the inserts.
2. Insert the entire row into this table.
3. Insert the 'temporary' row from the temporary table to the remote table.
4. Delete the 'temporary' row from the temporary table.
This is slower but it will get around the problem. It help me
OR
Set GLOBAL_NAMES=TRUE in the init<SID>.ora - not work for me
Solution Explanation:
=====================
The first workaround bypasses the remote node having to make a
call back to the local instance to reference the local sequence. -
Oracle Streams 9i Database Link Error
Can anyone be help me regarding Oracle Streams 9i
Oracle Version: 9.2.0.5.0
Initial parameters:
global_name=true
aq_tm_processes=1
job_queue_process=10
log_parallelism=1 scope=spfile
database is in archivelog;
I executed the following SQL statements:
CONNECT sys/xxxxx@db1 AS SYSDBA
CREATE USER strmadmin IDENTIFIED BY strmadminpw
DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
GRANT CONNECT, RESOURCE, SELECT_CATALOG_ROLE TO strmadmin;
GRANT EXECUTE ON DBMS_AQADM TO strmadmin;
GRANT EXECUTE ON DBMS_CAPTURE_ADM TO strmadmin;
GRANT EXECUTE ON DBMS_PROPAGATION_ADM TO strmadmin;
GRANT EXECUTE ON DBMS_STREAMS_ADM TO strmadmin;
GRANT EXECUTE ON DBMS_APPLY_ADM TO strmadmin;
GRANT EXECUTE ON DBMS_FLASHBACK TO strmadmin;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_SET_OBJ,
grantee => 'strmadmin',
grant_option => FALSE);
END;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_OBJ,
grantee => 'strmadmin',
grant_option => FALSE);
END;
CONNECT strmadmin/strmadminpw@db1
EXEC DBMS_STREAMS_ADM.SET_UP_QUEUE();
CREATE DATABASE LINK db2 CONNECT TO strmadmin IDENTIFIED BY strmadminpw USING 'DB2';
CONNECT sys/xxxxx@db2 AS SYSDBA
CREATE USER strmadmin IDENTIFIED BY strmadminpw
DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
GRANT CONNECT, RESOURCE, SELECT_CATALOG_ROLE TO strmadmin;
GRANT EXECUTE ON DBMS_AQADM TO strmadmin;
GRANT EXECUTE ON DBMS_CAPTURE_ADM TO strmadmin;
GRANT EXECUTE ON DBMS_PROPAGATION_ADM TO strmadmin;
GRANT EXECUTE ON DBMS_STREAMS_ADM TO strmadmin;
GRANT EXECUTE ON DBMS_APPLY_ADM TO strmadmin;
GRANT EXECUTE ON DBMS_FLASHBACK TO strmadmin;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_SET_OBJ,
grantee => 'strmadmin',
grant_option => FALSE);
END;
BEGIN
DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE(
privilege => DBMS_RULE_ADM.CREATE_RULE_OBJ,
grantee => 'strmadmin',
grant_option => FALSE);
END;
CONNECT strmadmin/strmadminpw@db2
EXEC DBMS_STREAMS_ADM.SET_UP_QUEUE();
CONNECT sys/xxxxx@db2 as sysdba
GRANT ALL ON scott.dept TO strmadmin;
CONNECT sys/xxxxx@db1 AS SYSDBA
CREATE TABLESPACE logmnr_ts DATAFILE 'D:\oracle\oradata\db1\logmnr01.dbf'
SIZE 25 M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
EXECUTE DBMS_LOGMNR_D.SET_TABLESPACE('logmnr_ts');
CONNECT sys/xxxxx@db1 AS SYSDBA
ALTER TABLE scott.dept ADD SUPPLEMENTAL LOG GROUP log_group_dept_pk (deptno) ALWAYS;
CONNECT strmadmin/strmadminpw@db1
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_PROPAGATION_RULES(
table_name => 'scott.dept',
streams_name => 'db1_to_db2',
source_queue_name => 'strmadmin.streams_queue',
destination_queue_name => 'strmadmin.streams_queue@db2',
include_dml => true,
include_ddl => true,
source_database => 'db1');
END;
CONNECT strmadmin/strmadminpw@db1
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
table_name => 'scott.dept',
streams_type => 'capture',
streams_name => 'capture_simp',
queue_name => 'strmadmin.streams_queue',
include_dml => true,
include_ddl => true);
END;
Did this exp/imp
exp userid=scott/tiger@db1 FILE=dept_instant.dmp TABLES=dept OBJECT_CONSISTENT=y ROWS=n
imp userid=scott/tiger@db2 FILE=dept_instant.dmp IGNORE=y COMMIT=y LOG=import.log STREAMS_INSTANTIATION=y
and then
CONNECT sys/xxxxx@db2 AS SYSDBA
ALTER TABLE scott.dept DROP SUPPLEMENTAL LOG GROUP log_group_dept_pk;
CONNECT strmadmin/strmadminpw@db2
BEGIN
DBMS_STREAMS_ADM.ADD_TABLE_RULES(
table_name => 'scott.dept',
streams_type => 'apply',
streams_name => 'apply_simp',
queue_name => 'strmadmin.streams_queue',
include_dml => true,
include_ddl => true,
source_database => 'db1');
END;
CONNECT strmadmin/strmadminpw@db2
BEGIN
DBMS_APPLY_ADM.SET_PARAMETER(
apply_name => 'apply_simp',
parameter => 'disable_on_error',
value => 'n');
DBMS_APPLY_ADM.START_APPLY(
apply_name => 'apply_simp');
END;
CONNECT strmadmin/strmadminpw@db1
BEGIN
DBMS_CAPTURE_ADM.START_CAPTURE(
capture_name => 'capture_simp');
END;
Here is my problem:
After i configured it the streams still cannot replicate. And when I checked the EM GUI for streams monitoring it displays a broken database link.
Also it says that the database link is not active.
Can anyone please help?
Thanks.I don't know what Datacomp is, but you should be able
to connect to any non-Oracle database if there is
an ODBC driver for it. You would use Generic
Heterogeneous Services to do this. See the following
link to the documentation for details:
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96544/gencon.htm#1656
There are also several articles on the Net. Do a google
search on oracle generic heterogeneous services /
connectivity.
Hope this helps.
Kailash. -
How do you close a database link in Apex?
How do you close a database link in Apex that is referenced in an interactive report on Page 1? I want to make sure the database link is closed before a user navigates to another page in the Apex application.
Lets assume the database link is referenced in the region source for Page 1 as follows:
Page 1 - Employee Listing
Region Source:
select ename, job, hiredate
from scott.emp@link1
Any suggestions are appreciated.
Ms. HJohn,
I figured out how to eliminate the ORA-02020 and ORA-02081 errors. The solution is reference below:
1. Create an interactive report in a page.
2. Add the SQL statement in the region source as listed below:
SELECT ENAME, JOB, HIREDATE
FROM SCOTT.EMP@DBLINK
WHERE (UPPER(ENAME) LIKE '%' || UPPER(:P1_TEXT_SEARCH)||'%')
Conditional Display
Condition Type:
PL/SQL Expression
Expression 1
:P1_TEXT_SEARCH IS NOT NULL
3. Add a search button and text search field as items on the page.
4. Create a process in the page to check the cursor and catch an exception as listed below:
Name: CHECK_CURSOR
Sequence: 30
Point: On Submit - After Computations and Validations
Type: PL/SQL Anonymous Block
PL/SQL Process:
FOR C1 IN (SELECT ENAME, JOB, HIREDATE
FROM SCOTT.EMP@DBLINK
WHERE (UPPER(ENAME) LIKE '%' || UPPER(:P1_TEXT_SEARCH)||'%'))
LOOP
IF C1.ENAME IS NOT NULL
THEN
HTP.P('Employee Name: '||C1.ENAME||' ');
END IF;
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
APEX_APPLICATION.G_PRINT_SUCCESS_MESSAGE := 'No Data Found Error';
WHEN OTHERS THEN
APEX_APPLICATION.G_PRINT_SUCCESS_MESSAGE := 'Unexpected Error';
Conditional Processing
When Button Pressed (Process After Submit When This Button is Pressed)
P1_SEARCH_DATA
5. Create a process in the page to close the database link as listed below:
Name: CLOSE_DBLINK
Sequence: 40
Point: On Submit - After Computations and Validations
Type: PL/SQL Anonymous Block
PL/SQL Process:
COMMIT;
EXECUTE IMMEDIATE 'ALTER SESSION CLOSE DATABASE LINK DBLINK';
Conditional Processing
When Button Pressed (Process After Submit When This Button is Pressed)
P1_SEARCH_DATA
6. Apply changes, run the page, and conduct a test.
I hope this solution is helpful to others.
Ms. H -
Cannot drop public database link
Hi all.
Just trying to drop some old database links and getting the following:
SQL> select * from dba_db_links where host = 'V638';
OWNER DB_LINK USERNAME HOST CREATED
PUBLIC V638 SYSADM V638 23-SEP-04
SQL> drop public database link V638;
drop public database link V638
ERROR at line 1:
ORA-02024: database link not found
There was another db link in there called V638.WORLD and when I issued
drop public database link v638 it removed that one with no errors...
Any way I can get rid of this other one?
Version info:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for Solaris: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
ThanksYes I already tried that...
SQL> select * from global_name;
GLOBAL_NAME
VTEST1.WORLD
SQL> alter database rename global_name to test.world;
Database altered.
SQL> alter database rename global_name to test.world;
Database altered.
SQL> select * from global_name;
GLOBAL_NAME
TEST.WORLD
SQL> drop public database link v638;
drop public database link v638
ERROR at line 1:
ORA-02024: database link not found
SQL> alter database rename global_name to vtest1.world;
Database altered.
SQL> select * from global_name;
GLOBAL_NAME
VTEST1.WORLD -
ORA-02020 too many database links
Hello,
I'm getting the ORA-02020 too many database links error in my Apex application. This error occurs when I run an interactive report in a page. There are 21 pages and 7 database links in the application. Each page has one interactive report that references one database link in the region source.
The database links are referenced in each page as follows: database link1 (page 1); database link2 (pages 2 and 3); database link3 (pages 4-7), database link4 (pages 8-15); database link5 (pages 16-18); database link6 (pages 19); and database link7 (pages 20-21). Each database link is referenced to separate schemas in one remote Oracle database.
I tried to eliminate the error by setting the open_links and open_links_per_instance parameters in the init.ora file of the remote and XE databases to 100 then restarted the both databases. This solution did not work. I created separate Application Processes from the Shared Components to close each database link by implementing the following:
Click on Shared Components> Logic > Application Processes > Create >
Name: CLOSE_LINK1
Sequence: 1
Point: On Load: Before Header (page template header)
Type: PL/SQL Anonymous Block
Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
Error Message: Database Link Error
When I run the application now, the ORA-02081: database link is not open error appears.
Please help anyone! I know someone has experienced these same errors.
Thanks,
Ms. HJoel,
Thank you for your quick response. For clarification purposes, could you provide samples for 1) issuing the CLOSE DATABASE LINK and catching the exception; and 2) querying from V$DBLINK prior to issuing the CLOSE DATABASE LINK from the Shared Components > Logic > Application Processes?
Lets assume the following query with a database link in the region source is referenced for Page 1.
Page 1 - Employee Listing
Region Source:
select ename, job, hiredate
from scott.emp@link1
Lets assume the following Application Processes from the Shared Components is referenced to close the database link:
Click on Shared Components> Logic > Application Processes > Create >
Name: CLOSE_LINK1
Sequence: 1
Point: On Load: Before Header (page template header)
Type: PL/SQL Anonymous Block
Process Text: execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
Error Message: Database Link Error
My thoughts are to do the following:
1. Log in SQL*Plus as SYS
SQL> grant select to v_$dblink to scott;
2. In Apex, goto Shared Components> Logic > Application Processes and add the following queries in the Process Text:
Name: CLOSE_LINK1
Sequence: 1
Process Text:
select db_link from v$dblink;
execute immediate 'ALTER SESSION CLOSE DATABASE LINK LINK1';
3. Catch the exception???
Your assistance is greatly appreciated. :8}
Ms. H -
Database Link and error ORA-02019
Oracle 9.2.0.6 on Windows 2003
Has anybody encountered this before and been able to resolve.
SQL> connect SchemaA/password@NSN1
SQL> create database link MyLink1
2 connect to REMDB identified okm135
3 using 'STAF'
4 /
Database link created.
SQL> create or replace VIEW rem_mydocs as
2 (select * from mydocs@MyLink1)
3 /
View created.
SQL> grant select on rem_mydocs to UserA ;
Grant succeeded
SQL> Create or replace function fn_rem_mydocs
2 return Sys_RefCursor
3 IS
4 v_rc Sys_RefCursor;
5 begin
6 open v_rc for
7 select * from rem_mydocs ;
8 return (v_rc);
9 end;
10 /
Function created.
SQL> grant execute on fn_rem_mydocs to UserA;
Grant succeeded
SQL> connect UserA/test975@NSN1
Connected.
SQL> create or replace synonym rem_mydocs for SchemaA.rem_mydocs;
Synonym created.
SQL> create or replace synonym fn_rem_mydocs for SchemaA.sp_rem_mydocs ;
Synonym created.
SQL> select count(*) from rem_mydocs ;
COUNT(*)
324
SQL> var g_ref refcursor
SQL> begin :g_ref := fn_rem_mydocs; end;
2 /
SQL> print g_ref
ERROR:
ORA-02019: connection description for remote database not foundMetalink Note:262881.1
The information in this article applies to:
Oracle Server - Enterprise Edition - Version: 8.0.x to 9.2.0.x
This problem can occur on any platform.
Errors
ORA 2019 connection description for
Symptoms
Describe on a Synonym which is based on a database link may issue error:
ORA-2019 connection description for remote database not found
Select from the synonym works successfully.
Cause
Based on the Bug 3071468 this issue happens when the local
and the remote database have different domain name in the GLOBAL_NAME.
For example if:
select * from global_name;
gives from local database:
PROD.UK.ORACLE.COM
and the remote database has:
TEST.US.ORACLE.COM
then we have different domains for the global_name.
This does not reproduce when the domain is the same for both global_names.
Fix
This issue is fixed in 10.1.0.2.
For previous versions we have the following 2 workarounds:
1. Use View in the place of the synonym. This works.
2. Alter one of the databases global_name , so that the 2 global_names to have the same domain.
For example in the above example chenge the TEST database as:
sql> alter database rename global_name to test.uk.oracle.com;
Then you would have to drop and recreate the database link.
References
Bug 3071468 - Ora-2019 May Occur When Describing An Synonym Using A Database Link
Regards,
Reza
Message was edited by:
Reza -
Database link from Oracle8i to Oracle9i
Hi,
I am trying to create a database link from an oracle 8i database to connect to an oracle 9i database ... When testing the connection , I always receive an error "The Database link is not active"
Notes
1- Creating a database link that connects from the same 8i database to another 8i database succeeds. This gave me the impression that it is a compatibility problem but I am not sure.
2- I changed the initialization parameter
global_names = falseand restarted the Oracle database
3- the 2 databases are on the same domain
Did anyone pass through this problem before ??
thanksWell, I was testing the database link via DBA studio and there was no ora error associated with the message.
A friend helped me to identify and sove the problem. here is what he did.
Lets assume that the oracle8i database called Ora8i
and the oracle9i database called Ora9i
and that the network domain name is OraTest.com
When i select * from global_name; on both databases
Ora8i database return ==> ora8i
Ora9i database return ==> Ora9i.us.oracle.com
We then execute the following statement on Ora9i database
alter database rename global_name to Ora9i.OraTest.com;
Testing the database link after that went fine.
Thanks
Maybe you are looking for
-
The custm error page is not getting loaded in TomCat 5.0
Hi all, I am working on a JSF web application deployed in Tomcat 5.0.I was trying to redirect 404 and 500 error pages to custom error pages.But the error pages are not getting loaded and i am getting normal Tocat 404 status page. I am giving the web.
-
9.5.1 stalls on exporting a slide show
When trying to wxport a slideshow, iPhoto stalls. 9.5.1
-
Solution Manager trace file ? Details of all systems messages ?
Hi, I had developed custom applications involving different systems like IDES, R/3, File system and web services and BPM scenarios. These systems are integrated with XI, and now I want to monitor the message exchanges between these systems. I need al
-
Making sound noise when connect to the electricity plug
I am using Pavilion dv6-2150us notebook. My problem is when I connect to the electricity plug my note book makes sound noise when I on the sound. I could not use the wound while connected in electricity. Please help to solve this problem
-
Can't run Adobe Premiere Pro CS 6 64 bit
After I installed and satartes the program, it says my graphic card drivers are old. But they are the newest. So I think the problem is the graphic card itself, a ATI Radeon HD6490M. Is it possible that this graphic card isn't compatible with Premier