Query from oracle to MySql using dblink fetch all the rows in MySql table
Hello,
I am using Heterogeneous connectivity between oracle 10204 to Mysql database.
I have a database link in the oracle side .
I am query a table in MySql that have 10 million rows.
Its doesnt matter if i am running :
select * from "CDR_Accounts"@mysql where "id"=7675405;
or
select * from "CDR_Accounts"@mysql ;
There is an index on the id column.
Yet, it seems that the Mysql is feteching all the rows from the table , all the data is transfering to oracle over the dblink , and only after that the requested rows are get back to the client.
The /etc/odbcinst.ini file is as follow:
[odbcprd:oracle@odbc /software/oracle]$ cat /etc/odbcinst.ini
[myodbc3]
Description = Mysql connector to mysql version 3.5
Driver = /software/oracle/MysqlOdbc/3.52/lib/libmyodbc3-3.51.25.so
Driver64 = /usr/lib
Setup = /software/oracle/MysqlOdbc/3.52/lib/libmyodbc3S-3.51.25.so
Setup64 = /usr/lib
UsageCount = 1
CPTimeout = 3600
CPReuse = Please advice
Thanks
When using a gateway it is always possible that a where clause is not sent to the remote database. This is called post processing and depends on several factors like the used ODBC driver, the columns and its data types but also if you specify certain functions in the where clause.
The fastest way to see if post processing happens is in Oracle 11g the explain plan for a query. In 10g the plan does not always match the statement sent to the foreign database. Here it would be better to enable gateway tracing and setting the trace level to ON. This will log the statements sent to the foreign database and you can compare what statement was sent with the statement you've tried to execute.
Similar Messages
-
Rowtype not fetching all the rows
This my cursor declaration. When the Package is executed it get all records minus 1 (Assumming there are 10 rows to be processed, it ONLY processes 9 records)
cursor X1 is
select *
from NT
hdr X1%rowtype;
Below is the procedure call
open X1;
fetch X1 into hdr;
loop
exit when X1%notfound;
fetch X1 into hdr;
pkgXX.insrt(hdr);
end loop;
commit;
close X1;That makes sense. You 1) fetch a row, 2) check for %notfound, 3) fetch a row and process it. Notice that the row you fetched in 1 was never processed. Try this:
open X1;
loop
fetch X1 into hdr;
exit when X1%notfound;
pkgXX.insrt(hdr);
end loop;
commit;
close X1; -
How to update all the rows of table using stored procedures
Hi,
I want to update all the rows of a table of a specific column
sp_a male
sp_b female
sp_c male
sp_d female
in above table
gender of all the columns has to be interchanged.Sir table is like this detail(name varchar(10),gender varchar(10))
Where Details are like this
Name Gender
sp_a
male
sp_b
female
sp_c
male
sp_d
female
I want to create a stored procedure which automtically updates gender from male to female and female to male
for all the rows . i.e., all the rows are updated for column gender by just running a stored procedure.
So after execution of stored proc the above table looks
Name Gender
sp_a
female
sp_b
male
sp_c
female
sp_d
male -
Tnsping timed out using dg4odbc from Oracle to MYSQL through ODBC
Hi,
I encountered problem when trying to connect from Oracle to MYSQL using dg4odbc, hope you can shed some light
Oracle database is 11.1.0.7 on SUSE Linux 64-bit.
Since the application which runs on MYSQL DB only offers ODBC driver on Windows platform, so I installed the 32-bit ODBC driver (from ServiceNow) on a 32-bit windows server (driver download from http://wiki.service-now.com/index.php?title=ODBC_Driver) .
created system DSN: MYSQLDEV, The DSN connection works fine. I then installed Oracle 11.2.0.1 gateway for ODBC 32-bit on the same windows server, the following configurations were done:
On 32-bit Windows server:
in gatewayHome\hs\admin
initMYSQLDEV.ora:
# HS init parameters
HS_FDS_CONNECT_INFO = MYSQLDEV
HS_FDS_TRACE_LEVEL = DEBUG
in gatewayHome\network\admin:
listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = abcdes.sda.sdva.com)(PORT = 1521))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=MYSQLDEV)
(ORACLE_HOME=C:\product\11.2.0\tg_1)
(PROGRAM=dg4odbc)
ADR_BASE_LISTENER = C:\product\11.2.0\tg_1
stop and started listener on windows server and check listener status
C:\product\11.2.0\tg_1\bin>lsnrctl status listener
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-MAR-2012 21:42:08
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=abcdes.sda.sdva.com)(PORT=1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date 29-MAR-2012 21:11:36
Uptime 0 days 0 hr. 30 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\product\11.2.0\tg_1\network\admin\listener.ora
Listener Log File c:\product\11.2.0\tg_1\diag\tnslsnr\abcdes\list
ener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=abcdes.sda.sdva.com)(PORT=1521)))
Services Summary...
Service "MYSQLDEV" has 1 instance(s).
Instance "MYSQLDEV", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
On Linux server where Oracle DB resides.
Added the following tns entry "jelly" on the Linux server ORACLE_HOME/network/admin:
jelly =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)
(HOST=abcdes.sda.sdva.com)
(PORT=1521))
(CONNECT_DATA=(SID=MYSQLDEV))(HS=OK)
tnsping from Linux server (64-bit) failed with timeout error:
tnsping jelly
TNS Ping Utility for Linux: Version 11.1.0.7.0 - Production on 29-MAR-2012 21:12:38
Copyright (c) 1997, 2008, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP) (HOST=abcdes.sda.sdva.com) (PORT=1521)) (CONNECT_DATA=(SID=MYSQLDEV))(HS=OK))
TNS-12535: TNS:operation timed out
tnsping from Windows server works fine: (added same tnsnames entry on windows server for testing purpose only)
C:\product\11.2.0\tg_1\bin>tnsping jelly
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 29-MAR-2
012 21:45:20
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
C:\product\11.2.0\tg_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=abcdes.sda.sdva.com)(PORT=1521)) (CONNECT_DATA=(SID=MYSQLDEV)) (HS=OK))
OK (20 msec)
if listener is not listening to the service, then the tnsping on the windows server should fail as well.
I don't know why only the tnsping from Linux failed, is it due to the 32-bit ODBC uncompatibility with 64-bit oracle server? or my configuration problem?
Of course, when I created the DB link from oracle, the connection failed with
create database link mysqldev connect to xxxx identified by "xxxxx" using 'jelly';
Database link created.
select * from tab1;
ERROR at line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from MYSQLDEV
Thanks for your help,Hi Mike,
This is part of the tnsping.trc file which contains the error. IP address is in the tnsnames entry with this tnsping.
nsopen: opening transport...
nttcon: entry
nttcon: toc = 1
nttcnp: entry
nttcnp: creating a socket.
nttcnp: exit
nttcni: entry
nttcni: Tcp conn timeout = 0 (ms)
nttcni: trying to connect to socket 5.
ntt2err: entry
ntt2err: soc 5 error - operation=1, ntresnt[0]=505, ntresnt[1]=110, ntresnt[2]=0
ntt2err: exit
nttcni: exit
nttcon: exit
nserror: entry
nserror: nsres: id=0, op=65, ns=12535, ns2=12560; nt[0]=505, nt[1]=110, nt[2]=0; ora[0]=0, ora[1]=0, ora[2]=0
nsopen: unable to open transport
nsiocancel: entry
nsiofrrg: entry
nsiofrrg: cur = 53b9f8
nsbfr: entry
nsbaddfl: entry
nsbaddfl: normal exit
nsbfr: normal exit
nsiofrrg: exit
nsiocancel: exit
nsvntx_dei: entry
nsvntx_dei: exit
nsopenfree_nsntx: nlhthdel from mplx_ht_nsgbu, ctx=53a7e0 nsntx=53ade0
nsiocancel: entry
nsiofrrg: entry
nsiofrrg: exit
nsiocancel: exit
nsmfr: entry
nsmfr: 2712 bytes at 0x53ade0
nsmfr: normal exit
nsmfr: entry
nsmfr: 1528 bytes at 0x53a7e0
nsmfr: normal exit
nsopen: error exit
nscall: error exit
nscall: entry
nscall: connecting...
nsclose: entry
nsclose: normal exit
nladget: entry
nladget: exit
nsmfr: entry
nsmfr: 264 bytes at 0x528900
nsmfr: normal exit
nladtrm: entry
nladtrm: exit
nscall: error exit
nlse_term_audit: entry
nlse_term_audit: exit
Thanks, -
Can Hyperion repository be migrated from Oracle to MySQL
Hi Gurus,
I was wondering if Hyperion Repository can be migrated from an existing Oracle database to MySQL database. If yes, then how? Any kind of advice is greatly appreciated.
Regards,
UdayHi,
First question is why you want to move from Oracle to MySQL as in newer versions of Hyperion MySQL is not supported anymore.
There is no direct way of migrating the database you would have to look at using a 3rd party conversion tool or writing some custom code.
Cheers
John
http://john-goodwin.blogspot.com/ -
Create a Database Link from Oracle to MYSQL on windows
Hi
I need to create a database link from oracle to mysql database on windows to fetch some records.Can anyone help me on this?Search for Transparent Gateways, Heterogeneous Services...
The Oracle SQL Developer have drivers to Access, MySQL and SQL Server. -
For Update Query from ORACLE Forms
Hi
We are using Oracle Forms 10g running with 10g database 10.2.0.1.0. We happend to see a query which is getting generated in AWR report like Select rowid, all_columns from TableName for Update of C1 Nowait. But no such query is really written in forms and we are aware that, Any query prefixed with rowid is definitely executing from Forms. But how the ForUpdate and Nowait clause is appended to the query.
We have checked the following properties in the database Block
*1) Locking Mode is set to Automatic*
*2) Update Changed Columns only is set to YES*
*3) Query all records is set to No (Though this particular property may not be relevant to the issue)*
What is the property or setting which might trigger such a query from ORACLE Forms with ForUpdate and Nowait clause.
Any ideas/suggestions on why such behaviour. Please have a healthy discussion on this. Thanks in advance.you can't dynamically add a query to the data model in reports.
You should look into the XML based customization of Oracle Reports. This will enable you to define a report dynamically by creating a definition in XML.
Also another option is to have the report with a query in it and use lexical parameters in reports to pass the query definition or just the where part of it.
Look at the reports online help for both of these solutions. -
Can I use dates from dual to fetch all he rows between that dates?
I am trying to get the records that have expirations in the month of May
What is the correct syntax to use the dates from dual to get all the rows that fall between two dates.
I am stuck with this query..
can any one look into it please..
insert into RENEWALS_ALL_MAY
select
from
ORIGINAL
where
(expiration_date between to_date(trunc(add_months (sysdate,3),'mm') from dual) and to_date(last_day(add_months (sysdate,3)) from dual))SQL Reference
Supplied PL/SQL Packages and Types Reference
For Oracle 9.2
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#80856
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/toc.htm
For other versions see
http://tahiti.oracle.com/ -
Update/Insert records from Oracle to MySQL
Hi team,
My application will insert/update records into Oracle database, I need to sync all of records into MySQL database. I designed a package to load data from Oracle to MySQL, the Oracle database use OLE DB component and MySQL database use ADO.NET.
How to insert new records into MySQL? If the old record exists, we also need to replace with new record. I did some research, someone suggest to create a stage table to handle this scenario, but I have 14 tables in this case. How to handle this scenario
with high performance?
If there is anything unclear, please let me know.
Thank you in advance.Finally, I created 14 tables as same as in our MySQL database system with prefix "updated" , they are use to store the updated records from Oracle system. All of new records we add a flag, the "1" means insert a new record into the system,
and the "0" means we should updated. So, I can use the conditional split component to split all of new records. The new records insert into the target table and the updated records insert into the "updated_table". Finally, we can add a
SQL Script task to run a update script to sync all of records.
I don't use Lookup Transformation because we must use Cache
Transform transformation in this case, the Cache connection manager to save the data to a cache file (.caw), it will hard to
trace the history data in the future.
In addition, I recommend to use ODBC connection if somebody face the similar scenario with me, there is a bug if we use ADO.NET to
load data from Oracle to MySQL by using SSIS. For more information, please refer the MSDN document: http://blogs.msdn.com/b/mattm/archive/2009/01/07/writing-to-a-mysql-database-from-ssis.aspx
@Arthur, thanks again for your input. Have a nice day! :) -
Migrating Stored procedure from Oracle to Mysql
Dear All,
Please suggest, is ther any tool of stored procedure migration from oracle to mysql.
I tried some tool like
1. Intelligent Converter.
2. Sql way
3. Mysql Migration Toolkit.
But procedure cannot migrate properly.
hb venkiVenki,
I think you are in the wrong place, try finding a MySQL forum ;0) -
WebI:Creating a minus query from data providers not using the same universe
Hi there. A client of ours wishes to use Combined Query on multiple universes in the same WebI report. So far, I have heard it is not feasible in WebI. I know it is possible in DeskI. Even the sub-query option is limited to just one universe in WebI. So, I am stuck.
Is there a workaround to creating a minus query from data providers not using the same universe in WebI?Hello Amit,
what are the Datasources ? Usually when you create a Sub Query you can choose a seperate Universe.
Maybe if you only see one Universe you only have the rights for this Universe ?!.
Regards
-Seb. -
Query to fetch all the responsibilities for which OA page is attached
Hi Team,
please help me to prepare a query to fetch all the responsibilities for which OA page is attached.
thanks in advance
Thanks & Regards,
Sriram THi,
Querys which you have provided was helpful.
But i was struck with the following issue. As the function is not excluded directly it may be excluded via a menu to the responsibility.
Even though it is displaying the responsibility name.
The following query is used to display the responsibility name with menu and function exclusions.
please help me on this.
SELECT r.RESPONSIBILITY_NAME
FROM
fnd_responsibility_vl r,
fnd_form_functions f
WHERE f.function_name = 'VSFFFRMADMN'--f.form_id =p_form_id
AND r.menu_id IN (SELECT me.menu_id
FROM fnd_menu_entries me
START WITH me.function_id = f.function_id
CONNECT BY PRIOR me.menu_id = me.sub_menu_id)
and r.menu_id not in (select frf.action_id
from fnd_resp_functions frf
where frf.action_id=r.menu_id
and frf.rule_type='M')
and f.function_id not in (select frf.action_id
from fnd_resp_functions frf
where frf.action_id=f.function_id
and frf.rule_type='F')
Thanks
Sriram T -
Query should fetch all the query details in the system.
Hi All
We are looking for a query which will fetch all the query details in the system along with the user names either who has created the query or who has run it atleast once.
If any of the queries are not used for a long time then we can delete it with the user's/owner's approval.
Is there anyway we can desing such query .
Thanks
AsimHi,
Thanks for the reply.
My requirement is that we want to create a new query which should fetch the details information of already existing queries.
Like who has created that query, how frequently the use it etc...
Whenever we run the new query it should give information of all other existing queries.
Thanks and Regards
Asim -
How to fetch all the records from ztable
Hi
My program is outbound program.
According to the requirement i have to fetch all the records from ztable which are not tranmitted before to the third party and once the records are extracted and written to output file they will be marked as 'X' in the "status" field of that ztable for the next days run.
How to fetch the records.Please suggest me.
Thanks,
NeelimaHI,
Fetch all the records whose status is equal to 'X' as whatever data is sent to third party system is marked as 'X' in status field of table after sending.
You need to first fetch the data into internal table using the select statement where status EQ space. You get the data which is not yet transmitted to third part. And later in the program after trasmitting the data to third party modify the Records in the DB table which are transmitted with Staus eq 'X'. -
How to insert data from JTable to mysql Table....
hello everybody
i need help about how to insert data from JTable to mysql table... i know about how to create Table model...facing problem about how to insert data from JTable to mysql table....any helping link or code ... ill be thankfulll....for giving me solution...table1.getValueAt(table1.getSelectedRow(),0)you are getting the value of a selected row... or if you want you can just use a loop..
for(.....){
table1.getValueAt(x,y);
}I think you know INSERT STATEMENT.. here on it just string concat
sample e.g. (This not insert)
"delete from accrule " +
"where ruleid= " + tblRA.getValueAt(tblRA.getSelectedRow(),0)+
" and accountname='"+tblRA.getValueAt(tblRA.getSelectedRow(),1)+"'"
Maybe you are looking for
-
Planning function to copy version A of year 2007 to Version B of 2008 - IP
I have a copy planning function which has a variable on from version and to version and it works fine.I can copy.So version to version for the same year works fine. Another requirement is to copy Version A of year 2007 to version B of year
-
Does your 5800 exhibit this bug too?
Can someone try this on their 5800 (mine is v40) too and see if it happens? With your phone in predictive/portrait mode: 1) Open a text message and go through some process to get the view window (http://www.allaboutsymbian.com/images/features/nokia58
-
Why do some old Mac programs run slowly in Classic mode?
I successfully installed OS 9 Classic Mode on an eMac. At first, some of my old programs (Thinkin' Things, Millie's Math House, both edmark) ran fine, but as time went on they started jerking and freezing as they ran. I re-started and it continued
-
i am trying to copy and paste a button from one menu to the next. i have about 10 menus. the look of the button comes over but not its attributes in terms of color, hightlight, etc. this makes no sense to me. can someone help?
-
Hard disk life with frequent data write and read
Dear All, Can you kindly advise on the effect of frequent write / read on shortening of (ordinary low-cost, 80 to 250G, office desktop PC type) hard disk life. File size is IMAQ iamge file (300k byte) 1000 wite / read per day for 1 day in a week (