Cann't Drop public database link
I am not able to drop public database link .
Oracle Version - 11.2.0.1.0 - 64bit Production
Os Version - Sun Solaris .
When I am going to drop a public database link it's give a error :
SQL Error: ORA-00604: error occurred at recursive SQL level 1
ORA-20000: Can not drop Object
ORA-06512: at line 2
00604. 00000 - "error occurred at recursive SQL level %s"
Can anyone help to resolve this problem? It is a Production Database and it's a Urgent .
Thanks,
Dip Sankar Rana
You say:
I already given syntax of creating Public database link.
But you should give real details (exact statements and exact results) to make it clear what you are attempting and what your problem is.
Please show:
- The CREATE PUBLIC DATABASE LINK statement (obscuring the password, of course) and its result (i.e. success or failure message)
- From each of schema1 (working) and schema2 (not working):
- - The result of SELECT USER FROM DUAL;
- - The result of SELECT USER FROM DUAL@DB_TST;
- - The result of SELECT COUNT(*) FROM ALL_OBJECTS@DB_TST WHERE OWNER = 'B1';
In the meantime, an observation.
You said:
I create a public db link from schema1 to other database using below command --
CREATE PUBLIC DATABASE LINK DB_TST
CONNECT TO B1 IDENTIFIED BY password
USING 'SPPROD'Note that any user (in caps: ANY USER) on this database can use this link to connect to database SPPROD as B1 without knowing the password - because you put the credentials in the link.
If you have a PUBLIC database link with credentials, like you do here, you have a serious, glaring security exposure. You really, REALLY should not do this. Use a private database link (available only to the user that created it) or do not put credentials on the link (so that any user using that link is using his own credentials to connect to the remote database).
Edited by: mtefft on Jan 14, 2011 4:14 AM
Similar Messages
-
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 -
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. -
A question about CREATE PUBLIC DATABASE LINK and ORA-12154 error
Dear all,
I have a problem about public database link creation and I would appreciate if you could kindly give me a hand. I have the following connection parameters in my
tnsnames.ora file:
DGPAPROD.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY=tcp.world)
(PROTOCOL=TCP)(HOST=ORASR001)(PORT=1521)
(CONNECT_DATA = (SID = DGPAPROD))
...Having the above mentioned parameters I can connect to this remote database directly in a SQL*Plus shell:
$ sqlplus username/[email protected] works pretty well and the connection is established without any problem.
Now, what I would like to do is to create a public database link to this remote database in order to avoid the user/connection switching for viewing the
content of this database. I proceeded according to the syntax indicated in the Oracle online documentation:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5005.htm#SQLRF01205
Therefore I run the following in order to create a public database link
CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING 'DGPAPROD.WORLD';Apparently there is no error and the link is created successfully. However it cannot resolve the remote host and whenever I run the following query
(myenterprise is the name of a table in that remote database)
SELECT *
FROM myenterprise@SR001_dblink
ERROR at line 1:
ORA-12154: TNS:could not resolve the connect identifier specifiedWhat causes this problem?
Thanks in advance,
Kind Regards,
Dariyooshspajdy wrote:
You must have defined DGPAPROD.WORLD in tnsnames.oar on server where you DB is runnig.Hello there,
Thanks a lot for this nice solution. In fact I had to add the connection parameters into the tnsnames.ora file of the server on which the link was created (not the tnsnames.ora of my oracle client stored on the localhost)
After a bit googling I found another solution that allows to create the database link:
CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING '(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY=tcp.world)
(PROTOCOL=TCP)(HOST=ip_adresse)(PORT=1521)))(CONNECT_DATA = (SID = GPAPROD)))';Thanks a lot for your help!
Kind Regards,
Dariyoosh
Edited by: dariyoosh on 18 nov. 2009 07:15 -
ORA-31600 when trying to view SQL DDL for a created public database link
I created and committed a public database link and I can access the external database.
When I try to view the DDL of the link, on the SQL tab, I'm getting following error:
ORA-31600: invalid input value EMIT_SCHEMA for parameter NAME in function SET_TRANSFORM_PARAM
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA_INT", line 3900
ORA-06512: at "SYS.DBMS_METADATA_INT", line 4048
ORA-06512: at "SYS.DBMS_METADATA", line 836
ORA-06512: at line 1
and
ORA-31600: invalid input value LONGNAME for parameter NAME in function SET_FILTER
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA_INT", line 1980
ORA-06512: at "SYS.DBMS_METADATA_INT", line 3665
ORA-06512: at "SYS.DBMS_METADATA", line 670
ORA-06512: at "SYS.DBMS_METADATA", line 571
ORA-06512: at "SYS.DBMS_METADATA", line 1221
ORA-06512: at line 1
Is this because of a bug in SqlDeveloper or because the db_link and host parameters have 33 characters?
I'm using sql developer 1.5.3, build MAIN-5783
tx,
Roger VermeirIt's probably the length; really all sqldev does is calling:
select DBMS_METADATA.get_ddl('DB_LINK',:NAME,:OWNER) FROM dual;So if you call it a bug, it's a database bug in the DBMS_METADATA package.
But if you work with identifiers over 30 chars, I'd say that's a bug on it's own...
FWIW, I can't reproduce this on our 10g DB; are you on 9i?
Regards,
K. -
Query the column names from Public database links
Greetings,
I would like to retrieve the list of all the column names from a public database link. A regular ALL_TAB_COLUMNS doesn't seem to be working.
Thanks
John9569Hi,
I think your DBA needed to create a synonym for you to have access of that remote database view.
CREATE SYNONYM synonym_name
FOR view_name@db_link;Then you can find the column names by
DESC synonym_nameGuru's , please correct me If I am wrong.
Thanks
Edited by: user10679113 on Mar 12, 2009 12:28 PM
Edited by: user10679113 on Mar 12, 2009 12:33 PM -
Hi All,
I am using Oracle 10g.
I created one Public database link as :
i created this database link by connecting ora1.
CREATE PUBLIC DATABASE LINK "ora2_1" CONNECT TO CURRENT_USER
USING 'ora2';
When i run the select query i am getting error. as:
i run this select query by connecting ora1 database.
SQL> SELECT * FROM C_UPDT@ora2_1;
SELECT * FROM C_UPDT@ora2_1
ERROR at line 1:
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from ora2_1
What could be the problem.
ThanksHi..
I want to use that link for all schemas existed in ora2.so, i didnot specify the username, password.
>
The database link connects to the only one schema per db link in the target database.If you specify PUBLIC, then all the schemas in the source database (where the db link is created) can use and access data through it.So, if you want to create public database link for all the schemas in the target database ORA2, then you will have to create as many as schemas are present in ORA2.
Anand -
Restriction on accessing public database link
How to restrict certain users from accessing public database link.
ravi02, sb has pretty much nailed the answer in that if you make the link public then anyone can use it. However, is the link in question a fixed user link or a current session user link? With a fixed user link then whatever access is granted to the fixed user is available to any user who has access to your instance. On the other hand if each user is required to have their username created on the remote instance then object and role grants issued on the remote instance can still limit what objects a user may reference.
HTH -- Mark D Powell -- -
Retrieve password from public database-link
In the past we have created a public database-link to another database. Unfortunately we forgot the password and want to have it back. Sice the database-link is public, the password can not be found in user_db_links.
Is it possible to retrieve a password from a public database-link?Hi,
I know resetting in an Option for you but in worst case. Coming to the point you can get from "sys.link$" But how far will work on 10g verison did not checked. Try and see
Ahh. sorry Why you try "select dbms_metadata.get_ddl(’DB_LINK’,’TEST’,user) from dual
it will give the script. If the password in encripted for 10g try with "link$" it will work.
- Pavan Kumar N
Edited by: Pavan Kumar on Nov 18, 2008 3:57 PM -
Hi there,
Possibly overlooking something but can I export a public database link using SQL Developer?
Thanks.HI,
Public synonym can not be exported and never exported even at FULL Export also. . You can get them from "dba_synonyms". I suggest that you create so customer script .
select 'create public synonym ' || table_name || ' for ' || table_owner || '.' || table_name || ';'
from dba_synonyms
where
owner='PUBLIC' and table_owner not in ('SYS', 'SYSTEM')
order by
table_owner;
More: Information:
https://forums.oracle.com/thread/855639?start=0&tstart=0
Oracle Data Pump Schema Export and Public Synonyms
Thank you -
Gentlemen,
I would like to recreate the public database links with new username and password. Prior to that, I want to know which user the current public database link in connecting to.
The dba_db_links table shows only the user name for private database links. Where can I find the username for public database link.
e.g.,
SQL> create public database link abc.domain.com connect to targetuser idenitified by targetpassword using 'abc.doman.com';
Where I find the information about targetuser; it is not shown in dba_db_links table for public database links.
ThanksThis indicates that the connection information (username/password) was not specified when the database link was created.
http://docs.oracle.com/cd/E11882_01/server.112/e25494/ds_admin002.htm#ADMIN12154
This implies that if user A on the local database tries to use this link, then the same account (i.e. A) with the same password exists on the remote database - i.e. all of the users on the local database that use this link are duplicated on the remote database as well.
HTH
Srini -
ORA-02081 error while trying to drop a database link
Hello,
I am trying to drop a database link but getting ORA-02081. How do you drop a database link if it is not open? Any help will be much appreciated.
MustafaTry this:
COMMIT;
alter session close database link dbl1;
drop database link dbl1;
Regards, -
I have two computers at my training lab. Both have computer Oracle 9i install. Bith have service/tag cats.
1.)
Computer Name : 10227-mr-srv.abc.com
Oracle service name : cats
2.)
Computer Name : 10227-ocrsrv.abc.com
Oracle service name : cats
Now from 1st oracle server, I want to connect to 2nd oracle server.
May be using fixed user hr Password hr_1.
Can you please give exact CREATE PUBILC DATABASE LINK statement for same.
May have to use identifier as creating loop.You can check out the syntax and examples here
-
Drop database link & ORA-02082 Error
Hello,
I have created db link. Now, I would like to DROP it but I got "ORA-02082 a loopback database link must have a connection qualifier".
I have tried every possible combination but without success.
Thanks for help
sasaHello Barbara,
I agree with you that if db link exist I should be able to drop it. If you look into my first reply there is complete select from user_db_links. Select from dba_db_links are the same because I haven't any others db links. I try to drop the db link as owner or as sys. I do not need to think about drop with name "qwer.cscargo.cz" because is wrong (our inner domain is "in.cscargo.cz"). The only difference among others db links is that qwer have "current_user".
DB_LINK USERNAME HOST
CARGODB.IN.CSCARGO.CZ CARGO_ADM cargodb
LMDB.IN.CSCARGO.CZ CARGO_ADM lmdb
QWER.IN.CSCARGO.CZ CURRENT_USER speisdb
SPEISDB.IN.CSCARGO.CZ CARGO_ADM speisdb_rac
There could be one problem. I created the db link when my db have name "speisdb". I rename my db (using rman - duplicate db) to "speisdev". Could be this source of problems?
Here is output of your drop script:
drop database link qwer
ERROR at line 1:
ORA-02082: a loopback database link must have a connection qualifier
drop database link qwer.cscargo.cz
ERROR at line 1:
ORA-02024: database link not found
drop database link qwer.in.cscargo.cz
ERROR at line 1:
ORA-02084: database name is missing a component
drop database link qwer@loopback
ERROR at line 1:
ORA-02024: database link not found
drop database link qwer.cscargo.cz@loopback
ERROR at line 1:
ORA-02024: database link not found
drop database link qwer.in.cscargo.cz@loopback
ERROR at line 1:
ORA-02084: database name is missing a component
drop public database link qwer
ERROR at line 1:
ORA-02082: a loopback database link must have a connection qualifier
drop public database link qwer.cscargo.cz
ERROR at line 1:
ORA-02024: database link not found
drop public database link qwer.in.cscargo.cz
ERROR at line 1:
ORA-02084: database name is missing a component
drop public database link qwer@loopback
ERROR at line 1:
ORA-02024: database link not found
drop public database link qwer.cscargo.cz@loopback
ERROR at line 1:
ORA-02024: database link not found
drop public database link qwer.in.cscargo.cz@loopback
ERROR at line 1:
ORA-02084: database name is missing a component
Thanks SASA -
Hi,
As user SYS i need to Dynamically DROP all the database link in the Database.
I cant drop private database link .
For example i have few database links under APPS schema that i would like to drop.
Please note that it should be done by SYS user
SQL> declare
2
3 cursor c is
4 select *
5 from dba_db_links;
6
7
8 begin
9 for c_rec in c loop
10
11 if c_rec.owner = 'PUBLIC' then
12 execute immediate ' drop public database link '||'"'||c_rec.db_link||'"';
13 else
14 dbms_output.put_line (' drop database link '||'"'||c_rec.db_link||'"');
15 execute immediate ' drop database link '||'"'||c_rec.db_link||'"';
16 end if;
17 end loop;
18
19 end;
20 /
drop database link "APPS_TO_APPS"
declare
ERROR at line 1:
ORA-02024: database link not found
ORA-06512: at line 15Thanks791550 wrote:
Yet it doest work please see bellow:Correct. The domain name can optionally be included with the database name. So if you for example want to drop database link "ABC.DEF.WORLD.COM", does ABC refer to the link name and DEF.WORLD.COM to the domain?
Or is ABC the schema name, DEF the link name and WORLD.COM the domain?
And what is schema ABC exists with link DEF.WORLD.COM and in the current schema there's a link called ABC for domain DEF.WORLD.COM ?
So there is no clean and correct way for Oracle to resolve the schema scope of a database link name.
If you, as SYS, want to drop all database links, then you can use the DBMS_SYS_SQL interface - this is a (mostly undocumented) interface for parsing SQL as any specific schema on the database. The DBMS_SQL interface (restricted to parsing as the current schema) is documented and runs on top of this system interface.
E.g.
create or replace procedure DropDbLink( schemaName varchar2, dbLink varchar2 ) is
cur number;
plsql varchar2(1000);
uid number;
rc number;
begin
select
u.user_id into uid
from dba_users u
where u.username = schemaName;
plsql := 'drop database link "'||dbLink||'"';
cur := SYS.DBMS_SYS_SQL.open_cursor;
SYS.DBMS_SYS_SQL.parse_as_user(
c => cur,
statement => plsql,
language_flag => DBMS_SQL.native,
userID => uid
rc := SYS.DBMS_SYS_SQL.execute( cur );
SYS.DBMS_SYS_SQL.close_cursor( cur );
end;
/This proc, as SYS, allows you to drop any private database link from the SYS schema.
Maybe you are looking for
-
Edit in Photoshop CC from within Lightroom 4.4
I have replaced a Windows 7 installation of Photoshop CS4, with CS6, then with Photoshop CC. Now, when I right-click an image in LR to Edit in Photoshop, the menu option for Photoshop appears in the submenu as the Windows pathname to the old CS4 pro
-
5800 GPRS turns off too late...
Hi guys, I have a problem with my Nokia 5800 (Firmware 20+). here in dubai, my Provider (etisalat) doesn't support Dual mode (GPRS and Calling at the same time). I have Nokia messaging service enabled on the phone and receive my emails just fine. (e
-
Ok, so i was going to watch Utube and i plugged in my headphones to not disturb the people around me. It started to play sound in the headphones and people were looking at me. i took off the headphones and for some reason it was playing through the s
-
Not sure what's gotten into me today... feel like I'm loosing it. I'm getting a list of users back from a RemoteObject method call. I can't seem to remember how to parse them out. Is this the appropriate method? private function loadUsersByGroupHandl
-
Replacing/relinking files over a network
This might be an OS issue and not related to After Effects but I thought I would give it a shot here. I have a project that was created entirely with still images (almost 200,000) shot with a Canon 5D. I converted the CR2 (RAW) to jpegs and edited t