?
Solved

Invalid objects

Posted on 2011-03-08
5
Medium Priority
?
532 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 1000 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 35

Assisted Solution

by:johnsone
johnsone earned 500 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 74

Assisted Solution

by:sdstuber
sdstuber earned 1000 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 500 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

770 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