PL/SQL :: Commit Loop - Brought Up As To Max Inserts Per Transactions In 11g?

Nov 2, 2012

I'm running 11.2.0I am looking at tuning a sql statement, and the question was brought up as to the max inserts per transactions in 11g, and if it exceeds 1000.I haven't found a solid answer yet, but I thought that 10g was higher than 1000.

My first thought was to implement a commit loop on every 1000 rows, as that is how things were handled in the past.But I found an article that talks about redo logs and performance and how it's a horrible practice to do the commit loop.

What I haven't found is what is the better methodology in doing this?My scenario could encounter inserts as much as 20,000 at a time.

View 9 Replies


ADVERTISEMENT

Forms :: Loop To Commit More Than 1 Record?

Jul 3, 2010

i made this loop to commit the same item but depend on the count of suppliers to set the same item every time to different supplier . but the problem this code commit only the first sypplier but not any othere one ..

code : { key - commit - trigger }
declare
var_record_count number ;
VAR_p_request number;
begin
var_record_count:= get_block_property('control',CURRENT_RECORD);

[code]....

View 2 Replies View Related

PL/SQL :: Commit After 2000 Records In Update Statement But Not Using Loop

Mar 12, 2013

My oracle version is oracle 9i

I need to commit after every 2000 records.Currently am using the below statement without using the loop.how to do this?

do i need to use rownum?

BEGIN

