a doubt on the database link
Hi allI use 10.2.0.1.0 oracle.
I had 2 databases named ( ora1, ora2 ).
in fact, I have to connect to ora1 and to use tables, procedures exist in ora2.
So, I've created database ora2 as database link:
CREATE DATABASE LINK ora2_test
CONNECT to ora1_user
IDENTIFIED BY ora1_password
Using of "ora1";
Here is ora2_test name of the database link.
Am I wrong?
I am connected to ora1 as
connect ora1_user/ora1_password@ora1;
Select * from redg@ora2_test;
but I get the error message.
Any help please.
Thank you
Please post the answer as correct/useful.
Asif kabir
Tags: Database
Similar Questions
-
How s/n know when and what account perform a function using the database link?
Dear,
My application of the CIM team asked DBA to create new function and run it. Function must use the database link for remote database data. So I need to create a new database to their licensing link. Cause we guess we'll experience the performance issue after the user performs this function, or another question and errors may occur. So we want to know when and who use this feature that connects to a remote database through the new database connection in advance. And I also need to know when and which connect to the remote database using this new database link. We have no idea to get this information? Can anyone recommend how do? Thank you very much.
Best reqards, Otis.
Check what business purpose, it will solve. If the function is so safe, why everyone will use. Only admin people should access.
All of these additional controls of this kind must be avoided as much as possible to improve the overall performance of the application.
Still if you need, see the database audit mechanism, specifically designed for this type of activity.
Kind regards
Harman
-
Using the database links in a process of page plsql
I try to use a database link in a process of pl/sql page.
It works fine when I use the link name in the plsql like this:
BEGIN SELECT CARD_ID into :P12_HDR_CARD_NUMBER from [email protected];
But the name of the link will come an element of page (P12_DBLINK) filled as follows:
select db_link d, db_link r from user_db_links;
I tried the following and it doesn't work:
DECLARE l_link VARCHAR2(30); BEGIN l_link := :P12_DBLINK; SELECT CARD_ID into :P12_HDR_CARD_NUMBER from fusion.EXM_CC_COMPANY_ACCOUNTS@l_link;
It gives me:
- ORA-04052: error occurred when searching to the top of the remote object MERGER. EXM_CC_COMPANY_ACCOUNTS@L_LINK. WORLD ORA-00604: error occurred at recursive SQL level 3 ORA-02019: description of the connection to the remote database not found
I thought that perhaps the name of the link was joined with. WORLD automatically but already has the name of the link. WORLD at the end I tried stripping first but the error is the same.
Is there some synatx for what will work? Can I use dynamic sql statements?
Any suggestions are most appreciated.
Thank you
John
Hi John,.
see the following example to use the execute immediate for your purpose
SQL - Variable for the name of the database link - Stack Overflow
Let me know if that answers your query in the active thread
-
Authentication of database through the database link
Is it posible to use database authentication in the APEX by link of database and how?
Also is it posible to reading user roles through the database link?
Database links to establish the connection, so you lose the context regarding which is recorded in a single user.
Custom authentication can do some PL/SQL you need, but I would say that replicate your tables locally through something as materialized views.
You could also potentially be used dba_role_privs, but do not forget roles can be turned on/off.
-
strange problem with the database link
Hello world
I have a strange problem with the link of database in Oracle 11 g Express Edition;
There are two computers: computer-server and the client computer. Tnsnames.ora are the same on both computers IE.
CT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = krzysztof) (PORT = 1521))
)
(CONNECT_DATA = (SERVICE_NAME = XE)
)
)
I created the database link:
Create database link zdalny
Connect to < user_id > identified by < password >
using "CT".
Customer cannot connect with server when I do not use above the command. But when I change 'use' for using "krzysztof:1521" or by using "krzysztof" or "server IP:1521" - everything is ok.
Why I ask. Because in all the materials that I read about Oracle command with the help of "CT" should work correct. But there is no. Do you know why?
Thanks in advance and apologize me for my English.
Rgds
KrzysztofHere's the tnsnames of your server, but to connect to the oracle server db (any client or to another instance of db oracle), you must install oracle client.
However, in your condition, you want to connect the DB1 Oracle OracleDB2 using a link db, I'm right? In this case you should always set the entry in the tnsnames.ora
To verify that you can connect to Oracle DB2 from DB1 Oracle, you can use tnsping in the command line.
In your casec:\tnsping CT
Krzysztof Szymaniak wrote: CT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = krzysztof) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)Check your tnsnames entry in the machine, you are trying to connect to. And check if the tnsping is successful.
Sometimes the error message says not everything, which means that you need to troubleshoot yourself and learn from the experience.
Always in the opposite case, refer to the documentation.See you soon.
Published by: Spongebob December 14, 2011 09:30
-
try to reduce the database links
Hello. Thank you for helping.
I think my basic question is this:
I can connect and create database links that can be used by all other users (and tablespaces?) on the server?
I have a bad understanding of how the areas of storage, dblinks and users go together, so I'll briefly describe my setup process so you can see how I have things that can be part of the cause of my confusion, possibly in a subtle way.
For this example, I have 2 servers with Oracle 11 g Enterprise.
After you create a database, I then create tablespaces, users and links like this:
On server 1:
create storage my_app1
create the user my_app1
create storage my_app2
create the user my_app2
and so on for all areas of storage and users on the server.
Then log in as my_app1 and create a link of database on server2:
link_to_s2 fixed my_app3 user
Then log in as my_app2 and create a link of database on server2:
link_to_s2 fixed my_app3 user
Same process on server2:
create storage my_app3
create the user my_app3
create storage my_app4
create the user my_app4
and so on to server2.
Then log in as my_app3 and create a database link to server1:
link_to_s1 fixed my_app1 user
Then log in as my_app4 and create a database link to server1:
link_to_s1 fixed my_app1 user
It operates well for me, except that I have to create four dblinks.
Is everything I see how this can be simplified to create dblinks less?
Any suggestions are greatly appreciated.Hello..
Why not create a public database link.
Documents: -.
Specify the PUBLIC to create a public database link available to all users. If you omit this clause, the database link is private and is only available to you.
[http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5005.htm#sthref6315]Anand
-
I try to import tables from one database to another via a database link. But faced with a weird error. Help, please.
Operating system: Server Linux Oracle release 6.4
Database of the source: Oracle 12.1.0.2
Target databases: Oracle 12.1.0.2
Measures
- Created a TNS entry for the source on the target server database.
- Create a link from public database to the schema of the source by using the tns name.
- Created a database in the target database directory and the permissions granted to the user target.
Run the command below
Impdp directory with name of user and password = dirname tables = network_link = linkname schema.tablename
Get the below output
Import: Release 12.1.0.2.0 - Production on Fri 9 Oct 14:51:32 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production database
With the options of partitioning, OLAP, advanced analytics and Real Application Testing
ORA-39004: invalid state
ORA-39091: unable to determine the State of standby and logical flow
ORA-06550: line 1, column 47:
PLS-00103: encountered the symbol "IN" when the expected in the following way:
< an ID > < a between double quote delimited identifiers of >
Hello
Run the command below
Impdp directory with name of user and password = dirname tables = network_link = linkname schema.tablename
can you show real impdp statement executed...
I guss here is the problem network_link 'name '.
Rajesh
-
doubts in the database using backup controlfile recovery.
Hi gurus,
I have a doubt in database recovery using backup controlfile.
I do not speak of "ORA-01207: file is newer than the control file - old control file.
Here, any of our files archive / redo log have been lost and the problem of lack of update in the control file.
So why open the database in resetlogs option, after recovering the database by using a backup controlfile. ?
Thanks in advance
Mahi
In order to maintain the consistency of the data, the RCS should be the same in all the files of the controlfile & file REDO data current.
By definition when you use 'backup controlfile' there a SNA expired in it.
RESETLOG requires the RCS to 1 in order to get consistency across all files in the database.
CREATE CONTROLFILE fills this new file with the most recent SNA that exist in the data files.
It's just the way Oracle has been implemented.
-
image uploaded to the database link
Hello
I downloaded the images in my server so now I want to show on different pages using php and mysql, so can someone tell me how I can do this in dreamweaver php codes or manual?
Please begin your answer of the way to start step I have to do after the download of the image, I also know a database table also be require for images should this complete tutorial please. Therefore, please answer thank you.
tanveerh86603130 wrote:
I mean if I have uploaed images manually on the server and now when I create a new page in php with the mysql database and want to inlucde one of these uploaded image dynamcally, so how I can do, how can I create table for these images and then use this table for u place links to this image?
If youre doing this manually - you should now have all your images in a folder on your server.
To get dynamically on a page, you must include the name of the image in the database table.
Create another field in your database table called - model_image
Then insert the name of the image in this area, associated with the mobile _name - nokia_1100.jpg, samsung_2300.jpg etc.
Back in your page model_details.php use a query as I pointed out in the other thread:
$model_details = mysql_query ("" SELECT * FROM mobile_phones WHERE model_id = ' $model_id ' ' ") or die (mysql_error ());
$model_details = mysql_fetch_array ($model_details);
Then echo the image of the page according to the model_id adopted in the link to the model_details.php page. (replace "folder_name' by the name of the folder in which images are stored)
as well as its other fields:
All this can be done through server Dreamweavers behaviors if you do want to write your own code. Don't forget the code that Dreamweaver now uses dynamic development is outdated.
-
ONLY INSERT OR DELETE THE PRIVILEGE TO THE DATABASE LINK
Hi all
Version of DB 11.2.0.1
RedHat 5.5 operating system
I created a link to private database by following the path
create database link test_link
connect to Scott identified by tiger
using
'(DESCRIPTION =)
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.194.180.45)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = prod)
)
)'
The link is created successfully and I am able to perform all the DML operations on it.
The Question is there a way by which we can give only insert or delete or privilege is not to remove from the table at this link.
For operations select only, I know that by creating a view I can restrict the remote user, but is there a way by which I can give only insert or remove remove link of database.
You can not grant any privilege to a link. Can you and your team identify a location in the documentation, if required?
By default, a remote session will get the same privilege as the user to which it connects.
BTW:
- do not use a database link tnsnames.ora makes your hard to maintain link
- using addresses IP hard in a database link makes your link even more difficult to maintain
- by specifying a hardcoded password in a database link is a breach of security.
-------------
Sybrand Bakker
Senior Oracle DBA
-
ORA-03113 while using the database link
From our database, we use a database link to query on a different database tables: they are the two 10.2.0.4
It is not always occur, but often. You have an idea? Thank youTake a look at this note:
ORA-03113 UNIX - what information collect [ID 17613.1] -
Hi guys!
I'm having problems creating a data link...
I enter something like < IP >: < PORT > / < SID > in the SERVICE NAME field and the Assistant returns me error message.
This structure for THE SERVICE NAME is correct?
Thank you.Hello
I think the nomenclature might be a little better. During create/edit the entry box is marked but the Service name in outdoor, HOMEtab, and in fact both are misleading.
Looks like you want to use the format EZConnect [host: port / service name].
http://www.orafaq.com/wiki/EZCONNECTService_name is generally SID.domain, but you can get away with only SID since many products add the local domain name. It can work if you leave off of the area, but local and remote domain names are the same.
It's really much easier to use a TNS alias if you have a local listener running with the appropriate entry in the tnsnames.ora file. Thus, for example, in my environment my sqlnet.ora file contains this line:
NAMES. DIRECTORY_PATH = (TNSNAMES, EZCONNECT)
My remote database THAT SID is ora1122 on, say, xyz1234567 to the remote computer and I have a TNS alias entry of the xyz1122 in my local tnsnames.ora file. Given these parameters, I am able to create the database to help link
xyz1122
or
xyz1234567:1521/ora1122.us.Oracle.com
Thus the first case depends on all: the local listener running, the tnsnames.ora and sqlnet.ora parameters. The second case only on rethinking the host, port, and service. And, in my environment, I actually couldn't give up the domain name. us.Oracle.com.
I hope that this more detailed example is aid,
Gary -
v ('APP_USER') on the database link
We have an APEX appliocation that updates the tables via 2 database llinks VIEWS
the views were created in select * from Employee@DBLINK for example
on each of the remote databases, we have implemented a package of verification which has been copied from another application and is called from the triggers
the following INSERT statement works very well when demand and the DB tables are not using the links
INSERT INTO AUDIT_TBL (TIMESTAMP, WHO, TNOM, CNAME, OLD, NEW, GCI)
VALUES
(sysdate, v ('app_user'), upper (l_tname), upper (l_cname),)
l_old, l_new, l_GCI);
but when the table is updated via the points of view on data base linking the value of v('app_user') is null
no idea how I can fill this value on the links
Thanks in advance
ChrisHello
If you set the client_info context when the user connects so yes it will happen. Apex sessions are pooled are reused by different users. That's why when a database of apex session creates a session on the remote database so that remote session is reused until the closing of the database session and therefore will be used by different users of the Apex. The client_info context is a session context and will be set for the duration of the session.
Therefore, you must set the context when the page is processed before we do each remote update. You can also issue an ALTER SESSION CLOSE DATABASE LINK
to ensure that the remote session is closed and cannot be reused, but this should not be necessary. Rod West
-
Using the database link in the applications
Hello
I just configured and created a PUBLIC database link on my oracle 10g. Can I use it with success of sqlplus do some like select simple:
"SQL > select * from table"@dblink ".
The query returns the result as expected.
Now, I would like to use this public link in my applications, but the problem is that the link seems to be only available in the SYS schema.
Ho can I access to a schema?
In other words, to do some select (and insert) of my applications APEX by using the link to the db. If I try to select said, all I get is
ORA-02019: description of the connection to the remote database not foundOK, thanks all for the help, I found the problem.
It seems that I created the link of database public and not public.I gave both of them and re - create public database link and now it works.
Thanks for the help.
-
creating user using the database link
Hello
I have 11g installed on one of the server
I created the database BUGAU to bugau.us.oracle.com link
link works fine
"Select * from table@"Bugau "gives the expected result
I ran the Sub statement to my server using the dblink.but do not know how to use the dblink to that effect. Please sat down
CREATE USER ABC IDENTIFIED BY welcome TEMPORARY by DEFAULT TABLESPACE USERS_001 temp123 TABLESPACE;
GRANT DEFAULT TO abc;
ALTER USER abc PROFILE LEVEL_1;
Thank you
ArchanaBravid wrote:
You cannot create a user on a remote database using a database link.
You can, but it is not a good design:
SQL> exec dbms_utility.exec_ddl_statement@orcl('CREATE USER ABC IDENTIFIED BY ABC'); PL/SQL procedure successfully completed. SQL> exec dbms_utility.exec_ddl_statement@orcl('GRANT CREATE SESSION TO ABC'); PL/SQL procedure successfully completed. SQL> connect abc@orcl/ABC Connected. SQL>
Of course, the user in the database unite ORCL must have EXECUTE on DBMS_UTILITY privilege.
SY.
Maybe you are looking for
-
Sorry, I'm not able to provide more details. I don't know how it happened, but I really don't like.
-
Default fonts in the Photos app
I create a quick slideshow in Photos and usually I add text in some of the photos in the slideshow. Is it possible to change the default font that chooses pictures for the text? I have found no way to do so.
-
Download the app from the MLB on my Sony Bravia?
-
Crashing when trying to list errors
After doing a few storage a complex provision of application Labview code now refuses to errors in the list and I can't find. LabVIEW and then quickly ends. Everyone came through this with Labview 8.6.1?
-
Please help, my cd/DVD on my laptop drive disappeared all of a sudden and I don't know what to do to get it back?