Best way to clone a table?

Hi,
What is the best way to clone an existing table definition?
What I mean is, I want to do the following:
create table tab2 as
select * from tab1;
delete from tab2;
commit;
But clearly this involves copying all the data and then delete it. Is there a more efficient way?
Another alternative I could think of is:
create table tab2 as
select * from tab1 where rownum < 2;
delete from tab2;
commit;
This would copy only one row instead of all the rows in tab1. This is clearly much more efficient than the first approach, but I still don't like the idea of copying the data and deleting it.
I am sure there would be a "cleaner" way. Any ideas?
Thanks in advance,
Rajesh

Hi Justin,
My work involves generating statistics by running various queries. So, I have written a few procedures that generate the statistics and insert into certain tables. Usually before starting to generate a new round of stats, I take back up of the previously generated data like this.
Approach I:
alter table summary_tab rename to summary_tab_20th;
create table summary_tab as
select * from summary_tab_20th
where rownum < 2;
delete from summary_tab;
commit;
Of course, another alternative I have is the following:
Approach II:
create table summary_tab_20th as
select * from summary_tab;
delete from summary_tab;
commit;
But I thought this is inefficient when compared to Approach I because it copies ALL the data from summary_tab to summary_tab_20th and then deletes ALL the data from summary_tab.
However, one disadvantage with Approach I is that everytime I do this the stored procedure gets invalidated and I have to recompile it.
So, that is where I stand. If all this looks very dirty, please suggest how I can 'clean up' my process :-)
Thanks,
Rajesh

