Updating a table which has 1291444946 records
Hi Friends,
We have table with 1291444946 records in that 13844852 records are updated.The Current process Time taken is 12:22:55.19.This is simple update statement
update table_name set a=b where a=c;Top wait event was db file scattered read.
DB_Version=11.2.0.2
OS=Solaris 10 x86
SGA=16GB
PGA=6GB
Cursor_sharing=EXACTIs their anyway we can reduce this time to 6 hours or less.
Regards
NM
Hi,
Thanks for your reply.
TABLE_NAME,COLUMN_NAME,COUNT(*)
TIBEX_ORDER,HALTREASON,2
TIBEX_ORDER,BOOKTIMESTAMP,4
TIBEX_ORDER,STOPPRICE,2
TIBEX_ORDER,ORDERSIDE,4
TIBEX_ORDER,LASTEXECSETTLEMENTCYCLE,3
TIBEX_ORDER,PRICELEVELPOSITION,4
TIBEX_ORDER,PARTICIPANTIDMM,2
TIBEX_ORDER,LASTEXECUTIONROLE,4
TIBEX_ORDER,REFERENCEID,4
TIBEX_ORDER,LASTEXECQTY,4
TIBEX_ORDER,LASTEXECUTIONCOUNTERPARTY,4
TIBEX_ORDER,CLEARINGHANDLING,2
*TIBEX_ORDER,INSTRUMENTID,412*
TIBEX_ORDER,PRICE,257
TIBEX_ORDER,PARTICIPANTID,14
TIBEX_ORDER,MEID,6
TIBEX_ORDER,MDENTRYID,4
TIBEX_ORDER,QUANTITY,4
TIBEX_ORDER,DISCLOSEDQTY,4
TIBEX_ORDER,LASTINSTRESULT,4
TIBEX_ORDER,LASTINSTMESSAGESEQUENCE,4
TIBEX_ORDER,NOTE,4
TIBEX_ORDER,PARTNEREXID,4
TIBEX_ORDER,ORDERSTATUS,12
TIBEX_ORDER,TIMESTAMP,510
TIBEX_ORDER,ISPEX,4
TIBEX_ORDER,USERORDERID,4
TIBEX_ORDER,QTYFILLED,4
TIBEX_ORDER,LASTEXECACCOUNTNO,4
TIBEX_ORDER,ENTEREDPRICETYPE,3
TIBEX_ORDER,TIMEINFORCE,11
TIBEX_ORDER,ACCOUNTTYPE,4
TIBEX_ORDER,LASTINSTTYPE,11
TIBEX_ORDER,EXPIRYTIMESTAMP,51
TIBEX_ORDER,PEGOFFSET,4
TIBEX_ORDER,REMAINQTY,4
TIBEX_ORDER,LASTEXECPRICE,4
TIBEX_ORDER,MESSAGESEQUENCE,4
TIBEX_ORDER,PREVREFERENCEID,4
TIBEX_ORDER,PRICETYPE,2
TIBEX_ORDER,ACCOUNTNO,4
TIBEX_ORDER,MARKETSTATE,5
TIBEX_ORDER,LASTEXECPOSTTRADEVENUETYPE,4
TIBEX_ORDER,ORDERID,4
TIBEX_ORDER,LASTEXECCLEARINGAGENCY,4
TIBEX_ORDER,ORDERTYPE,6
TIBEX_ORDER,BOARDID,15
TIBEX_ORDER,CLEARINGAGENCY,6
TIBEX_ORDER,LASTINSTUSERALIAS,21
TIBEX_ORDER,LASTINSTREJECTCODE,5
TIBEX_ORDER,AVERAGEPRICE,4
TIBEX_ORDER,LASTEXECUTIONID,4
TIBEX_ORDER,VISIBLEQTY,4
TIBEX_ORDER,LASTEXECCPCLEARINGAGENCY,4Regards
NM
Similar Messages
-
Update enrolled table which has 6 composite primary key
Hi Everyone,
I am trying to update a grade column in table called enrolled which has 6 composite primary key column including SID, TERMYEAR, FACCODE, DEPCODE, COURSENO, SECNO and 2 extra column including GRADE, IDD all of them are of type VARCHAR2 as describe below:
To update this table I used the command below:
UPDATE enrolled
SET grade = :COURSE_BLOCK.GRADE_TEXT
WHERE IID = :GLOBAL.logUserid
AND SID = :COURSE_BLOCK.SID_TEXT
AND FACCODE = :COURSE_BLOCK.FACULTY_TEXT
AND DEPCODE = :COURSE_BLOCK.DEPARTMENT_TEXT
AND COURSENO = :COURSE_BLOCK.COURSE_TEXT
AND SECNO = :COURSE_BLOCK.SECTION_TEXT;
Note: the :GLOBAL.logUserid is a global variable that I assigned the user id when the user log on to the application.
When I run the application and fill out the form in order to update the table this doesn't update the table and if I use SQL*PLUS as well with the values that I use for the form to update the table I get message: o rows updated
Can Someone help please?Here is the solution.
The problem:
The problem was that the enrolled table was designed in a way that a student can enrolled in the lecture(LEC type column) and Laboratory(LAB type column). When a student is given a grade, it is given a grade for the course 100 (eg: 03-60-100) this course has a lecture and lab. this course belong to the faculty code 03(science) department 60 (computer Science) so when a student register to a course, will register to a lecture and a lab but he will receive a grade for the course 100 lec in this case Oracle couldn't update the table because there was two column with course 100 for that particular student Id
The solution:
There are many solution I believe but my quickest solution is when a student register to the course by default is given a grade 'I' means Incomplete then when the instructor add the grade, he can just update a grade from incomplete to the final grade (eg A) now the code will be to get only the course 100 that has grade and discard that doesn't have grade this means that I need only to make sure that the WHERE Clause grade is not null shown below.
UPDATE enrolled
SET grade = BLOCK_NAME.FIELD_NAME
WHERE grade IS NOY NULL
AND IID = BLOCK_NAME.FIELD
AND faccode = BLOCK_NAME.FIELD
AND depcode = BLOCK_NAME.FIELD
AND courseno= BLOCK_NAME.FIELD_NAME
NAD secno = BLOCK_NAME.FIELD_NAME
AND SID = BLOCK_NAME.FIELD_NAME -
How to update a table that has Million Records
Hi,
Lets consider the basic EMP table and lets assume that it has around 20 Million Records . we need to have an update statement.Normal UPdate statement may hang the system or it may take a lot of time.
The basic or Normal update statement goes like this and hope it may not work.
update emp set hiredate = sysdate where comm is null and hiredate is null;Basic statement may not work. sugestions Needed.
Regards,
Vineshsri wrote:
I heard Bulk collect will resolve these type of issues and i am really poor at Bulk Collect concepts.Exactly what type of issue are you concerned with? The business requirements here are pretty important-- what problem is the UPDATE causing, specifically, that you are trying to work around.
so looking for a solution to the problem using Bulk Collect .Without knowing the problem, it's very tough to suggest a solution. If you process data in batches using BULK COLLECT, your UPDATE statement will take longer to run and will consume more resources on the database. If the problem you are trying to solve is that your UPDATE is not fast enough, this is a poor approach.
On the other hand, if you process data in batches, and do interim commits, you can probably hold locks on individual rows for a shorter amount of time. That would only be a concern, though, if you have some other process that is trying to update the same rows that you are updating at the same time that you're updating them, which is pretty rare. And breaking your update into multiple transactions introduces a whole bunch of complexity. You now have to write a bunch of code to ensure that your process is restartable should the update fail mid-way through leaving some number of updates committed and some number rolled back. You have to have a very detailed understanding of the data and data consistency to ensure that breaking up the transaction isn't going to negatively impact any process, report, etc. To do it correctly is a pile of work and then it's something that is constantly at risk of creating problems in the future when requirements change.
In the vast majority of cases, you're better off issuing a simple SQL statement during a time when the system isn't particularly busy.
Justin -
How to update a table which contains empty records.
I had created one table, i didn't insert anything.
It is possible to update the same table?[clippy]
Hi! it looks like you're trying to use Oracle!
Do you:
( ) want to INSERT data to a table
( ) want to UPDATE existing data in a table
( ) ALTER the structure of the table
( ) search the internet for other queries
[clippy]
It's not clear what you're trying to do:
as we understand it it seems like:
you have a newly created table and you want to make it so there's data in it is this correct? -
How to update table which has column name as Oracle keyword?
Hi All,
Somebody has created one table which has column name as "OPTION", now i am trying update this table column value and its throwing an error. "Invalid Identifier".
Could you please help me in this?
Thanks in advance.
Regards,
Ganesh Patilcheck this :
batch@DOLN1> create table "from" ("select" varchar2(10));
Table created.
batch@DOLN1> desc "from";
Name Null? Type
select VARCHAR2(10)
batch@DOLN1> update "from" set "select" = 'hello World';
0 rows updated.
batch@DOLN1> insert into "from" values('hello World');
insert into "from" values('hello World')
ERROR at line 1:
ORA-12899: value too large for column "TCM_BATCH"."from"."select" (actual: 11, maximum: 10)
batch@DOLN1> update "from" set "select" = 'hello';
0 rows updated.
batch@DOLN1> insert into "from" values('hello');
1 row created.
batch@DOLN1> commit;
Commit complete.
batch@DOLN1> update "from" set "select" = 'World' where "select" = 'hello';
1 row updated.
batch@DOLN1> select * from "from";
select
World -
How to update a column which has 35 millions of rows?
Hi everyone
need help
I am updating a column which has 35 millions of records. When i start update, it is taking like > 60 mins and its not stoping (finishing).
I need to null that column A, and update that column A with the other column B values.
Thanks
kumarThree common causes for big updates that are slow:
blocking. You can check whether the UPDATE is waiting on another connection to release locks using sp_who2
improperly sized log file. A big update may use of a lot of log space. If you log file is too small, and you have auto-grow enabled (which is the default setting), it will grow whenever needed. But this takes a lot of extra time. You can easily see this
when you view the file size of the log file
if the column you are updating is indexed, the engine may also you tempdb a lot, so tempdb may also grow a lot, which would take a lot of additional time. This is also easy to check by inspecting tempdb's file size
Gert-Jan -
INSERTING DATA INTO A SQL SERVER 2005 TABLE, WHICH HAS A IDENTITY COLUMN
Hi All,
I have to insert the data into a SQL SERVER 2005 Database table.
I am able to insert the data into a normal SQL Server table.
When I am trying to insert the data into a SQL Server table, which has a identity column (i.e. auto increment column in Oracle) I am getting error saying that can't insert value explicitly when IDENTITY_INSERT is set to OFF.
Had anybody tried this??
There are some SRs on this issue, Oracle agreed that it is a bug. I am wondering if there is any workaround from any one of you (refer Insert in MS-SQL database table with IDENTITY COLUMN
Thanks
V KumarEven I had raised a SR on this in October 2008. But didn't get any solution for a long time, finally I had removed the identity column from the table. I can't to that now :).
I am using 10.1.3.3.0 and MS SQL SERVER 2005, They said it is working for MS SQL SERVER TABLE, if the identity column is not a primary key and asked me to refer to note 744735.1.
I had followed that note, but still it is not working for me.
But my requirement is it should work for a MS SQL SERVER 2005 table, which has identity column as primary key.
Thanks
V Kumar -
Need to make a copy/clone of a table which has sdo_geometry data type
Folks,
We are running Oracle 11gr1 on Suse Linux platform.
We have a requirement, where we need to make a copy of a table, in the same database but in a difference schema, the source table has about 130 millions rows and also has the sdo_getometry data type.
I tried materialized view, but MV does not support sdo_geometry data type.
According to one of my DBAs, doing it via data pump , will take few days, which is not acceptable.
Is there a way, we can make a copy of this table in the same db ?
Thanks
AshishSiva,
This is not for backup purpose.
Here is the background information on this requirement.
I need to have a static copy of a table, which has spatial column, sdo_geometry in it.
So we can run another application against this table, just read-only, since we need static data, data in the source table changes quite often.
One of my DBA suggested to have another instance/database, to keep the copy of the source table, I thought idea of having another database just to keep a copy of a table is an over kill.
That is why I had asked this question and you had provided a viable solution.
Then we need to refresh this table , with the data (changes) from the source table, maybe once in 2- 3 weeks.
I tried creating a Materialized view, but it does not support Spatial columns.
So now I am trying to figure out, the most efficient way to refresh the clone table from the source table.
Regards,
Ashish -
can anyonehelp, i have updated to ios7 which has put a passcode on my ipad, i keep getting the code wrong, i have no itunes or cloud sync
Duncanray10 wrote:
... I keep getting a message stating my ipad needs software to be 10.6.3. ...
You are misreading it... it is referring to iTunes on your computer...
Download and Install the Latest version of iTunes onto your computer...
http://www.apple.com/support/itunes/install/ -
How to find tables which has more than 1000 Partitions
Hi All,
Is there any other way to find out the tables which has more than 1000 Partitions ?
Apart from SAP report RSDD_MSSQL_CUBEANALYZE. Because this report is not working for me as job getting cancel again and again with ABAP dump DBIF_DSQL2_SQL.I already check SAP Note 1309838, but itu2019s not applicable for us because we are on highest support package level SAP_BW 701 SP06.
Thanks,
HarshalIf you are running SQL Server as your database platform run this query:
select o.object_id,o.name,p.Partition_count from sys.objects o
inner join
(select object_id,count(distinct partition_number) as Partition_count
from sys.partitions
group by object_id)
p
on o.object_id = p.object_id
where o.type = 'U'
order by p.Partition_count desc -
I need to implement Drag N Drop between two tables which saves both records
I need to implement Drag N Drop between two tables which saves both records in a third page, by using drag n drop.
check this video http://baigsorcl.blogspot.com/2011/01/drag-and-drop-collection-in-oracle-adf.html
-
To select table which has TAB as data column with in
Hi All
I have a table which has column type defined as TAB type. When I try selecting the table in PL/SQL developer, I got below error.
What should I do? Even SQL* Plus shows the same error!
SQL> select *
2 from my_tab_cap
3 /
from my_tab_cap
ERROR at line 2:
ORA-00904: : invalid identifierThanks in advance.
Message was edited by:
guru paran
Changed the table name.You probably want to help us out with all your ddl:
create table tab2 (my_tab_col my_type ) nested table my_tab_col store as my_tab;
create type my_type as table of varchar2(100);
declare
v_type my_type := my_type();
begin
v_type.extend(4);
v_type(1) := 'I like table types1';
v_type(2) := 'I like table types2';
v_type(3) := 'I like table types3';
v_type(4) := 'I like table types4';
insert into tab2(my_tab_col) values (v_type);
end;
select * from tab2;
MY_TAB_COL
VARCHAR(I like table types1,I like table types2,I like table types3,I like table types4) -
How to find table which has no index?
Hi,
How to find a table which has no index?
Please provide the query to find the above.
Thanks
Jafarselect owner,
table_name
from dba_tables dt
where not exists(select 'x'
from dba_indexes di
where dt.owner=di.table_owner
and dt.table_name = di.table_name) -
I want to update my iphone which has 6.1 to iOS7. Can I do it thru the service center or do I need to do it on my own. Updating at home is lot more inconvinient as the internet connection is not stable.
To add to templeton advice, you need at least 3.5 GB free space to update directly from iPhone.
And don't forget to make a backup at home before you proceed. -
Problem while inserting into a table which has ManyToOne relation
Problem while inserting into a table *(Files)* which has ManyToOne relation with another table *(Folder)* involving a attribute both in primary key as well as in foreign key in JPA 1.0.
Relevent Code
Entities:
public class Files implements Serializable {
@EmbeddedId
protected FilesPK filesPK;
private String filename;
@JoinColumns({
@JoinColumn(name = "folder_id", referencedColumnName = "folder_id"),
@JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)})
@ManyToOne(optional = false)
private Folders folders;
public class FilesPK implements Serializable {
private int fileId;
private int uid;
public class Folders implements Serializable {
@EmbeddedId
protected FoldersPK foldersPK;
private String folderName;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "folders")
private Collection<Files> filesCollection;
@JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)
@ManyToOne(optional = false)
private Users users;
public class FoldersPK implements Serializable {
private int folderId;
private int uid;
public class Users implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer uid;
private String username;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "users")
private Collection<Folders> foldersCollection;
I left out @Basic & @Column annotations for sake of less code.
EJB method
public void insertFile(String fileName, int folderID, int uid){
FilesPK pk = new FilesPK();
pk.setUid(uid);
Files file = new Files();
file.setFilename(fileName);
file.setFilesPK(pk);
FoldersPK folderPk = new FoldersPK(folderID, uid);
// My understanding that it should automatically handle folderId in files table,
// but it is not…
file.setFolders(em.find(Folders.class, folderPk));
em.persist(file);
It is giving error:
Internal Exception: java.sql.SQLException: Field 'folderid' doesn't have a default value_
Error Code: 1364
Call: INSERT INTO files (filename, uid, fileid) VALUES (?, ?, ?)_
_ bind => [hello.txt, 1, 0]_
It is not even considering folderId while inserting into db.
However it works fine when I add folderId variable in Files entity and changed insertFile like this:
public void insertFile(String fileName, int folderID, int uid){
FilesPK pk = new FilesPK();
pk.setUid(uid);
Files file = new Files();
file.setFilename(fileName);
file.setFilesPK(pk);
file.setFolderId(folderId) // added line
FoldersPK folderPk = new FoldersPK(folderID, uid);
file.setFolders(em.find(Folders.class, folderPk));
em.persist(file);
My question is that is this behavior expected or it is a bug.
Is it required to add "column_name" variable separately even when an entity has reference to ManyToOne mapping foreign Entity ?
I used Mysql 5.1 for database, then generate entities using toplink, JPA 1.0, glassfish v2.1.
I've also tested this using eclipselink and got same error.
Please provide some pointers.
ThanksHello,
What version of EclipseLink did you try? This looks like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=280436 that was fixed in EclipseLink 2.0, so please try a later version.
You can also try working around the problem by making both fields writable through the reference mapping.
Best Regards,
Chris
Maybe you are looking for
-
Hi All, Please help to elaborate the difference between Insert All and Insert in oracle 10g. Thanks, regards,
-
Data selection period seems no use in logical DB PCH??
Hi experts,I have a problem when using LDB PCH. There are object selection period fields PCHOBEG and PCHOEND. there are also data selection period fields PCHBEGDA and PCHENDDA . I set the data selection fields PCHBEGDA & PCHENDDA values at Start-of-s
-
Problems With Time Capsule Showing Up on Windows 7
I just recently got a job that requires me to connect to the company's TC but my PC won't connect. I installed the software, put in my login info, and Airport Utility comes up under "Programs." However, the TC fails to show up under "My Computer." I'
-
Hi, I have one client and one server. In both hosts I created an OS-user named User1. The user have been given various role under the prefix SQLServer2005. The default instance of SQL Server and instance (background-process) of Analysis Service are
-
Cisco Prime Collaboration 9 cannot discover ipphone
Hi Folks I am testing Cisco Prime Collaboration ver 9.0.24376 in my lab environment, Im using it to discover CUCM Cluster version 8.6.2 and successfully to obtain Server and Gateway information, but I can't see any endpoint that registered to CUCM sh