CrBruno
CrBruno

Reputation: 1003

Copy package from one database to another using TOAD for Oracle

I'm using TOAD for oracle for managing Oracle database, I want to copy one procedure package from one database to another. Is there some simple way to do that like copy-paste?

Thanks

Upvotes: 1

Views: 8538

Answers (2)

ivorykoder
ivorykoder

Reputation: 1020

The simple option is to use "Create in another schema" option available in TOAD. Follow below steps: (There are two databases DB1 and DB2. Say you want to create the procedure in DB1 into another database DB2.)

  1. You need to be logged in both databases(say DB1 and DB2).
  2. Go to procedure in DB1.
  3. Right click on it. Choose "Create in another schema".
  4. Choose the script options you want and click 'OK'.
  5. Choose Destination Connection and Destination Schema(which will be for DB2).
  6. Click 'Execute'

Your job is done. Did I make it any simpler?

Upvotes: 2

Erkan Haspulat
Erkan Haspulat

Reputation: 12572

Using Schema Browser, you can reach the source code of the package if you are priviliged to do so. After that point forward, its up to you to do whatever you want with it.

If these two databases you are talking about are actually two schemas, I would advise not to re-create the package, but to grant it to the other schema.


EDIT: More explanation on packages.

Basiically speaking, an Oracle package includes two objects; a package and a package body. package is where the methods of your package that are public and visible to the users are. package body is where you actually implement the procedures.

So when moving a package somewhere else, you need to create these two objects. Toad, has a way to show you the scripts of these objects, using the schema browser. Find the source, copy both scripts and run them on your target.

Upvotes: 0

Related Questions