dbTalk Databases Forums  

Materialized Views

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Materialized Views in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
The Magnet
 
Posts: n/a

Default Materialized Views - 04-15-2010 , 12:33 PM






We're about at the end of our rope. We have a script that runs at
night and re-created some materialized view. The SQL simple drops the
view and re-creates it.

However, each night a different view fails to be created. The view is
dropped, but when attempting we'll get a ORA-00955:

FROM analyst a, broker b, master_table m, (
*
ERROR at line 14:
ORA-00955: name is already used by an existing object

How can you get that error on a SELECT?? And, it is different every
time. I thought is was timing, but that is not it.

Suggestions?

Reply With Quote
  #2  
Old   
Michel Cadot
 
Posts: n/a

Default Re: Materialized Views - 04-15-2010 , 12:36 PM






"The Magnet" <art (AT) unsu (DOT) com> a écrit dans le message de news: 059a76ea-1b9d-486d-bd56-ae3857f9b893...oglegroups.com...
Quote:
We're about at the end of our rope. We have a script that runs at
night and re-created some materialized view. The SQL simple drops the
view and re-creates it.

However, each night a different view fails to be created. The view is
dropped, but when attempting we'll get a ORA-00955:

FROM analyst a, broker b, master_table m, (
*
ERROR at line 14:
ORA-00955: name is already used by an existing object

How can you get that error on a SELECT?? And, it is different every
time. I thought is was timing, but that is not it.

Suggestions?
Because the optimizer generates intermediate memory views and
unfortunatly (and bugly) it generates trwice the same name.

Regards
Michel

Reply With Quote
  #3  
Old   
The Magnet
 
Posts: n/a

Default Re: Materialized Views - 04-15-2010 , 12:42 PM



On Apr 15, 12:36*pm, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
Quote:
"The Magnet" <a... (AT) unsu (DOT) com> a écrit dans le message de news: 059a76ea-1b9d-486d-bd56-ae3857f9b... (AT) w17g2000yqj (DOT) googlegroups.com...
|
| We're about at the end of our rope. *We have a script that runs at
| night and re-created some materialized view. *The SQL simple drops the
| view and re-creates it.
|
| However, each night a different view fails to be created. *The view is
| dropped, but when attempting we'll get a ORA-00955:
|
| *FROM analyst a, broker b, master_table m, (
| * * * *
| ERROR at line 14:
| ORA-00955: name is already used by an existing object
|
| How can you get that error on a SELECT?? *And, it is different every
| time. *I thought is was timing, but that is not it.
|
| Suggestions?

Because the optimizer generates intermediate memory views and
unfortunatly (and bugly) it generates trwice the same name.

Regards
Michel
If this is true, the I have 2 questions:

1) Why does it not happen to every view
2) How to get around it?

We have 7 views which we create.

Thanks.

Reply With Quote
  #4  
Old   
Michel Cadot
 
Posts: n/a

Default Re: Materialized Views - 04-15-2010 , 01:16 PM



"The Magnet" <art (AT) unsu (DOT) com> a écrit dans le message de news: 57abad0c-82ca-404c-b6bb-e7a8a80a6cfa...oglegroups.com...
On Apr 15, 12:36 pm, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
Quote:
"The Magnet" <a... (AT) unsu (DOT) com> a écrit dans le message de news: 059a76ea-1b9d-486d-bd56-ae3857f9b... (AT) w17g2000yqj (DOT) googlegroups.com...
|
| We're about at the end of our rope. We have a script that runs at
| night and re-created some materialized view. The SQL simple drops the
| view and re-creates it.
|
| However, each night a different view fails to be created. The view is
| dropped, but when attempting we'll get a ORA-00955:
|
| FROM analyst a, broker b, master_table m, (
| *
| ERROR at line 14:
| ORA-00955: name is already used by an existing object
|
| How can you get that error on a SELECT?? And, it is different every
| time. I thought is was timing, but that is not it.
|
| Suggestions?

Because the optimizer generates intermediate memory views and
unfortunatly (and bugly) it generates trwice the same name.

Regards
Michel
If this is true, the I have 2 questions:

1) Why does it not happen to every view
2) How to get around it?

We have 7 views which we create.

Thanks.

-----------------------------

1) Because it is a bug and so happens only in certain circonstances
2) Try to change the way you write it

It could happen on any complex query not only in mview.

Regards
Michel

Reply With Quote
  #5  
Old   
Shakespeare
 
Posts: n/a

Default Re: Materialized Views - 04-16-2010 , 02:12 PM



Op 15-4-2010 20:16, Michel Cadot schreef:
Quote:
"The Magnet"<art (AT) unsu (DOT) com> a écrit dans le message de news: 57abad0c-82ca-404c-b6bb-e7a8a80a6cfa...oglegroups.com...
On Apr 15, 12:36 pm, "Michel Cadot"<micadot{at}altern{dot}org> wrote:
"The Magnet"<a... (AT) unsu (DOT) com> a écrit dans le message de news: 059a76ea-1b9d-486d-bd56-ae3857f9b... (AT) w17g2000yqj (DOT) googlegroups.com...
|
| We're about at the end of our rope. We have a script that runs at
| night and re-created some materialized view. The SQL simple drops the
| view and re-creates it.
|
| However, each night a different view fails to be created. The view is
| dropped, but when attempting we'll get a ORA-00955:
|
| FROM analyst a, broker b, master_table m, (
| *
| ERROR at line 14:
| ORA-00955: name is already used by an existing object
|
| How can you get that error on a SELECT?? And, it is different every
| time. I thought is was timing, but that is not it.
|
| Suggestions?

Because the optimizer generates intermediate memory views and
unfortunatly (and bugly) it generates trwice the same name.

Regards
Michel

If this is true, the I have 2 questions:

1) Why does it not happen to every view
2) How to get around it?

