Home » SQL & PL/SQL » SQL & PL/SQL » How to export packages??? (Oracle 9i, windows XP)
How to export packages??? [message #425230] Thu, 08 October 2009 03:00 Go to next message
amit.sehrawat
Messages: 29
Registered: September 2009
Location: India
Junior Member

Hey i need to export/import packages associated with one particular user, do i have to take entire dump or is there a way to just export packages.

P.S.: I am new to oracle, so sorry if i ask anything stupid.
Re: How to export packages??? [message #425231 is a reply to message #425230] Thu, 08 October 2009 03:03 Go to previous messageGo to next message
Michel Cadot
Messages: 63804
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use dbms_metadata.get_ddl procedure or user_source view.

Regards
Michel
Re: How to export packages??? [message #425241 is a reply to message #425230] Thu, 08 October 2009 04:07 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
There's no way to just export packages that I know of, but if you export a whole user, and set ROWS=N, INDEXES=N TRIGGERS=N then you'll get as little extra data in the export as you can, and the export will contain the packages and procedures.
Re: How to export packages??? [message #425255 is a reply to message #425241] Thu, 08 October 2009 05:00 Go to previous messageGo to next message
amit.sehrawat
Messages: 29
Registered: September 2009
Location: India
Junior Member

JRowbottom wrote on Thu, 08 October 2009 04:07
There's no way to just export packages that I know of, but if you export a whole user, and set ROWS=N, INDEXES=N TRIGGERS=N then you'll get as little extra data in the export as you can, and the export will contain the packages and procedures.


Thanks, this worked. Smile
Re: How to export packages??? [message #425296 is a reply to message #425255] Thu, 08 October 2009 08:07 Go to previous messageGo to next message
joy_division
Messages: 4616
Registered: February 2005
Location: East Coast USA
Senior Member
Be aware that this tpye of export will still usually have control characters spread throughout, making it a challenge to get the source without having to still make minor modifications to be able to reproduce it.
Re: How to export packages??? [message #425334 is a reply to message #425230] Thu, 08 October 2009 11:39 Go to previous messageGo to next message
Kevin Meade
Messages: 2098
Registered: December 1999
Location: Connecticut USA
Senior Member
Yes, if what you desire is the source code, an export is not the best method of getting it.

In order of preference

1) dbms_metadata.get_ddl as was indicated by Michel

2) select text from user_source...

3) use a third part tool (TOAD for example)

Getting source code via export is error prone and not the intent of the export tool.

Good luck, Kevin
Re: How to export packages??? [message #425447 is a reply to message #425334] Fri, 09 October 2009 03:13 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
It's not a good way of getting the code, but I got the impression from the first post that the OP wanted to move the packages to another schema.
Re: How to export packages??? [message #425512 is a reply to message #425334] Fri, 09 October 2009 06:42 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Kevin Meade wrote on Thu, 08 October 2009 18:39
Yes, if what you desire is the source code, an export is not the best method of getting it.

In order of preference
0) Use an external source version repository

1) dbms_metadata.get_ddl as was indicated by Michel

2) select text from user_source...

3) use a third part tool (TOAD for example)

Getting source code via export is error prone and not the intent of the export tool.

Good luck, Kevin


There, fixed that for you.
Previous Topic: Ora-00604 while dropping user.
Next Topic: Update/insert
Goto Forum:
  


Current Time: Mon Sep 26 14:35:08 CDT 2016

Total time taken to generate the page: 0.10046 seconds