Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Import of single storeproc from export file?
On 3 Sep 1998 03:23:29 GMT, jpmakar_at_aol.com (Jpmakar) wrote:
>Does anyone know how to import a single storedproc from a export file of an
>entire database that consists of many schemas? I can restore a single table,
>but have only been able to get storedprocs if I restore an entire schema.
>Right now I have a dummy schema that I do a 'touser' import into and cut and
>past the storedproc back to the original schema. This is a pain in the
>butarsky. Anybody got a better way?
Here is a clumsy aproximation of what you want to achieve:
and to prevent recreating existing PL/SQL objects, views and sequences)
3. Restote the original to_users's tablespace quotas.
As a result, the import will create all the nonexisting procedures, functions, packages, package bodies, sequences and views (i.e. all the objects that exist only in the data dictionary) from orig_owner schema in the to_user's schema, while leaving all the existing objects intact.
So it's not the "SINGLE_PROCEDURE_IMPORT" like you wan't it, but it is "NONEXISTING_VIEW_SEQ_PLSQL_IMPORT". You can make a table listing all the procedures, functions, packages, package bodies, sequences and views prior to the above import. Then after the import, you can dynamicaly create the script (by querying this table and the catalog) for droping all the new objects except the procedure you wanted to import originaly.
This should be much quicker than importing the whole schema into a dummy schema and then cut-and-pasting the procedure definition into the to_user schema. And you'll avoid tablespace fragmentation (by not creating creating/dropping objects in the dummy schema).
HTH,
--
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)