Operating System - HP-UX
1752742 Members
5388 Online
108789 Solutions
New Discussion юеВ

Re: Export/import procedures....

 
Ramana.Sv
Frequent Advisor

Export/import procedures....

How do you export/import a stored procedure/function/package? Is it possible?


6 REPLIES 6
Rita C Workman
Honored Contributor

Re: Export/import procedures....

Maybe I'm missing something here.

export/import is generally the term for what is done with volume groups and making them available to other nodes.

Procedures/functions - that sounds like programming and obviously you can move all or parts of a program/scripts.

Package - try MC/SG and it's called cmhaltpkg and cmrunpkg -n pkgname to move it from node to node.

Or could you clarify a little more....

Rgrds,
Rita

...but it's early and I haven't half finished my first cup of coffee...
Hein van den Heuvel
Honored Contributor

Re: Export/import procedures....

Hi Rita!

The question Ramana asks has nothing to do at all with HPUX and everything and only with Oracle. That's why it was put under the database category.

I just don't get it though.
I recognize that we are an extremely nice and helpful bunch here, but why would anyone in their right mind not go to Oracle/Oracle Forums/Oracle newsgroups/Oracle support to ask a question which is 100% Oracle dependent and has 0% platform contents.

By all means, if you'd like to know how to best create an Oracle datafile under hpux, or how to use LVM to set up a specific structure for Oracle, by all means do ask here. And more power to you if you can stick it in the database category, not general, but please let there be some hpux, or even just hp, component to this!

Ramana, don't take this personal, it's just a generic comment which I reserve for every 100th time someone asks a pure, and obvious 100% non-hpux related question in the hpux forum. The other 99 times I just answer and score some easy points (or not).

Just please realize that you are shortchanging yourself, your boss, and most importantly your customers by asking Oracle questions to well meaning HPUX helpers.

'nuff said!

Regards,
Hein.

Rita C Workman
Honored Contributor

Re: Export/import procedures....

Well Good Morning Hein,

Totally snoozing past that point. See - I really do need my coffee in the morning.

Ramana...agree with Hein, you will get far better answers from an Oracle Forum. But, we'll be here when you need some HPUX or SAN help.

Regards,
Rita
Yogeeraj_1
Honored Contributor

Re: Export/import procedures....

Hi Ramana,

One way would be to:

exp userid=old_user/pw owner=old_user rows=n

imp userid=new_user/pw fromuser=old_user touser=new_user


That would do a structural copy of the old_user to the new_user but not pull any data over. Now you can drop anything you don't want.

hope this helps!
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Jeff Crew
Advisor

Re: Export/import procedures....

My preference to "Reverse Engineer" Oracle stored code would be the following:
1) Use a GUI tool like Quest S/w TOAD or Oracle SQL developer. Then copy and paste the code (Pkg, Procedure, Function, Trigger, etc) into an editor.
2) Write a query to extract the code from the table DBA_SOURCE to grab the data in TEXT where the NAME = and TYPE = and be sure to order by the NUMBER column too.

You will need to add a "CREATE OR REPLACE " line at the beginning of the query to update or import the exported code. And set you linesize huge since TEXT is a varchar2(4000).

desc dba_source
Name Null Type
-------- -------- --------------
OWNER VARCHAR2(30)
NAME VARCHAR2(30)
TYPE VARCHAR2(12)
LINE NUMBER
TEXT VARCHAR2(4000)
Geoff Wild
Honored Contributor

Re: Export/import procedures....

And speeking of points....

Ramana, has assigned points to 25 of 214 responses to questions.

http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA1502188&listType=unassigned&forumId=1

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.