Moving procedures and sequences from one schema to another

Hi all,
Is there any way to export the procedures and sequences alone from one schema to another? If not is there any way to generate the procedure creating scripts from the source schema.
I used the following script SET HEADING OFF
SET PAGESIZE 999
SET LINESIZE 100
SELECT DBMS_METADATA.GET_DDL('PROCEDURE', NAME, owner) || '/' FROM ALL_SOURCE WHERE
OWNER='SCOTT' AND TYPE='PROCEDURE'
SPOOL C:\A.SQL
SPOOL OFF
[/CODE]
But the problem is in the out put script it is cutting the line .. for egCREATE OR REPLACE PROCEDURE "QC_PFIZER_REL5"."SPGETNEXTDS
S_ID"
( V_ID OUT NUMBER )
IS
BEGIN
SELECT SEQUENCE_DSS_Id.NEXTVAL INTO V_ID FROM DUAL;
END ;
i experimented with increasing linesize but it is not helping. I am using 9.2.0.5 on windows 2003.
Thanks
Muneer

Similar to getting the code from user_source, you could get sequences from user_sequences.
SQL> select dbms_metadata.get_ddl('SEQUENCE', sequence_name) from user_sequences ;
DBMS_METADATA.GET_DDL('SEQUENCE',SEQUENCE_NAME)
   CREATE SEQUENCE  "SCOTT"."SEQ"  MINVALUE 1 MAXVALUE 1.00000000000000E+27 INCR
EMENT BY 1 START WITH 1 CACHE 20 NOORDER  NOCYCLE
1 row selected.
SQL>

