Thanks for the question, Boobal.
Asked: June 11, 2016 - 12:42 pm UTC
Last updated: June 14, 2016 - 3:57 am UTC
Version: 12c
Viewed 1000+ times
You Asked
Hello Connor,
I have tried the below scenario and couldnt understand why it is happening.
First I tried to create the below object
create type obj1 is object(col1 number,col2 number);
/
Then I created a table with one column having the above created object as its data type.
create table t (t1 obj1);
/
Then I drop the object with FORCE option.
drop type obj1 force;
/
Now, when I query the table T it throws me error,
Select * from t;
ORA-04063: table "SYS.T" has errors
04063. 00000 - "%s has errors"
*Cause: Attempt to execute a stored procedure or use a view that has
errors. For stored procedures, the problem could be syntax errors
or references to other, non-existent procedures. For views,
the problem could be a reference in the view's defining query to
a non-existent table.
Can also be a table which has references to non-existent or
inaccessible types.
*Action: Fix the errors and/or create referenced objects as necessary.
Error at Line: 8 Column: 15
And this table is of no use anymore as im not able to add column or anything except dropping it.
Also, when I query the data dictionary tables there are some misleads,
select table_name,status from user_tables where table_name='T';
TABLE_NAME STATUS
------------- --------
T VALID
OBJECT_NAME STATUS
------------- -------
T INVALID
Can you please explain me why?
Thank you,
Boobal Ganesan
and Connor said...
In most places in the database, where the concept of "force" is allowed, you are basically telling us:
"Trust me, even though you (the database) think something should be checked, or alerted about, do not bother with that. Just go ahead and *do* the operation I have asked you to do".
In this case, you've said to us - "No matter what the consequences, I want this type called OBJ1 gone from my database. I dont care what breaks".
And that is exactly what we did...
The STATUS column in xxx_TABLES does not apply here. As the docs say, STATUS is relevant when:
"If a previous DROP TABLE operation failed, indicates whether the table is unusable (UNUSABLE) or valid (VALID)"
Hope this helps.
Rating
(1 rating)
Is this answer out of date? If it is, please let us know via a Comment