Solved

Invalid objects

Posted on 2011-03-08
5
521 Views
Last Modified: 2012-06-27
How does truncating affect the compiling of invalid objects? If a truncate a table that has child tables will I be able to recompile invalid objects?
0
Comment
Question by:msimons4
5 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 250 total points
ID: 35072957
if you have constraints from the children to the parent,  you can't truncate the parent.

if you don't then the truncate will work and shouldn't invalidate any dependent objects.
0
 

Author Comment

by:msimons4
ID: 35073084
How about if I disable constraints, delete rows, then enable no vaildate? Will I be able to recompile invalid objects?
0
 
LVL 34

Assisted Solution

by:johnsone
johnsone earned 125 total points
ID: 35073103
You should be able to recompile the invalid objects.  If records violate the constraints you enabled with no validate, then expect to get some errors later, but it should not prevent objects from being compiled.
0
 
LVL 73

Assisted Solution

by:sdstuber
sdstuber earned 250 total points
ID: 35073327
truncate and delete will have no impact on the validity or invalidity of your objects
0
 
LVL 15

Assisted Solution

by:Franck Pachot
Franck Pachot earned 125 total points
ID: 35082215
Hi,

cursors will be invalidated in shared pool but dependant objects will remain valid:
SQL> create table T as select * from dual;

Table created.

SQL> create view V as select * from t;

View created.

SQL> select object_name,status,data_object_id from user_objects where object_name in ('T','V');

OBJECT_NAM STATUS  DATA_OBJECT_ID
---------- ------- --------------
T          VALID            77043
V          VALID

SQL> truncate table T;

Table truncated.

SQL> select object_name,status,data_object_id from user_objects where object_name in ('T','V');

OBJECT_NAM STATUS  DATA_OBJECT_ID
---------- ------- --------------
T          VALID            77044
V          VALID

Open in new window


Regards,
Franck
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

948 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

17 Experts available now in Live!

Get 1:1 Help Now