DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Copying a package from one schema to another

  1. #1
    Join Date
    Aug 2000
    Posts
    11

    Question

    Hi!

    Suppose that a package x belongs to the schema SCOTT. Now, I want to copy the entire package to another schema, say LIZ. Is there any command in sql for doing so, e.g. COPY SCOTT.X TO LIZ.X ?
    Thanks for your help!
    Dan

  2. #2
    Join Date
    Oct 2000
    Posts
    9

    Thumbs up Use Toad

    Dan,

    If you arent aware there is a very good freeware developer tool called toad(www.toadsoft.com). This tool will allow you to 1). create different database logins within same toad session. 2). It has a procedure editor that will allow you to pull procedures, functions, packages.... by schema owner.

    So you could create 2 database sessions(1st sess would be where your package is currently located, 2nd sess would be where you want to copy package to).

    Load up procedure editor from session one, pull in you package, click blue button(menu bar). This action will select all code. Pull up procedure editor from session two. The click ctrl-v. Once code is in procedure editor(session two). then click compile.

    Hope this helps.


  3. #3
    Join Date
    Jul 2000
    Posts
    521
    Use the Schema Manager of OEM.

    Select the package under the original schema. Right click - Selct "Create like" and next will be self explainatory.
    svk

  4. #4
    Join Date
    Nov 1999
    Location
    Elbert, Colorado, USA
    Posts
    81
    Or, as I mentioned on an identical post you placed elsewhere, export the package, then import with fromuser=scott and touser=liz.

  5. #5
    Join Date
    Aug 2000
    Location
    Ny
    Posts
    105
    If you looking for an eassy way to do this try to use the following script:

    SET PAGESIZE 10000
    SET feedback OFF
    SET heading OFF
    SET echo OFF
    spool d:\SQL.OUT

    SELECT TEXT
    FROM USER_SOURCE
    WHERE NAME = 'MY_PACKAGE';

    spool OFF
    SET echo ON
    SET feedback ON
    SET heading ON

    CONNECT OTHER_USER/OTHER_PASSWORD@OTHER_DATABASE;

    @d:\SQL.OUT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width