Similar Messages

  • Moving Events and Projects from one location to another on the same hard drive.

    Hello.
    I've searched in the FCP X User Manual, on this forum and in Google, but have found no explanation of how to do this, so I'm posting this here in hopes that someone in our community will be able to help.
    I've previously stored my FCP X Events and Projects folders on an external 3TB hard drive, because there is more room on it than on the internal 1TB hard drive, but, since then, I've worked with other media apps, for video, photography and audio, the files for which are also stored on the external hard drive, and this has created a bit of clutter with no folder structure to keep it tidy.
    I like an organised file structure on my system, to keep it uncluttered, easy to navigate and efficient to use, so I put all the files for my photography, video and audio apps into their own folders, which are, in turn, stored in their appropriate folders for Audio, Photography and Video, and those three folders are stored in a folder called Media, and then I directed each app to its own files.
    The only app with which this has been a problem is FCP X. While there is a way of relocating projects and events from within FCP X, it allows the user to move them from one hard drive to another, and not, as I want, from one place to another on the same hard drive.
    I'm not sure if it matters, but perhaps it's relevant to mention before the next paragraph that the files that had previously been imported as events are, to save hard-drive space, stored in the events folder as shortcuts to the original files, which are stored elsewhere on the drive, rather than as duplicates of those files.
    In Finder, I copied the Events and Projects folders to their intended new locations and tried in the app to link the events and projects to their new Finder location. It seemed to have worked, until I moved the original folders to the Trash. On re-opening FCP X, it was clear that the linking hadn't worked. I returned the original folders from the Trash to their original location, but that didn't entirely reverse the problem. I noticed also that, in the original and duplicated Events folders, the shortcuts had lost their links to the original files stored elswehere on the drive.
    Fortunately I had run a backup before starting, so I restored the original folders and the app from the backup, and all was back to normal.
    I'd be grateful if anyone could advise me on whether or not it's possible to move FCP X events and projects from one place to another on the same hard drive with the app's compliance.
    Thank you.

    Ludio wrote:
    I'd be grateful if anyone could advise me on whether or not it's possible to move FCP X events and projects from one place to another on the same hard drive with the app's compliance.
    I
    Message was edited by: Russ H Apparently mis-read the questions.

  • How to copy procedures and packages from one server to another?

    Hi,
    I have 439 packages and 178 procedures located in one server called MAXWELL.
    I need to copy these objects to another server called TITAN.
    The schema names is SPCBR in both servers.
    So both servers have an instance running with this schema SPCBR.
    SPCBR in TITAN server has their tables with table data which was generated by an export/import process from MAXWELL server.
    However, procedures and packages were not copied by the export/import because I used the clause 'tables'.
    Now, what can I do in order to equalize procedures and packages in both databases? I can't risk in damaging or duplicating data in my database located in TITAN server, ok?
    Thanks,

    Another simple alternative, according to AskTom (http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:454220160386)
    ---------------- getcode.sql ----------------------------
    set feedback off
    set heading off
    set termout off
    set linesize 1000
    set trimspool on
    set verify off
    spool &1..sql
    prompt set define off
    select decode( type||'-'||to_char(line,'fm99999'),
    'PACKAGE BODY-1', '/'||chr(10),
    null) ||
    decode(line,1,'create or replace ', '' ) ||
    text text
    from user_source
    where name = upper('&&1')
    order by type, line;
    prompt /
    prompt set define on
    spool off
    set feedback on
    set heading on
    set termout on
    set linesize 100
    ------------------- eof --------------------------------
    it extracts one procedure, function or package to a file. Thats it. If you
    wanted to get all of the procedures in a schema extracted to the current working
    directory, you would run a script:
    --------------- getallcode ---------------------------
    set termout off
    set heading off
    set feedback off
    set linesize 50
    spool xtmpx.sql
    select '@getcode ' || object_name
    from user_objects
    where object_type in ( 'PROCEDURE', 'FUNCTION', 'PACKAGE' )
    spool off
    spool getallcode_INSTALL.sql
    select '@' || object_name
    from user_objects
    where object_type in ( 'PROCEDURE', 'FUNCTION', 'PACKAGE' )
    spool off
    set heading on
    set feedback on
    set linesize 130
    set termout on
    @xtmpx.sql
    ---------------- eof ---------------------------------
    You can see how to filter on that one by adding to the where clause if you want.
    Just run @getallcode_INSTALL to run all of the scripts...

  • Move Business Area and EUL from one schema to another

    Hi,
    I need to take a EUL from the schema where it is now and bring it to another schema. I use Oracle Discoverer 3.1 Admin Edition to Export Business Area then import it in the new schema. Everything works fine except the fact that workbooks (.dis file) created in the original schema returns no data (as it does in the original schema).
    Anybody can help ?

    Hi,
    There could be a number of reasons for this, but the first thing to check is whether Discoverer is generating the same SQL when the report is run in the two EULs.
    If the SQL is the same Discoverer could still return different data if for example there were user specific conditions in the query or language specific conditions in the query and the default language was different in the EULs.
    Are you using an Apps or database mode EUL? What is in the workbook query that you are running?
    Rod West

  • Moving playlists AND songs from one computer to another

    Hi there,
    I need to move several playlists and the songs in those playlists from my Mini to my laptop. Why? The laptop is going to be playing the music at my wedding, and the Mini's staying home.
    I have 6 different playlists. I know how to export the playlists as an XML file and import that file onto the laptop. But what about the files themselves? Between the 6 playlists, there's probably over 200 songs. I'd rather not hunt them all down, move them manually to the laptop, export XML playlists, lather, rinse, repeat.... but I suppose I will if I need to!
    If it help, my Mini's entire iTunes library lives on an external hard drive.
    Thoughts? Suggestions? Moral support?

    I'm confused--if your laptop is authorized to play all of the songs in your mini library, why can't you just burn a DATA DVD (if you have a DVD burner) of everything on the playlist. This should work on your laptop (as long as it's authorized to play purchased tunes). Post back if you have questions, but I don't know why this won't work!

  • Export sequence from once schema to another using dbms_datapump

    Hello,
    Can anybody help me how to export only sequences from one schema to another using dbms_datapump or using any other packages.
    I cannot use the expdp/impdp from command prompt.
    Thanks.

    Hello Richard,
    No luck yet, it's new one now.
    declare
    l_dp_handle NUMBER;
    v_job_state varchar2(4000);
    l_last_job_state VARCHAR2(30) := 'UNDEFINED';
    l_job_state VARCHAR2(30) := 'UNDEFINED';
    l_sts KU$_STATUS;
    v_logs ku$_LogEntry;
    v_row PLS_INTEGER;
    BEGIN
    dbms_output.put_line('get_sequence - Started');
    l_dp_handle := DBMS_DATAPUMP.open(operation => 'IMPORT',
    job_mode => 'SCHEMA',
    remote_link => 'PSUP_DATA',
    version => 'LATEST');
    dbms_output.put_line('get_sequence - get handle :'||l_dp_handle);
    DBMS_DATAPUMP.add_file(handle => l_dp_handle,
    filename => 'test.log',
    directory => 'DMPDIR',
    filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE); dbms_output.put_line('get_sequence - add file');
    DBMS_DATAPUMP.METADATA_FILTER(l_dp_handle, 'SCHEMA_LIST', '''PSUP_DATA'''); dbms_output.put_line('get_sequence - metadata filer1');
    DBMS_DATAPUMP.METADATA_FILTER(l_dp_handle,
    'INCLUDE_PATH_EXPR',
    'IN (''SEQUENCE'')'); dbms_output.put_line('get_sequence - metadata filer2');
    DBMS_DATAPUMP.METADATA_REMAP(l_dp_handle,
    'REMAP_SCHEMA',
    'PSUP_DATA',
    'IRIS_DATA'); dbms_output.put_line('get_sequence - metadata remap');
    DBMS_DATAPUMP.start_job(l_dp_handle); dbms_output.put_line('get_sequence - starting job');
    DBMS_DATAPUMP.WAIT_FOR_JOB(l_dp_handle, v_job_state);
    dbms_output.put_line('get_sequence - completed');
    exception
    WHEN OTHERS THEN
    dbms_datapump.get_status(NULL, 8, 0, v_job_state, l_sts);
    v_logs := l_sts.error;
    v_row := v_logs.FIRST;
    LOOP
    EXIT WHEN v_row IS NULL;
    dbms_output.put_line('logLineNumber=' || v_logs(v_row).logLineNumber);
    dbms_output.put_line('errorNumber=' || v_logs(v_row).errorNumber);
    dbms_output.put_line('LogText=' || v_logs(v_row).LogText);
    v_row := v_logs.NEXT(v_row);
    END LOOP;
    RAISE;
    end;
    get_sequence - Started
    get_sequence - get handle :58
    get_sequence - add file
    declare
    ERROR at line 1:
    ORA-31623: a job is not attached to this session via the specified handle
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 2772
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3886
    ORA-06512: at line 43
    ORA-39001: invalid argument value
    I go ogled some of adive i could see is grant create table to user, but my user is having DBA role as well.
    Please help.

  • How do I move a table from one schema to another schema on Oracle XE?

    How do I move a table from one schema to another schema on Oracle XE?

    Hi,
    I tried to use the insert/select statement that you had given, it did not work.
    The error is ORA-00913: too many values.
    But finally what I did was, I went into the system schema where the table was and generated the DDL through the utilities and afterwards I imported them into the schema that I am currently working on. It solved the problem!
    However I am still curious to know why the insert/select statement did not work? Do you know any site/tutorial which gives a real time example?
    Thank you
    Skye

  • How do I move a table from one schema to another schema?

    How do I move a table from one schema to another schema?

    Grant access to the table from the source schema to destination schema.
      GRANT SELECT ON <TABLE_NAME> TO  <DESTINATION SCHEMA>A simple way would be to use CREATE Table with select syntax (in destination schema)
      CREATE TABLE <TABLE_NAME> AS SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME><li>However, you would be in <b><u>trouble when the table has index,constraints and triggers</u></b>.
    So you can better of grab the DDL statement of the table(and any additional components) andd then create the table in the destination schema.You can use SQL developer, Toad or Apex's Object browser for this.
    After the table is created, Insert the records using SELECT.
    INSERT INTO <TABLE_NAME> SELECT * FROM <SOURCE SCHEMA>.<TABLE_NAME>This question is discussed in great detail in this <b>AskTom thread</b>

  • Best LKM to move data from with in Oracle from one schema to another Schema

    Hi Gurus,
    What is the best KM to move data from one schema to another schema within same oracle database.
    Thanks in advance

    Dear,
    If your source and target are on the same database server then you dont need LKM.
    You have to 1. create one data server for the database server
    2. Create one physical schema for your source and another physical schema for your target under the above created data server.
    3. Then create models for each above created physical schema
    In this case you just need IKM knowledge module
    Please refer http://oditrainings.blogspot.in/2012/08/odi-interface-source-target-on-same.html
    If your source and target are on different server then you must create two different data servers in topology. You have to use LKM.
    The best LKM to use is LKM oracle to Oracle dblink. But you should have proper grants to use it
    If your source has very few records you can go with LKM SQL to Oracle other wise use LKM oracle to Oracle dblink

  • Copying data contianing long datatype from one schema to another

    I'm using Oracle 8.1.7 and trying to move copy data from one schema to another.
    Usually an easy task. This time the data contains longs so I can't use standard SQL. The data in the long is too long for a PL/SQL long datatype so that's not worked.
    I've tried the COPY FROM command but get the invalid sql command error.
    Can anyone save my hair?

    The COPY command doesn't have to be all on one line. The continuation character for SQL*Plus commands is a hyphen.
    SQL> prompt "Hello"
    "Hello"
    SQL> prompt -
    "Hello""Hello"
    SQL>Metalink is the website for customers that pay for Oracle support. Go to www.oracle.com and click on the metalink button on the top left of the screen. It's called Metalink because Oracle support levels are named after metals: bronze, silver, gold.

  • Copy data from one schema to another schema tables

    Hi,
    I was doing a copy using sql developer copy feature, data copy worked perfect but for few table data didn't move there are about 30 tables from schema prod to schema dev i need to move tables are already created only data needs to be moved from prod to dev
    Can you suggest me any method were I can move all the tables data at a time from one schema to another. Please suggest.
    Thanks
    Sudhir

    Hi,
    If table structure is the same then:
    insert into dev.table_name
    select
    from
      prod.table_name  --if prod is in another database change to prod.table_name@db_link_to_prod_db
    commit
    ;Hope this helps. Otherwise give some more info about where these schema's are.
    Regards,
    Peter

  • I am trying to drag and drop one page of a .pdf into another .pdf in Acrobat Reader.  I used to be able to drag and drop from one .pdf to another.

    I am trying to drag and drop one page of a .pdf into another .pdf in Acrobat Reader.  I used to be able to drag and drop from one .pdf to another.

    If you could drag and drop pages before, it wasn't in Reader. You no doubt had Adobe Acrobat (Pro or Standard) which shouldn't be confused with Adobe Acrobat Reader. They recently added Acrobat to the name of Adobe Reader so the confusion about which product you had and/or have is understandable.

  • How can I transfer my iTunes library and playlists from one computer to another?

    How can I transfer my iTunes library and playlists from one computer to another?

    Copy the iTunes folder (Mac: Home\Music or PC: My Music) to the same location on the new computer. If an iTunes folder already exists on the new computer (it will on a Mac) replace it with one you copied.

  • Can I sync podcasts and ITunesU. from one computer to another that both have the same acount.

    Can I sync podcasts and ITunesU. from one computer to another that both have the same account.

    No.  Time Machine won't get your boot camp partition back.  There are excellent utilities that move entire hard drive contents among hard drives such as SuperDuper! and CCC, but as far as I know they don't work with boot camp partition.  My suggestion: reinstall Mac OSX on your new Mac (you don't want to hold Option key to start it everytime anyway), partition it with boot camp exactly (or similarly) as you did to your previous Mac (install the same operating system, which should be one of the Microsoft Windows I assume).  Use Migration Assistant as kaz-k suggested to move all the stuff on the Mac partition of your previous Mac.  Reboot both your Macs from the boot camp partition - I assume they are all on Windows platform.  Now you have two computers on Windows platform.  Use Norton Ghost or similar tools to migrate all the stuff from your old machine to your new machine.  Hope this helps.  Backup all your data before such operation.  Good luck.

  • Is it possible to copy formats and styles from one document to another?

    Is it possible to copy formats and styles from one document to another?
    Or use a commen styledocument as a masterdocument?

    Only by creating a template with what you want.
    Apple has removed the ability to import styles inPAges 5 along with almost 100 other features.
    Peter

Maybe you are looking for

  • Crystal reports with SAP BI Infocube

    All, I need to create a report from the BW Infocube . I have the SAP integration installed and working properly and I am able to create reports from Bex queries, but I am unable to see any Infocubes in the. Do I need to generate the Infocube as an ex

  • Dreamweaver CS4 (Student Copy) Installation

    Hi, I purchased a copy of DW CS4 on eBay! Tried a 'try-out' read before install error immediate - "not a valid 32bit application". Searched forum & found exact error as coming from a pirated copy. Tried Vista OS disc (not yet installed) as a check te

  • Sync folders between two Macs

    Howdy, I want Mail on two of my Macs to be in sync. I have a lot of rules set up and once the rules are applied the mail is sorted in local folders so it disappears from the inbox. This of course causes it to no longer be available on the other Mac.

  • Color lines in Photoshop CS4 artwork

    Hello. This is the image I want to color.

  • Repeat Data used in Load Rule

    Hi, I'm building an report script and a load rule to extract data from one cube into another. The problem is that I want to use one of the fields in the report extract twice. The cube I'm loading to has more demension than the one I'm extracting from