Database link from one Oracle database to another
Hi everyone!
I have 2 databases. I need to create a database link to copy a table from one of the database to another.
Both of them are Oracle 10g v2
Please advice me on how can I go about it.
I am trying to avoid import and export.
What are the options left to me?
Thanks
user5160274 wrote:
Hi Kanchana,
I am using Oracle 10g/Windows Server 2008. I have created a dabaselink. The link works perfectly fine. I want to copy the table (Oracle 11g) from remote server in to my database. It is ongoing process ie, it has to be scheduled and I want the updated rows to be copied in to my database on a daily basis. Please help me out.
Eagerly awaiting for your response.
Regards
Narayanan NAnd once again a new member of the forum, on their very first post, goes on an archeological dig and tries to raise the dead. This thread is well over a year old. You should have started your own thread for your own issue. You say you have created a link and it works, so whatever your problem is, it is NOT even related to the question the OP raised.
At exactly what point are you unsure about the process? Scheduling a processes? The command to use? Exactly what have you tried? What results do you have so far?.
Please, start a new thread explaining your issue.
Moderator --- please lock this thread.
Similar Messages
-
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. -
Import/export from one oracle db to anothe roracle db
Hi All,
I would like to import and export data from one oracle database to another oracle database. Can any one please suggest me/provide me any script if available.
I am following Datapump IMPDP and EXPDP. I would like to do this data pump process every time. So I wolud like to do this task as automate. So please provide me any script for automating this job
or let me know if there is any easy method to do this process.. I would like to have a script and am uising Oracle 11.2.0.3.
ThanksHi,
Below Anonymous block Exports the 'HR' schema:
DMPDIR -- Directory object where you want to create the dmp files
DECLARE
l_dp_handle NUMBER;
l_last_job_state VARCHAR2(30) := 'UNDEFINED';
l_job_state VARCHAR2(30) := 'UNDEFINED';
l_sts KU$_STATUS;
BEGIN
l_dp_handle := DBMS_DATAPUMP.open( operation => 'EXPORT', job_mode => 'SCHEMA', remote_link => NULL, job_name => 'SCHEMA_EXPORT', version => 'LATEST');
DBMS_DATAPUMP.add_file( handle => l_dp_handle, filename => 'SCHEMA_EXPORT.dmp', directory => 'DMPDIR');
DBMS_DATAPUMP.add_file( handle => l_dp_handle, filename => 'SCHEMA_EXPORT.log', directory => 'DMPDIR', filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
DBMS_DATAPUMP.metadata_filter( handle => l_dp_handle, name => 'SCHEMA_EXPR', value => '= ''HR''');
DBMS_DATAPUMP.start_job(l_dp_handle);
DBMS_DATAPUMP.detach(l_dp_handle);
END;
Now you can use this dmp file to import the 'HR' schema in the required database.
Below Anonymous block imports the 'HR' schema:
DECLARE
dph NUMBER;
BEGIN
dph := dbms_datapump.open(operation => 'IMPORT', job_mode =>
'SCHEMA',job_name => 'SCHEMA_IMPORT');
dbms_datapump.add_file(handle => dph,filename =>
'SCHEMA_EXPORT.dmp', directory => 'DMPDIR',filetype=>1);
dbms_datapump.add_file(handle => dph,filename =>
'SCHEMA_IMPORT.log',directory => 'DMPDIR',filetype=>3);
dbms_datapump.start_job(dph);
dbms_datapump.detach(dph);
END; -
I have a document made up of separate PDF files which reside in a folder and are linked to each other via hyperlinks. Each pdf file is set to open with bookmarks displayed, however if I link from one PDF file to another and use the "Previous View" button to navigate back to my starting point the bookmarks are replaced by "page thumbnails". Is there anyway to stop this from happening?
Hi Pusman,
While setting up the links, if you choose to open the file in a new window then you won't face this issue, then you can simply switch to the previous file and bookmark view will remain as it is.
Does that helps with your query?
Regards,
Rahul -
Migration from one oracle DB to another Oracle DB
Hi ,
We are migration data from one oracle DB to another Oracle DB. Lets take it as DB1 and DB2.
Both are having many tables and many columns. So some tables contains common columns with different data types and same datatype with different datasize.
I am trying to map the columns in both the DB's. Then I will retrieve what are the equal columns and what are columns have difference in data types and datatype lengths.
for Eg : Please find the below tables and the structures.
DB1 DB2
EMP EMPLOYEE
ENO VARCHAR2(10) EMP_NO Number(8)
ENAME Varchar2(25) EMP_NAME Varchar2(20)
SAL NUMBER(8) JOb VARCHAR2(20)
Description BLOB/CLOB Department Varcgar2(20)
SAL number(8,3)
JOB_DESC varchar2(30)
I would like to migrate DB1 to DB2
Here I found the differences as follows.
1. There is relation between EMP and EMPLOYEE tables.
2. Datatype is different for EMPNO(DB2) compare to DB1. ( Here in DB1 datatype is Varchar and in DB2 it is Number )
3. in DB1 Ename datatype length is 25 and in DB2 it is 20...
So can any one suggest me any pl/sql automation code how can we map the columns,datatypes,datalengths and other required information.
Can you please suggest me and give your suggestions to write automation code if possible or how can we resolve these type of issues.
Thanks,
VasSo can any one suggest me any pl/sql automation code how can we map the columns,datatypes,datalengths and other required information.
No such 'automation code' exists. You need to write your own mapping functions and exception handling processes.
Can you please suggest me and give your suggestions to write automation code if possible or how can we resolve these type of issues.
Finish what you started. The most important step you can take is to create a Functional Requirements document that includes, at a minimum:
1. Mapping of each source table to each target table
2. Lists of possible errors, or dirty data issues, that might be encountered
3. The business rules that should be applied to each of those possible errors
You already made a good start on the mapping for the one table above. And you made a good start of identifying the possible errors:
2. Datatype is different for EMPNO(DB2) compare to DB1. ( Here in DB1 datatype is Varchar and in DB2 it is Number )
Good - it should be easy for everyone in your org to agree that you can't put 'TEXT' data into a NUMBER column so now you need to document that issue:
1. Identify data in DB1.ENO that is not numeric
2. Remove, ignore, fix that data?
What do the business users want to do with text data in that DB1.ENO column that is not numeric? They need to tell you. They may want a report or excel file that contains that 'dirty' data so they can review and/or fix it. They may want to query that data for themselves. They may want to know where that data came from - especially if the data is all supposed to be numeric.
3. in DB1 Ename datatype length is 25 and in DB2 it is 20...
Good - use the same process as above
1. Identify data in DB1.ENAME that is longer than 20.
2. Remove, ignore, fix that data? Truncate it?
Again - it is usually the business users that need to actually determine what should be done. Your job is to identify that 'dirty' data and/or make it available to the business users so they can research it
You don't need to wait for the business users to actually provide all of those answers. You can begin writing pseudo-code that contains steps to deal with those issues - you just can't write the actual code until you have the answers.
You can certainly begin writing queries or procedures that look for 'dirty' data. Just based on the two problems you posted you can write queries to find data that has those two issues. -
Move database files from one ASM diskgroup to another
We are working on 11.2.0.3 RAC environment. We have an activity in which we have to move ASM database files from one diskgroup to another. We have the sufficient downtime for the activity. On checking MOS it says copying datafiles from "rman copy" command is the preferred method.But with 11g R2 we can use cp command in ASMCMD.
So which is the preferred method to copy asm database files and why:
RMAN Copy command or ASMCMD cp commandHi,
I normally prefer to go with RMAN than the ASMCMD cp command. Suppose the datafiles are OMF and you use RMAN to copy:
1. offline the datafile
2. RMAN>copy datafile <offline-datafile-on-old-DG> to +NEW-DG;
3. At database level, rename the old datafile to the new name reported from the above command
4. Switch the new datafile to copy
5. Recover the new datafileHere, RMAN assigns automatically a unique name for the new datafile (OMF) and you only have to specify the new diskgroup name while using the COPY command which makes things easier. But say if you are using ASMCMD, then you cannot just specify the new diskgroup name for the CP command, which means that a unique name cannot be obtained automatically.
The below command does not work out.
asmcmd>cp OLD_DG/datafile/abc.123 NEW_DGYou need to specify the destination name as well something like below:
asmcmd>cp OLD_DG/datafile/abc.123 NEW_DG/abc.dbfHere you are getting a normal file and not OMF, though ASM internally creates a link for the file "+NEW_DG/abc.dbf" pointing to an OMF. ASMCMD makes you a bit more confusive.
Refer this http://surachartopun.com/2009/10/moving-datafile-in-asm-by-asmcmdcp.html -
Report links from one dashboard(report) to another dashboard with prompt
There are two dashboards ‘Chart’ and ‘Transaction details’ . I am trying to link from one report(dashboard called 'Chart') to another dashboard(Transaction details).
In first dashboard (screenshot 1) there is a column called ‘Day’ which is like date., I have set the navigate properties and pointed out the second dashboard as the target ( screenshot3).
In the second dashboard (screenshot 2) , the request has an prompt on the date column.
Requirement, Once I click on particular value on ‘Day’ column in first dashboard, it has redirect to the second dashboard. Having said that, it is not only enough to navigate but also pass the value as a parameter to the second dashboard.
Currently, it is successfully navigating to the second dashboard, but not passing the parameter. Is there any particular step that I have take care here.
By the way, the column which has prompt has be defined as ‘as prompted’ in its report.
Any inputs, ideas are appreciated.
Thanks and Regards
S
For some reason, I couldn't able to upload the screenshots that I took now in oracle forums.Hi Saicand,
Thanks for you reply. What should I need to check at fx section of the column. Do you mean that the format of the date format should be the same for both the reports.
Thanks and Regards
S -
Improving performance on migrating data from one Oracle database to another
We are using hibernate to migrate complete tables from one database to the other. This takes hours to days to transfer a couple of tables, all having relationships between each other. The only difference is that the new tables have an extra column which stores the primary key of the source table as an alias key in the destination table and the destination table has only one extra column which is its own primary key. Another small difference is that the name of the columns is a little different.
Isn't there a simple way to use Oracle database's in built tools to migrate data if provided the source and destination tables and column names for mapping purposes? Please provide some suggestions for this Oracle newbie. Any other suggestions on improving the migration performance will be greatly appreciated.
Suggestions please!!!Hello Justin,
Thanks for your prompt reply. Ours is a small company so we take up all kinda roles. In this particular scenario, I was asked to migrate all the tables from one database to another. Both of the databases are present on two different machines but on the same network. There are about 100,000 records in some of the tables and there are about 50 tables to migrate. As I said, both the tables have different columns to be mapped and then transferred and the new table has only one extra column which is a primary key in the new table. Under these constraints, Hibernate is taking way too much time.
I always felt that there must be a simpler and efficient way to do this. I would appreciate if you could you explain me the procedures in detail please.
Thanks in advance. -
Moving the mailbox database copy from one exchange server to another exchange server 2010 DAG
Hello Team
is it possible to the move the passive copy of database and logs from one server to another exchange server in the same DAG with out removing and deleting the mailbox database copies in exchange 2010
normaly procedure is
Remove the mailbox database copies and manually delete the .edb files and logs from the physical location and re-add the mailbox database copy to the new server in the DAG.
is that any way to achieve to move the passive database copy to another exchange 2010 server in the same DAG ?From your note, you appear to have a two-member DAG (with a server hosting your active database, and a second hosting the passive copy), and you want to move your passive database copy from the current passive server to another. Your note
about what "the normal procedure is" isn't 100% correct - there are many ways to handle this task, and all can be considered "normal". Why not just add the third server to the DAG and
add a database copy on that third server? Once it is fully seeded, you can remove the current passive copy. This way, you never lose your redundancy.
Yes i can add the third and fourth serve in DAG , but i cannot add the mailbox database copies to the 3rd and 4th mailbox server in DAG as am using RTM version of exchange 2010 which is allowing to have only 5 database inclding mailbox datbase copies
and also currently my lab setup is two member dag (with a server hosting your active database,
and a second hosting the passive copy) in the same site named SITE A
and recently i have created new SITE B and included the 3rd and 4th DAG members in the same DAG
i want the mailbox database copies from the mailbox server database in SITE A to
Mailbox server database in SITE B as passive copy
That is why i want to move the mailbox database without deleting / removing it manually
Hope you understand my situation! -
How to export a table from one oracle server to another oracle server?
Hi experts,
Scenario : Copying table T1 from Server1 to Server2.
Can I follow any of the following two options. Please advise if these options would be feasible under the current scenario.
1) Create the same table T1 in Server2. Export the values of T1 in Server1 to an Excel sheet. Make the Excel sheet as source and import the values of the excel sheet to table T1 in Server2.
2) Use an ETL tool like Oracle Warehouse builder to extract and load the values in T1 in Server1 to T1 in Server2.
Can we schedule both option1 & 2 as a job in Oracle Warehouse Builder? The job will have 2 steps :-
a) Delete all rows in T1 (Server2).
b) Insert the values from T1(Server1) to T1(Server2).
Please advise.
Thanks,
DebashishCan you exactly explain a little bit more what is the actual requirement.
Just to kick off the things..
In case:
1) you just need to create a table based on another table in same schema. Its as simple as : create table table2 as (select * from table1)
2) table1 is on remote db then
create table table2 as (select * from table1@yourdblink)
3) Need to export and import table1 refer this link :
http://wiki.oracle.com/page/Oracle+export+and+import+?t=anon
4) Need to refresh table periodically either schedule a job or create materialized view refer to this link :
http://download.oracle.com/docs/cd/B10501_01/server.920/a96567/repmview.htm
Choose an approach. Then try it and see what errors you get, In case you get errors search on internet for that error code and how to resolve that and in case need any help post it here. But key is understanding first what exactly your requirement is and which approach you need/want to follow. -
Link from one Page Group to another
It it possible to click on a link in one page group and link to a page in another page group.
Create a "Page Link" item, one of the built-in item types. When specifying the attributes for this item, you should be able to choose pages in other page groups.
-
How can I link from one flash document to another with buttons?
Hi,
From the question above, you can tell that I'm very new to flash, especially with scripting. Total noob.
I watched my instructor's videos and I'm still stumped. He didn't explain it very well.
For starters, I am using Flash CS6, but I clicked on AS1.0 and AS2.0 from the drop down mention in the actionscript window for the script below, since that is what my instructor used.
What I have now are various pages I've already created in flash that are different pages in my website, including a splash page with an enter button.
For example, I want the enter button to link to another .swf or .html file when it is clicked. This file will be the main page.
I tried using this script that my instructor mentioned in the video on the button layer:
on (release); {
getURL("page1.swf");
the "page1.swf" file is already in the same folder in my computer as my splash page and I even imported it to the library of my splash page.
From my instructor's video demo, that should be apparently all that is needed.
But I cannot get this to work.
I tested the file and this is what flash comes up with:
In the output tab:
ReferenceError: Error #1065: Variable TCMText is not defined.
In the compiler errors tab:
Scene 1, Layer 'Layer 28', Frame 1, Line 1
1180: Call to a possibly undefined method on.
Scene 1, Layer 'Layer 28', Frame 1, Line 1
1120: Access of undefined property release.
Scene 1, Layer 'Layer 28', Frame 1, Line 2
1180: Call to a possibly undefined method getURL.
Any thoughts? My instructor also recommended that I embed the .swf into an .html, but he obviously didn't tell us how to do that!
Also, why doesn't script assist work with AS3?
Thank you so much!Okay so I changed it to AS1/AS2.
Now it says this:
Scene=Scene 1, layer=Layer 28, frame=1, Line 1
Mouse events are permitted only for button instances
Scene=Scene 1, layer=Layer 28, frame=1, Line 4
Syntax error.
I am very confused.
Also, since all my other pages are in AS3, is there some way I can use another script in AS3 that accomplishes the same task?
Can someone please provide me with the correct script to use?
Thank you so much! I feel that people here are much more responsive than my instructor is! Thank God for this forum! -
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 -
Database link to Personal Oracle
Question:
I can create a database link from an Oracle-Server
to a Personal Oracle Database.
But I cannot use it: the TNS name cannot be resolved.
Why ? Is it necessary to start any additional processes?
nullHMMMM....tried that and I still cannot connect. This is how XE created the entry in the tnsnames.ora file:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = uad-rawallacejr.win.csupomona.edu)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
I created the database link as follows:
CREATE DATABASE LINK XE
CONNECT TO GIFTPROC
IDENTIFIED BY nikki
using 'XE'
getting this error:
SQL> select count(*) from project@XE;
select count(*) from project@XE
ERROR at line 1:
ORA-12154: TNS:could not resolve service name
Is there anything else I need to do?
Thanks in advance for your help! -
I am trying to create a database link from the 11g database to the 10g database using:
create database link ORCL10R2 connect to <username10g> identified by <password10g> using <db10g>;
It Returns
Database link created.
select sysdate from dual@ORCL10R2 returns error:
ERROR at line 1:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
Please let me know what changes I need to make to tnsnames and listener at both servers.11g database: 10.1.1.10
10g database: 10.1.1.12
TNSNAMES.ORA at 10.1.1.10
XYZ =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.10)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XYZ)
LISTENER.ORA at 10.1.1.10
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.10)(PORT = 1521))
what needs to be modified here?
Edited by: 944558 on 5 Jul, 2012 12:27 AM
Maybe you are looking for
-
10.5.1 Update - Keychain broken?
Hi, I just updated to 10.5.1 and now my keychain has started acting up all weird . I have heard about people having problems under 10.5, but I wasn't expecting an update to reintroduce it! Basically I have to enter my passwords all the time, when usi
-
Hello, I just found out that some of my pics are missing! I can see them when I am browsing albums and folders but when I double click on them to see them in full screen I see just black monitor. If I try to email them nothing happens. I can't drag t
-
Execution of report in background and foreground
Hi all, I have a report in which i have two radio buttons on selection screen. 1, Foreground 2. background could you please tell how to do foreground and background execution of report depends on user selection.if you could send some sample code its
-
How do I build TopLink expression for the following query in one transaction? Select * from employee where emp_id in (select emp_id from address); Please let me know. Thanks in Advance.
-
Re-allocating Actual Costs and Actual Work from one project to multiple projects
My company would like to track costs in one project and then re-allocate those costs to multiple projects. Example: An end user would submit a timesheet against a task named 'Analysis' for Project A. Once accepted and published, the costs for those