|
|
|
|
Re: EXECUTE IMMEDIATE 'set autotrace on'; ORA-00922: missing or invalid option [message #422421 is a reply to message #422344] |
Wed, 16 September 2009 04:57 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Quote:
Quote:i'll create & drop indexes as below inside dynamically.
That's the worst idea I've heard this week.
You must be having a bad week.
I'd got to a month minimum on that one.
The reasons it's such a bad idea are:
1) It will prevent any inserts/updates on the indexed columns while the create index is running.
2) If another session has an uncommited change to that table, then your create index will error with an 'ORA-00054 Resource busy and acquired with NOWAIT'
3) It will invalidate all the current query plans for that table and require them to be reparsed
You'll get problems 2 and 3 again when you try to drop the index.
Just create the index and leave it there.
|
|
|