How to copy statistics of a partition to another??

Hi,
I have a partitioned table (Oracle 9.2).
We will be creating new partitions for increasing data and I would like to copy the statistics of the existing partition for the newly created partition.
Whats the best way to do this?
Regards

Hi,
<br>
1. Create a table to hold statistics with <a href=CREATE_STAT_TABLE Procedure. <br>
2. Use EXPORT_TABLE_STATS Procedure to export a partition level stats.<br>
3. Update your own stattab (created in step 1) to change the partition name.<br>
4 Use IMPORT_TABLE_STATS Procedure to import stats into a partition.<br>
<br>
Here a simple example with a table stats level (but for partition, it's the same thing, verify which the column you need to update, where partition name is) :<br>
SQL> create table teststat (col number);
Table created.
--rows insert
SQL> select * from teststat;
       COL
         1
SQL> select num_rows from dba_tables where table_name = 'TESTSTAT'
SQL> /
  NUM_ROWS
SQL>  exec DBMS_STATS.GATHER_TABLE_STATS('SYSTEM','TESTSTAT')
PL/SQL procedure successfully completed.
SQL> select num_rows from dba_tables where table_name = 'TESTSTAT'
  2  /
  NUM_ROWS
         1
SQL> exec DBMS_STATS.CREATE_STAT_TABLE ('SYSTEM','MYSTATS')
PL/SQL procedure successfully completed.
SQL> desc mystats
Name                                      Null?    Type
STATID                                             VARCHAR2(30)
TYPE                                               CHAR(1)
VERSION                                            NUMBER
FLAGS                                              NUMBER
C1                                                 VARCHAR2(30)
C2                                                 VARCHAR2(30)
C3                                                 VARCHAR2(30)
C4                                                 VARCHAR2(30)
C5                                                 VARCHAR2(30)
N1                                                 NUMBER
N2                                                 NUMBER
N3                                                 NUMBER
N4                                                 NUMBER
N5                                                 NUMBER
N6                                                 NUMBER
N7                                                 NUMBER
N8                                                 NUMBER
N9                                                 NUMBER
N10                                                NUMBER
N11                                                NUMBER
N12                                                NUMBER
D1                                                 DATE
R1                                                 RAW(32)
R2                                                 RAW(32)
CH1                                                VARCHAR2(1000)
SQL> exec DBMS_STATS.EXPORT_TABLE_STATS ('SYSTEM','TESTSTAT',null,'MYSTATS')
PL/SQL procedure successfully completed.
SQL>
SQL> select c1 from mystats; --c1 for table name, verify where is partition name
C1
TESTSTAT
TESTSTAT
SQL> update mystats set c1 = 'TESTSTAT2' where c1 = 'TESTSTAT';
2 rows updated.
SQL> commit;
Commit complete.
SQL> create table TESTSTAT2 (col number);
Table created.
SQL> select * from teststat2;
no rows selected
SQL> select num_rows from dba_tables where table_name = 'TESTSTAT2'
SQL> /
  NUM_ROWS
SQL> exec DBMS_STATS.IMPORT_TABLE_STATS ('SYSTEM','TESTSTAT2',null,'MYSTATS')
PL/SQL procedure successfully completed.
SQL> select table_name,num_rows
from dba_tables
where table_name in ('TESTSTAT','TESTSTAT2');
TABLE_NAME                       NUM_ROWS
TESTSTAT                                1
TESTSTAT2                               1
SQL>
SQL> <br>
HTH,<br>
<br>
Nicolas.
Message was edited by: <br>
N. Gasparotto<br>
I change a little bit my example

Similar Messages

  • How to copy one column BLOB value into another column of another database.

    How to copy one column BLOB value into another column of another database.
    BLOB value contains word document.
    I thought of copy the BLOB value into a text file and then update the new column value by the same text in textfile. Will this work?
    Is there any other better way to do this?

    You're welcome
    BLOB fields contains binary data. I don't think you can do this
    Also if I view the BLOB as text. Can I copy it and insert into the new database.
    I think your options are as I said. Datapump or CTAS
    Best Regards

  • HOW TO COPY A FORM FROM ONE TO ANOTHER CLIENT

    HOW TO COPY A FORM FROM ONE TO ANOTHER CLIENT

    Hi Tina,
    To copy either a Script or a Smartform fron one client to another client i.e from reference client 000 to any client say 010  follow instructions as given below:
    Go to Tcode SE71->Give Form name MEDRUCK then go to Menu path Utilities->Copy From Client, give
    Form Name: MEDRUCK
    SOURCE:000 (it will be already there)
    Target Form: Zmedruck(here give ur form zname)
    Execute
    It will be copied into all languages.
    Then come back to SE71
    Give your form name Zmedruck
    Language:: de then goto change mode
    then menu path->utilities->convert original languge to En and enter you will get a message original language of form zmedruck converted from de to en,
    now  change language de to en in se71 main screen and then do what ever changes you want to do , this is how you can copy a script or smartform from one client to another client.
    If this answer is useful reward points any queries revert me back.

  • How to copy and paste a photo in another folder using Aperture?

    How to copy and paste a photo in another folder using Aperture?

    What do you want to achieve? Do you really want to create a copy of an image, and thus create a second copy of the master image file? You will waste disk space this way.
    Usually you would create new versions of an image, if you want versions with different adjustments. Versions do not require much additional disk space. But all versions of an  image have to be in the same project. To create a new version: Main menu bar -> Photos -> Duplicate Version
    To create a copy of an image in another project (and to waste the space ) drag the image to another project while holding down the option key. This will create a copy in the other project.
    Sofar nobody here could come up with a good reason why one would want to create a copy. I am curious what in your workflow requires you to do that. Would you mind to tell us?
    Regards
    Léonie

  • How to copy pictures from one iPad to another iPad?

    I want to copy pictures in my new iPad3 to my iPad1 without going through my apple computer.  Is there a way to do it?  I tried to use the usb connector to sync but it can only go from my iPad 3 to iPad1 but not the other way around.  (I did try to switch the "direction" of the usb connector.)
    If I have to go through my apple computer, how should I proceed?  I have created another iTune library for the new iPad3.

    Use Finder on your computer to locate your iPad when attached. Dig down through the folders (which will only contain photos and videos) to locate your photos. Select them and copy them to a new folder or folders on your computer and subsequently check that folder or folders in iTunes during a sync to the other iPad.

  • How to copy a standard search help to another field

    Hi All,
    I have a BSP screen in that for one input field i need to copy the standard search help for the Business Partner. Could any one guide me how to copy the standard search help for the business partner into the input field in the BSP screen.
    Thanks In advance for the help...
    Thanks,
    SAP SAP

    Hi,
    the BP search is its own web client UI component. For the integration you could check any standard transaction UI component like the BT115H_SLSO, as those contain several partner fields.
    Best Regards,
    Michael

  • How to move rows from one partition to another?

    We have a data retention requirement for 6 months and after 6 months the data can be removed except for few records with certain statuses (which cannot be removed even if they are over 6 months). We have Oracle 11g.
    I wanted to see if the following strategy works:
    I will have monthly partitions and 8 sub partitions (hash) in each of the main partitions. The hash sub-partitions are to spread the load of application data and balance the data insertion to avoid any contention.
    At the end of 6 months, is it possible for me to move the row that needs to be kept to a different partition and drop the last partition. I wanted to avoid data deletion because we only have very little database downtime and data deletion require us to coelize the database to avoid fragmentation.
    If I can move the data to another partition, how will I do it?
    Thanks

    I think you didn't get intentions correctly.
    My intention is to move the required data to a partition and then drop the original partition. that because the amount of data required to keep for future use is less than 1%.
    I understood what you meant to convey. Thanks a lot.
    I laid out eh plan something like the following.
    1. Add a new date column to facilitate the partitioning (say its called PARTITION_DT. PARTITION_DT will have the same data as ROW_CREAT_DTTM without the timestamp portion of the date.)
    2. We will start with monthly partition using PARTITION_DT, Create a 'Default' partition as well.
    3. Add hash sub-partitions on MSG_ID to spread the application data load and avoid contention (so the application load is balanced just like how its balanced through the hash partitions today)
    4. At the end of the data retention period, identify the records that needs to be retained (because of some trade statuses, etc ) and update the PARTITION_DT with a distant past date so the row will automatically move to the Default partition. The identification of the records to be retained and updating the PARTITION_DT can be done through a batch job. since this step involve very few records, it can be done in minutes or seconds.
    5. Now, we can drop the oldest partition and rebuild the index if required.
    6 The process should add sufficient number of monthly and its sub-partitions ahead of time to make sure we always have partitions available for new data.
    The entire process can be automated and executed through a scheduled job.

  • How to copy personalizations of a responsibility to another responsibility

    Hi All,
    I have done OAF Personalization at responsibility level for one responsibility. The same personalization is to be done for 60 more responsibilities. Please guide me on following points:
    1. How to copy the same personalization to other responsibilities?
    2. How to import the personalizations to application?
    3. How to migrate the personalizations on another instance?
    Thanks,
    Regards,
    Abdul

    Abdul,
    Use the Functional Administrator to get the XML files for the Personalizations. If you notice you would observe that for a particular file with path:
    oracle/apps/ap/abc/webui/XXPG
    the personalization xml wd be created as
    oracle/apps/ap/abc/customization/responsibility/12345/webui/XXPG (where 12345 is the responsibility Id).
    You would need to create 60 such copies with 60 different responsibility Ids. Also in the actual XML document you would need to update the responsibility key for each responsibility individually.
    As a suggestion why dont you do your personalizations at the site level itself. For those responsibilities where you dont need this (assuming that is lesser in number) you personalize again so that the site level personalizations dont take effect.
    regards
    Sumit

  • How to copy object from transport request to another transport  request

    Hi All,
    Can some body tell me how to copy the objects which are there in on transprot request to another transprot request ? I think we can do this from the transction SE09 but I am not getting how to do this.
    Thanks&Regards
    Mahesh

    Hi,
    step 1.Go to se10, give your user id and clik display.
    step 2.There will be list of transport requests, go the respective request and point
               the cursor on the object under that request and click on delete button.
    step 3. Assign new request to the objects deleted.you can do this by activating all the objects once again.
    Regards,
    santhosh

  • How to transfer files from one partition to another on the same computer

    I had a crash could not boot back into my 8.1 upgrade. Went out bought standalone 8.1. I loaded it on HD free space now I want to transfer files from one partition to another.

    hi
    say there are two infoobjects X  and Y.
    X is existing infoobject and Y in new one.
    go to infosurce-search for X-create export datasource - map the rules and load the data.
    This is one way.
    Other way is u can use X as a reference object of Y so that both of them have same structure and both objects will share common database tables in BW which are exsting for X.
    Hope this helps.
    Kindly assign the points if it helps.

  • How to copy file from one table to another table at another database

    I need to transfer my tables from one workspace and schema to another workspace and schema. Basically I need to create again all the tables at this new schema. How could I transfer data from tha table at old schema to the table at new schema when this table has files stored in it? (data type is blob)
    thank you so much,
    Silver

    Hello Silver,
    Depending which database you're using (if it's available) I would recommend to use datapump.
    Datapump allows you to copy an entire schema to another database, it's the "new" export/import you might now.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/
    REWARDS: Please remember to mark helpful or correct posts on the forum

  • How to copy file from  one location to another

    Hi,
    I am new to java, I tried the following code to move the file from one location to another
    public class CopyFiles {
    public String copy ( File source, File target)
    throws IOException {   
    FileChannel sourceChannel = null;
    FileChannel targetChannel =null;
    try {   
    sourceChannel =new FileInputStream(source).getChannel();
    targetChannel= new FileOutputStream(target).getChannel();
    targetChannel.transferFrom(sourceChannel, 0,
    sourceChannel.size());
    finally {   
    targetChannel.close();
    sourceChannel.close();
    return "Success";
    public static void main(String [] args) throws Exception{   
    File source = new File("C:\\users\\download.pdf");
    File destinationFile = new File("C:\\apple\\download.pdf");
    copy(source, destinationFile);
    The above code is working perfectly, but I Don't want to include the file name in destination file. i.e. File destinationFile=new File("C:\\apple"), and at the same time the pdf with same name has to get stored in the destination location, how can I achieve this.

    kameshb wrote:
    I Don't want to include the file name in destination file. i.e. File destinationFile=new File("C:\\apple"), and at the same time the pdf with same name has to get stored in the destination location, how can I achieve this.It's not totally clear what you're saying here, but what I think you mean is that you don't want to explicitly set the destination file name--you want to just give the copy the same name as the original. Yes?
    If that's the case, then break the original up into separate directory and file name portions, and then construct the destination path from the destination directory plus original file name. You can do that by manipulating the full path string, or by using the methods in java.io.File.

  • How to copy files from one user to another on same macbook pro

    I used the migration assistant to move files from an old windows pc to my new macbook pro.  It created a second user and put everything there.  I now can't figure out how to move them so they are under me.

    Welcome to Apple Support Communities
    The easiest way is to put your files in /Users/Shared. To access to this folder, open a Finder window, select the Go menu (on the menu bar) > Go to Folder, and type that directory.
    That folder can be read by all users, so you won't have any problem to copy your files to the other user account.
    Another option would be to copy your files to an external drive. Also, see > https://discussions.apple.com/docs/DOC-5472

  • How to copy value from one field to another in a Apex Form

    Hello guys,
    There are 2 addresses one is shipping and other is billing. I do not want the customer to re-enter all the details if it is the same address. So based upon an action, it should take the live values from one address field and populate the other address field. I know in JS you can do it, but how to implement that in Apex?
    I guess using Dynamic Actions to achieve this in Version 4 but do not know how. Read quite some info but no luck.
    Thanks in advance!

    Hi,
    I have assumed that you have your shipping address at the top of the page, and then further down the page you have your billing address that you want to enable the users to copy (if this is in reverese, you will need to switch the js variables in the code following).
    I would create a Select List item above the 'Billing Address' details, called PX_SAME_ADDRESSThis select list would be static, with the options Null.
    I also assume you would have pairs of address page items such as:
    PX_SHIPPING_ADDRESS_L1
    PX_BILLING_ADDRESS_L1
    PX_SHIPPING_ADDRESS_L2
    PX_BILLING_ADDRESS_L2
    PX_SHIPPING_POST_CODE
    PX_BILLING_POST_CODEThen copy the following code into the HTML Header of the page definition:
    <script language="JavaScript" type="text/javascript">
    function copyAddress()
       if( $x('PX_SAME_ADDRESS').value == 'YES')
         $x('PX_BILLING_ADDRESS_L1').value = $x('PX_SHIPPING_ADDRESS_L1').value;
         $x('PX_BILLING_ADDRESS_L2').value = $x('PX_SHIPPING_ADDRESS_L2').value;
         $x('PX_BILLING_POST_CODE').value = $x('PX_SHIPPING_POST_CODE').value;
       else //Clear Address Fields
         $x('PX_BILLING_ADDRESS_L1').value = " ";
         $x('PX_BILLING_ADDRESS_L2').value = " ";
         $x('PX_BILLING_POST_CODE').value = " ";
    </script>Then, in your PX_SAME_ADDRESS item, copy the code below into the Element > HTML Form Element Attributes field.
    onChange="copyAddress();"Hopefully this works for you too, and should give you some basis to play around with.
    Amanda.

  • How to copy data from one table to another (in other database)

    Hi. I would like to copy all rows from one table to another (and not use BC4J). Tables can be in various databases. I have already 2 connections and I am able to browse source table using
    ResultSet rset = stmt.executeQuery("select ...");
    But I would not like to create special insert statement for every row . There will be problems with date formats etc and it will be slow. Can I use retrieved ResultSet somehow ? Maybe with method insertRow, but how, if ResultSet is based on select statement and want to insert into target table? Please point me in the right direction. Thanks.

    No tools please, it must be common solution. We suceeded in converting our BC4J aplication to PostgreSQL, the MSSQL will be next. So we want to write simple aplication, which could transfer data from our tables between these 3 servers.

Maybe you are looking for

  • Open Data Unit Question

    Has anyone been able to retrieve parent members when using the new user defined list functionality within the OpenDataUnit function? Set DataUnit=HS.OpenDataUnit(A{MyCashFlowList}.I#[ICP Top].C1#TOTC1.C2#[None].C3#[None].C4#[None]) The user defined l

  • Nokia 1320 - Need Support - Nokia Down - Brazil

    Hello Guys, Vim expose all my disappointments with Nokia product as professional in the field of Information Technology, came to recommending compared to other Nokia phones believe that Mark is doing an excellent job, but the brand disappoint me as m

  • User exit for Payment terms at header level

    Dear Alli In which user exit, I have to modify if I need ti change value of payment terms at Sales Order Header level . and  let me know in which include program is that ?? Thank You. Regards Madhu Edited by: madhu tatikonda on Feb 12, 2008 8:58 PM

  • HELP - Buffered Reader

    Below is a portion of my program, its a simple app, that is supposed to read a policy number, and then display the results. I can't get it to read the file, or output onto the app. Any help would be appreciated. the file is called loans.txt and a lin

  • Hi im not able to download andninstall latest version of iOS, it goes till last moment disrupts, any suggestions?

    hi im not able to download andninstall latest version of iOS, it goes till last moment disrupts, any suggestions?