Record insert speed! help me
I use SQLServer 2000.In order to increase insert speed,I use batch method.But the result is too bad.
Only 2000 records are inserted at one min.I think I use batch in a wrong way,anyone could give me a sample about it?The refrence is welcome.Thank you.
By the way,how many records could be inserted in one min.
Thanks for reading.
Insert speed is dictated by:
- Network speed
- If the database must reparse the SQL for each insert statement
- If the inserting is logged or not
- If there are triggers and constraints in the tables affected by the insert
- If there are a lot of indexes in the tables affected by the insert.
If you really need to insert a lot of lines in a batch, use bcp or DTS.
The executeBatch methods (JDBC 3.0) alleviate the influence of the two first factors (network speed and reparsing SQL statements). The other factors can not be reduced using pure JDBC.
Similar Messages
-
Oracle insert speed (92k records)
I am inserting 92,000 records into oracle (nightly job)
I am just trying to speed things up (is my first C#/Oracle app)
at the moment, I have 2 ways of inserting the records
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
1) command.CommandText = "INSERT into B2BE (ledger,sku,descr,Price,PriceT,PriceP,PricePS,PricePX,unitom,Brandname ) VALUES ('" + myLedger + "','" + mySku + "' ,'" + myDescrip + "', " + myRetail + "," + myTrade + " , " + myPP + " , " + myPPS + "," + myPPX + " ,'" + myUnitom + "' ,'" + myBrandname + "' )";
command.ExecuteNonQuery();
2) command.ArrayBindCount = maxArray;
command.CommandText = "INSERT into B2BE (ledger,sku,descr,Price,PriceT,PriceP,PricePS,PricePX,unitom,Brandname ) VALUES (:p_Ledger , :p_Sku , :p_Descrip , :p_Retail , :p_Trade , :p_PP , :p_PPS , :p_PPX , :p_Unitom , :p_Brandname )";
OracleParameter prm2 = new OracleParameter("p_Ledger", OracleDbType.Varchar2);
prm2.Direction = ParameterDirection.Input;
prm2.Value = a_myLedger;
prm2.Size = maxArray;
command.Parameters.Add(prm2);
etc etc...
Both ways work fine, but I was trying to work out a way of speeding up the process
at the moment, option 1) takes 10 mins to process 92k records doing an insert for each record, (in a loop) and option 2) takes 7 mins to process 2 blocks of 60k records then 32k records
are these speeds acceptable? or am I doing things totally wrong
(application attacks old foxpro tables using codebase, & process's them all to get ready to push into oracle that process takes all of 45 seconds)... yes codebase is insane.
Thanks
-ChrisHi,
I'm not sure what, but I'd say "you're doing something wrong", unless you have Network issues or something perhaps.
Inserting 60,000 records, using the following code, takes 3 seconds on my system (the database is local however, so I have minimal network delay). How long does this code take on your system?
I'm using 10.2.0.2.20 ODP, 10.2.0.3 client/database for what it's worth.
Cheers
Greg
TABLE
======
create table bulkttab(col0 number,col1 varchar2(4000), col2 varchar2(4000), col3 varchar2(4000),
col4 varchar2(4000),col5 varchar2(4000),col6 varchar2(4000),col7 varchar2(4000),
col8 varchar2(4000),col9 varchar2(4000));
CODE
=========
private static void arraybind()
string connectStr = "User Id=scott;Password=tiger;Data Source=orcl";
int size = 60000;
int[] myArrayofNums = new int[size];
string[] myArrayofV2s = new string[size];
for (int i = 0; i < size; i++)
myArrayofNums[i] = i;
myArrayofV2s[i] = "abcdefghijklmnopqrstuvwxyz";
OracleConnection connection = new OracleConnection(connectStr);
OracleCommand command = new OracleCommand("insert into bulkttab values(:0,:1,:2,:3,:4,:5,:6,:7,:8,:9)", connection);
command.ArrayBindCount = size;
OracleParameter numParam = new OracleParameter("param2", OracleDbType.Int32);
numParam.Direction = ParameterDirection.Input;
numParam.Value = myArrayofNums;
command.Parameters.Add(numParam);
for (int i = 1; i < 10; i++)
OracleParameter v2param = new OracleParameter("", OracleDbType.Varchar2);
v2param.Direction = ParameterDirection.Input;
v2param.Value = myArrayofV2s;
command.Parameters.Add(v2param);
connection.Open();
DateTime start = DateTime.Now;
command.ExecuteNonQuery();
DateTime stop = DateTime.Now;
Console.WriteLine("{0} records inserted in {1} seconds", size,(stop - start));
connection.Close();
command.Dispose();
connection.Dispose();
OUTPUT
========
60000 records inserted in 00:00:02.2656250 seconds -
Record Insertion Form Wizard Help required
Hi there
I am having trouble getting my insertion form to save the
info to a database. What I want to do is to get customers to
subscribe to a monthly newsletter by inserting their email
addresses into a form which should then be saved to a MS Access
Database. I have made the connection and theres no problems there.
But when use the record insertion form wizard and try to test it on
my testing server (offline)...and when I click submit I get the
following message:
The page cannot be displayed
There is a problem with the page you are trying to reach and
it cannot be displayed.
Please try the following:
Click the Refresh button, or try again later.
Open the localhost home page, and then look for links to the
information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
Technical Information (for support personnel)
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Could not use
'(unknown)'; file already in use.
/jb_root/Digest_Subscription.asp, line 113
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Xtra
V3.5)
Page:
POST 55 bytes to /jb_root/Digest_Subscription.asp
POST Data:
Email_Address=[email protected]&MM_insert=form1
Time:
Tuesday, 26 September 2006, 10:38:06 a.m.
More information:
Microsoft Support
I have defined a go to page after submitting the info...but
that doesnt come up and neither does it want to store the input
data into the database..Can anyone please help me out here.Springbok_yfc wrote:
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC Microsoft Access Driver] Could not use
'(unknown)'; file
> already in use.
This error is usually associated with a permissions error.
Check out this technote.
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18802
Cheers jojo
Adobe Community Expert for Dreamweaver 8
http://www.webade.co.uk
http://www.ukcsstraining.co.uk/
Extending Knowledge, Daily.
http://www.communityMX.com/
Free 10 day trial
http://www.communitymx.com/joincmx.cfm -
SQL: System locks up and runs slow after performing simple DML record insert
SQL Version: 2008 R2
I am having a serious problem. I ran the following code to perform a simple table record insert which ran successfully. However, after running this code I could no longer access the related table. I couldn't run a query against it.
I tried to delete all the records and that wouldn't work either. When attempting to run any DML statements (i.e. Select * From vPCCertificateTypes) against this table SQL gets locked up and never returns anything and no error messages. I have
to manually stop the query. Now the entire SQL system is running slow.
Any help would be greatly appreciated. The code I ran to originally insert the records is below.
Regards,
Bob Sutor
CODE:
Begin TRAN
INSERT INTO vPCCertificateTypes (VendorGroup, CertificateType, Description, Active, Category)
SELECT HQCo, 'MBE', 'Minority-owned Business Enterprise', 'Y', 'Affirmative Action'
FROM HQCO
Where HQCo IS NOT NULL
AND HQCo <> 100
AND HQCo <> 99
IF @@ROWCOUNT <> 44 ROLLBACK ELSE COMMIT
Bob SutorThe problem was an open uncommitted transaction against the table as you suspected. I ran your code and it cleared the transaction. In the past I would intentionally leave our the Commit statement and then if the transaction ran fine, I would
simply highlight and run 'COMMIT' and it would close the transaction. Apparently that is not the correct approach. I'll use your suggested code from now on.
Thanks for the help.
Bob Sutor -
Dreamweaver CS4 - Record Insertion Form js error
Hi
I'm dreamweaver cs4 and started using the Record Insertion form, I was mainly experimenting with it and just seeing what it could do.
However when I get to the wizard i have to wait a few seconds for it to connect to the database and then I get an error message that says:
While executing onLoad in ServerObject-InsRecPHP.htm, the following Javascript error(s) occured:
At line 283 of the file "Macintosh HD:Application:Adobe Dreamweaver
CS4:Configuration:Commands:ServerObject-FormCmnPHP.js":
invalid array length
I was just wondering if this was a common problem, or I've messed something up either in Dreamweaver, or in the SQL database that I'm using.
I've also noticed that its the same for Update and Delete Records Wizards aswell.
Any help would be greatly appreciated
Aaron KennedyI see it's your first post. Welcome to the forum.
A good place to start looking for answers is the Dreamweaver FAQ. You'll find the answer to your question under "Crashes, installation, JavaScript, and unexplained problems". -
Find record insert date and time in a table
Hi All,
I want to get record insert date and time in a table. There is no datetime column in my table. Are there any possibility to get date and time for each record?
Thank YouThats not easy. If your transaction info still resides on active portion of the log you can use fn_dblog to read out the time at which the transactions occurs. This is useful only if you try it shortly after transaction.
the code would look like this
SELECT *
FROM fn_dblog(null,null)
WHERE [Transaction Name] LIKE 'INSERT%'
OR [Transaction Name] LIKE 'UPDATE%'
Also see
http://www.mssqltips.com/sqlservertip/3076/how-to-read-the-sql-server-database-transaction-log/
http://solutioncenter.apexsql.com/read-a-sql-server-transaction-log/
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to determine the last record inserted
hi
I have a table abc ( x number, y number, z date ) columns, there
is no primary or unique key.
I have been inserting values into it. there r some duplicate
values to.
but now I want to modify only the record inserted at the end.
i.e
if initially ABC is having
x y z
10 20 01-nov-2001
11 20 01-nov-2001
out of these records I want to change the value of x to 50 for
the record which was inserted last or shall I say whose z is the
greatest.
I have been trying to do but what I see that the z column is not
getting the time in increasing order. i.e even though I tried to
display the dated in dd-mon-yyyy 24hh:mm:ss format still and I
found that date is not consistant. the record I inserted first
is have a much more value than the record I inserted last.
please help...
Sreekantrowid refers to the current position of the record; if the
record has been moved (and there are any number of reasons why
the database might shift a record) the order of rowid will not
reflect the order of insertion.
the only way to guarantee order of insertion is to timestamp the
record. if I understand the original posting, you have been
doing this.
Now you should have been using SYSDATE. if you are saying that
SYSDATE is giving you inconsistent results then you have a real
problem: has somebody been tinkering with your database server -
changing the system clock or something?
Or are you using some other method to set the value for Z
column? If so, what?
rgds, APC -
SQL syntax error when creating record insertion form
Good day,
I was hoping someone could help me. I am trying to create a record insertion form on a website to insert data into a database table. When attempting to create the form, I am getting the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' Organization, Office, Department, Phone, EmailAddress, JobTitle, `OfficialMaili' at line 1
Not sure what is going on. I am running windows 8 and DW cs5 w/ MYSQL. I am testing on a local server prior to pushing to the remote server.
Thank you for your assistance and please advise any code you would like me to send.Here is all the code from this particular webpage. I apologize, I am too stupid to realize which parts are SQL vice PHP vice HTML:
<?php require_once('Connections/group4.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO individual (Grade, LastName, FirstName, M.I., Organization, Office, Department, Phone, EmailAddress, JobTitle, `OfficialMailing Address`, Citizenship, Designation, IATrainingComplete, IADate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Grade'], "text"),
GetSQLValueString($_POST['LastName'], "text"),
GetSQLValueString($_POST['FirstName'], "text"),
GetSQLValueString($_POST['MI'], "text"),
GetSQLValueString($_POST['Organization'], "text"),
GetSQLValueString($_POST['Office'], "text"),
GetSQLValueString($_POST['Department'], "text"),
GetSQLValueString($_POST['Phone'], "double"),
GetSQLValueString($_POST['EmailAddress'], "text"),
GetSQLValueString($_POST['JobTitle'], "text"),
GetSQLValueString($_POST['OfficialMailing_Address'], "text"),
GetSQLValueString($_POST['Citizenship'], "text"),
GetSQLValueString($_POST['Designation'], "text"),
GetSQLValueString($_POST['IATrainingComplete'], "text"),
GetSQLValueString($_POST['IADate'], "text"));
mysql_select_db($database_group4, $group4);
$Result1 = mysql_query($insertSQL, $group4) or die(mysql_error());
$insertGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
mysql_select_db($database_group4, $group4);
$query_rsIndividual = "SELECT * FROM individual ORDER BY IndividualNumber ASC";
$rsIndividual = mysql_query($query_rsIndividual, $group4) or die(mysql_error());
$row_rsIndividual = mysql_fetch_assoc($rsIndividual);
$totalRows_rsIndividual = mysql_num_rows($rsIndividual);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact Us</title>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.header {
font-size: 36px;
text-decoration: underline;
.quote {
font-size: 18px;
font-style: italic;
.tablethisone {
margin: 5px;
padding: 25px;
border: medium none #000;
text-align: center;
</style>
</head>
<body>
<p><img src="Images/EGA.png" width="227" height="222" alt="EGA" /><span class="header">SAAR Tracking System
</span></p>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="index.php">Home</a> </li>
<li><a href="search.php">Search</a></li>
<li><a href="contact.php">Contact Us</a> </li>
</ul>
<p> </p>
<p>PRIVACY ACT STATEMENT</p>
<p>Executive Order 10450, 9397; and Public Law 99-474, the Computer Fraud and Abuse Act.
To record names, signatures, and other identifiers for the purpose of validating the trustworthiness of individuals requesting
access to Department of Defense (DoD) systems and information. NOTE: Records may be maintained in both electronic
and/or paper form.</p>
<p> </p>
<p> </p>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Grade:</td>
<td><input type="text" name="Grade" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">LastName:</td>
<td><input type="text" name="LastName" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">FirstName:</td>
<td><input type="text" name="FirstName" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">M.I.:</td>
<td><input type="text" name="MI" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Organization:</td>
<td><input type="text" name="Organization" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Office:</td>
<td><input type="text" name="Office" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Department:</td>
<td><input type="text" name="Department" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Phone:</td>
<td><input type="text" name="Phone" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">EmailAddress:</td>
<td><input type="text" name="EmailAddress" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">JobTitle:</td>
<td><input type="text" name="JobTitle" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">OfficialMailing Address:</td>
<td><input type="text" name="OfficialMailing_Address" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Citizenship:</td>
<td><input type="text" name="Citizenship" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Designation:</td>
<td><input type="text" name="Designation" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">IATrainingComplete:</td>
<td><input type="text" name="IATrainingComplete" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">IADate:</td>
<td><input type="text" name="IADate" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Insert record" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</form>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Disclosure of this information is voluntary; however, failure to provide the requested information may impede, delay or
prevent further processing of this request.</p>
<p class="quote">"Be polite, be professional, but have a plan to kill everybody you meet" General James Mattis</p>
<p> </p>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>
<?php
mysql_free_result($rsIndividual);
?> -
Dw cs5 BUG: record insertion Form
TO RECREATE:
When dreamweaver CS5 is connected to Coldfusion 8 and MySql server, And the mySql table field contains allow "NULL" (that is allows NULL)
the "Record Insertion Form" generates incorrect code. The varchar(50) does not work -- it incorrectly generates cfqueryparam(..."cf_sql_clob") Hopefully this will help some one else.
mysql>
CREATE TABLE `contacts`(
`contacts_ID` INT UNSIGNED NOT NULL AUTO_INCREMENT
,`contacts_detail_ID` INT UNSIGNED NULL
,`firstname` VARCHAR(50) NOT NULL
,`lastname` VARCHAR(50) NOT NULL
,`emailaddr` VARCHAR(128) NOT NULL UNIQUE
,`pwd` VARCHAR(40) NULL
,`contacts_status` TINYINT UNSIGNED NOT NULL DEFAULT 1
,`modified_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
,PRIMARY KEY(`contacts_ID`)
,KEY(`firstname`)
,KEY(`lastname`)
,KEY(`emailaddr`)
">
WRONG CODE:
<cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "form1">
<cfquery datasource="ndi2010">
INSERT INTO contacts (firstname, lastname, emailaddr, pwd, contacts_status)
VALUES (<cfif IsDefined("FORM.firstname") AND #FORM.firstname# NEQ "">
<cfqueryparam value="#FORM.firstname#" cfsqltype="CF_SQL_CLOB" maxlength="50">
<cfelse>
</cfif>
, <cfif IsDefined("FORM.lastname") AND #FORM.lastname# NEQ "">
<cfqueryparam value="#FORM.lastname#" cfsqltype="CF_SQL_CLOB" maxlength="50">
<cfelse>
</cfif>
, <cfif IsDefined("FORM.emailaddr") AND #FORM.emailaddr# NEQ "">
<cfqueryparam value="#FORM.emailaddr#" cfsqltype="CF_SQL_CLOB" maxlength="128">
<cfelse>
</cfif>
, <cfif IsDefined("FORM.pwd") AND #FORM.pwd# NEQ "">
<cfqueryparam value="#FORM.pwd#" cfsqltype="CF_SQL_CLOB" maxlength="40">
<cfelse>
</cfif>
, <cfif IsDefined("FORM.contacts_status") AND #FORM.contacts_status# NEQ "">
<cfqueryparam value="#FORM.contacts_status#" cfsqltype="CF_SQL_TINYINT">
<cfelse>
NULL
</cfif>
</cfquery>
CORRECTED / better CODE:
<cfset CurrentPage=GetFileFromPath(GetBaseTemplatePath())>
<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "form1">
<cfquery datasource="ndi2010">
INSERT INTO contacts (firstname, lastname, emailaddr, pwd, contacts_status)
<cfqueryparam value="#FORM.firstname#" cfsqltype="CF_SQL_VARCHAR" maxlength="50">
<cfelse>
</cfif>
, <cfif IsDefined("FORM.lastname") AND #FORM.lastname# NEQ "">
<cfqueryparam value="#FORM.lastname#" cfsqltype="CF_SQL_VARCHAR" maxlength="50">
<cfelse>
</cfif>
, <cfif IsDefined("FORM.emailaddr") AND #FORM.emailaddr# NEQ "">
<cfqueryparam value="#FORM.emailaddr#" cfsqltype="CF_SQL_VARCHAR" maxlength="128">
<cfelse>
</cfif>
, <cfif IsDefined("FORM.pwd") AND #FORM.pwd# NEQ "">
<cfqueryparam value="#FORM.pwd#" cfsqltype="CF_SQL_VARCHAR" maxlength="40"
null="#YesNoFormat(NOT Len(Trim(FORM.pwd)))#" >
<cfelse>
<cfqueryparam value="" cfsqltype="CF_SQL_VARCHAR" maxlength="40"
null="#YesNoFormat(1)#">
</cfif>
, <cfif IsDefined("FORM.contacts_status") AND #FORM.contacts_status# NEQ "">
<cfqueryparam value="#FORM.contacts_status#" cfsqltype="CF_SQL_TINYINT">
<cfelse>
NULL
</cfif>
</cfquery>MX 2004 was always a bit "gummy" on this. Instead of using the DW wizard, I downloaded a free version of Microsoft SQL Server Express Edition. I use that for all table Inserts, Updates,etc. This accesses the tables directly on the server. Nothing needs to be synced, put, gotten or whatever. Use DW for Form and UI creation and making prebuilt queries.
Hope that helps
Jerry H -
Need to commit after every 10 000 records inserted ?
What would be the best way to Commit after every 10 000 records inserted from one table to the other using the following script :
DECLARE
l_max_repa_id x_received_p.repa_id%TYPE;
l_max_rept_id x_received_p_trans.rept_id%TYPE;
BEGIN
SELECT MAX (repa_id)
INTO l_max_repa_id
FROM x_received_p
WHERE repa_modifieddate <= ADD_MONTHS (SYSDATE, -6);
SELECT MAX (rept_id)
INTO l_max_rept_id
FROM x_received_p_trans
WHERE rept_repa_id = l_max_repa_id;
INSERT INTO x_p_requests_arch
SELECT *
FROM x_p_requests
WHERE pare_repa_id <= l_max_rept_id;
DELETE FROM x__requests
WHERE pare_repa_id <= l_max_rept_id;1006377 wrote:
we are moving between 5 and 10 million records from the one table to the other table and it takes forever.
Please could you provide me with a script just to commit after every x amount of records ? :)I concur with the other responses.
Committing every N records will slow down the process, not speed it up.
The fastest way to move your data (and 10 million rows is nothing, we do those sorts of volumes frequently ourselves) is to use a single SQL statement to do an INSERT ... SELECT ... statement (or a CREATE TABLE ... AS SELECT ... statement as appropriate).
If those SQL statements are running slowly then you need to look at what's causing the performance issue of the SELECT statement, and tackle that issue, which may be a case of simply getting the database statistics up to date, or applying a new index to a table etc. or re-writing the select statement to tackle the query in a different way.
So, deal with the cause of the performance issue, don't try and fudge your way around it, which will only create further problems. -
Recurrent single record Insert problems
Hi,
we have on production environment a Java based application that makes aprox 40.000 single record Inserts per hour into a table.
We ha traced the performance of this Insert and the medium time is 3ms, that is ok. Our Java architecture is based in Websphere Application Server and we access to Oracle 10g through a WAS datasource.
But we have detected that 3 or 4 times a day, during aprox 30 seconds, the Java service is not able to make any insertion in that table. And suddenly it makes all the "queued inserts" in only 1 second. That "pause" in the insertion cause problems of navigation because is the top layer there is a web application.
We are sure that is not a problem with the WAS or the Java code. We are sure that is a problem with the Oracle configuration, or some tunning action for this kind of applications that we don´t know. We first thought it could be a problem with a sequence field in the table. Also, a problem when occurs the change of the redo log. But we've checked it with our DBA and this is not the problem.
Has anybody any idea of what could be the origin of this extrange behaviour?
Thanks a lot in advance.
Jose.If by one single disk you mean a single physical disk then spreading the online redo lobs onto multiple disks would be a good idea. Log Group A should be on a seperate disk from Log Group B and the members of each log group should also be on seperate disks.
Note that Oracle does not stop processing when it does a checkpoiint. Here is basically how it works. When online redo LogA fills a checkpoint is signaled and Oracle immediately starts writing to LogB. The ckeck point is processed by ckpt and dbwr.
If logB fills and a switch to LogC occurs before the ckeckpoint signaled by the switch from LogA to LogB has completed then you get the checkpoint not complete information message. Oracle will continue processing though it has more work to do having to combine two ckeckpoints. If the problem continues then you get 3 and 4 checkpoints backed up. This will bog Oracle down as the buffer cache has to be pretty full at this point. You cannot read data unless you have a clean buffer to read into.
The checkpoint not complete message normally means your online redo logs are too small and are filling too quickly. In the absence of Data Guard configured to use log shipping you should look to see how many log switches you are doing per day. If is is more the 24 - 48 then increase the size of the online redo logs.
Database writer performance issues are the next area you would want to ckeck after properly sizing the online redo logs and verifying the IO performance of log writer. Pretty much all you can do to help log writer IO is put enough physical disk under the logs to spread the IO out.
If your problem is caused by the activity level during peak periods then setting MTTR probably will not help since dbwr will be busy writing anyway.
You really should run a statspack or AWR report to help clarify the issue.
If you determine you are switching online redo logs too many times and increase the size take a set of statspack both before and after you make the change. This will help you see the effect on the database as a whole.
HTH -- Mark D Powell -- -
Hello.
I have a db which has 5M records and has 2 secondary associated dbs.
ENV uses 800M cache.
I have checked speed of insertion, and how long took to populate every 100,000 records.
before 3M records, it took about 10 sec. to insert every 100,000 records.
I think that's very nice.
But after 3M inserted, it took about 100 sec. to insert every 100,000 records.
overall, it took 20 minutes to insert 5M records.
Is there any solution improving performance without having more cache?
Thanks.
ps.
* Primary DB's file size is 4.9GB
* 2 Secondary DB's file size is 700MB
* I'm not using transactions.
Result of Insert Test
inserted rows seconds to insert 100,000 records
100,000 5.5
200,000 4.5
300,000 5.6
400,000 5.8
500,000 5.4
600,000 6.7
700,000 5.2
800,000 9.5
900,000 8.1
1,000,000 10
1,100,000 10.8
1,200,000 9.9
1,300,000 10.7
1,400,000 11
1,500,000 11.8
1,600,000 9.6
1,700,000 10.6
1,800,000 10.9
1,900,000 12.2
2,000,000 11
2,100,000 10.8
2,200,000 10.9
2,300,000 11.7
2,400,000 11.1
2,500,000 13.9
2,600,000 10.7
2,700,000 10.6
2,800,000 11.4
2,900,000 11.3
3,000,000 24.2
3,100,000 45.4
3,200,000 53
3,300,000 38
3,400,000 59.4
3,500,000 81.8
3,600,000 83.8
3,700,000 95.6
3,800,000 79
3,900,000 75.8
4,000,000 80.9
4,100,000 98
4,200,000 117.8
4,300,000 110
4,400,000 96
4,500,000 82
4,600,000 101
4,700,000 104
4,800,000 109
4,900,000 110
4,931,099 20
Message was edited by:
wertyu
Message was edited by:
wertyu
Message was edited by:
wertyuHello.
I have a db which has 5M records and has 2 secondary
associated dbs.
ENV uses 800M cache.
I have checked speed of insertion, and how long took
to populate every 100,000 records.
before 3M records, it took about 10 sec. to insert
every 100,000 records.
I think that's very nice.
But after 3M inserted, it took about 100 sec. to
insert every 100,000 records.You did not mention what hardware you run on. I can give you some numbers that I'm seeing on my MacBook Pro (2.4 Ghz, slow laptop disk)
My records are 40 bytes and my keys are 20 bytes. With two secondary indexes I'm inserting those with about 20.000 records per second. The insert speed is pretty constant, whether I'm testing with 200.000 or 10.000.000 million records.
The one thing that is completely killing performance is doing an import from some dump file on the same filesystem that ie being read record by record. If I do that then I see your speed pattern, first few go fast, then it drops.
What worked very well for me was to read all or large chunks of import files into memory. Then there is mostly write access to the database files and nothing else. Speeds up many times.
S. -
Using getPrevStepLog to get number of records inserted
Hi-
I need to get the number of records inserted by the ODI interface but the value is contained not within previous step, but within previous step's sub-step. e.g.
Step 0. Load Data Interface (No. of Inserts field is 0, No. of Rows contains a number but it doesn't look like there is a valid parameter string for it...)
SubStep 1
SubStep 4 (This substep's No. of Inserts value I want)
Step 1. Variable Assignment (select '<%=odiRef.getPrevStepLog("INSERT_COUNT")%>' -> gets me 0, but I want the number from Substep 4.
Thank you in advance for any help.Use this in your current step to get previous log information:
SELECT MAX(NVL(NVL(nb_ins,0),0)
FROM <key_work_rep>.SNP_SESS_TASK_LOG
WHERE sess_no = <%= odiRef.getPrevStepLog("SESS_NO") %>
AND nno = <%= odiRef.getPrevStepLog("NNO") %>
AND scen_task_no = <hard code your sub_step_no>
Exception:
i) No insert log available then return 0
ii) If no previous step log or sub step found then return 0
Regards,
Himanshu -
How to find out the n number of records inserted??
In File to JDBC Scenarios, i am inserting n records in Oracle.
How to find out the n number of records inserted??Hi,
If you are using the statement "UPDATE_INSERT", get the response on element <insert_count>count</insert_count>. It will give you the inserted rows.
This link can be very helpfull.
[http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm]
regards.
roberti -
Guys, I just upgraded my iphone 3gs to ios6, it took 2 hours get it installed. However asfter installing there are issues with activating it.
Its getting failed every time..."says the activation server is temporarily unavailable".
Tried activating via itunes but no respite " says No sim inserted".
pls help.No, I did not find a way to fix it. Went to Apple store to be told that the phone is dead and I would need to purchase a new phone. A little frustrated with the fact that it is Apple who caused the phone to not work!
Maybe you are looking for
-
How do I open a previous version Numbers file in the current version of Numbers?
I get a window that says the file is too old to open in my current version. I no longer have previous versions installed. It seems very strange that current versions will not open legacy files. Why is this? How do I fix it?
-
A kinda off topic question but hopefully someone can help: I want some advice on a sound setup for my home, i want surround sound in my livingroom with wireless speakers for use this with my tv, PC, Hi-fi and maybe other appliances. Also i would like
-
All online logs needed archiving
"All online logs needed archiving" I have the database in "archivelog" mode alert file ..All online logs needed archiving When adding a new schema should the archivelog be NO? What am I to do here?
-
Workitem stays in InProcess state
Hi Everybody, I have created a custom workflow to send mail with PDF as attachment.I have an activity step which is creates calls the method of my custom BO and in the method I am calling a function module wherein I have all the code to Create a smar
-
Template SQL for EIS Drill-Through
I am trying to figure out the command that I need to add to my template SQL in an EIS drill-through report that will exclude all rows that have a 0 value in my data column when the report is executed. Does anyone have an example of how this can be do