Executing a procedure gives this error

After sucessfully upgrading to 10g from 9i . Executing a procedure gives this error.


SQL> exec adp_grants

ERROR at line 1:
ORA-00955: name is already used by an existing object
ORA-06512: at "SYS.DBMS_SYS_SQL", line 906
ORA-06512: at "SYS.DBMS_SQL", line 39
ORA-06512: at "SYSADM.DC_GRANTS", line 72
ORA-06512: at line 1
ballioballiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
what is the code of the adp_grants procedure?
0
ballioballiAuthor Commented:
It is very similar to this:-
Runs good in all 9i env since 3 years

CREATE OR REPLACE procedure adp_grants is
b_sql varchar2(200);
sql1_cursor        INTEGER;
   execute_sql1             INTEGER;

cursor c1 is
select 'grant select on '||object_name||' to query_only'
  from (select object_name
  from user_objects
 where object_type in ('VIEW', 'TABLE')
minus
select table_name
  from USER_TAB_PRIVS
where grantee='QUERY_ONLY'
  and privilege = 'SELECT')
 union all
select 'grant insert, delete, update on '||object_name||' to modify_also'
  from (select object_name, 3
  from user_objects
 where object_type in ('VIEW', 'TABLE')
  and SUBSTR(object_name,1,6) = 'PS_ADP_'
GROUP BY TABLE_NAME

)
 union all
select 'drop public synonym '||synonym_name
from ( select synonym_name, table_name
         from all_synonyms
        where table_owner='ADP'
          and owner='PUBLIC'
;
begin
open c1;
loop
fetch c1 into b_sql;
exit when c1%notfound;
   sql1_cursor := dbms_sql.open_cursor;
   dbms_sql.parse(sql1_cursor, b_sql, dbms_sql.native);
dbms_output.put_line(' '||b_sql||' ');
   execute_sql1 := dbms_sql.execute(sql1_cursor);
   dbms_sql.close_cursor(sql1_cursor);
end loop;
close c1;

end;
/
0
ballioballiAuthor Commented:
This script is not the full script but it has  similar more lines for some more "table_owner."
Same is working  fine in 9i
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ballioballiAuthor Commented:
Any update ?? Experts??
0
ram_0218Commented:
That should be simple. The name of the object is already existing because,

1.  You try to grant on something that is already granted.
2. You try to drop something that is being still used.

Check it out. Since you've a dbms_output.put_line, while executing find out which grant is throwing error then analyze.
0
MohanKNairCommented:
>>  ORA-00955: name is already used by an existing object


The above error clearly says that an "An attempt was made to create either a table, view, cluster, index, or synonym that already exists"

Search for any "create" in the procedure.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.