Similar Messages

  • What is the best way to clone a form field in BC

    Hi,
    What is the best way to clone a form field in BC.  I tried using jquery .clone.  It works fine on other forms for me but not on the BC forms, why? is it just me?  Any help would be great. Thanks

    I mean, duplicate a field with the click of a button.
    I think this should work, but it's not and  I am linked to the jquery library in the head of my page.
    <script type="text/javascript">
    $(document).ready(
      function() {
        $('input#tmpAddRow').click(
          function($e) {
            $e.preventDefault();
            $('tr#tmp').clone(true).removeAttr('id').appendTo('tbody');
        $('tr input[type=text]').focus(
          function() {
            $(this).addClass('myFocused');  
        ).blur(
          function() {
            $(this).removeClass('myFocused');
        </script>
    <img alt="" style="border: 0px solid; width: 200px; height: 134px; float: left;" src="/images/pv logo 3d.png" />
    <h3 style="text-align: center; color: #0000ff; text-shadow: #999999 0px 1px 5px;">Member Directory Listing</h3>
    <p style="text-align: center;">If you would like to be listed in the Pine Valley Middle School Directory, please fill out this form.  Only fill out the areas you would like to show up in our Directory.</p>
    <div style="margin-left: 130px;" class="form_bg">
    <form action="/CustomContentProcess.aspx?CCID=5656&amp;OID={module_oid}&amp;OTYPE={module_otype }" method="post" enctype="multipart/form-data" onsubmit="return checkWholeForm45842(this)" name="catcustomcontentform45842">
        <table cellspacing="0" cellpadding="2" border="0" class="webform">
            <tbody>
                <tr>
                    <td id="tmp"><label for="ItemName">First Name</label><br />
                    <input type="text" value="{module_firstname}" maxlength="255" id="ItemName" name="ItemName" class="cat_textbox_small" /><br />
                    <input type="button" id="tmpAddRow" value="Add a Row" />
                    </td>
                </tr>
                <tr>
                    <td><label for="CAT_Custom_131512">Last Name</label><br />
                    <input type="text" value="{module_lastname}" class="cat_textbox" id="CAT_Custom_131512" name="CAT_Custom_131512" maxlength="1024" /></td>
                </tr>
                <tr>
                    <td><label for="CAT_Custom_131509">Number</label><br />
                    <input type="text" value="{module_homephone}" class="cat_textbox" id="CAT_Custom_131509" name="CAT_Custom_131509" maxlength="1024" />
                    </td>
                </tr>
                <tr>
                    <td><label for="CAT_Custom_131510">Email</label><br />
                    <input type="text" value="{module_emailaddress}" class="cat_textbox" id="CAT_Custom_131510" name="CAT_Custom_131510" maxlength="1024" /></td>
                </tr>
                <tr>
                    <td><label for="ItemAddress">Address</label><br />
                    <input type="text" value="{module_homeaddress}" maxlength="500" class="cat_textbox" id="ItemAddress" name="ItemAddress" />
                    </td>
                </tr>
                <tr>
                    <td><label for="ItemCity">City</label><br />
                    <input type="text" value="{module_homecity}" maxlength="255" class="cat_textbox" id="ItemCity" name="ItemCity" /></td>
                </tr>
                <tr>
                    <td><label for="ItemState">State</label><br />
                    <input type="text" value="{module_homestate}" maxlength="255" class="cat_textbox" id="ItemState" name="ItemState" />
                    </td>
                </tr>
                <tr>
                    <td><label for="ItemZip">Zipcode/Postcode</label><br />
                    <input type="text" value="{module_homezip}" maxlength="255" class="cat_textbox" id="ItemZip" name="ItemZip" /></td>
                </tr>
                <tr>
                    <td class="hidden"><label for="FirstName">First Name</label><br />
                    <input type="text" value="{module_firstname}" class="cat_textbox" id="FirstName" name="CAT_Custom_131511" maxlength="1024" /></td>
                </tr>
                <tr>
                    <td><input type="submit" id="catcustomcontentbutton" value="Submit" class="cat_button" /></td>
                </tr>
            </tbody>
        </table>
        <script type="text/javascript" src="/CatalystScripts/ValidationFunctions.js"></script>
        <script type="text/javascript" src="/CatalystScripts/Java_DatePicker.js"></script>
        <script type="text/javascript">
    //<![CDATA[
    var submitcount45842 = 0;function checkWholeForm45842(theForm){var why = "";if (theForm.ItemName) why += isEmpty(theForm.ItemName.value, "Item Name");if (theForm.Days) why += isNumericIfVisible(theForm.Days, "days"); if (why != ""){alert(why);return false;}if(submitcount45842 == 0){submitcount45842++;theForm.submit();return false;}else{alert("Form submission is in progress.");return false;}}
    //]]>
    </script>
        <script type="text/javascript">
        jQuery("#ItemName").blur(function(){
            jQuery("#FirstName").val(jQuery("#ItemName").val());
    </script>
    </form>
    </div>

  • What's the best way to clone my boot drive?

    I just bought a new 500GB drive for my G4. What's the best way to clone my boot drive?
    Is there a way to put the new drive on the buss as a second drive and then copy everything from my boot drive to the new drive? How do I make the new drive bootable?
    Or
    Do I have to install OSX on the new drive, put the old boot drive on the buss as a second drive and migrate everything to the new drive with the Utilities Migration Assitant program?
    Are there programs available to make this easier? Where & how much?
    Thanks for any help I can get.

    bamim2:
    Dr. Smoke's FAQ Backup and Recovery has excellent advice on developing a backup strategy.
    You already have a larger extrnal HDD (Hopefully it is firewire?) The next step is to format and partition the HDD. (see step-by-step below). And thirdly you will need a good cloning utility. Carbon Copy Cloner has already been suggested, and the latest version is excellent. I, personally, prefer SuperDuper for its ease of use and efficiency. Both are great tools and relatively simple to use.
    I mentioned the hope that you have a firewire. One of the wonderful benefits of using an external firewire HDD for backing up is that you can make a bootable clone. This gives you an emergency boot drive in case of a problem. It also gives you an external device for running diagnostics and repairs from the extnernal to the computer and vice-versa.
    Congratulations on taking the first step toward securing your computer and your data!
    Formatting, Partitioning Zeroing a Hard Disk Drive
    Warning! This procedure will destroy all data on your Hard Disk Drive. Be sure you have an up-to-date, tested backup of at least your Users folder and any third party applications you do not want to re-install before attempting this procedure.
    Boot from the install CD holding down the "C" key.
    Select language
    Go to the Utilities menu (Tiger) Installer menu (Panther & earlier) and launch Disk Utility.
    Option for formatting an External HDD
    Connect external HDD to computer
    Turn on external HDD
    Start up computer and log in
    Go to Applications > Utilities > Disk Utility and launch DU.
    Select your HDD (manufacturer ID) in left side bar.
    Select Partition tab in main panel. (You are about to create a single partition volume.)
    Select number of partition in pull-down menu above Volume diagram.
    (Note 1: One partition is normally preferable for an internal HDD. External HDDs usually have more than one. See Dr. Smoke’s FAQ Backup and Recovery for tips on partitioning external HDD
    Note 2: For more partitions than one, after you have selected the number of partitions you can adjust the size of the partition by selecting the top partition and typing in the size; then move down if more adjustments need to be made..)
    Type in name in Name field (usually Macintosh HD)
    Select Volume Format as Mac OS Extended (Journaled)
    Click Partition button at bottom of panel.
    Select Erase tab
    Select the sub-volume (indented) under Manufacturer ID (usually Macintosh HD).
    Check to be sure your Volume Name and Volume Format are correct.
    Optional: Select on Security Options button (Tiger) Options button (Panther & earlier).
    Select Zero all data. (This process will map out bad blocks on your HDD. However, it could take several hours. If you want a quicker method, don't go to Security Options and just click the Erase button.)
    Click OK.
    Click Erase button
    Quit Disk Utility.
    Good luck.
    cornelius

  • Best way to Clone 11i on Linux w/o any Oracle SW on target.

    Hi,
    I have an instance of BS 11.5.10.2 on Linux 4.6 (Single Node) stage. I have another Linux box stage which also has HEAL 4.6 which don't have any kind of oracle software. But both system has same oracle/capping users, file systems, host configuration and OS RPM.
    I want to setup stage box as an test instance for stage. In order to clone the 11.5.10.2 from stage to stage, do I need to install any Oracle software to perform cloning. What would be the best way to clone 11.5.10.2 ; in this scenario?
    Thanks
    Samar

    You do not need to install any Oracle software before cloning, but you need to install all pre-req. software and packages at the OS level before doing so. Rapid Clone will NOT take care of that, the OS at the source and the target nodes should be identical in terms of packages and pre-req. software. Moreover, make sure you have all software components installed as in Note: 230672.1 (Under "Section 1: Prerequisites").
    For the list of pre-req. OS packages/patches and kernel settings, please refer to:
    Note: 294932.1 - Recommendations to Install Oracle Applications 11i
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=294932.1
    Note: 169706.1 - Oracle® Database on AIX®,HP-UX®,Linux®,Mac OS® X,Solaris®,Tru64 Unix® Operating Systems Installation and Configuration Requirements Quick Reference (8.0.5 to 11.1)
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=169706.1

  • Best way to update RBSELBEST table for invoice

    what is the best way to update RBSELBEST table for PO invoice? Is there any BAPI or FM for this?

    Thanks. I tried this one also, but it does not update the table.
    in case if someone used this, what parameters i need to pass for this to work?

  • Best way to clone an existing drive, then clone back to a dual SSD Raid 0 setup?

    Have a Mac Pro 5,1 (mid 2012) and want to install 2 SSD drives in a Raid 0.
    Will attempt to use the Apple Disk Utility to set up the raid. any suggestions on this first part will be welcome!
    But what is the best way to clone the existing SATA drive onto the Raid setup?
    The 2 SSD are Samsung 84 Pro 256 GB units, installed on a Temp SSD Pro 6 Gb SATA PCIe card.
    The OS is Mavericks 9.1.
    Thanks !

    Always no matter what, have a clone or three - clean, working image, last version before OS X 1.2.3 that you are about to install.
    It is about INSTALLING OS X, not updating once you have it - though updates and security updates are known to be monkey wrenches too at times.
    Never remove safety net, no matter how safe it seems.
    Use a clone to run DU and repair the drive, the drive partition, it handles both (partition integrity was new to Lion), AND to invoke TRIM command when repairing (which won't happen in recovery partition mode of DU).
    CCC does a smart update. You don't worry about applying updates to those, and in fact wait a few days before applying updates sometimes, or just make sure the clone is up to date so you can boot from and do a restore if needed. A system restore image is only as good as knowing it will work in an emergency should one arise.
    Like to see people break ground on new projects and how to get more out of their systems.  The 5,1 does not have the  limitations or issues that even the 4,1 exhibited let alone even more for the Early '08 3,1s.
    One good SSD alone should / would / make more improvement in performance for low investment than any I have seen.   If you have the Tempo Pro card and 2 x 250GB 840's that is about $600 investment   - throw in another system SSD and use the Tempo for scratch and/or Aperture and insure you have "more than enough" RAM and your workflow should be smooth.  Even wtih that, which I call "best practices" the nMP 6.1 makes Aperture etc even smoother as everything is optimized better and the 1200MB/sec SSD and 4-channel 1866 DDR3  makes  graphics smoother and respond instantly to your touch (sports car handling vs your sedan?)
    After doing a lot of installs, upgrades, Migration Assistant; and then on a 2-4 week basis boot from another volume to run DU Repair.
    OS X alone without the cache used and other things on the boot drive really only takes 40-160GB and makes it easy to create a DU sparse disk image for CCC to update and restore from and that can be kept anywhere. And have a small 200GB emergency maintenance boot volume that you can add to and create on any volume you have handy, shrink and add to that 2TB media drive or  TimeMachine drive volume.
    I would just set aside half an hour weekly or as needed to clone your system. Than clone again before you apply anything, system update or update to applications or new applications.
    With all your personal data and media and projects not on the system you don't need a RAID0 array to hold as much data, no need for the added complexity or using two SSD devices, easier to maintain and restore. There is even a small added overhead to  any  RAID. With an 840 EVO 500GB just above $300 it makes a lot of sense to use those, and almost too big for a system  drive. Fine if the system drive is not just OS and applications but media and stuff don't need to be there. Again, Aperture/Lightroom and other uses, yes and with t he new Mac Pro  people are putting and using it for multiple purposes and uses that they would not have wtih the 2012 5,1 and earlier. But it is so fast it makes sense - and Thunderbolt 2 external storage has added more costs to storage.
    Kind of got long winded, hope it proves helpful. And not confusing but may raise more questions and ideas.

  • Best way to clone my drive to an EHD

    I want ot clone my ibooks drive to an EHD.  The ibooks 40gb is just to small so I want to use the firewire EHD as the main drive to keep all my files etc.  Whats the best way to clone my drive?  Should I use disc utility or other software?

    Carbon Copy Cloner:
    http://www.bombich.com/download.html

  • Best Way to Clone Drive?

    What would be the best way to clone a drive. Arch has worked so well I might drastically shrink my Windows 7 partition, but would like to restore an exact copy of this install. Please note it's installed in an encrypted lvm group, which might complicate things.

    Clonezilla, definitely. It runs as a live cd/usb, so you can easily clone existing installs. It has a bunch of easy to use dialogs to clone drives and partitions to devices and images, local and over a network etc. (yeah i used it recently and it saved me ). I have no experience with LVM, but according to the website it seems to support LVM2.

  • Opinion needed on best way to map multiple table joins (of the same table)

    Hi all
    I have a query of the format:
    select A.col1, B.col1,C.col1
    FROM
    MASTER_TABLE A, ATTRIBUTE_TABLE B, ATTRIBUTE_TABLE C
    WHERE
    A.key1 = B.key1 (+)
    AND
    A.key1 = C.key1(+)
    AND
    B.key2(+) = 100001
    AND
    C.key2(+) = 100002
    As you can see, I am joining the master table to the attribute table MANY times over, (over 30 attributes in my actual query) and I am struggling to find the best way to map this efficiently as the comparison for script vs. mapping is 1:10 in execution time.
    I would appreciate the opinion of experienced OWB users as to how they would tackle this in a mapping and to see if they use the same approach as I have done.
    Many thanks
    Adi

    SELECT external_reference, b.attribute_value AS req_date,
    c.attribute_value AS network, d.attribute_value AS spid,
    e.attribute_value AS username, f.attribute_value AS ctype,
    g.attribute_value AS airtimecredit, h.attribute_value AS simnum,
    i.attribute_value AS lrcredit, j.attribute_value AS airlimitbar,
    k.attribute_value AS simtype, l.attribute_value AS vt,
    m.attribute_value AS gt, n.attribute_value AS dt,
    o.attribute_value AS datanum, p.attribute_value AS srtype,
    q.attribute_value AS faxnum,
    R.ATTRIBUTE_VALUE AS FAXSRTYPE,
    s.attribute_value AS extno,
    t.attribute_value AS tb, u.attribute_value AS gb
    v.attribute_value AS mb, w.attribute_value AS stolenbar,
    x.attribute_value AS hcredit, y.attribute_value AS adminbar,
    z.attribute_value AS portdate
    FROM csi_item_instances a,
    csi_iea_values b,
    csi_iea_values c,
    csi_iea_values d,
    csi_iea_values e,
    csi_iea_values f,
    csi_iea_values g,
    csi_iea_values h,
    csi_iea_values i,
    csi_iea_values j,
    csi_iea_values k,
    csi_iea_values l,
    csi_iea_values m,
    csi_iea_values n,
    csi_iea_values o,
    csi_iea_values p,
    csi_iea_values q,
    CSI_IEA_VALUES R,
    csi_iea_values s,
    csi_iea_values t,
    csi_iea_values u,
    csi_iea_values v,
    csi_iea_values w,
    csi_iea_values x,
    csi_iea_values y,
    csi_iea_values z
    WHERE a.instance_id = b.instance_id(+)
    AND a.instance_id = c.instance_id(+)
    AND a.instance_id = d.instance_id(+)
    AND a.instance_id = e.instance_id(+)
    AND a.instance_id = f.instance_id(+)
    AND A.INSTANCE_ID = G.INSTANCE_ID(+)
    AND a.instance_id = h.instance_id(+)
    AND a.instance_id = i.instance_id(+)
    AND a.instance_id = j.instance_id(+)
    AND a.instance_id = k.instance_id(+)
    AND a.instance_id = l.instance_id(+)
    AND a.instance_id = m.instance_id(+)
    AND a.instance_id = n.instance_id(+)
    AND a.instance_id = o.instance_id(+)
    AND a.instance_id = p.instance_id(+)
    AND a.instance_id = q.instance_id(+)
    AND A.INSTANCE_ID = R.INSTANCE_ID(+)
    AND a.instance_id = s.instance_id(+)
    AND a.instance_id = t.instance_id(+)
    AND a.instance_id = u.instance_id(+)
    AND a.instance_id = v.instance_id(+)
    AND a.instance_id = w.instance_id(+)
    AND a.instance_id = x.instance_id(+)
    AND a.instance_id = y.instance_id(+)
    AND a.instance_id = z.instance_id(+)
    AND b.attribute_id(+) = 10000
    AND c.attribute_id(+) = 10214
    AND d.attribute_id(+) = 10132
    AND e.attribute_id(+) = 10148
    AND f.attribute_id(+) = 10019
    AND g.attribute_id(+) = 10010
    AND h.attribute_id(+) = 10129
    AND i.attribute_id(+) = 10198
    AND j.attribute_id(+) = 10009
    AND k.attribute_id(+) = 10267
    AND l.attribute_id(+) = 10171
    AND m.attribute_id(+) = 10184
    AND n.attribute_id(+) = 10060
    AND o.attribute_id(+) = 10027
    AND p.attribute_id(+) = 10049
    AND q.attribute_id(+) = 10066
    AND R.ATTRIBUTE_ID(+) = 10068
    AND s.attribute_id(+) = 10065
    AND t.attribute_id(+) = 10141
    AND u.attribute_id(+) = 10072
    AND v.attribute_id(+) = 10207
    AND w.attribute_id(+) = 10135
    AND x.attribute_id(+) = 10107
    AND y.attribute_id(+) = 10008
    AND z.attribute_id(+) = 10103
    AND external_reference ='07920490103'
    If I run this it takes less than a second in TOAD, when mapped in OWB it takes ages. 10:1 is a conservative estimate. In reality it takes 15-20 minutes. CSI_IEA_VALUES has 30 million rows CSI_ITEM_INSTANCES has 500,000 rows.
    Hope that helps. I would love to know how others would tackle this query.

  • Business rules to  implement - BEST way -  triggers and mutating table

    I have the following table where it has Foreign Key defined on itself(self reference for parent_id column which can be null or valid site_id)
    create table test_virtual_site
    site_id number CONSTRAINT site_id_pk primary key,
    parent_id number CONSTRAINT parent_site_id_unq UNIQUE ,
    closed_date date default NULL ,
    CONSTRAINT check_self_ref CHECK(parent_site_id <> site_id), --avoid self refernce
    CONSTRAINT check_valid_site foreign key(parent_site_id) references test_virtual_site(site_id)
    I have the following business rules to implement and my problem is related to their implementation
    1)     A check should be made that Site_id specified as parent_id should not be a child of any other store (parent should have its parent_id column as NULL)
    Site_id Parent_id
    1
    2 1
    3 2 =>NOT VALID 2 is a child of another store
    2)     Parent is not closed
    Site_id Parent_id Closed_date
    1 10-May-2005
    3     1 =>NOT VALID 1 is a closed
    3)
    when parent store is closed - updated so at closed_date is not null
    Want to set the parent_id as NULL for the child store.
    OR
    SET the closed_date for child store too same as the parent_store.
    Example
    Site_id Parent_id Closed_date
    1     
    1 2
    Update test_virtual_site
    SET closed_date = sysdate
    Where site_id = 1 ;
    Through Trigger
    Site_id Parent_id Closed_date
    1     22-Mar-06
    1 2 22-Mar-06
    OR
    Site_id Parent_id Closed_date
    1     22-Mar-06
    1
    When I am trying to do the above mentioned through constraints I am running into mutating trigger problem. Can you please guide me what is the best way to handle the above-mentioned scenarios.
    I am aware that I can avoid the 3rd problem using the following
    -- - Initialize an array in the before statement trigger.
    -- - Add the processed rowid to the array in the after row
    -- trigger.
    -- - In the after statement trigger: get each rowid from the
    -- array and process it. When all rowids are processed, clear
    -- the array.
    BUT for 1 and 2 I need to look at the parent specified , the parent exists in the same table BUT I can not perform the lookup from the BEFORE INSERT ROW LEVEL trigger but I want to ensure at the row level , so if the parent store is closed or parent specifed itself is a child(not permissible) I want to rollback the insert – RAISE_APPLICATION_ERROR.
    Can you please guide me what is the best way to handle the above mentioned conditions .

    I have the following table where it has Foreign Key defined on itself(self reference for parent_id column which can be null or valid site_id)
    create table test_virtual_site
    site_id number CONSTRAINT site_id_pk primary key,
    parent_id number CONSTRAINT parent_site_id_unq UNIQUE ,
    closed_date date default NULL ,
    CONSTRAINT check_self_ref CHECK(parent_site_id <> site_id), --avoid self refernce
    CONSTRAINT check_valid_site foreign key(parent_site_id) references test_virtual_site(site_id)
    I have the following business rules to implement and my problem is related to their implementation
    1)     A check should be made that Site_id specified as parent_id should not be a child of any other store (parent should have its parent_id column as NULL)
    Site_id Parent_id
    1
    2 1
    3 2 =>NOT VALID 2 is a child of another store
    2)     Parent is not closed
    Site_id Parent_id Closed_date
    1 10-May-2005
    3     1 =>NOT VALID 1 is a closed
    3)
    when parent store is closed - updated so at closed_date is not null
    Want to set the parent_id as NULL for the child store.
    OR
    SET the closed_date for child store too same as the parent_store.
    Example
    Site_id Parent_id Closed_date
    1     
    1 2
    Update test_virtual_site
    SET closed_date = sysdate
    Where site_id = 1 ;
    Through Trigger
    Site_id Parent_id Closed_date
    1     22-Mar-06
    1 2 22-Mar-06
    OR
    Site_id Parent_id Closed_date
    1     22-Mar-06
    1
    When I am trying to do the above mentioned through constraints I am running into mutating trigger problem. Can you please guide me what is the best way to handle the above-mentioned scenarios.
    I am aware that I can avoid the 3rd problem using the following
    -- - Initialize an array in the before statement trigger.
    -- - Add the processed rowid to the array in the after row
    -- trigger.
    -- - In the after statement trigger: get each rowid from the
    -- array and process it. When all rowids are processed, clear
    -- the array.
    BUT for 1 and 2 I need to look at the parent specified , the parent exists in the same table BUT I can not perform the lookup from the BEFORE INSERT ROW LEVEL trigger but I want to ensure at the row level , so if the parent store is closed or parent specifed itself is a child(not permissible) I want to rollback the insert – RAISE_APPLICATION_ERROR.
    Can you please guide me what is the best way to handle the above mentioned conditions .

  • Best way to create a table based on another table

    Hello,
    I am trying to create a table based on another table with all the data in it. It has large data.
    create table <tablename> as select * from table1.
    Is this the best way of doing it or is there any other way. please advice.
    thanks

    I am suggested to create new table as
    create table <newtable> as
    select * from <oldtable> where rownum < 1;
    then
    alter table <newtable> compress;
    then
    insert /*+ append */ into <newtable> as select * from <oldtable>;
    but i getting an error saying missing values key words ora- 00926.
    please advice

  • Best way to update custom table

    Hello experts,
    Iu2019m writing a report program and after pulling data from a custom table Iu2019m modifying certain fields within internal table and then eventually update custom table. The way Iu2019m updating custom table is working fine. However Iu2019m concern about performance issues because Iu2019m doing update on custom table within loop.
    Here is my code for reference.
    *&      Form  update_contracts
          text
    -->  p1        text
    <--  p2        text
    FORM update_contracts .
    Update record in an internal table first
      loop at izsc_compliance into wa_zsc_compliance..
        wa_zsc_compliance-zapproval = c_accepted.
        wa_zsc_compliance-CHANGED_DT = sy-datum.
        wa_zsc_compliance-CHANGED_TM = sy-uzeit.
        wa_zsc_compliance-CHANGED_BY = sy-uname.
        modify izsc_compliance from wa_zsc_compliance index sy-tabix.
        write:/ sy-tabix, wa_zsc_compliance-vbeln_new, wa_zsc_compliance-zapproval.
        if p_test is initial.
          move wa_zsc_compliance to zsc_compliance.
          update zsc_compliance.
        endif..
      endloop.
    Write records to database
      if p_test = 'X'.
        skip.
        write:/ 'Test mode'.
      endif.
    ENDFORM.                    " update_contracts
    Iu2019m not certain if there is any better way by not doing update within loop and update custom table outside this loop.
    Many thanks in advance.

    Hi,
    Yes, there is a better way to update the custom table. That will be more performance oriented and will be a much cleaner approach. As, I am not much aware of the custom table structure which you have in your program, the best way that I can suggest is to remove the update statement from that check. I guess you are checking against the mode - test or production. Once you have done the check, put the selected entries in an internal table which is same as database table. And then in a single command - a single array operation as it is commonly called, you can update the custom table.
    Have a look at the following link
    [Overwriting Several Lines Using an Internal Table|http://help.sap.com/saphelp_bw33/helpdata/en/fc/eb3a94358411d1829f0000e829fbfe/content.htm]
    [Inserting or Changing Lines|http://help.sap.com/saphelp_bw33/helpdata/en/fc/eb3ac8358411d1829f0000e829fbfe/content.htm]
    You can also scan the forum for multiple links and references and sample examples.
    Hope this will help. The above approach will be much more performance oriented and will help to optimize. Also, check where exactly you are providing the locking feature if at applicable in your business functionality.
    Regards,
    Samantak.

  • Hi, we need to create the test environment from our production for oracle AP Imaging. we have soa,ipm,ucm and capture managed servers in our weblogic. can anyone tell me what is the best way to clone the environment, can I just tar the weblogic file syste

    Hi, we need to create the test environment from our production for oracle AP Imaging. we have soa,ipm,ucm and capture managed servers in our weblogic..
    Can anyone tell me what is the best way to cloning the application from different environment, the test and production are in different physical server.
    Can I just tar the weblogic file system and untar it to the new server and make the necessary changes?
    Can anyone share their experiences and how to with me?
    Thank in advance.
    Katherine

    Hi Katherine,
    yes and no . You need as well weblogic + soa files as the database schemas (soa_infra, mds...).
    Please refer to the AMIS Blog: https://technology.amis.nl/2011/08/11/clone-your-oracle-fmw-soa-suite-11g/
    HTH
    Borys

  • What is the best way to clone my iPad 2?

    We are currently rolling out 30 new iPad2s in our classrooms.  What is the best way to customize/confgure/clone 1 iPad and roll out those settings to the remaining iPads?
    I've tried using the backup and restore in iTunes however, I'm running in to the following issues:
    Backup has iOS 4.3.5, but when I restore from backup, it has iOS 4.3.3
    Backup has Facetime turned OFF, but when I restore from backup, it has Facetime turned ON.

    Thanks for the replies.
    I actually called apple support and the only response was to turn off the camera AND FaceTime in restrictions.  Meantime I've used a combination of the BACKUP and RESTORE FROM BACK UP and iPHONE CONFIGURATION UTILITY (enterprise support). Unfortunately there is no one simple solution.
    Example:
    iTunes backup and restore won't disable FaceTime, but using configuration profiles will.
    iTunes backup and restore let's you set a passcode for restrictions while allowing individuals to still change restrictions, but using configuration profiles will disable your selected restrictions.
    In both programs (iTunes and the invigoration utility) you have to update/install one at a time. There isn't a way to update a group of iPads at one time.
    Especially for use with apps in education/classroom settings, I hope apple figures out a better enterprise solution.

  • Best way to clone SSD to upgrade

    Hi
    I'm oretty tech savvy and i know several ways to do this but i'm looking forward to best way to do it. I have kensigton 240gb ssd in my computer and im upgrading to intel 240gb ssd. Lion onwards, you can't run disc utility and do restore to clone, we need to boot to restore partition or lion boot disc for this. Is that the best way to do it? I know doing this we lose the hidden restore partition whih i dont care but is there anyway doing it to keep the hidden partition or to make it truly perfect clone without affecting any programs.
    One way to do is do clean install of 10.7.3 and use migration assitant the very first time computer boots and it will keep hidden partition also but i have always refrained from doing migration assistant since it doesnt copy few stuff from old hard drive. I have ableton and some other critical programs loaded on it curently.
    I don't like the new interface of CCC and i havent used superduper lately, i believe they use apples restore command under the hood?
    What would you geniuses would do if you want a perfect clone?

    Time machine restore?
    I've used Carbon Copy Cloner as well in the past and it seemed to work just fine..
    So I'd either do a Time Machine restore or use CCC..

Maybe you are looking for