Need to create the Partition in the history table

Hello

I have an audit table that stores the data for the last 8 years in it and the customer wants to retain the data for the last 8 years. Now as adding data to this table is increasing, there is a delay in execution of report which are acquired by querying on this table.

Basically, they go a from date and to date. Then these date are compared with two columns of dates in the table. The condition of the query will be as below

TRUNC (NVL (DATE1, DATE2)) > = TRUNC (TO_DATE (?, ' dd/mm/yyyy ""))

AND TRUNC (NVL (DATE1, DATE2)) < = TRUNC (TO_DATE (?, ' dd/mm/yyyy ""))

Users can query for any date range.

I am thinking of creating a Partition of the range on this table for each month during the 8 years of data. Please suggest on the question of whether I should use partition interval range to make it more effective. And would also create an Index on this partition for the above two day columns.

12 (months) SO * 8 (years) = 98 would be created partitions. This will not overload the schema of database/Tablespace? Y at - it another effective way to set the table.

Please suggest and let me know for any clarification.

There are 2 approaches (but not limited to 2) to create the Partition on an existing table:

Note: There is no ALTER TABLE statement to convert a heap table to a partitioned table.

1. create a temporary Partitioned table with the same types of data in the column. Take a dump of the original table (HEAP) export and import the dump into the newly created partitioned intermediate table. After checking the data file the original and rename the interim even as the original table.

2 using the package Oracle DBMS_REDEFINITION automates the steps above from said (not exactly the same steps, however) and its done online - which means there is no required downtime, the original table may undergo DML operations during this process of redefinition. View partitioning of a table online with DBMS_REDEFINITION | Oracle instructor

According to my understanding if let us know as a partition interval then in April if there is an inserted record then it will create a new partition for the month of April will be of value less than 30 April 2014 "and all other documents created in April will pass under it"

Yes, it's a feature of 11g, which Oracle manages adding partitions as needed. In earlier versions DBA can add partitions manually from time to time. Reference www.gavinsoorma.com/2009/09/11g-interval-partitioning/

Here the reason for check the sent_out_datetime NVL will be NULL for few records, so in this case we want to get the records for dates of mapping them to received_datetime

In addition, try to replace the NVL with COALESCE and test it. This would help improve performance.

Tags: Database

Similar Questions

  • I created a custom and registered with a specific name date format. However, when I open a new worksheet, my saved format does not display in the menu drop-down? Am hoping that I don't need to create the same format for each new sheet?

    I created a custom and registered with a specific name date format. However, when I open a new worksheet, my saved format does not appear in the menu drop-down? Am hoping that I don't need to create the same format for each new sheet?

    You must save the spreadsheet containing the new date as a model format and use this custom template for each new spreadsheet where you want that this date format personalized at your disposal.

  • Problem steps Recorder error - you have not permissions to system files needed to create the specified output file.

    I am trying to use the PSR as a domain user, but get the following error message when you try to save my record:

    "You don't have permissions of system files needed to create the specified output file.
    If I run the present when logged in as a domain administrator, I can record without problem.  But when logged in as a domain user, I get the error.  I tried "Run as Administrator" as well as "Run as different user", enter the domain administrator credentials, but still get the error.
    Everyone knows about this problem?

    Hello Giblits,

    Because the computer is connected to a domain, it would be better on the TechNet forum. I suggest you post your question on the following link to get the exact resolution.

    http://social.technet.Microsoft.com/forums/en-us/category/w7itpro

  • I want to install windows on my new macbook and I need to create a partition. I have not now what size to make my windows partition. Can someone give me some advice?

    I want to install windows on my new macbook and I need to create a partition. I have not now what size to make my windows partition. Can someone give me some advice?

    1. in what year is your Mac?

    2. What is the size of your storage internal?

    3. what version of Windows?

    4 as a general rule 60-100 GB for W8 + / W10 is recommended. You can also create a minimum Windows (30-50 GB) and use an external drive D: for documents applications for portability.

  • How to create the logical tables &amp; how to give joints according to obiee 11g?

    Hello

    I have again to obiee 11g. I want to create the logical tables in MDB layer.

    After that I want to give joins according to MDB.

    I don't know, how to create the logical tables and how to give joints according to obiee 11g?

    Please help me.

    Thanks in advance,

    A.Kavya

    Hello

    The new logical table is right click on the MDB itself, for the join you generally in the business model diagram (again right click on objects).

    Maybe it's better if you start from a kind of tutorial to at least have an overview of what is happening where (layer business and physical layer etc.).

    Take a look at what Oracle has available: Oracle BI EE 11 g

    And no doubt, it can be a good start: https://apexapps.oracle.com/pls/apex/f?p=44785:24:0:NO:P24_CONTENT_ID, P24_PREV_PAGE:9787, 2

  • Why we need to create the package instead of procedure or function in Oracle

    Hello

    Recently, I attended an interview, they asked,
    why we must create the package instead of procedure or function in oracle. Is a specific advantage, if we create together.
    I'm not sure. can u tell me please someone.

    Thank you and best regards,
    Sanjeev.

    Hello

    A part of the oracle documentation.

    What is a PL/SQL Package?
    A package is a schema object which includes subroutines, variables, and logically related PL/SQL types. Packages have two parts: a specification (spec) and a body. Sometimes, the body is unnecessary. The specification is the interface to the package. It declares the types, variables, constants, exceptions, cursors, and subprograms that can be referenced from outside the package. The body defines queries for the sliders and the code for the subprogrammes.

    Benefits of the PL/SQL Packages
    Packages have a long history in software engineering, offering important characteristics for a reliable, maintainable, and reusable code, often in team for large systems development efforts.

    Modularity

    Packages allow you to logically encapsulate Associates types, elements, and subroutines in a module named PL/SQL. Each package is easy to understand, and the interfaces between packages are simple, clear and well defined. This facilitates the development of applications.

    Easier application design

    When you design an application, all you need initially is the interface information in the package specification. You can code and compile a spec without his body. Stored subprograms that reference the package can then be compiled as well. You should not set the package body entirely until you are ready to complete the application.

    Information masking

    With packages, you can specify which types, elements, and subprogrammes are (and accessible) public or private (hidden and inaccessible). For example, if a package contains four subprogrammes, three can be public and one private. The package hides the implementation of the subprogramme private so that only the package (not your application) is affected if the application changes. This simplifies maintenance and improvement. Also, by hiding the implementation details of the users, you protect the integrity of the packaging.

    Feature added

    Sliders and packed public variables persist for the lifetime of a session. They can be shared by all the subprogrammes that are running in the environment. They allow you to manage data in any of the transactions without storing in the database.

    Best performance

    When you call a subprogram packaged for the first time, the whole package is loaded into memory. Subsequent calls to related subprograms in package require no disk i/o.

    Packets stop cascading dependencies and avoid an unnecessary recompilation. For example, if you change the body of a packaged function, Oracle does not recompile other routines that call the function; These routines only depend on parameters and return value that are declared in the specification, so they are recompiled only if the specification changes.

  • Need to create the directory (folder) using phonegap (mobile jquery)

    In my application, I have a button field and text on each click I need to create a folder (folder create text file with text field data). I also read data from the text file. I also need to count the number of folder in this directory how it is it possible to phonegap + jquery mobile.

    is it possible to control this feature in office or I need device?

    I suggest you start here

    www.html5rocks.com/en/tutorials/file/filesystem/

    Its a good guide

  • Safari, taken in charge by the fake site FBI and money required for release, I need to delete the history data and the web to regain access.  How do I block it?

    Safari, supported by the fake site of the FBI and the money requested release. I have to delete the history data and the web to regain control. How do I block it?

    Lean on an adblock app. I use Weblock but there are other

    And if there is a particular site that you are attending that flat to the top of these malicious ads, well stop to go.

  • Need to create the profile and assign it to a user

    I created a profile,

    create the profile j_profile limit

    sessions_per_user 1

    Idle 5

    failed_login_attempts 3

    password_life_time 7

    password_resue_time 10

    password_verify_function by default;


    PROFILE

    also, I created a user rr and assigned to the profile,

    create user rr

    identified by rr

    Profile of j_profile;


    CREATED BY THE USER


    grant create session, resource to rr;


    Grant succeeded


    now I tried to use the command as:


    Select profile_resource_name, limit

    of dba_profile

    where profile = "j_profile";

    showing me 0RA - 00942:TABLE or VIEW IS NOT OUT


    can you get it someone please let me know the solution?



    name of the data dictionary is "sdba_profile".

  • How to create the new table by using the pertioned table

    Hello
    I use a partitioned table, now I want CPDR a new table with the same structure of my existing partitioned table.
    so can I use this syntax

    create the table abc_new as
    Select * from my_partitioned_table
    where 1 = 2;

    If I use this syntax, he would do the same my existing partitioned table structure?

    and

    When
    We use a syntax such as

    create the table abc_new as
    Select * from my_partitioned_table
    where 1 = 2;

    so he would also make the indexing on the new table if old table exists? If this isn't the case, then how can we create this indexing too at the time of execution of this syntax?


    regards

    N °

    Although the command would create a new table with the same column names and data types, it is NOT a partitioned table. You must explicitly specify the PARTITION BY clause and definitions of Partition when creating the table.

    Similarly, index definitions are not automatically copied. You must explicitly run the CREATE INDEX statements (which you can generate source using DBMS_METADATA. GET_DDL or by using any other tools/utilities).

    (However, if you use Export-Import - for example import to another schema, or to another database, it would create a table partitoned bearing the same name and with the same index definitions).

    Hemant K Collette

  • After you have created the encrypted table, I'm not able to view the records.

    Cheap DBA

    I created encrypted tablespace and table as follows.

    Step 1 - change the file sqlnet.ora as follows
    --------------------------------------------

    ENCRYPTION_WALLET_LOCATION =
    (SOURCE = (METHOD = FILE) (METHOD_DATA =
    (DIRECTORY = C:\ora11g\app\admin\AMAN\encryption_wallet\)))


    Step 2 - set the encrypted key
    ------------------------------
    Run the following at the command prompt:
    ------------------------------------------
    create a portfolio orapki - C:\ora11g\app\admin\AMAN\encryption_wallet portfolio - pwd abcd1234 auto_login

    Step 3 - create the encrypted Tablespace
    ------------------------------------
    CREATE TABLESPACE encrypted_ts
    DATAFILE 'C:\ora11g\app\oradata\AMAN\DATAFILE\encrypted_ts01.dbf' SIZE 128K
    AUTOEXTEND ON NEXT 64K
    ENCRYPTION USING "AES256".
    DEFAULT STORAGE (ENCRYPT);

    Step 4 - assign the user to the encrypted storage space;
    -----------------------------------------------------
    ALTER USER scott QUOTA UNLIMITED ON encrypted_ts;


    Step 5 - check space storage, encrypted or not.
    ------------------------------------------------
    SELECT nom_tablespace, encrypted from dba_tablespaces;

    Step 6 - Test of encryption.
    -------------------------
    CONN scott/tiger

    CREATE TABLE ets_test (id NUMBER (10), data TABLESPACE VARCHAR2 (50)) encrypted_ts;

    CREATE INDEX ets_test_idx ON ets_test encrypted_ts (data) TABLESPACE;

    INSERT INTO ets_test (id, data) VALUES (1, "it is a secret!) 1') ;

    COMMIT;

    _ Now I am interrogating the table it gave the following error

    C:\Documents and Settings\suresh gelda > sys/xxxx sqlplus as sysdba;

    SQL * more: version 11.1.0.6.0 - Production the sea may 4 08:41:39 2011

    Copyright (c) 1982, 2007, Oracle. All rights reserved.


    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > select * from scott.ets_test;
    Select * from scott.ets_test
    *
    ERROR on line 1:
    ORA-28374: typed master key could not be found in the portfolio


    SQL > ALTER SYSTEM SET PORTFOLIO OPEN IDENTIFIED BY "abcd1234";
    ALTER SYSTEM SET PORTFOLIO OPEN IDENTIFIED BY "abcd1234".
    *
    ERROR on line 1:
    ORA-28354: already open wallet

    SQL > conn scott/tiger
    Connected.
    SQL > select * from ets_test;
    Select * from ets_test
    *
    ERROR on line 1:
    ORA-28374: typed master key could not be found in the portfolio

    SQL >

    Best regards
    SG

    When you start Oracle Wallet Manager (OMG), could you please confirm if the automatic connection option is checked or not?

    Thank you
    Hussein

  • Creating the external Table to alert log

    Hello

    I create an external table in oracle database 11g for the alert log file monitoring (to find the ORA errors), I used this statement to create an external table

    Create the directory TESTForAlertLog as 'E:\oracle\product\10.2.0\admin\db\bdump '.

    create table Alert_Log)
    Message varchar2 (30),
    Date of the day
    )
    (external) Organization
    type oracle_loader
    Default directory TESTForAlertLog
    (settings) access
    records delimited by newline
    fields ended by ',' possibly framed by "" "
    missing field values are null
    (
    "Message."
    'DAY' DATE 'DD MM YYYY ".
    )
    )
    location ("alert_db.log")
    )
    reject limit unlimited;

    Output is

    DAY OF MSG

    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORA-1109 marked during: ALTER DATABASE CLOSE NORMAL...
    ORA-00313: open failed for the members of the group log 1 of thread 1
    ORA-00312: thread 1 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO01. JOURNAL"
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of the Group of newspapers wire 2 1
    ORA-00312: wire 2 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO02. JOURNAL"
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of Group 3, Journal of thread 1
    ORA-00312: wire 3 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO03. JOURNAL"
    ORA-27041: could not open the file
    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORACLE V10.2.0.1.0 - Production vsnsta = 0

    But I need the eyes of output like this


    DAY OF MSG

    ORACLE V10.2.0.1.0 - Production vsnsta = 0 lun 22 dec 13:10:48 2008
    ORACLE V10.2.0.1.0 - Production vsnsta = 0 lun 22 dec 13:10:48 2008
    ORA-1109 marked during: ALTER DATABASE CLOSE NORMAL...
    ORA-00313: open failed for the members of the group log 1 of thread 1
    ORA-00312: thread 1 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO01. JOURNAL"Mon dec 22 13:10:48 2008
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of the Group of newspapers wire 2 1
    ORA-00312: wire 2 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO02. JOURNAL"Mon dec 22 13:10:48 2008
    ORA-27041: could not open the file
    ORA-00313: open failed for the members of Group 3, Journal of thread 1
    ORA-00312: wire 3 1 online journal: ' E:\ORACLE\PRODUCT\10.2.0\ORADATA\db\REDO03. JOURNAL"Mon dec 22 13:10:48 2008
    ORA-27041: could not open the file
    ORACLE V10.2.0.1.0 - Production vsnsta = 0
    ORACLE V10.2.0.1.0 - Production vsnsta = 0

    I need the message and time of the message occurred

    No idea... is it possible to get this output...


    Thank U very much

    Concerning

    SHAN

    Read this - he explains how:
    http://www.singleQuery.com/2007/02/read-the-alert-log-with-SQL/

  • Select the last disk in the history table

    How to select the last record in a history table? the example data is
    < p >
    Product EffectiveDate

    prod1 01/01/1980

    prod1 01/01/1990

    prod1 01/01/2000

    prod2 02/02/1980

    prod2 02/02/2000
    < /p >
    < p >


    The expected result is



    Product EffectiveDate

    prod1 01/01/2000

    prod2 02/02/2000
    < /p >

    Assuming that there is a single line with max (effectivedate) for a given product

    SELECT product, attrib1, attrib2, ... , max_effective_date
      FROM (SELECT product,
                   attrib1,
                   attrib2,
                   ... ,
                   effectivedate,
                   max( effectivedate ) over (partition by product) max_effective_date
              FROM history_table)
     WHERE effectivedate = max_effectivedate
    

    should work.

    Justin

    Published by: Justin cave on October 30, 2008 18:32

    Formatting changes

  • Create the content table gives error since the site Explorer

    Hi all

    I'm new to the web sites of the centre.

    Trying to create the table from the Explorer of sites.

    Tied at the top of the screen for creating the table.table_creation.png

    Get above error after clicking OK.sites_explorer_error.png

    No idea what I can do wrong. I logged in Site Explorer using admin user 'fwadmin '.

    Another way, I can create table content?

    Thanks in advance...

    Kind regards

    Ganesh

    Hello

    As Stephan said, you must create the table with the ID. Also, I wanted to just mention that I did face some questions, creation or update of some tables because of fwadmin ACL.

    There is another default user who has these specific ACLs to work on the database:

    -name: ContentServer

    -password: password

    I hope this can help,

    Concerning

  • How to create the monthly table is created?

    Hi guys,.

    Impossible to create the table for each month in the analytical database, but to load the data in the previous table continues as the screenshot attached, schema user has the privilege of creation. We use Webcenter interaction 10gR 4.

    How to create monthly creating the table please?

    Thank you

    Katherine

    Hi Trevor,

    Thanks for your help.  We were able to create table and load data to attached Apr.

    However the analytical user privilege has changed the APR because of the operation of the server.

    Since then, there was a message saying that there is no permission to create tables in the crawl log.

    analytical user privilege was granted after checking this message, as I suspected, the problem occurred after you change the analytical user privilege.

    Currently, Analytics is granted with all the privileges.

    Any idea please?

    Thank you

    Kathy

Maybe you are looking for