Home » Infrastructure » Linux » rebuild index failure in Crontab
rebuild index failure in Crontab [message #263541] Thu, 30 August 2007 04:54 Go to next message
win3vin
Messages: 35
Registered: April 2007
Location: Malaysia
Member
Hi,

I have a schedule job in crontab tab that rebuild the indexes.
Few indexes able to rebuild successfully except one index which has character '$'. Any idea how to set the command in the crontab for index with '$'?

Command:
ALTER INDEX SCHEMA_ABC.INDEX$222 REBUILD;

Error:
SQL> ALTER INDEX SCHEMA_ABC.INDEX$ REBUILD;
ALTER INDEX SCHEMA_ABC.INDEX$ REBUILD;
*
ERROR at line 1:
ORA-01418: specified index does not exist

Re: rebuild index failure in Crontab [message #263545 is a reply to message #263541] Thu, 30 August 2007 05:05 Go to previous messageGo to next message
Michel Cadot
Messages: 58920
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I have a schedule job in crontab tab that rebuild the indexes.

I don't think this is a good idea (actually I think it is a very bad one).
Anyway, when an object name has non alphanumeric character you have to enclose it between ".
But $ as _ is not assumed to be a special character, so it should works without ".
I think you have directly "ALTER INDEX SCHEMA_ABC.INDEX$222 REBUILD;" this in your shell script and "$222" is not a shell variable. If this is the case you have to espace $: "ALTER INDEX SCHEMA_ABC.INDEX\$222 REBUILD;"

Regards
Michel
Re: rebuild index failure in Crontab [message #263551 is a reply to message #263541] Thu, 30 August 2007 05:31 Go to previous messageGo to next message
win3vin
Messages: 35
Registered: April 2007
Location: Malaysia
Member
Thanks.

My index name is INDEX$222.
Trying to put " like "ALTER INDEX SCHEMA_ABC.INDEX$222 REBUILD;"

seem it wouldn't work with error message
SP2-0734: unknown command beginning ""ALTER IND..." - rest of line ignored.


Re: rebuild index failure in Crontab [message #263590 is a reply to message #263551] Thu, 30 August 2007 08:16 Go to previous message
Michel Cadot
Messages: 58920
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As you didn't put what is the real script, I can't help you more.
I didn't say you to put the whole statement between " but only the object name. Moreover I said this is likely not the problem.

Regards
Michel
Previous Topic: coding for job schduling in shell programming.
Next Topic: Editor pb
Goto Forum:
  


Current Time: Thu Aug 28 04:10:11 CDT 2014

Total time taken to generate the page: 0.12729 seconds