Search script generator for all objects and data (!) from a user/schema ?

Is there a way to create a script which (when run) creates all the existing
TABLES; INDEXES, KEYS and DATA for a specified user/schema ?
This (PL-)SQL script should contain all INSERTS for the currently existing rows of
all the TABLEs.
When I use e.g. export to Dumpfile I have at first find all TABLEs and components
which I want to dump. This is rather uncomfortable.
I just want to specify the user name similar to
createscript user=karl@XE outfile=D:\mydata\myscript.sql
Is this somehow possible ?

So that I understand your requirements exactly, are you asking for your script to ...
1/ export from database A the entire schema of a specified user
2/ drop all objects owned by that user in database B
3/ import the objects from database A into database B
If so, it sounds to me that a shell script that does a schema level export as Nicholas suggested, and then drops the user from database B using the cascade keyword (e.g. drop user username cascade), recreates the user and then imports the export file into B should do the trick.
I don't think searching for individual tables and creating the statements to recreate them is the best idea.
Hope that helps
Graham

Similar Messages

  • How can I delete all songs and data from my 80GB ipod classic without opening itunes?

    I have an older 80GB ipod classic that works but will not play any songs. I'm trying to delete all songs and data from the hard drive to see if that will fix the problem, however, it will not appear in my itunes. I've tried various ways to help it appear in my itunes but I do not want to delete my itunes because I have another ipod that has all those songs on it.
    I was wondering if there was a way to restore my ipod back to the beginning without having to go through itunes. Thanks!

    It might, but I wouldn't bet much on it.  Either way, give it a shot.
    Otherwise, if appears in Windows an external hard disk, try a low level reformat of the device's hard drive.  See here for instructions on how to do this.
    http://www.methodshop.com/gadgets/ipodsupport/erase/
    B-rock

  • Request in steps in deleting all the tables data in an user schema.

    Hi Gurus,
    Could some one please provide me the steps involved in deleting all the tables data in an user(schema)
    thanks in advance

    write a script as below
    sys@11GDEMO> select 'truncate table '||owner||'.'||table_name||';' from dba_tables where owner='SCOTT';
    'TRUNCATETABLE'||OWNER||'.'||TABLE_NAME||';'
    truncate table SCOTT.DEPT;
    truncate table SCOTT.EMP;
    truncate table SCOTT.BONUS;
    truncate table SCOTT.SALGRADE;
    truncate table SCOTT.EMPBACKUP;
    truncate table SCOTT.T_NAME;
    truncate table SCOTT.D_TEMP_STSC;
    Example:
    sys@11GDEMO> truncate table SCOTT.T_NAME;
    Table truncated.
    sys@11GDEMO>

  • Copying database objects and data from one server database to another server database in AG group

    Hi,
    I am still trying to wrap my head around sql clusters and AGs and I have a project that requires I take a vendor's database and restore it weekly so its available on the production server which is clustered.
    The vendor's database on the cluster is in an AG group and encrypted.
    Right now, I plan to restore the database on a sql staging server and use the SSIS Transfer SQL Server Objects Task to copy the table structure and data from Stage to the Production database of same name and I would first drop the objects in production
    database using the same task.
    I am concerned that this might cause issues with the passive cluster due to "logging" from active to passive. The database is about 260 MBs and I am not sure how many tables.
    Has anyone run into this type of scenario before or have a better solution?
    Thanks
    Sue

    IF I understand anything about clustered sql and logging, the sql server should take the log file and recreate the same scenario on the passive side of the cluster.
    Is that correct?
    Hi Sue,
    Yes, for AlwaysOn Availability Group, the transaction log is basically replayed from the primary to all of the secondary's.
    Besides, from my point of view, as we cannot directly restore a database that is part of an Availability Group, it is a good way using SSIS task to drop and recreate all tables then transfer data from the restored database to the primary replica. Schema changes
    and data changes will also happen on the secondary  replica.
    There are some similar links for your reference.
    http://dba.stackexchange.com/questions/21404/do-schema-changes-break-sql-server-2012-alwayson-or-are-they-handled-transpare
    http://blogs.msdn.com/b/sqlgardner/archive/2012/08/28/sql-2012-alwayson-and-backups-part-3-restore.aspx
    Thanks,
    Lydia Zhang
    If you have any feedback on our support, please click
    here.
    Lydia Zhang
    TechNet Community Support

  • Copy all tables and data from remote schema to local schema

    Hi,
    I am using Oracle 10g Enterprise edition as a database and Windows 7 as the operating system.
    My Requirement is to copy all the tables and data from remote machine database to my local machine.
    I created a DB link between my location schema and remote machine schema. Database link created successful. Error what i am getting when i am trying to import all the tables from the remote data is as mentioned below
    I created a directory gave all the privilege to do read and write on the directory.
    Directory name : DUMP
    Local Schema name / PASSWORD : PRODUCTION / PRODUCTION
    Remote Schema name / Password : portal / m3892!2
    When i run this scrip from command prompt
    impdp PRODUCTION/PRODUCTION DIRECTORY=DUMP LOGFILE=LOCALPROD_MERUPROD.log network_link=MERU_DEV_LOCAL_PROD schemas=portal remap_schema=portal:PRODUCTION TABLE_EXISTS_ACTION=REPLACE
    It is giving me following error please suggest me what is the mistake i couldn't trace
    ORA-31631: privileges are required
    ORA-39149: cannot link privileged user to non-privileged user
    Thanks
    Sudhir

    Thanks I gave the grant permission for the "portal" remote user. I didn't not get the error. Issue am facing now is I need to copy the entire schema of production to my local system production.
    I am currently using the below script to copy. it not working. what might be the reason there is no error message coming but still i don't see any tables in my local system after executing this script
    impdp PRODUCTION/PRODUCTION DIRECTORY=DUMP LOGFILE=LOCALPROD_MERUPROD.log network_link=MERU_DEV_LOCAL_PROD schemas=portal remap_schema=portal:PRODUCTION TABLE_EXISTS_ACTION=REPLACE
    Or suggest me some other script to copy all the tables and procedure function from remote database to my local database using impdp script
    Thanks
    Sudhir

  • HT5463 How can I, with my new iphone 5, set everything to vibrate only? ...I mean quickly go to vibrate only(for all notifications and calls) from my normal audio settings?

    How can I go from normally selected rings and fnotifications to 'vibrate only' for all calls and notifications?

    Have you tried using the Ring/Silent switch on the upper left side?  If it's set to 'orange', I think it only vibrates for almost everything, with a few exceptions.

  • How to copy all tables, triggers, etc from one user schema to another

    Hello everybody!
    I am searching for a QUERY or Stored Procedure to copy the tables of one user schema to another schema.
    Should look kind of: Copy (Select * from all_objects where owner = 'UserIwantToCopyFrom') to user = 'UserIwantToCopyTO'
    I am sure that my example is rubbish but I tried to explain what I want to do.
    So is there a chance to do that within sql-code? I have to build a template of a user schema with hundreds of tables, triggers, etc and copy it to several other user schemas.
    Thanks for your advice!
    Jan

    There are numerous examples available.
    What you typically will want to do is:
    For the export use the job_mode => 'SCHEMA' option
    Export example
    http://www.oracle-base.com/articles/10g/OracleDataPump10g.php
    DECLARE
      l_dp_handle       NUMBER;
      l_last_job_state  VARCHAR2(30) := 'UNDEFINED';
      l_job_state       VARCHAR2(30) := 'UNDEFINED';
      l_sts             KU$_STATUS;
    BEGIN
      l_dp_handle := DBMS_DATAPUMP.open(
        operation   => 'EXPORT',
        job_mode    => 'SCHEMA',
        remote_link => NULL,
        job_name    => 'EMP_EXPORT',
        version     => 'LATEST');
      DBMS_DATAPUMP.add_file(
        handle    => l_dp_handle,
        filename  => 'SCOTT.dmp',
        directory => 'TEST_DIR');
      DBMS_DATAPUMP.add_file(
        handle    => l_dp_handle,
        filename  => 'SCOTT.log',
        directory => 'TEST_DIR',
        filetype  => DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);
      DBMS_DATAPUMP.metadata_filter(
        handle => l_dp_handle,
        name   => 'SCHEMA_EXPR',
        value  => '= ''SCOTT''');
      DBMS_DATAPUMP.start_job(l_dp_handle);
      DBMS_DATAPUMP.detach(l_dp_handle);
    END;
    /for the import you will have to use the remap_schema option with:
    DBMS_DATAPUMP.METADATA_REMAP (
       handle      IN NUMBER,
       name        IN VARCHAR2,
       old_value   IN VARCHAR2,
       value       IN VARCHAR2,
       object_type IN VARCHAR2 DEFAULT NULL);There are much more details in the document that Thierry provided.

  • Customizing Settings for the Object and Data Provider

    Dear All,
    I am trying to create a view for my manager to view ONLY their direct report employees (relationship A002).
    Anyone knows what is the organization view that i need to use or which evaluation path that i an use?
    Thanks.
    Regards,
    Bryan

    Hi Bryan,
    Please use this function module to given the list of direct reporting employee for the org level HRWPC_GET_DIREPS_OF_LEVEL_1 the format is O-S-P.
    This will list the employees who are direct reporting to the manager.
    Thanks & Regards,
    Ganesh R K

  • I was using my iphone 3gs with one computer, now i want to sync it with other computer butbut the msg says that all data will be overwritten, how do u retain my all apps and data from my previous i tune library?

    plz

    All iTunes content on your iPhone - all music, movies, tv shows, ringtones, audio and print books, and 3rd party apps should be in your iTunes library - on the computer that you have been using to sync your iPhone.
    Transfer your iTunes library from the computer you have been using to the new or different computer per the instructions included with this link.
    http://support.apple.com/kb/HT1751

  • How can i transfer all photos and data from at&t ipad to verizon mini?

    I am switching from my AT&T ipad to a verizon mini ipad - but not everything transferred.  How do i transfer photos from my camera on the old ipad? 

    How to Transfer Everything from an Old iPad to New iPad
    http://osxdaily.com/2012/03/16/transfer-old-ipad-to-new-ipad/
     Cheers, Tom

  • Remove authorization for Tcode: ME21 and ME22 from certain users

    Hi Guys,
    I'm new to BASIS.
    My requirement is to: Remove authorization to Tcodes ME21/ME22 from a list of users.
    How do I acheive this? We run on SAP 4.0B version.
    Hoping to get this resolved as soon as possible.
    Thanks
    SAPUser

    dear friend,
    1.
    run SU01
    goto Information-Information system
    select node Roles-By Transaction Assignment
    type ME21, ME22
    execute report
    see the roles displayed
    2.
    then find user who have these roles (usually company uses z-roles copied from standard)
    just highlight the role and hit user assignment (Cntrl-Shift-F9)
    you see all users who have this role. that means they are able to run these transactions.
    3.
    let's remove the role(s) we found.
    open second session, run SU01 type one of the user , goto Roles tab and delete the particular role you found.
    save user and test it (ask hem/her to log in sap and run ME21 and ME22). if needed adjust it again (may be another role to be deleted)
    say, fix completely one user/test it and then do the same things for other. test them.
    good luck!

  • Automatically generate thumbnail image icons for all pix and vids...

    hello,
    i've searched around on the forums a bit about making the icons of my pics and vids actual thumbnail images made from the picture or the first frame of the video.
    a lot of responses are mistaking this question for "how do i put the window into icon view?" this infact is not the answer that i suspect a lot of windows converts are looking for.
    windows automatically makes such icons for all pix and vids if you put the window into icon view.
    i notice in at cmd-j or in the window preferences there is a checkbox for "show image preview" or something like that, but despite this being checked, my pix and vids do not show an image preview. i'm gathering that this information does not exist in the resource fork which mac uses to organize photos.
    is there any script or addition i can make to my system to automatically generate icons for pics and vids of all types? how to i suggest to mac that they add this functionality into the next release?
    thanks for your time,
    max

    The Finder will create icons "on the fly" for nearly all graphic type files (jpegs, tiff, psd, and so on) and display them in both icon view and column view, provided the appropriate view preference has been set. Movies will just have the generic movie icon in icon view, and have a "live" preview in column view, ie you can play them in preview mode. If you want to add a permanent thumbnail which will display in all views, and whether or not the preference has been set for a particular folder in Finder, you'll need to add a thumbnail to the file. There are lots of ways to do this for static pictures, even rather clumsy ways to do it for movies, but the easiest thing is to get CocoThumbX:
    http://www.stalkingwolf.net/software/cocothumbx/
    Drag and drop both static pictures and movie files onto the application and a permanent thumbnail is created. Indeed, it will create cool thumbs even for things like PDF and HTML files (code or rendered display). For movies to get a thumb, they must be in a format that QuickTime can read. It has a set of preferences for just how you want the thumb determined (eg random or at a certain time), and you can drop batches of movies or even folders to have it assign thumbs to multiple movies at the same time. It is a way cool piece of shareware.
    Francine
    Francine
    Schwieder

  • Command to  provide list of all objects and their scripts from database

    Hi,
    How do i get the list of all objects and their scripts/source from database?
    I guess using dbms_metadata package or Toad tool we can achieve the above task
    But i do not know the steps to get the objects and their scripts.
    Im using oracle database 11g R2 11.2.0.2
    Kindly ge me the advice
    Thanks in Advance

    How do i get the list of all objects and their scripts/source from database?
    I guess using dbms_metadata package or Toad tool we can achieve the above task
    But i do not know the steps to get the objects and their scripts.
    Im using oracle database 11g R2 11.2.0.2If you want the all the metadata of whole database, then it is quiet difficult to get from DBMS_METADATA, as it is very complex because you need to gather for each object of each schema in whole database and to spool.
    http://www.orafaq.com/node/57
    I want to know, what is the use of entire database metadata, Certainly need of objects of metadata.
    or if you want to whole database, then i suggest you go for export full backup and import as impdp sqlfile option,

  • Itunes store account for an iphone my friend created an account also in the same computer for an ipod and now it the ipod keeps getting all my personal data from my iphone how can i that  both devices sync in the pc

    hi , can any one help me with a problem ,,, i own an iphone 4 and creates my account in itunes months later my friend bought an ipod and created an account also but created in my pc and  now both get sync in the same pc and all my personal data from the iphone 4 keeps getting copy and the ipod gets it and have acces to my personal data and apps gets my mail etc , can any one help me with this issue?
    thnk you

    Sorry to hear of your problem, but any hardware in a computer can fail - that includes the hard drive, the logic board, etc, etc. Fortunately, it usually doesn't happen that soon; however, I've read of hard drives failing within 6 months.
    So, since you did not purchase the extended Applecare Protection Plan (3 years coverage), you will need to make a decision to repair or sell it as is. I would always purchase 3 year coverage for an all in one or a laptop because repairs are expensive and at least I'd be covered for 3 years.
    We can't speculate on whether there should be a recall or not; these forums are for user to user assistance with technical problems. In your case, there is nothing we can help with since you've already gotten a diagnosis.

  • I like the idea of auto back-up for my new iMac, Ipad and PC Netbook, particularly if I can access all files and data stored on any device.  But I have a Conceptronic router.  Will Time Capsule work with this and how?

    I like the idea of auto back-up for my new iMac, Ipad and PC Netbook, particularly if I can access all files and data stored on any device.  But I have a Conceptronic router.
    1. Will Time Capsule work with this and how?
    2. Can my printer USB be plugged in and then shared between the devices?
    3. Can I create a network and how?
    4.  What happend when a visitor logs onto my existing wireless router?
    I'm new to Macs (well a returning user having started with Mac Plus!!) and not very technical.  Any help / advice will be much appreciated.
    Ray

    The key to what you seem to want to do is to be able to get Apple's Time Capsule router to "join" the network that your Conceptronic router.  I believe that works with some third-party routers, but I've never seen a list of those that work in such a configuration and I have no experience with Conceptronic equipment.
    You might be better off with a Network-Attached Storage (NAS) device instead of a Time Capsule.

Maybe you are looking for

  • Background Job hangs!

    Hello Friends, I am encountering a problem with background jobs which has driven me crazy. The background job hangs and when I try to debug it using the JDBG command the results are surprising. When the program control reaches a particular PERFROM st

  • What are the book names for MDM from SAP Education academy

    Hi SAP gurus, Can any one tell the name of the books for MDM from SAP Education academy. For example in SAP MM (material management) - it is TAMM40(part1,part2,part3,paret4...etc) So what are the names of the books for MDM from SAP Education academy.

  • Belle & Orange UK N8

    Was Orange UK forgotten about in all this? When I called Orange about the update they didn't have a clue and I don't see them anywhere in the list. Anyone work for or have contacts in Nokia or Orange UK that can confirm they are working on getting th

  • Visualize binary bytecode

    Is there a tool that would allow me to see the binary of the Java byte code for comparison against the disassembled code (i.e. see the actual '0's and '1' that correspond to a given byte code)? Thanks in advance,

  • "Run As Administrator" issue Ill CC 14

    I'm using Illustrator CC 14 on Windows 7. About 2ish weeks ago I got an error that I need to run Illustrator as Administrator. I've attached the exact error. Illustrator still functions properly, but the error before is annoying.