[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 541
  • 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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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