How to implement hasing algorithm in oracle

implement hasing algorithm in oracle

Assuming you're using the enterprise edition of the database and that you've licensed the partitioning option, you specify the number of hash partitions you want when you create the table. The SQL Reference for the CREATE TABLE statement has the following example
CREATE TABLE hash_products
    ( product_id          NUMBER(6)
    , product_name        VARCHAR2(50)
    , product_description VARCHAR2(2000)
    , category_id         NUMBER(2)
    , weight_class        NUMBER(1)
    , warranty_period     INTERVAL YEAR TO MONTH
    , supplier_id         NUMBER(6)
    , product_status      VARCHAR2(20)
    , list_price          NUMBER(8,2)
    , min_price           NUMBER(8,2)
    , catalog_url         VARCHAR2(50)
    , CONSTRAINT          product_status_lov_demo
                          CHECK (product_status in ('orderable'
                                                  ,'planned'
                                                  ,'under development'
                                                  ,'obsolete')
PARTITION BY HASH (product_id)
PARTITIONS 5
STORE IN (tbs_01, tbs_02, tbs_03, tbs_04); You'd just specify 4 or 8 partitions, your partition key, etc.
It doesn't make sense, however, to try to join two hash-partitioned tables on the hash key value. What is it, exactly, that you're trying to accomplish.
Justin

Similar Messages

  • Anyone knows how to implement Decomposition Tree in Oracle BI products? to

    Hello Everybody
    Recently I'm trying to use Oracle BIEE plus to upgrade our old report service in our product. I'm a newbee to OracleBI products but I have a question that oracle support guys in our region also could figure out a clear answer. If anybody here can give me some clues it would be appreciated.
    I once used ProClarity BI product before, and ProClarity report service can provide a very powerful visualization tool like Decomposition Tree. I'm quite interested this function. But I searched many Oracle BIEE plus and ESSBASE documents, it seems Oracle BI can' implements the functional for which Proclrity Decomposition Tree can provided?
    Is there any body knows any other solution to implement Decomposition Tree in Oracle BI product?
    Thanks

    Appreciated the quick response:)
    Yes. I don't find the directory object .. I'm not very familiar with biee so far so might be me slight this object in my investigation.
    I need to check this object and see how it works.
    And thanks for your advise.

  • How to implement invoker rights in oracle 9i

    implement invoker rights in oracle 9i

    Invoker rights is a new model for resolving references to database elements in a PL/SQL program unit. From Oracle 8i onwards, we can decide if a program unit should run with the authority of the definer or of the invoker. This means that multiple schemas, accessing only those elements belonging to the invoker, can share the same piece of code.
    To enable code to run with Invoker rights, an AUTHID clause needs to be used before the IS or AS keyword in the routine header. The AUTHID clause tells Oracle whether the routine is to be run with the invoker rights (CURRENT_USER), or with the Owner rights (DEFINER). If you do not specify this clause, Oracle by default assumes it to be AUTHID DEFINER.
    create or replace procedure update_par(pi_parcod  in     varchar2,
                                           pi_val     in     varchar2,
                                           pio_status in out varchar2)
    authid current_user is
    begin
      pio_status = 'OK';
      update appparmst
      set    parval = pi_val
      where  parcod = pi_parcod
      and    rownum = 1;
      if sql%notfound then
        pio_status = 'Error in resetting the parameter';
      end if;
    end; Restriction in using Invoker rights
    1. When compiling a new routine, direct privileges are only considered to resolve any external references. Grants through roles are ignored. The same applies when executing a routine created with invoker rights.
    2. AUTHID is specified in the header of a program unit. The same cannot be specified for individual programs or methods within a package or object type.
    3. Definer rights will always be used to resolve any external references when compiling a new routine.
    4. Maintain extra caution on privileges being assigned to a different user. If the wrong privileges are assigned, a routine with invoker rights may have a mind of its own! Such issues would be difficult to debug. So ensure that the grants are perfectly in place.
    5. For an invoker rights routine referred in a view or a database trigger, the owner of these objects is always considered as the invoker, and not the user triggering it.
    ~ Madrid.

  • How to Implement User Area in Oracle Forms 6i

    Hi,
    Could anyone please let me know how to implement Item Type *"User Area"* ?
    How to add User Area in layout Editor?,
    Thanks and Regards,
    Manasa

    Hi,
    Please post your question in the appropriate forum.
    Forms
    Forms
    Thanks,
    Hussein

  • How to implement SubType/SuperType in Oracle ?

    Hi,
    I have a supertype and three subtypes, as attached below, how is the
    best approach to implement it in Oracle (9i/10g) ?
    Thank you for your help,
    Krist
    Supertype : Employee
    Employee_Number
    Employee_Name
    Address
    Employee_Type
    Date_Hired
    SubType : Hourly_Employee
    Hourly_Rate
    SubType : Salaried_Employee
    Annual_Salary
    Stock_Options
    SubType : CONSULTANT
    Contract_Number
    Billing_Rate

    Assuming you want to model this relationally, try something like this.
    http://groups-beta.google.com/group/comp.databases.oracle.server/msg/a23ffb19bfde2f20?hl=en
    Note its a generic SQL approach, and somewhat over fussy but I think the genral approach holds up for this type of relationship.
    I would sort of stay away from objects in the database, it over complicates everything else you will ever do.

  • How to implement 3DES algorithm in Hardaware

    Help !!!
    I am getting poor perfomance in implemeting 3DES algorithm by code, which i need to improve lot.
    Can i implement it using hardware. If yes HOw? please help ...
    thanks.

    If you can use JNI the problem is very simple to solve. Write a JNI function (in C) that calls some C/Assembly implementation of TripleDES. You must deploy a .DLL (WIndows) or .SO (Unix) with your app.
    Read the Sheng Liang's book, downloadable from ftp://ftp.javasoft.com/docs/specs/jni.pdf , and the JNI specification in Sun's site.
    The speediest way is to make your JNI function handle the file reading, writing and encrypting (pass only the file names and the key, or password).
    The interface between Java and C via JNI is slow and if you simply define a JNI function that receives byte arrays, encrypt them and returns encrypted byte arrays, you can have performance problems. If the byte array is too small, the Pure Java implementation could be even faster than your JNI solution.

  • How to implement C2 Audit in Oracle 10g Express Edition?

    Hi,
    I am developing a database using 10g Express Edition in which I need to implement c2 audit. I am planning to use triggers for this. Does anyone have a better method to implement audit in Express Edition?
    Thanks.

    I don't know what C2 audit exactly is, but before programming anything read this Security Guide chapters on Database Auditing http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/auditing.htm#i1011984 and http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/cfgaudit.htm#i1014788.
    All this should be available in XE also, except for Fine Grained Auditing, which is in Enterprise Edition only.
    If you are only interested in knowing when, who, did what command, including failed attempts than you don't have to program anything - you just define what activities you want to audit and set AUDIT_TRAIL initialization parameter to start auditing.
    You only need to write triggers if you need to catch column values before/after the change.

  • How to implement this algorithm with region growing ?

    hi,
    I would like to ask u to help me in developing code for the region growing segmentation algorithm for digital images.The algorithm perform
    1.Model I should use the average of the pixel(for each colorchanel,red-green-blue ) from the color I choose.
    2. Strating start by choosing an arbitrary seed pixel via 10X10 region and calculate the average of the region and compare it with neighbouring pixels.
    3. growing region is grown from the seed pixel by adding in neighbouring pixels that are similar , increasing the size of the region.
    4. stop when the growth of one region stops, then the program should try another direction. the growth is starting on the left and in the same direction as the rotating hands of a clock
    the whole process is stoped until the growth of all the direction stoped and choose a largest region with a bounding box. all the pixels in the bounding box is now similar.
    I really don't know , how can I do it?
    Please suggest the tips to develop or code if u have for this algorithm.
    Thanks for ur help

    Something you need to consider is what sort of data structure you will use to hold the result of a region that you are growing. One possibility is to keep a second black and white image that is simply a mask of the grown region, i.e. black in the areas that have been included and white in the areas not yet covered.
    You also need to determine a threshold for similarity. How close in color space must two pixels be in order that you consider them to belong to the same region. You will need a boolean function that compares two colors and returns true if they are similar.
    Finally, if you use a mask bitmap to indicate where you have been, you can proceed in the following sort of manner.
    You can sweep across the entire image array, first right to left, then top to bottom, then left to right, then bottom to top, cycling through these 4 directions until nothing changes.
    A single sweep will consist of a double nested for loop, one incrementing x and the other incrementing y. Inside the inner loop you are considering a single pixel at (x,y)
    So assume that you are sweeping from left to right, i.e. incrementing x
    You will be expanding the reagion at (x,y) only if
    a) mask(x-1,y) is black (i.e. the previous pixel is in the region.
    b) maks(x,y) is white (the current point is not in the region
    c) color of image at (x,y) is similar to color of region
    When you update the region you will
    a) color the mask at (x,y) black
    b) add the RGB from the image to TotalR,TotalG,TotalB in region
    c) increase point count for the region
    The point count for a region and the TotalR etc allow you to compute the average color of the region at any time. You can detect if a single pass changed anything by noticing if the pointCount changed between two passes
    This algorithm is not particularly efficient, because you keep sweeping over the entire array, but it is easy to comprehend and easy to code.
    Note: the hard part is determining a decent threshold for color similarity. everything else is very straight forward.
    Enjoy!

  • How to implement "Filtered Indexes" in Oracle?

    I know that function-based index can (kind-of) create index for only a portion of all the rows in a table,
    create index idx_abc_01 on t_abc (case when end_dt > '01-APR-2008' then end_dt else null end);
    /* to use the index, you have to use the same express in the filter clause */
    select * from t_abc where xyz in ('O', 'S', 'X') and
         case when end_dt > '01-APR-2008' then end_dt else null end
              between '12-JUL-2008' and '15-JUL-2008';But this approach is very inflexible because the expression in the where clause has to exactly match the index creation, otherwise that filtered index will not be used.
    MS SQL Server 2008 has a new feature called - Filtered Indexes
    CREATE NONCLUSTERED INDEX fidx_abc_01
        ON t_abc ( EndDate )
    WHERE EndDate > '20040401';
    select * from t_abc where EndDate between '20050121' and '20050130';[url http://msdn.microsoft.com/en-us/library/cc280372.aspx]Filtered Indexes can be very helpful in both OLTP and DW. I'm wondering how to get the same thing done in Oracle.
    Any suggestion beyond [url http://erturkdiriksoy.wordpress.com/2008/06/30/filtered-indexes-on-oracle/]Dunyada?

    In 11.2, if you're building a data warehouse (and assuming that implies you have the partitioning option), you can declare that certain partitions of a local index are unusable which prevents Oracle from building them. If T_ABC were partitioned on END_DT, that would allow arbitrary queries where Oracle could perform partition pruning to make use of the index if it was available for those partitions without the need for an exact expression match.
    Beyond that, if you are creating a function-based index, you would often want to create (or modify) the view that your application queries to specify the condition (i.e. a VW_RECENT_ABC that only has post-April, 2008 data) so that queries didn't have to specify the condition exactly.
    Justin

  • How to implement Dual Authentication in Oracle Apex

    Currently I am learning an oracle Apex tools. I am pretty confuse and not able to find any help for authentication scheme offered from oracle Apex. Like I would like to implement dual authentication scheme i.e. I want to implement Database Authentication and LDAP authentication. If user is fail in authenticate in Database Credential then I would like to check him in LDAP Credential. If user is present in LDAP credential then User is able to login. But if user is not present in any of them then again Login page should get displayed.
    Edited by: user2074688 on Jun 24, 2010 3:27 PM

    Dual Authentication doesn't exist as predefined Authentication Scheme, you need to program that yourself.
    So what you need to do is create a custom Authentication Scheme where you at first check user credentials against Database and then against LDAP.
    Have fun,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at

  • How to implement this algorithm ?

    Hello all,
    can u help me in implementing the following algorithm in java?
    1.suppose we start with a single pixel p and wish to expand from that seed pixel to fill a coherent region. lets define a similarity measure s(i,j) such that it produces a high result if pixels i and j are similar and a low one otherwise.
    first, consider a pixel q adjacent to pixel p. we can add pixel q to pixel p's region if S(p,q)>T for some threshold T. we can the proceed to the othr neighbors of p and do likewise.The process will continue till all the pixels in the image are labelled or belong to one region or the other.

    You may want to look at the various Connected components algorithms out
    there. These (tend to) recursively search the neighbours of the seed
    pixel and check for similarity. If the neighbours are similar to the
    seed they are marked as being in the same region. These algorithms can in general be made to run using a stack and while loop rather then using recursion (which on large images can get you into memory trouble very rapidly).
    A basic algorithm does the following
    create a second image containing ints. This image is the output from the algorithm. different regions have different integer numbers assigned to them. Ensure all pixels have -1 as their value.
    from your seed pixel check each of its neighbours in turn
    // the output image of integers
    private Image output;
    // the input image to process
    private Image input;
    // origin of the image is in the top left
    // assuming input image is greyscale and getPixel() / setPixel()
    // return Pixel objects. regionvalue should be greater then 0
    public void processPixel(int x, int y, Pixel compareTo, int regionValue)
       // am I similar to the pixel passed in
       // if so set my corresponding pixel in the output image
       if(isSimilar(input.getPixel(x,y),compareTo))
          output.getPixel(x,y).setGreyValue(regionValue);
       } else
          // i am not similar so bail out at let the caller check its
          // other neighbours
          return;
       //check north
       if( output.getPixel(x,y-1).greyValue() == -1)  // -1 means that its not been processed
          // this compares new pixel to this pixel
          processPixel(x,y-1,input.getPixel(x,y), regionValue);
       //check north east
      if( output.getPixel(x+1,y-1).greyValue() == -1)  // -1 means that its not been processed
          // this compares new pixel to the seed pixel
          // achives a different goal then the search for north given above
          // choose which goal suits you best
          processPixel(x+!,y-1,compareTo, regionValue);
       // check east
       //check south east
        //check north west
    // nope you are not mistaken all 8 neighbours may need to be checked if
    //  processing a greyscale image.
        return;
    }matfud

  • How can implement running total in oracle forms

    I want to implement a running total in oracle form
    like
    100 100
    300 400
    200 600
    500 1100
    200 1300
    100 1400
    PROCEDURE calculate_srno IS
    current_rownum     integer:=:System.Cursor_Record;
    starting_srno integer:=:rs_1;
    last_rownum integer;
    BEGIN
         last_record;
         last_rownum:=:system.cursor_record;
         go_record(1);
         FOR counter IN 1..last_rownum LOOP
              :sum_1:=:rs_1;
              :rs_1:=:sum_1+:rs_1;
         --     :offered_srno_to:=starting_srno;
              if last_rownum=:System.Cursor_Record then exit;
              end if;
         END LOOP;
    END;
    it is not working after want to insert between in the table

    Why write code for this? Oracle Forms 10g has Calculated/Summary fields that will do this for you without the need of writing any PL/SQL.
    Simply add a non-table item to the data block with the item you want to keep the running total for. Then change the following properties of the item:
    Data Type: Number
    Calculation Mode: Summary
    Summary Function: Sum
    Summarized Block: <Your Data Block>
    Summarized Item: <Your Block Item>
    Number of Items Displayed: 1 (if your item is in a Multi-Record (Tabular) layout else you don't need to change this property.
    You will also need to change the following property of the block: Query All Records: Yes
    If changing the Block's "Query All Records" property causes your form to be too slow because of the number of records in your block, then you could keep a running total manually by using a combination of the Post-Query and When-Validate-Item (WVI) triggers. If your block does not allow data entry, then you could do this with just the Post-Query trigger. For example:
    BEGIN
      /* This code sample assumes you have added a non-table item */
      /* to your block called SUMMARY.  */
      :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
    END;If your block allows data entry, then you would add the following to your existing WVI trigger.
    BEGIN
      /* Perform your data entry validation logic first... */
      IF ....
      ELSE
        ...Validation is successful...
        :YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
      END IF;
    END;Hope this helps.
    Craig...

  • How to implement parallel processing in oracle.

    Hi Gurus,
    In one our procedures we are calling 7 procedures internally. We want to execute them parallely insted of sequentially.
    Please help me to resolve this issue.
    thanks in advance...

    Hi,
    You have dbms_job package in Oracle 9i and dbms_scheduler from Oracle 10g.
    Though you can run all these procedures parallel submitting via dbms_job, any exception/error out in any of these procedures need to be handled explicitly. Just be aware that once you submit these jobs, your application loses control of the execution and you have to build a whole infrastructure for rerun in case of an exception(log/exception tables, monitoring application to periodically check the exception tables, alerts from procedures in case of an exception and so on ...)
    It's going to become more complex if you have any dependencies between these procedures.

  • How to implement simple replication with Oracle 8.0.5 ?

    Hello,
    I want to replicate some tables of my database's tables with simple replication :
    I use local naming configuration.
    Both databases have the same default ID ORCL.
    But every time I create a database link and I want to test it, I receive the message : "The link is not active!".
    So, if some DBA could help me, I will be very grateful.
    Thank you.

    Hi,
    In our project we are using this type. Since in this project server in UNIX(DEC) and client is running on windows. We have created a listener which always listen requests from client and doing the according to the request.
    Step1. create a request table, where u are inserting ur request.
    step2. create PRO*C proram, which is listening request on the table. If there is any request, call the imp (executable). This is happening on server side.
    Benifit. U can make a request from cleint and ftp the file client sit.
    Are u interested in more details and code, pls send a mail to me
    ---- Boby Jose Thekkanath
    [email protected]
    Dharma Computers(p) Ltd. Bangalore.
    null

  • How to implement Custom Authentication and Authorization in Oracle SOA 11g

    Can anyone please tell me, how to implement Custom Authentication in Oracle SOA 11g ?
    Because in Oracle SOA 10.1.3.4 , i have implemented this custom authentication and authorization by implementing BPMAuthenticationService, BPMAuthorizationService, BPMIdentityService to verify againt my database systems.
    implementation classes like the mentioned below
    1).
    public class SampleAuthenticationService extends SampleServiceBase implements BPMAuthenticationService {
    2).
    public class SampleAuthorizationService extends SampleServiceBase implements BPMAuthorizationService {
    3).
    public class SampleIdentityService extends SampleServiceBase implements BPMIdentityService {
    Please help me to implement the authentication and authorization in Oracle SOA 11g .
    thanks in advance

    To start with please go through following document
    http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/adptr_jms.htm
    http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm
    Regards
    Arpit

Maybe you are looking for

  • Accessing JavaScript function from an Applet?

    Hi, I've found how to access an applet's method from Jscript, but can we do the inverse? I'd like to refresh some frames in my web pages from my applet. The refresh of several frames could be done with a Jscript function but how can I call it from my

  • Multiple Spry tabbed panels?

    Is it possible to have more than one set of Spry Tabbed Panels .css rules, i.e., with different rules within the same web site? I'd like to have tabbed panels with differing heights or widths, but if the dimensions (and, obviously, other rules) are c

  • Identification of terms; default font, where is it?

    OK, I guess a spreadsheet (Appleworks) with rows and columns is now called a table and what is now called a spreadsheet is a whole new thing, kind of like a blank counter top on which to put tables and charts and such? I wish they would connect up ne

  • Read perticular collumn of xls file

    hi i have one data file in which i want to read 3rd column(c) and want to plot it with respect to time. help reuired please thanks Solved! Go to Solution. Attachments: 255.xls ‏19 KB

  • Phone will not lock when charging

    My phone will not Lock when charging through the computer or the wall socket. the screen will go dim only. it is ok in regular use