How to extract Procedure, Function, etc. Source Code from an Oracle Export

If you've got access to the original database, I'd go with DBMS_METADATA.GET_DDL.

You can script it with UTL_FILE so that it goes through each object (from USER_OBJECTS), uses the name and type to extract the object then write it to a file that has the appropriate naming convention.

It will be a lot cleaner than trying to split a single file.


Use the SHOW parameter to see the DDL:

imp userid=usr/pass@db full=y show=y log=imp.log