Solved

update clob column with varchar column

Posted on 2010-08-12
6
1,159 Views
Last Modified: 2013-12-19
I added a new column to the existing table (clob column) and i wanted to move the existing data from varchar column to the newly added  clob column. ( The size for the existing varchar is not enough and I don't want to remove that column so i didn't do alter table to change the data type)

UPDATE  schedule_ table
         SET   condition_large_sql = to_clob(condition_sql);

commit;


This statement is running for ever.

The table has 360 records.


Plan
UPDATE STATEMENT  ALL_ROWSCost: 3  Bytes: 292  Cardinality: 4              
      2 UPDATE SCHEDULE_TABLE       
            1 TABLE ACCESS FULL TABLE NEMA.CR_REPORT_SCHEDULE Cost: 3  Bytes: 292  Cardinality: 4  


0
Comment
Question by:vishali_vishu
6 Comments
 
LVL 73

Expert Comment

by:sdstuber
ID: 33421411
you should be able to assign the record directly

UPDATE  schedule_ table
         SET   condition_large_sql = condition_sql;
0
 
LVL 1

Author Comment

by:vishali_vishu
ID: 33422094
it is running forever.
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 168 total points
ID: 33422169
are multiple people updating that table?

your update doesn't have a where clause,  if just one other person is updating just one row you will have to wait until that transaction completes.

if you have multiple people and multiple rows it just gets that much worse
0
 
LVL 6

Assisted Solution

by:sridharv9
sridharv9 earned 166 total points
ID: 33424906
We do run similar sql moving varchar to clob using bind variables.

UPDATE streaminfo SET strm_tag1 = '' , strm_lob_tag2 = :1  WHERE stream_ID=:2

Check if the "enq-HW: contention"  wait event is high. And if yes try  manually add extend to lob segment.

However, still you may see slowdown of overall system performance. Oracle so far couldn't give us any appropriate answer.  

 Good luck.
0
 
LVL 13

Assisted Solution

by:riazpk
riazpk earned 166 total points
ID: 33452025
Try to lock the table before issuing update:
LOCK table schedule_ table in exclusive mode;
and you will know whether any record has been locked by someone else or not.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now