• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 546
  • Last Modified:

Invalid objects

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
msimons4
Asked:
msimons4
4 Solutions
 
sdstuberCommented:
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
 
msimons4Author Commented:
How about if I disable constraints, delete rows, then enable no vaildate? Will I be able to recompile invalid objects?
0
 
johnsoneSenior Oracle DBACommented:
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
 
sdstuberCommented:
truncate and delete will have no impact on the validity or invalidity of your objects
0
 
Franck PachotCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now