UPDATE
(SELECT A.SKU,M.TO_SKU,A.TO_STORE FROM
RT_TEMP_IN_CARTON A,
CD_SKU_CONV M
WHERE

[Code].....

View 8 Replies View Related

Server Administration :: How Partition Can Be Brought Offline

Jan 4, 2012

I have a partitioned table - 128 partitions.

If I am not using data of many partitions in any way, will it affect my performance if I am firing select query that uses other/active partitions data.

How can I check when that partitioned was last accessed, also can I brought those inactive partitions offlie? If we can, what will be the advantages or disadvantages of that?

View 23 Replies View Related

Performance Tuning :: Cost Of Query Is Brought Down But Taking Same Time

Sep 1, 2010

For an query, cost was 16Lakhs and was taking 30min, I brought down the cost to 1.5lakhs, but still it is taking 30min.

There were many outer joins and same table has been Used(FROM clause) 5 times in the query. I have introduced WITH clause, and brought down the cost.

View 7 Replies View Related

How To Make Multiple Inserts In DB

Sep 4, 2009

i have multiple inserts to make in a table that is in an Oracle database...i already try several ways to do it but it always giving erros... how to make multiple inserts at same time.

View 2 Replies View Related

SQL & PL/SQL :: Automate Inserts From One Schema To Another

Dec 18, 2012

We have two databases one localdb with user rakdb and another one remotely remotedb with user rakdb .We need to be in sync with data in one table called om_item, where the users are inserting data on daily basis and the user sends us the insert script everday to run it on local databse to insert the new records in local database.I managed to create a file which records all the inserts into one text file in one directory.Can we have a scheduler to pick this text file from the specified folder and send mail using utl_mail.

CREATE TABLE ITEM (IT_CODE VARCHAR2(12),IT_NAME VARCHAR2(20));
INSERT INTO ITEM VALUES ('A','AAA');
CREATE OR REPLACE DIRECTORY MY_DIR AS 'C:TEMP';
CREATE OR REPLACE PROCEDURE it_status

[Code]..

Procedure created.

EXEC it_status
HOST TYPE c: empaaaa.txt
INSERT INTO ITEM (IT_CODE, ITEM_NAME) VALUES ('A','AAA');
COMMIT;

View 4 Replies View Related

Parameters For Table Containing Only Inserts

Apr 1, 2013

I'm on 11.2 DB and need to create an audit table that will be populated by DB triggers of other tables (after Insert,Update and Delete). The triggers will only ever be inserting data into the audit table. I have read that for insert only tables, you should define the 'pctfree' as 0. Is this correct? Do I need to set any other params (like pct_used) for tables only ever being inserted into?

View 2 Replies View Related

SQL & PL/SQL :: Performance Tuning In Large Inserts

Jan 19, 2011

I want to load 10 millions records from staging table to master table.One logic must be take during the load, the logic is rows already present in master table means, we need to update corresponding rows in master table otherwise rows insert in target table.

I have been using bulk collect and forall method to load data. it shows better performance compare then cursor row by row process. As per oracle doucmentation, we cannot use SELECT statements inside FORALL condition so we could not use logic inside the forall condition.

View 2 Replies View Related

SQL & PL/SQL :: Inserts Based On Column Values

Aug 15, 2012

I have a data in one table with 6 columns where user may be updating values in all of these 6 columns or he may enter 3 or 4 columns based on that inserts should take place, this is similar to my previous thread , i am using if condition to check column for null if its not null then i will make a insert , but is there any other easier way to do this.

CREATE TABLE ot_inspect_head
(inh_sys NUMBER,i_txn_code VARCHAR2(12),i_no NUMBER,i_ref_txn VARCHAR2(20),i_ref_no NUMBER);
CREATE SEQUENCE inh_sys START WITH 1;
CREATE TABLE ot_inspect_item
(ii_inh_sys NUMBER , ii_pi_sys NUMBER,ii_sys NUMBER,ii_item_cd VARCHAR2(12),
ii_grade VARCHAR2(12),ii_qty number, ii_flex_01 VARCHAR2(12),ii_flex01_qty number,
ii_flex_02 VARCHAR2(12),ii_flex02_qty number,ii_flex_03 VARCHAR2(12),ii_flex03_qty number);
CREATE SEQUENCE ii_sys START WITH 1;

insert into ot_po values ('ss-po',1,ph_sys.nextval);
insert into ot_inspect_head values (inh_sys.nextval,'ss-ins',1,'ss-po',1);
commit;
select * from ot_inspect_item

II_INH_SYS II_PI_SYS II_SYS II_ITE II_GRADE II_QTY II_FLEX_01 II_FLEX01_QTY II_FLEX_02 II_FLEX02_QTY
---------- --------- ------ ------ -------- ------ ---------- ------------- ---------- -------------
2 1 2 HEA100 A 100

--Now if the inspection user issues the update statement , it will delete this row
--from ot_inspect_item and reinserts the values with values based on
--ii_flex_01,ii_flex_02,ii_flex_03
[code]...

View 5 Replies View Related

SQL & PL/SQL :: How To See Today's Transactions

Sep 24, 2010

how to see for todays transactions in a database's Schema for example, in scott/tiger user.

To See All DML Operations carried out for current day with a single query, Insert,Update, Delete for the tables affected today.

View 10 Replies View Related

SQL & PL/SQL :: Missing Records While Performing Parallel Inserts

Jun 29, 2010

I have prepared shell scripts to do the parallel inserts on my DB table (LEGACY_SYSTEM).

There is a trigger (AFTER INSERT ON EACH ROW) associated with the above table. I am calling a package.function inside the trigger to do the required operation and finally it will insert records into my target table (PRICE_CHANGE).

Expectation:
------------
If I insert 10 rows into LEGACY_SYSTEM table, it should do few updates and finally insert 10 rows into PRICE_CHANGE table.

Result:
-------
10 rows got inserted into LEGACY_SYSTEM. All the updates are successful but I could see only 4 rows in PRICE_CHANGE table. If I run it for the second or third time, all the results will be perfect.

Instead of these shell script, if I insert one by one rows manually into LEGACY_SYSTEM table, I am getting all the expected results and the results are consistent. If you look at my scripts below, you will understand the problem better..

DRIVING SCRIPT(test_global.sh):
---------------
#!/bin/sh
./test_script.sh &
./test_script2.sh &
exit;

test_script.sh:
---------------
#!/bin/sh
./test.sh 100052051 10974 &
./test.sh 100052051 8649 &
./test.sh 100052060 10974 &
./test.sh 100052060 8649 &
./test.sh 100052078 10974 &
./test.sh 100052078 8649 &
./test.sh 100052086 10974 &
./test.sh 100052086 8649 &
exit;

test_script2.sh:
---------------
#!/bin/sh
./test.sh 100052051 11698 &
./test.sh 100052051 11777 &
./test.sh 100052060 11698 &
./test.sh 100052060 11777 &
./test.sh 100052078 11698 &
./test.sh 100052078 11777 &
./test.sh 100052086 11698 &
exit;

test.sh:
--------
#!/bin/sh
sqlplus HRUAMGR/HRUAMGR@MALDEV_DW1<<EOF
ALTER SESSION ENABLE PARALLEL DML;
insert into legacy_system (product, item, supp, type, g_ind, d_ind, o_num) values (7896544,$1,$2,'TEST',NULL,NULL,NULL);
commit;
exit;
EOF

I am calling test_global.sh through the UNIX session and all the records got inserted into LEGACY_SYSTEM table and few rows are missing from PRICE_CHANGE table.

If I remove the '&' symbol and execute, the results are perfect. But the requirement is not to remove the '&' symbol. I have been facing this problem for the past 1 month.

View 8 Replies View Related

SQL & PL/SQL :: Create Counter For The Number Of Inserts Run In A Block

Feb 18, 2010

I have a plsql Proc, which accepts a few parameters and inevitably loops through a cursor and runs a bunch of insert statements. With quite a few IF conditions.

Each insert statement has a value which i want to increment by (+1) every time an insert statement is executed in the same loop.. This is for a student housing database and this is for their room preferences so 1 is the first, 2 is there second preference e.t.c.

Please take a look at the code below: in the Insert values() I have put a? Where I want the number to increment from.

There are a lot more inserts which I haven't put below. I hope I have made myself clear as this has been quite difficult to explain. So for example if the 2nd two inserts are run, then I was the first one to insert with a 1 and the second with a 2.

BEGIN
FOR rec IN c1
LOOP
IF c1%FOUND THEN
INSERT INTO table (PK_A, fk_rms_id, application_type, application_person_type) VALUES (NULL, rec.pk_rms_id, app_type, app_person_type) RETURNING PK_APPLICATION_NO INTO x;
[Code] ........

View 2 Replies View Related

SQL & PL/SQL :: Create A Procedure That Inserts Parameters Into A Table

Oct 20, 2011

I am trying to create a procedure that inserts parameters into a table and then returns the number of rows inserted back to calling block. the procedure is compiling fine but is not returning the number of rows inserted. My code is as follows;

HOST VARIABLE DECLARATION
VARIABLE g_CarMasterInsertCount NUMBER;

STORED PROCEDURE
CREATE OR REPLACE PROCEDURE CarMasterInsert_sp (
registration IN VARCHAR2,
model_name IN VARCHAR2,
car_group_name IN VARCHAR2,
date_bought IN DATE,
cost IN NUMBER,
miles_to_date IN NUMBER,
miles_last_service IN NUMBER,
status IN CHAR,
rowsInserted OUT NUMBER)
[code]....

I think im close just that my syntax is off.

View 8 Replies View Related

SQL & PL/SQL :: Find Number Of Inserts Happened Every Day To A Particular Table?

Aug 9, 2013

Is there any way I could find the number of inserts happened every day to a particular table.

View 10 Replies View Related

SQL & PL/SQL :: Insert Select Statement Limit Inserts?

Apr 7, 2011

this is my problem,

insert into t1
select *
from t2
where condition;

Select * from t2 where condition retrieves in example 1000000 records but I only need to insert into t1 the first 100 records.

Is there anyway to abort/limit the insert into t1 to 100 records?

This can´t be used because only applies the condition to the first 100 rows of t2 and it's not valid.

insert into t1
select *
from t2
where condition
where rowcount<100;

View 16 Replies View Related

Oracle Hung Transactions

Jul 22, 2012

I have the following PL/SQL program.

declare
v_amount NUMBER;
v_paymentno INTEGER := &sv_paymentno;
v_playerno INTEGER;
v_payment_date DATE:= SYSDATE;
begin
select 500 into v_amount from dual;
select 44 into v_playerno from dual;
insert into penalties values (v_paymentno, v_playerno, v_payment_date, v_amount);
end;

I forgot to add the commit statement and now I have hung transaction with dirty data with v_paymentno 27. Is there a way to commit or rollback that transaction?

View 1 Replies View Related

ORA-24756 In Distributed Transactions

Jan 31, 2013

We found out an error from alert log of our Oracle 10.2.0.5 DB :
====================================
..
Wed Jan 30 16:45:01 EAT 2013
DISTRIB TRAN bea1.67AA54355C4A74ECDEE0
is local tran 6.42.332492 (hex=06.2a.512cc)
insert pending prepared tran, scn=8151148567799 (hex=769.d6509cf7)
Wed Jan 30 16:45:02 EAT 2013
Errors in file /oradata/sfapdb/bdump/sfapdb_reco_2739.trc:
ORA-24756: transaction does not exist
Wed Jan 30 16:45:02 EAT 2013
Errors in file /oradata/sfapdb/bdump/sfapdb_reco_2739.trc:
ORA-24756: transaction does not exist
..
====================================

There is no useful information from the trace log as shown below:
====================================
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Data Mining and Real Application Testing options
ORACLE_HOME = /ap/oracle10
System name:HP-UX
Node name:scvap2
Release:B.11.23
Version:U
Machine:9000/800
Instance name: sfapdb
Redo thread mounted by this instance: 1
Oracle process number: 18
Unix process pid: 2739, image: oracle@scvap2 (RECO)

*** SERVICE NAME:(SYS$BACKGROUND) 2013-01-30 16:45:01.941
*** SESSION ID:(1749.1) 2013-01-30 16:45:01.941
*** 2013-01-30 16:45:01.940
ERROR, tran=6.42.332492, ose=0:
ORA-24756: transaction does not exist
*** 2013-01-30 16:45:02.059
ERROR, tran=6.42.332492, session#=1, ose=0:
ORA-24756: transaction does not exist
====================================

I also found out there are some records (trans_id = "6.42.332492") in SYS.PENDING_TRANS$/ SYS.PENDING_SESSION$/dba_2pc_pending with "prepare" status.

This transaction is launched from a Weblogic Server via JDBC. Since it is abnormal so I have no choice to force commit/purge this transaction. Is that a bug of Oracle DB ? or Weblogic coding problem ?

View 2 Replies View Related

SQL & PL/SQL :: How To See A Tables Transactions For The Day Or Interval

Jun 12, 2012

I have a problem, we have some datas in a table for example 7500 rows in a table name called table1 upto 11:am today. but after 11:25 am i have only 5500 rows. in that table.

the table can be accessed by many users here. we dont know when the delete happended in that table. is there any query to find the transaction log of this particular table.

the deletion should be happended between 11:00 am to 11:30 am. but we have retrieved the data using timestamp query. but we need to know when the query issued and by which user the query has been issued.

View 3 Replies View Related

Serialize Distributed Transactions

Mar 27, 2012

here

[URL].......

you wrote that

"The serialize transaction isolation level is not supported with distributed transactions."

what is not supported (or example on what is not working properly)?

View 2 Replies View Related

Sessions Processes And Transactions

Nov 20, 2012

Oracle database 11g Expression Edition 11.2.0.2

I want to change the the number of processes to 150 (default is 100) I did this by issuing the below command.

alter system set processes=150 scope=spfile;But why that modified value is not being reflected?

select name, value from v$parameter where name in ('sessions','processes','transactions');

NAME                 VALUE
-------------------- -----
processes            100
sessions             172
transactions         189

View 8 Replies View Related

SQL & PL/SQL :: Improve Procedure Which Is Looping Through Query To Make Inserts

Oct 10, 2013

I am trying to improve a procedure which is looping through a query to make inserts.

FOR P IN (
SELECT O.TYPEID
,o.KEY
,O.ID
,O.NAME
,O.LGNUM
,O.LGNAME
[code]....

View 12 Replies View Related

SQL & PL/SQL :: Bulk Inserts Get Extremely Slow After 10000 Queries?

Feb 20, 2010

I am running a custom script that creates about 100,000 rows of demo data.

The table I am loading in to is fairly wide (100 columns), and only has about 10,000 rows at the moment.

The script goes really fast for the first 10K rows (100 inserts per second), and then incrementally gets slower. By 20,000 rows it is doing about 1 row per second. At this rate, it will never finish!.

Each insert is a separate statement, using bind variables and wrapped in a single transaction. I've tried dropping the indexes first but it didn't make a difference.

OEM shows it's 100% CPU bottleneck with no other information I can glean.

View 32 Replies View Related

Oracle Database Concept - Transactions

Nov 6, 2011

How a DB client session establishes a connection and how it performs any transaction.

View 1 Replies View Related

Save Button On A Form / SQL Plus Transactions

Jan 22, 2013

When a user clicks on Save Button on a form, can we know from sql plus (Oracle) all the related queries (insert/Update etc) for that transaction ??

View 1 Replies View Related

SQL & PL/SQL :: Query To Show Only Transactions For Today

Sep 12, 2010

I need to create a report that will show all activity for the day that the report is run. The report will be run or auto-refreshed throughout the day. So, at 10am, 11am, 2pm, 4pm etc. I just need to display quantities received, shipped etc. for that same day. Since the report will not be run at a fixed time, I can't use sysdate - .5 for example.

View 6 Replies View Related

SQL & PL/SQL :: To Create A Trigger To Prevent Transactions

May 10, 2013

Im trying to create a trigger to prevent transactions like insert, update and delete based on two conditions:

1) Friday
2) Between 5pm to 8am

View 5 Replies View Related

PL/SQL :: Possible To Use Forall Instead Of For Loop - End Loop

Nov 19, 2012

CREATE OR REPLACE PROCEDURE IND_MONITOR(P_tab VARCHAR2)
is
type ind_table is table of varchar2(20);
p_ind ind_table;
v_sql varchar2(2000);
begin
select index_name bulk collect into P_Ind from user_indexes where table_name=upper(P_tab);
for i in 1..p_ind.count loop
v_sql :='alter index '||p_ind(i)|| ' monitoring usage'
execute immediate v_sql using p_ind(i);
end loop;
end;

can i use forall instead of 'for loop ..end loop'

View 10 Replies View Related

SQL & PL/SQL :: How Many Select / Insert / Update Transactions Executing Per Day In DB

Jan 20, 2011

I need to generate a report by showing the select, insert, update transactions count per day.

I have been use V$SYSSTAT veiw but there is not include my requested data exactly!

[URL]

View 3 Replies View Related

Precompilers, OCI & OCCI :: Using Distributed Transactions With ProC

Jul 7, 2011

I found this thread, and recently i want to embedded oci in pro*c for distributed transaction reason.

can pro*c deal with distributed transaction? i want to use mts in pro*c .

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved