You appear to have a table (or user/schema) identifier which does not conform to the usual pattern and the database object naming rules, and which must therefore have been created as a quoted identifier.
For example, a table name starting with a number, or with a space in the name - you'd need to check your data dictionary to find out exactly what it's tripping over, or add a debug before the execute immediate
to do dbms_output.put_line(str);
.
Whatever it is though, you can just quote the identifier in the analyze command too:
str:='analyze table "'||c1.owner||'"."'||c1.table_name||'" list chained rows';
So if your current query generates a command like:
analyze table MYSCHEMA.42 list chained rows
... where the 42
is an invalid identifier, the modified version would do:
analyze table "MYSCHEMA"."42" list chained rows
This will also take care of any mixed-case names, which would also cause the analyze to fail unless quoted.
This is why quoted identifiers are not recommended by Oracle and are usually disliked by anyone who has been forced to deal with them. The identifier has to be quoted whenever it is referenced anywhere, and be used with exactly the same case as when it was created. If you have a choice, don't use them.
It may not be your fault though. On my 11gR2 instance there's an entry in dba_tables
for "SYS"."_default_auditing_options_"
which breaks the naming rules by starting with an underscore, and was created quoted in lowercase. (And that seems to have been there since at least 8.0). Not sure manually analyzing SYS tables is necessarily a good idea anyway, it might be better to restrict this to your own schema(s).