Need help on List-Hash partition - oracle 11 feature !

Can a list-hash partitioned tabled be exchanged for a partition?
Say, the table is partitioned by list on CODE (varchar2) column and subpartitioned by a NUMBER column
i.e. create table TAB1 (ID, Code, Number)
partition by LIST (Code)
subpartition by HASH (Number)
subpartition template
( subpartition1 , subpartition2 , subpartition3)
partition part1 values ('A'),
partition part1 values ('B'),
partition part1 values ('C')
Lets say the subpartitions1,2 and 3 have values 1,2,3,4,5,6....10, how can I move only say value 1 and 2 into another table using exchange partition method? Is this possible?

>
Thanks for the reply. The db version details is as below. And I am more interested in knowing if and how can data be extracted from hash sub-partitions for a given sub-partition key value, using partition exchange. Can anyone demonstrate this or point to any article that demonstrates this? I am not even sure if something like is possible.
>
What part of my reply didn't you undertand?
Except now you are saying 'extract' where before you wanted to exchange the hash subpartition. If you exchange then the subpartition will now have NO data since it will have been exchanged with an empty table.
In a partition exchange ALL of the partition (or subpartition) is exchanged, not just part of it. So for a hash subpartition you either exchange ALL data or none of it. If you only want some of the data in the subpartition you have to query it out.
No one can provide any samples until you provide a valid sample yourself. You said your partitions have character data
partition part1 values ('A'),
partition part1 values ('B'),
partition part1 values ('C')
);But then you ask about manipulating numeric data
>
Lets say the subpartitions1,2 and 3 have values 1,2,3,4,5,6....10, how
>
Which is it?
Post the DDL for the table and show which subpartition you want to query or exchange.

