undefine owner
set verify off
set linesize 200
set pagesize 0
set feedback off
set heading off
spool create_functions.sql
select decode(line,1,'CREATE '||text,text)
from   dba_source
where  owner = upper('&&owner')
and    type = 'FUNCTION'
order by name, line
/
select 'grant '||privilege||' on '||table_name||' to '||grantee
       ||decode(grantable,'Y',' with grant option;',';')
from dba_tab_privs tp,
     dba_objects o
where tp.owner      = upper('&&owner')
and   tp.table_name = o.object_name
and   tp.owner      = o.owner
and   o.object_type = 'FUNCTION'
/
spool off
set heading on
set feedback on
