• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 569
  • Last Modified:

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
0
ballioballi
Asked:
ballioballi
1 Solution
 
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now