Retrieving record from oracle DB very slow..pls help
Hi, i'm writing a VB code to retrieving records from Oracle DB Server version 8. I'm using VB Adodb to retrieve the records from various tables. Unfortunately one of the table are very slow to response, the table only contain around 204900 records. The SQL Statement to retrieve the records is a simple SQL Statement that contain WHERE clause only. Any issue that will make the retrieving time become slow? Is that a Indexing? Oracle Driver? Hardware Spec? Or any solution for me to improve the performance. Thanks!
Well, there are a few things to consider...
First, can you try executing your query via SQL*Plus? If there are database tuning problems, your query will be slow no matter where you run it.
Second, are you retrieving significantly more rows in this query than in your other queries? It can take a significant amount of time to retrieve records to the client, even if it's quick to select them.
Justin
Similar Messages
-
Performance Issue: Retrieving records from Oracle Database
While retrieving data from Oracle database we are facing performance issues.
The query is returning 890 records and while displaying it on the jsp page, the page is taking almost 18 minutes for displaying records.
I have observed that cpu usage is 100% while processing the request.
Could any one advise what are the methods at DB end or Java end we can think of to avoid such issues.
Thanks
R.passion_for_java wrote:
Will it make any difference if I select columns instead of ls.*
possibly, especially if there's a lot or data being returned.
Less data over the wire means a faster response,
You may also want to look at your database, is that outer join really needed? Does it perform? Are your indexes good?
A bad index (or a missing one) can kill query performance (we've seen performance of queries drop from seconds to hours when indexes got corrupted).
A missing index can cause full table scans, which of course kill performance if the table is large. -
Fcp 7 running very slow pls help me
my fcp 7 running very slow
some time normal , some time very slow
pls how to find problam pls help meYou're in the wrong forum. Post your question here:https://discussions.apple.com/community/professional_applications/final_cut_stud io
They will want to know what kind of clips you're working with – like whether it is h.264 – as well as how your system is configured.
Russ -
Java.sql : Cannot retrieve records from Oracle 9i with JDK 1.5
I think I'm doing everything right, but still the following code does not
return any rows. I have the classpath set correctly and ojdbc14.jar in
the path. I'm using jdk 1.5.
What am I missing? Any help greatly appreciated. Thanks!
Connection conn = null;
String serverName = "MySvr";
String portNumber = "1521";
String sid = "mySID";
String myURL = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
logger.writeLog("URL: " + myURL);
String username = "scott";
String password = "tiger";
String query = "select 'test' from dual";
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection(myURL, username, password);
Statement stmt = conn.createStatement();
rs = stmt.executeQuery(query);
logger.writeLog("Cur Row : " + rs.getRow());
-----> returns 0
while (rs.next()) {
------> throws java.lang.NullPointerException
}I think I'm doing everything right, but still the following code does not
return any rows. JDBC didn't change from 1.4 to 1.5, so that's a red herring. It's you, not the JVM.
I have the classpath set correctly Really? A system CLASSPATH environment variable? I'd say that's wrong. Better to use the -classpath option on javac.exe when you compile and java.exe when you run.
and ojdbc14.jar in the path. You'd better mean CLASSPATH and not PATH. CLASSPATH is for the Java class loader; PATH is for the operating system. Don't get the two confused.
I'm using jdk 1.5. Irrelevant here.
What am I missing? Any help greatly appreciated. Thanks!I think you're using ResultSet incorrectly, because it's never null.
Try this:
// I'd externalize this so you could change it on the fly.
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@MySvr:1521:mySID";
// I hope you're not using the default username and password for real
String username = "scott";
String password = "tiger";
logger.writeLog("URL: " + url);
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try
Class.forName(driver);
conn = DriverManager.getConnection(url, username, password);
String sql = "select 1 from dual";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
int value;
while (rs.next())
value = rs.getInt(1);
catch (SQLException e)
e.printStackTrace();
finally
// I'd put all these in a utility class
try { if (rs != null) rs.close(); } catch (SQLException e) { logger.writeLog("could not close result set"); }
try { if (stmt != null) stmt.close(); } catch (SQLException e) { logger.writeLog("could not close statement"); }
try { if (conn != null) conn.close(); } catch (SQLException e) { logger.writeLog("could not close connection"); }
}Note: close your resources in a finally block. It's important, especially if you don't want to run out of Oracle cursors.
% -
How to write jsp select record from Oracle divide per page , about 50 reco
Dear Expert,
How to write jsp select record from Oracle divide per page , about 50 record per page.
Thank you very much.I wish I could, but there is no single sign on module available for Fusion, also, so called Fusion is yet another Word With Big Letters, behind it there is yet another OC4J ( now Oracle switched to Weblogic though) container with bunsh of Oracle apps residing in it.
Generally speaking, neither Fusion nor Oracle Apps user database does not have any single authentication module available out of the box to integrate user database.
It's a long sad story running straight from Oracle Apps 11.0.5.
That's why I've created JAAS single sign on login module and used it ever since at OC4J 10.2 and onwards at OC4J 10.3
Back to the topic: to develop Apps and test them externally using the session bean I've isted above, one need to copy certain libraries from Oracle Apps server, then add them as libraries for JDeveloper project.
Here is the complete list:
oracle.apps.fnd.cache
oracle.apps.fnd.cache
oracle.apps.fnd.common
oracle.apps.fnd.functionSecurity
oracle.apps.fnd.metadata
oracle.apps.fnd.security
oracle.apps.fnd.util
oracle.apps.jtf.cache
oracle.apps.jtf.security
Edited by: Faceless on Nov 26, 2009 3:04 AM -
Export tables and records from oracle 8i to oracle 10g
hi,
i had installed oracle 10g, but i want to export my tables and record from oracle 8i to oracle 10g.
can you tell mePlease have a look to Using Different Releases and Versions of Export in Utilities document.
-
Retrieving records from a Data Block same as retrieving records from cursor
Dear Gurus,
Is it possible to retrieve records from a datablock same as retrieving records from a cursor,
Eg:
I am having two data blocks in two different tabs, Say B1 in Tab1, B2 in Tab2
B1 is filled with two records, now when I switch to Tab2,
I want all records of B1 in B2, assuming that blocks are having the same structure.
The code I wish to write is,
Goto B1,
Take all the records like a cursor,
Goto B2,
loop
insert
end loop;
Is this possible???I need to show it before saving,
I tried this and it is successful somehow, do not know about any further problems,
I took the record count of both blocks
if :B1.reccount <> :B2.reccount
then
go_block('B1');
first_record;
for i in 1..:B1.reccount
loop
go_block('B1');
go_record(i);
assign values from B1 to variables.
go_block('B2');
assign values from variables to B2
next_record;
end loop;
clear_record;
end if;
This is working, Now I just want to know, if my block is having numerous fields, say more than 100 (may not be a value for large databases)
how can I replace these variables here.
I mean is it possible to declare something like a cursor record type.
For eg : r1 cursor%rowtype -
Retrieve data from oracle table, table name passed in runtime into JSP
Hello All,
I am new to JSP, i have a requirement,
I need to retrieve data from oracle table, here table is passed at random. how to get the data displayed in JSP page.
can any one help me in that
thanks1) Learn SQL.
2) Learn Java.
3) Learn JDBC.
4) Learn DAO.
5) Learn HTTP.
6) Learn HTML.
7) Learn JSP/Servlet.
8) Learn JSTL.
9) Apply learned things and develop.
Whenever you stucks, please come back and post the specific coding/technical problem here. -
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! :) -
Get username from session and retrieve records from database wit tat userna
hello..
i got a ChangePassword.jsp which i retrieve the username from session using bean to display on e page..
<jsp:getProperty name="UsernamePassword" property = "username"/>
but in my servlet, i wan to retrieve records from database with tat username..
i tot of coding
String username = (String)request.getSession().getAttribute("UsernamePassword");
and then use tat username to retrieve records.. but is that e right way? The page did not display and i got a CastingException..
Please help.If you are using the session inside a jsp, you can say "session" without having to declare it.String usernamePassword = (String) session.getAttribute("usernamePassword");However, right after you get this value, check if it is null:
if(usernamePassword==null)
// do sth like forward to error page
else
// continue processing
If it is null, then you are probably not setting it right in the first place. Make sure that in your servlet A you create a session, and before you return or forward to a jsp, that you actually set this value in the session like saying
session.setAttribute("usernamePassword", usernamePassword);
and it is case sensitive for the key. -
hey there, whenever i try to start iTunes in my laptop amsg coming up saying : data execution prevention prevented iTunes from starting (Dep), would you Pls help me out.I have windows vista installed.
No, i do not have quickTime player.
I have tried to close dep off for iTunes but failed to do so as i got a msg that iTunes can't work without Dep in execution data prevention. -
HT204053 sir; i can't import song and videos from pc to my iphone pls help me
sir; i can't import song and videos from pc to my iphone pls help me
We are fellow users here on these forums, you're not talking to iTunes Support nor Apple - if you would like help then you will need to provide more information than 'can't import' e.g. how are trying to sync content and what happens when you do it ?
You have the latest version of iTunes installed on your computer, and your phone appears in it when it's connected to your computer ? If not then see if this troubleshooting page helps : http://support.apple.com/kb/TS1538
You should be able to sync music and films/TV programmes by selecting your phone on the left-hand sidebar of your computer's iTunes (you can enable the sidebar via control-S on a PC) and then using the tabs on the right-hand side of the iTunes screen to select and sync your content
Is that how you are trying to do it and it's not working ?
If you haven't synced your phone to that computer before then you may also find this page useful : https://discussions.apple.com/docs/DOC-3141 -
Best way to retrieve data from oracle?
Hi,
I have a few questions.
1.)Can a rowtype or a table type returned from oracle database can be retrieved as a dataset or datareader?
2.)Cursors generally slow down your db(Iam from microsoft sql server back ground). But we seem to be using ref cursors quite a lot here.The only way to return a result as far as i have seen in oracle is to use a ref cursor.Is there any other way?Hello,
1.)Can a rowtype or a table type returned from oracle database can be retrieved as a dataset or datareader?
I'm not sure how complex your "table types" are -- do you mean PL/SQL Associative Arrays (formerly knowns as "index-by" tables)?
I believe that %rowtype is a PL/SQL'ism that does not work outside of PL/SQL.
However, the 11g version of the provider introduced User Defined Types (UDTs) which may be helpful depending on your requirements, etc.
2.)Cursors generally slow down your db(Iam from microsoft sql server back ground). But we seem to be using ref cursors quite a lot here.The only way to return a result as far as i have seen in oracle is to use a ref cursor.Is there any other way?
Using a ref cursor is the way to return a result set from PL/SQL to a client. If you are not using PL/SQL then you would not use a ref cursor.
The .NET Developer Center has good information:
http://www.oracle.com/technology/tech/dotnet/index.html
Regards,
Mark -
Oracle insert very slow (very urgent)
Hello
I am new to this forum and also new to oracle .... I am woking in a C# 3.5 desktop application
I am Leasing data from socket (1 message per 10 millisecond) and save in queue<T> and then i have a background thread which dequeu the data and perform some calculation and create “insert sql query “ on run time NO STORE PROCEDURE just simple insert query
For example
insert into Product values(0,computer , 125.35);
I pass that insert query to my datalayer which create oracle connection and insert in to a data base. see the code below
using System.Data.OracleClient
class db
OracleConnection conns = null
public static void conn(string dbalias, string userid, string password){
try
string connString = @"server =" + dbalias + ";uid =" + userid + ";password =" + password + ";";
conns = new OracleConnection(connString);
conns.Open();
catch (OracleException e){
Console.WriteLine("Error: " + e);}}
public static void ExecuteCommand(string sqlquery)
try
OracleCommand cmd = new OracleCommand(sqlquery,conns);
cmd.ExecuteNonQuery();
NOW the problem is that inseration in oracle database is very slow please tell me how to solve this issueAdditionally:
How slow? Just one single insert is slow? Or you're doing thousands of inserts that way and they add up to being slow?
If you're doing a bunch of inserts, wrap a bunch of them inside a transaction instead of doing them one by one which will avoid a commit each time as well.
Or use Array binding or Associatve arrays as indicated previously (You'd need to use Oracle's provider for that though ~ ou're using System.Data.OracleClient).
You're using a literal hard coded statement, per your example? Use bind variables.
Also, this forum is for tools that plug in to VS. Problems with ODP.NET code you've written would be more appropriate in the [ODP.NET forum|http://forums.oracle.com/forums/forum.jspa?forumID=146], but that forum deals with problems with Oracle's ODP, not Microsofts (which is in maintenance mode by the way)
Hope it helps,
Greg -
Retrieve data from oracle table
hi,
i have uploaded a piece of xml format data in oracle and successfully uploaded but when trying to retrieve data it reterieve 0 records. Oracle version is given below:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
create table temp_loading_lob(
xml_id varchar2(3),
q_clob CLOB
nologging
create table temp_loading_xml
nologging as
select xml_id,xmltype( q_clob) q_xml
from temp_loading_lob;
XMl Data
<?xml version="1.0" encoding="ISO-8859-1" ?>
<Root xmlns="http://www.w3.org/2000/10/XMLSchema">
<Accounts ApplicationVersion="7.2.1.6 (10-02-2012)" Database="Q" DateExported="20120813">
<Account AccountID="QF8AA000">
<AccountName>124 On Brunswick Bed & Breakfast</AccountName>
<Addresses>
<Address AddressID="aQF8AA000YMY">
<Description>Physical</Description>
<Address1>124 Brunswick Drive</Address1>
<Address2>Brunswick Park - RD 4</Address2>
<Address3></Address3>
<Suburb></Suburb>
<City>Rotorua</City>
<Postcode></Postcode>
</Address>
<Address AddressID="aQF8AA000WXX">
<Description>Postal</Description>
<Address1>PO Box 7365</Address1>
<Address2></Address2>
<Address3></Address3>
<Suburb>Te Ngae</Suburb>
<City>Rotorua</City>
<Postcode>3042</Postcode>
</Address>
</Addresses>
</Accounts>
</Account>
</Root>
Query used to reterive data
select po.*
from temp_loading_xml p,
XMLTable('/Accounts/Account'
PASSING p.q_xml
COLUMNS
AccountID varchar2(20) PATH '@AccountID'
,AccountName varchar2(20) PATH 'AccountName'
)poi am trying to catch my error but unable to fix it. Any help will ge greatly appretiated. How can i close my thread?
Best Regards,
Zaid>
<Root xmlns="http://www.w3.org/2000/10/XMLSchema">
<Accounts ApplicationVersion="7.2.1.6 (10-02-2012)" Database="Q" DateExported="20120813">
<Account AccountID="QF8AA000">
</Accounts>
</Account>
</Root>
>
must be
<Root xmlns="http://www.w3.org/2000/10/XMLSchema">
<Accounts ApplicationVersion="7.2.1.6 (10-02-2012)" Database="Q" DateExported="20120813">
<Account AccountID="QF8AA000">
</Account>
</Accounts>
</Root>and add namespaces to xmltable
32 select po.*
33 from temp_loading_xml p,
34 XMLTable(
35 xmlnamespaces(default 'http://www.w3.org/2000/10/XMLSchema')
36 ,'Root/Accounts/Account'
37 PASSING p.q_xml
38 COLUMNS
39 AccountID varchar2(20) PATH '@AccountID'
40 ,AccountName varchar2(20) PATH 'AccountName'
41 )po
42 /
ACCOUNTID ACCOUNTNAME
QF8AA000 124 On Brunswick Bed
SQL>
Maybe you are looking for
-
IPOD will not update? quicktime error? READ
For a long time i have been unable to put new songs onto my nano...on one of my computers when I plug my ipod in, it goes on as normal saying "Updating iPod. Do not disconnect." And i think, ok, its putting the new songs on..but when i go on my ipod
-
Why does my lion upgrade not work?
I have followed the instructions to the letter but I get about 50 mins through and it comes up with a screen telling me that it could not continue as it could not connect to the internet and download files - we are a school downloading from the memo
-
I HATE THE NEWEST ITUNES UPDATE. how can i uninstall this latest update and just use the previous version??
-
I have 3 routers at home. The first one is from my internet provider. Then I have a dlink (in bridge mode) and the cisco E1200 (also in bridge mode). They are connected in this way: Provider - dlink - cisco - my pc. Everything works fine for a few ho
-
If anyone has anything that can help I would greatly appreciate it!