We have 7 views which we create.

Thanks.

-----------------------------

1) Because it is a bug and so happens only in certain circonstances
2) Try to change the way you write it

It could happen on any complex query not only in mview.

Regards
Michel


Sometimes 'purge recyclebin' helps.

Shakespeare

Reply With Quote
  #6  
Old   
Shakespeare
 
Posts: n/a

Default Re: Materialized Views - 04-16-2010 , 02:39 PM



Op 15-4-2010 20:16, Michel Cadot schreef:
Quote:
"The Magnet"<art (AT) unsu (DOT) com> a écrit dans le message de news: 57abad0c-82ca-404c-b6bb-e7a8a80a6cfa...oglegroups.com...
On Apr 15, 12:36 pm, "Michel Cadot"<micadot{at}altern{dot}org> wrote:
"The Magnet"<a... (AT) unsu (DOT) com> a écrit dans le message de news: 059a76ea-1b9d-486d-bd56-ae3857f9b... (AT) w17g2000yqj (DOT) googlegroups.com...
|
| We're about at the end of our rope. We have a script that runs at
| night and re-created some materialized view. The SQL simple drops the
| view and re-creates it.
|
| However, each night a different view fails to be created. The view is
| dropped, but when attempting we'll get a ORA-00955:
|
| FROM analyst a, broker b, master_table m, (
| *
| ERROR at line 14:
| ORA-00955: name is already used by an existing object
|
| How can you get that error on a SELECT?? And, it is different every
| time. I thought is was timing, but that is not it.
|
| Suggestions?

Because the optimizer generates intermediate memory views and
unfortunatly (and bugly) it generates trwice the same name.

Regards
Michel

If this is true, the I have 2 questions:

1) Why does it not happen to every view
2) How to get around it?

We have 7 views which we create.

Thanks.

-----------------------------

1) Because it is a bug and so happens only in certain circonstances
2) Try to change the way you write it

It could happen on any complex query not only in mview.

Regards
Michel


Just got this from metalink: sometimes when the MV is dropped, the
MV-table with the same name still exists (a MV has a table with the same
name). It's a bug.
Metalink note 565532.1

Shakespeare

Reply With Quote
  #7  
Old   
frank
 
Posts: n/a

Default Re: Materialized Views - 04-18-2010 , 04:20 AM



Shakespeare wrote:

Quote:
Just got this from metalink: sometimes when the MV is dropped, the
MV-table with the same name still exists (a MV has a table with the same
name). It's a bug.
Metalink note 565532.1

Shakespeare
Wouldn't that be while using "create MV on prebuilt table as select ..."?
Not if you just did "create MV as select".

OP: would there perhaps be a state in time, where a prebuilt table
existed? Or a synonym with the same name?

Regards,
frank van bortel

Reply With Quote
  #8  
Old   
Shakespeare
 
Posts: n/a

Default Re: Materialized Views - 04-18-2010 , 05:03 AM



Op 18-4-2010 11:20, frank schreef:
Quote:
Shakespeare wrote:


Just got this from metalink: sometimes when the MV is dropped, the
MV-table with the same name still exists (a MV has a table with the
same name). It's a bug.
Metalink note 565532.1

Shakespeare

Wouldn't that be while using "create MV on prebuilt table as select ..."?
Not if you just did "create MV as select".

OP: would there perhaps be a state in time, where a prebuilt table
existed? Or a synonym with the same name?

Regards,
frank van bortel
The note does not mention that. Some references do, though.
It states: It is possible that an earlier drop of Mview did not complete
successfully. It could be verified by checking dba_objects.


Shakespeare.

Reply With Quote
  #9  
Old   
Norbert Winkler
 
Posts: n/a

Default Re: Materialized Views - 04-19-2010 , 10:46 AM



Am Thu, 15 Apr 2010 10:33:17 -0700 (PDT) schrieb The Magnet:

Quote:
Suggestions?
http://www.dba-oracle.com/art_9i_mv.htm
has some suggestions under "Refreshing materialized views"

I've tested succesfully:
---
EXECUTE DBMS_MVIEW.REFRESH('a_mat_view_name');
---
declare
number_of_failures integer;
begin
DBMS_MVIEW.REFRESH_DEPENDENT(number_of_failures,'m aster_tab1,master_tab2,master_tab3');
end;
/
-------------
this fails:
DBMS_MVIEW.REFRESH_ALL_MVIEWS(number_of_failures);
-------------
and this (refresh on commit!!!!!) fails too for my views:
CREATE MATERIALIZED VIEW
empdep
ON PREBUILT TABLE
REFRESH FAST ON COMMIT
ENABLE QUERY REWRITE
AS SELECT empno, ename, dname, loc,
e.rowid emp_rowid,
d.rowid dep_rowid
FROM emp e, dept d
WHERE e.deptno = d.deptno;





--
Norbert
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit
Production

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.