Similar Messages

  • Need to uncompress a hash partitioned table

    I am working on oracle 11.1.0.7 database on solaris.
    We had issues loading data into compressed tables, so we are trying to uncompress the tables and their partitions.
    When I tried uncompressing a hash partitioned table, I am getting this error
    SQL> alter table sample move partition SYS_1 nocompress;
    alter table sample move partition SYS_1 nocompress
    ERROR at line 1:
    ORA-14260: incorrect physical attribute specified for this partition
    I am able to move the table, it is just the nocompress option which doesn;t work.
    SQL> alter table sample move partition SYS_1;
    Table altered.
    Can't we uncompress a hash partitioned table which is compressed?

    You have to do it in two steps
    alter table sample modify partition SYS_1 nocompress;
    alter table sample move partition SYS_1;Best regards
    Maxim

  • Need help with Thin JDBC connecting Oracle to SQL server.

    I am fairly new to JAVA. We have ORACLE 8.1.7 running on Solaris 8. I have a need to
    periodically extract data from ORACLE DB and transfer it to SQL Server. I am limited to
    moving data from the ORACLE/UNIX environment to SQL Server side.
    From what I have read, Server-side Thin driver should work.
    1) Are there any issues in trying to achieve this with ORACLE running on the UNIX platform?
    2) Will the Server-side Thin driver talk to both the DBs ?
    3) Is it possible to provide some sample code ?
    Thanks in advance,
    Solomon

    Quattro,
    I had complete success in reading from Oracle and writing to SQL Server. First of all let me thank you for all your help. I do have one last request. Its more on optimization than any thing else.
    I was trying to optimize my code by grouping both the connections in one place and to keep my reads and inserts together so that I don't commit at the end of each insert etc. I don't seem to have the scope rules under control yet. Could you suggest how to improve this:
    import java.sql.*;
    public class Test_Combined2 {
    public static void main(String args[]) throws SQLException {
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Connect to the database
    // You must put a database name after the @ sign in the connection URL.
    // You can use either the fully specified SQL*net syntax or a short cut
    // syntax as <host>:<port>:<sid>. The example uses the short cut syntax.
    Connection con2 = DriverManager.getConnection ("jdbc:oracle:thin:@Test:1521:PSDEVElOP",
    "SOLOMON","SOL1");
    // Create a Statement
    Statement stmt2 = con2.createStatement ();
    String url = "jdbc:microsoft:sqlserver://INTRADEV:1433;DatabaseName=Measure";
    Connection con;
    String query = "select dataYear, dataMonth, yieldRate from tblYield " ;
    Statement stmt;
    try {
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.print(e.getMessage());
    // Select the ENAME column from the EMP table
    ResultSet rset = stmt2.executeQuery ("select year_start, monthofyear, percent_comp " +
    " from ps_usm_ytd_yield ");
    // Iterate through the result and print the employee names
    while (rset.next ()) {
    System.out.println (rset.getFloat (3));
    int ps_dataYear = rset.getInt(1);
    int ps_dataMonth = rset.getInt(2);
    float ps_yieldRate = rset.getFloat(3);
    try{
    con = DriverManager.getConnection (url, "tmpuser","tmppush");
    stmt = con.createStatement();
    PreparedStatement insertTblYield;
    String insertString = "insert into tblYield " +
    " values(?, ?, ?)";
    //con.setAutoCommit(false);
    insertTblYield = con.prepareStatement(insertString);
    insertTblYield.setInt(1, ps_dataYear);
    insertTblYield.setInt(2, ps_dataMonth);
    insertTblYield.setFloat(3, ps_yieldRate);
    insertTblYield.executeUpdate();
    con.commit();
    //con.setAutoCommit(false);
    /*ResultSet rs = stmt.executeQuery(query);
    System.out.println("dataYear, dataMonth, yieldRate");
    while (rs.next()) {
    int dataYear = rs.getInt(1);
    int dataMonth = rs.getInt(2);
    float yieldRate = rs.getFloat(3);
    System.out.println(" " + dataYear + ", " + dataMonth + ", " + yieldRate);
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    } //while
    stmt2.close();
    con2.close();

  • Need Help on List of Months between Two Dates

    Hello everyone,
    I have a table which has startdate & enddate, and need a SELECT statement to list all months between these two dates for each given ID.
    I did some test, and could not figure out how to get the startdate & enddate from testing table (instead of hard code them) in the select statement.
    Could anybody please help on it (Oracle 11gR2),
    Thanks in advance!!!
    create table testing(
    id          number,
    start_date  date,
    end_date    date);
    insert into testing values(100, to_date('05-FEB-2011', 'DD-MON-YYYY'), to_date('28-MAY-2011', 'DD-MON-YYYY'));
    insert into testing values(200, to_date('20-JUN-2011', 'DD-MON-YYYY'), to_date('28-DEC-2011', 'DD-MON-YYYY'));
    commit;
    select * from testing;
            ID START_DAT END_DATE
           100 05-FEB-11 28-MAY-11
           200 20-JUN-11 28-DEC-11
    Elapsed: 00:00:00.01
    *for testing.id = 100:*
    select to_char(add_months(to_date('05-FEB-2011', 'DD-MON-YYYY'), l - 1), 'YYYY-Mon') Dates
    from (select level l
           from dual
        connect by level <= months_between(trunc(to_date('28-MAY-2011', 'DD-MON-YYYY'), 'MONTH'),
                                           trunc(to_date('05-FEB-2011', 'DD-MON-YYYY'), 'MONTH')) + 1);
    DATES
    2011-Feb
    2011-Mar
    2011-Apr
    2011-May
    Elapsed: 00:00:00.01
    *for testing.id = 200:*
    select to_char(add_months(to_date('20-JUN-2011', 'DD-MON-YYYY'), l - 1), 'YYYY-Mon') Dates
    from (select level l
           from dual
        connect by level <= months_between(trunc(to_date('28-DEC-2011', 'DD-MON-YYYY'), 'MONTH'),
                                           trunc(to_date('20-JUN-2011', 'DD-MON-YYYY'), 'MONTH')) + 1);
    DATES
    2011-Jun
    2011-Jul
    2011-Aug
    2011-Sep
    2011-Oct
    2011-Nov
    2011-Dec
    7 rows selected.

    SQL> select * from testing
      2  /
            ID START_DAT END_DATE
           100 05-FEB-11 28-MAY-11
           200 20-JUN-11 28-DEC-11
    SQL> select  id,
      2          to_char(add_months(start_date,column_value - 1),'YYYY-Mon') dates
      3    from  testing,
      4          table(
      5                cast(
      6                     multiset(
      7                              select  level
      8                                from  dual
      9                                connect by add_months(trunc(start_date,'MM'),level - 1) <= end_date
    10                             )
    11                     as sys.OdciNumberList
    12                    )
    13               )
    14    order by id,
    15             column_value
    16  /
            ID DATES
           100 2011-Feb
           100 2011-Mar
           100 2011-Apr
           100 2011-May
           200 2011-Jun
           200 2011-Jul
           200 2011-Aug
           200 2011-Sep
           200 2011-Oct
           200 2011-Nov
           200 2011-Dec
    11 rows selected.
    SQL> SY.

  • Need help in creating Aria using Oracle APEX

    Hi,
    I am trying to develop an employee lookup using DBCON's PDF(http://www.dbcon.com/oracle_apex_ebook_aria.html).
    I downloaded the Oracle XE, version 11.0.0.28844 and used the APEX from this. But, the files provided by DBCON seem to be old. I tried using the AriaTheme.sql file in the APEX, but, it errors out complaining that the file is not compatible.
    As this did not work, I downloaded the APEX(apex_4.0.1) and am trying to proceed with this. This comes with a large package and it is not clear on how to install and where to start off to build ARIA.
    Please help me out with the latest compatible theme or suggest the XE version that I need to download.
    Thanks,
    Divya.

    I downloaded it from: http://www.oracle.com/technetwork/database/express-edition/downloads/102xewinsoft-090667.html(Oracle Database 10g Express Edition (Universal) )
    Could you please comment on the 'Aria' setup, if you are aware?

  • Need help for Conversion Function in Oracle

    Hi, Can Any One help me Please.
    I need a Oracle conversion script for converting from decimal to hex. and decimal to datetime.
    Thanks In Advance.

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

  • Need help converting SQL "OVER (PARTITION BY   )" to JPQL equivalent - JPA

    Having trouble converting this query:
    select
    sdi,
    val,
    vldtn,
    TO_CHAR(sdt, 'yyyy-mm-dd hh:mi:ss AM')
    from
    select
    sdi,
    val,
    vldtn,
    sdt,
    max(sdt) over (partition by sdi) as MaxDate1
    from
    r_ins
    ) x
    where x.sdt = x.MaxDate1
    and sdi in (1234,2345,3456,4567,5678,6789,7890);
    to JPQL equivalent using JPA
    Able to convert simple queries but I do not know how to handle the "over (partition by sdi)" portion of the query.
    Can anyone help
    TIA
    Jer

    Paul Horth wrote:
    Why have the power (and cost) of Oracle and then not use those powerful features because you are restricting yourself to a vanilla set of SQL because you are using some generic framework.You know how it is :
    1 - Application developers create code & queries but only test them on tiny database with low volume and no concurrency at all.
    2 - Application goes Live, Database grows (as expected) but stupid optimizer is not as fast as on test environment (that was mostly empty)
    3 - Queries are now 200 times slower.
    4 - Expensive DB expert comes and gathers statistics, creates indexes, rewrites queries, uses hint/outline/SQLprofile.
    Conclusion : Database is evil and prevent application from working efficiently, the proof of all that being : nothing had to be done on application's side to make things work correctly. Database is declared guilty.
    Which could translate to :
    1 - Team buy a formula one with 800HP that can reach 200mph in less than 10 seconds.
    2 - Give it a pilot that doesn't even want to understand what-the-heck is a gearbox/transmission. Pilot only drives in 1st gear.
    3 - The formula one is now doing 0.003 miles per gallon, doing the hell of a noise, and is limited to 80mph +(any $10000 family wagon is faster in average)+
    4 - Expensive expert comes and check everything in the formula one. Finally understand the problem and modify the gearbox to a sloppy automatic transmission
    Conclusion : Formula 1 is evil and prevent pilot from being fast. The proof of that being : nothing had to be changed on pilot's side to make things work correctly. Formula 1 is declared guilty.
    You cannot win race without understanding how the car/engine/transmission/physics/race rules work.
    Too much levels of abstraction is bad. Treating the database as a black box is the most seen "Bad Idea" these days (to my point of view).
    Warning: I am biased towards Oracle :-)And so am I.
    (^_^)

  • I'm new and need help with lists.

    I'm writing an app in java (duh, thats why im here), and using NetBeans. I need to know how to add items to an awt list at run time. Thanks for your help in advance. ;)

    Try the APIs. I am assuming that you are not using the GUI editing part of NetBeans to make your app, but if you are, again.... make the action and then look at the APIs .
    Good Luck,
    Edward S. Rice

  • How to do it? Need help in syntax - new to Oracle syntax

    create or replace
    PROCEDURE "SP_SAMPLE_data" (prodName in VARCHAR2) AS
    where_criteria char(100);
    BEGIN
    if prodName = 'A' then
    I want to build the where criteria string as “product_name in (‘iPod’,’iPad’)”
    else
    I want to build the where criteria string as “product_name = directly read from the passed variable(prodName)”
    end if;
    select *
    from “MySchema”.”MyTable”
    where where_criteria concatenated here – do not know how to concatenate;
    END SP_SAMPLE_data;
    New to Oracle PL/SQL syntax.
    Oracle 10gR2

    You could try someting like this
    create or replace procedure SP_SAMPLE_data (prodName in VARCHAR2) AS
       where_criteria char(100);
       sql_stmt varchar2(1000);
    BEGIN
       if prodName = 'A' then
          -- I want to build the where criteria string as "product_name in ('iPod','iPad')"
          where_criteria := 'product_name in (''iPod'',''iPad'')';
       else
          -- I want to build the where criteria string as
          -- "product_name = directly read from the passed variable(prodName)"
          where_criteria := 'product_name = '''||prodName||'''';
      end if;
      sql_stmt := 'select * from MySchema.MyTable'||where_criteria;
    END SP_SAMPLE_data;I added SQL_STMT variable as I am not sure what do you want to do with SQL statement once it is created. Do you plan to execute it in the procedure or pass it back to the calling environment? If you need to pass it back, then specify SQL_STMT as out parameter.

  • I need help with creating a partition with bootcamp. I run OSX Lion and want to also run Windows 7.

    Bootcamp is not allowing me to create the partition. The message i get when i try to do so is as follows:
         The disk cannot be partitioned because some files cannot be moved.
        Back up the disk and use Disk Utility to format it as a single Mac OS Extended (Journaled) volume. Restore your information to the disk and try using Boot      Camp Assistant again.
    I am looking in Disc Utility and am not sure what to do.
    To me it looks like i only have one 'single Mac OS Extended (Journaled) volume. So i am not sure exactly what it is requiring me to do?
    Help greatly appreciated!

    Look to the right under "More Like This". Your issue has been discussed many many times. The error you are seeing is because you do not have enough free "contiguous" space on your hard drive. Read the other threads that address this issue to find how to solve the issue.
    Or, put "The disk cannot be partitioned because some files cannot be moved" into the search box at the upper right of this page.

  • Newbie needs help can't compile an Oracle form 10g

    I am trying to compile a form in Oracle 10G. in the /u01/dba/oracle/product/1012ias/bin directory there is a script called frmcmp.sh which I assume is the correct script to use. It calls the frmcmp executable (it does mean form compile, right?). anway I get the error
    FRM-91500: Unable to start/complete the build.
    This is on a HPUX machine running HPUX 11.11.
    I am having no success trying to search for an answer on the Oracle site and all the documentation I have looked at so far fail to address the issue.
    I hate being a newbie!
    Thanks
    Harold

    for this you need Xwindow session, if dont, you can make it command line by running it like.
    * frmcmp.sh USERID=manager/manager@dbname MODULE_TYPE=form MODULE=form.fmb*
    Greetings

  • Need help in List

    Hello techies,
    I am reading 2 xml Files by using DOM.
    I having the values in the xml files like the followin
    <fid>
        <name>SIZE</name>
         <value>13</value>
    </fid>
    <fid>
        <name>BID</name>
         <value>23</value>
    </fid>when i select size then immediately i should get value 13
    Basically I am adding the values in the <name> n <value> to list.
    Here is my code.
    public static List getContent(Document doc) {
              List listInGetContentMethod = new ArrayList();
              Element root = doc.getDocumentElement();
              NodeList childList = root.getElementsByTagName("name");
              NodeList chList = root.getElementsByTagName("value");
              System.out.println("xxxx" + chList.getLength());
              for (int j = 0; j < chList.getLength(); j++) {
                   Node valueNode = chList.item(j);
                   root = (Element) valueNode;
                   System.out.println("eachelemet"
                             + root.getFirstChild().getNodeValue());
                   listInGetContentMethod.add(root.getFirstChild().getNodeValue());
              int n = childList.getLength();
              System.out.println("Child Nodes" + n);
              for (int i = 0; i < n; i++) {
                   Node titleNode = childList.item(i);
                   root = (Element) titleNode;
                   System.out.println("eachelemet"
                             + root.getFirstChild().getNodeValue());
                   listInGetContentMethod.add(root.getFirstChild().getNodeValue());
              return listInGetContentMethod;
         }whenever the value is size , I should hget 13 immediately.
    How can i do this .
    Thanx(inadvance)
    ramu

    following code may help :
    DATA TEXT(20).
    START-OF-SELECTION.
      PERFORM WRITE_AND_HIDE USING SPACE SPACE.
    AT LINE-SELECTION.
      CASE TEXT.
        WHEN 'List index'.
          PERFORM WRITE_AND_HIDE USING 'X' SPACE.
        WHEN 'User command'.
          PERFORM WRITE_AND_HIDE USING SPACE 'X'.
        WHEN OTHERS.
          SUBTRACT 2 FROM SY-LSIND.
          PERFORM WRITE_AND_HIDE USING SPACE SPACE.
      ENDCASE.
      CLEAR TEXT.
    FORM WRITE_AND_HIDE USING P_FLAG_LSIND P_FLAG_UCOMM.
      WRITE / 'SY-LSIND:'.
      PERFORM WRITE_WITH_COLOR USING SY-LSIND P_FLAG_LSIND.
      TEXT = 'List index'.
      HIDE TEXT.
      WRITE / 'SY-UCOMM:'.
      PERFORM WRITE_WITH_COLOR USING SY-UCOMM P_FLAG_UCOMM.
      TEXT = 'User command'.
      HIDE TEXT.
      IF SY-LSIND > 0.
        WRITE / 'PICK here to go back one list level'.
      ENDIF.
    ENDFORM.
    FORM WRITE_WITH_COLOR USING P_VALUE
                                P_FLAG_POSITIVE.
      IF P_FLAG_POSITIVE = SPACE.
        WRITE P_VALUE COLOR COL_NORMAL.
      ELSE.
        WRITE P_VALUE COLOR COL_POSITIVE.
      ENDIF.
    ENDFORM.
    Sameer

  • Need help Cloning a Bootcamp partition

    I need to install a larger hard drive in my Leopard MBP that has a HFS+ and a FAT32 partition running Win XP.
    Moving the HFS+ partition is no big deal, but I really could use some step by step guidance in moving the contents of the existing FAT32 partition to a new and larger FAT32 partition.
    I essentially need to backup to an intermediate drive, and then to the new larger target drive. I have been trying to use Disk Utility, but am unable to get a partition that is bootable. I have tried doing a "throwaway" WinXP install on the partition, but am unable to write over the files there, because many of them are locked. I am not running NFS.
    Any guidance would be appreciated.

    I'm not sure if this will work, but.... What if you used the Microsoft Backup Utility to back-up the files to an external hard drive (you will need an NTFS partition on the external), use bootcamp to create the larger FAT32 on the new drive, install a fresh copy of windoze on the new drive, then use the Microsoft Backup Utility to restore the files from the external hard drive.

  • Need help with understanding updates, partitions, firmware etc.

    I went to update my QuickTime and in doing so was told to update my OS which included QT updates. Now I'm getting all kinds of messages about partitions, firmware etc. do not understand at all what's going on.

    THIS IS MY STEP BY STEP situation with my updates:
    I go to the Apple Icon and selected Software Update and it reads I have 2 items:
    MacBook EFI Firmware Update 1.2
    MacBook SMC Firmware Update 1.4
    I select Install and then it state Installs completed successfully.
    BUT THEN I recieve and new icon and this message below: 
    To update the SMC firmware on your MacBook:
    Your computer's power cord must be connected and plugged into a working power source, or your battery must be at least 25% charged.
    For more information see 'http://support.apple.com/kb/TS3499'.
    1. Quit all other open applications.
    2. Click Restart in the MacBook SMC Firmware Update window and wait for your computer to restart.
    The SMC firmware update starts automatically. A status bar indicates the progress of the update. During the update your computer fans will run at full speed, but will return to normal once the update completes.
    Important: Do not interrupt the update.
    Your computer restarts automatically when the update is completed and opens the MacBook SMC Firmware Update.
    3.  Click OK. The SMC firmware is now up-to-date.
    If these instructions appear on your screen again, the SMC firmware update was not successful. Repeat steps 2 and 3.
    I follow the instructions and then I get this: (could get my image to attach but here's what it said)
    the first error message heading of:
    MacBook SMC Firmware Update 1.4
    Your firmware could not be updated, the hard drive partition scheme may not be supported.  You must be booted from a GUID partition or RAID scheme.
    see http://support.apple.com/kb/HT2434 for more information (internal error 28:3)
    THEN ANOTHER ONE POPS UP saying:
    Your Hard Drive partition scheme is not supported, you must be booted from a GUID partition scheme.
    see http://docs.info.apple.com/article.html? artnum=303609 for more information
    I went to those URL and tried to understand what it was telling me but I did not understand.  I can't figure, by reading thru forums, etc, if I need to do this or not and what exactly it is.
    So back to just pushing a simplet update has thrown all this unknown info. my way and I have no clue what to do.
    Thank you. Hope this is more clear.

  • I need Help how to start in Oracle App.

    Please Any one can tell me how I can start with Oracle Applications .
    Which steps I must go through it ?
    And if any one in Riyadh Saudi Arabia can help me in that .
    My email : [email protected]
    Thanks In Advance ,
    Ibrahim Salameh.
    Oracle Database Administrator .
    Riyadh Saudi Arabia.
    0096657236902 .

    U Mean Oracle Application Instance

Maybe you are looking for

  • Upload tab delimted file without using GUI_UPLOAD

    hi gurus, my requirement is I have to upload a Tab - delimited text file into a internal table. this should happen as a background job due to which, I cannot use GUI_UPLOAD. please provide me with code snippets using open dataset and close dataset. p

  • Reports Required in MM

    Dear SAP Experts, My Client is required as follows report in MM. We have to tell input to technofunctional consultants. Accordingly give me the necessary inputs to get these reports in SAP MM. 1) Consumption report, date to date, & Group  & Item wise

  • 80 GB is skipping the album page

    I have songs for some artists organized such that some are organized with album (if I have the full album) but some are organized without album (blank, if they are a single or something). My problem is with artists with only 1 album but possibly othe

  • Not modfying ithe infotype while using FM HR_INFOTYPE_OPERATION

    Hi Experts, When i am using this FM HR_INFOTYPE_OPERATION its not modifying the infotype 14.Can you please suggest me. Please see my below code. Can please let me know if i am wrong.. form INSERT_DATA_0014 .     loop at pa_0014. CALL FUNCTION 'BAPI_E

  • Customizer Dialog size too small and cannot be resized

    Hi, I've written a CUSTOMIZER for a bean. It contains a table and three buttons. I have set the headers for the table. I've included the bean in my project. When i open the customizer for this bean by clicking on the Customizer button in the property