10gR2 Table Compression Question

I have a very large table (560GB, 12billion records) which I would like to compress.
This table has 6 partitions (range partition) and 24 subpartitons for each partition (hash partition)
Data in this table is never deleted (obviously).  Data is inserted daily via bulk load (SqlLoader)
Please make recommendations on how to compress using 10g compression.
Thank you,
Larry

903039 wrote:
I have a very large table (560GB, 12billion records) which I would like to compress.
This table has 6 partitions (range partition) and 24 subpartitons for each partition (hash partition)
Data in this table is never deleted (obviously).  Data is inserted daily via bulk load (SqlLoader)
Please make recommendations on how to compress using 10g compression.
Thank you,
Larry
The first thing you should do is fully document the business requirements you plan to implement. That document should include:
1. why you are compressing data - which you haven't told us by the way.
2. what data you intend to compress - new data? existing data? both?
3. to what extent is the data updated or deleted? and to what extent are 'normal' (i.e. not direct-path) INSERTs done?
4. what compression options are available - basic? advanced?
5. how you plan to TEST your compression options and validate the savings and problems with each of them. That testing should include deletes and updates.
6. how you plan to do the compression - online? in an outage windows? over one month and one subpartition at a time? other?
7. what your 'fallback' plan is if you need to undo part or all of the compression.
8. any opportunities for archiving older, unneeded data. If you plan to compress the existing data you need to move it so now is the time to offload any older, unneeded data.
For basic compression Oracle does NOT compress existing data in place. That means if you want the existing data compressed you need to MOVE it; and that means moving 560GB of data. If you want to compress new data you need to use BULK inserts; that means 'direct-path' inserts.
If you just want to start compressing new data you can do that fairly quickly since no existing data needs to be moved.
Don't even begin an operation like compression on a large table without a good requirements doc as suggested above.

Similar Messages

  • Do we have Table compression in Standard Edition

    Hi,
    We installed Oracle Version 11g(11.2.0.2) in our Local server and the size of the table is around 11GB. we thought of doing Table Compression. My Question is Are we having This feature in 11g Standard Edition?
    Thanks,
    Lakshmikanth

    Sorry short update...
    I found a old Thread here with same information about this issue.
    License for Table compression
    regards
    Peter

  • Query on Oracle Concepts: Table Compression

    The attributes for table compression can be declared for a tablespace, table, or table partition. If declared at the tablespace level, then tables created in the tablespace are compressed by default. You can alter the compression attribute for a table, in which case the change only applies to new data going into that table. Consequently, a single table or partition may contain compressed and uncompressed blocks, which guarantees that data size will not increase because of compression. If compression could increase the size of a block, then the database does not apply it to the block.
    Can anybody please explain text marked as bold? How can data-size/block-size can increase by compression?
    Regards,
    Ankit Rathi
    http://oraclenbeyond.blogspot.in

    >
    The attributes for table compression can be declared for a tablespace, table, or table partition. If declared at the tablespace level, then tables created in the tablespace are compressed by default. You can alter the compression attribute for a table, in which case the change only applies to new data going into that table. Consequently, a single table or partition may contain compressed and uncompressed blocks, which guarantees that data size will not increase because of compression. If compression could increase the size of a block, then the database does not apply it to the block.
    Can anybody please explain text marked as bold? How can data-size/block-size can increase by compression?
    >
    First let's be clear on what is being said. The doc says this:
    >
    If compression could increase the size of a block, then the database does not apply it to the block.
    >
    That is misleading because, of course, the size of the block can't change. You should really read that as
    >
    If compression could increase the size of the data being stored in a block, then the database does not apply it to the block.
    >
    There is overhead associated with the compression because the metadata that is needed to translate any compressed data back into its original state is stored in the block along with the compressed data.
    The simplest analogy (though not a perfect one) is the effect you can get if you try to zip an already highly compressed file.
    For example, if you try to use Winzip to compress an image file (jpg, gif, etc) or a video file you can easily wind up with a zip file that is larger than the uncompressed file was to begin with. That is because the file itself hardly compresses at all but the overhead of the zip file adds to the ultimate file size.
    I suggest you edit your thread subject since this question is NOT about partitioning.

  • Table Compression in 9.2.0.1

    Dear All,
    I need to use table compression. Could you please suggest some ideas from your practice?
    I tried to load 545 mb text file into database and compress it. the result of compression is not such significant I expected. I got 456 MB table. pctfree was set to 0.
    As I know oracle compresses data on Database block level.
    What happens if I sort text file? Will this increase the compression ratio? I mean duplicate rows will be located in same block.
    Sincerely,
    giviut

    Not having access to a 9i R2 database I have not been able to try this for myself. However, you may find this OTN article helpful: http://otn.oracle.com/oramag/webcolumns/2003/techarticles/poess_tablecomp.html
    Cheers, APC

  • Advanced Table Compression Create Table with LOBs

    Hi,
    I need some help with the Advanced Table Compression when creating a table especially when they contain a LOB.
    Here are 3 examples:
    Exp#1
    CREATE TABLE emp (
          emp_id NUMBER, 
          first_name VARCHAR2(128), 
          last_name VARCHAR2(128)
    ) COMPRESS FOR OLTP;
    This one is ok - all elements are compressed.
    Exp#2
    CREATE TABLE photos (
          photo_id NUMBER,
          photo BLOB)
          LOB(photo) STORE AS SECUREFILE (COMPRESS LOW);
    This one I am confused - is it just the LOB(photo) that is compressed or the whole table. If it is just the LOB then what syntax do I need for the whole table?
    I also assume that the LOB is being stored in the default tablespace associated with this table - correct me if I am wrong!
    Exp#3
    CREATE TABLE images (
          image_id NUMBER,
          image BLOB)
          LOB(image) STORE AS SECUREFILE (TABLESPACE lob_tbs COMPRESS);
    This one I am confused - I think it is telling me that LOB(image) is being compresses and stored in tablespace lob_tbs and the other elements are being stored uncompressed in the default tablespace.
    Again if it is just the LOB then what syntax do I need for the whole table?
    Thanks & regards
    -A

    Welcome to the forums !
    Pl post details of OS, database and EBS versions. Pl be aware that Advanced Compression is a separately licensed product. Pl see if these links help
    http://blogs.oracle.com/stevenChan/2008/10/using_advanced_compression_with_e-business_suite.html
    http://blogs.oracle.com/stevenChan/2008/11/early_benchmarks_using_advanced_compression_with_ebs.html
    http://blogs.oracle.com/stevenChan/2010/05/new_whitepaper_advanced_compression_11gr1_benchmar.html
    HTH
    Srini

  • Oracle table compression

    Can you please explain - how oracle compression works - It would be really good if things will be explained with examples - also would be very use if you post some useful links ...
    Will there be any performace problems if the table is compressed ..

    BelMan wrote:
    Table compression was designed primarily for read-only environments and can cause processing overhead for DML operations in some cases. However, it increases performance for many read operations, especially when your system is I/O bound
    http://download.oracle.com/docs/cd/B13789_01/server.101/b10752/build_db.htm
    Not necessarily true. Envision a table where you have 7 years worth of data (say for auditing purposes) partitioned monthly with only the current month being actively DML'd, the rest are for all intents and purposes read only and compressed.
    Table compression was designed to be designed with :)

  • The detail algorithm of OLTP table compress and basic table compress?

    I'm doing a research on the detail algorithm of OLTP table compress and basic table compress, anyone who knows, please tell me. 3Q, and also the difference between them

    http://www.oracle.com/us/products/database/db-advanced-compression-option-1525064.pdf
    Edited by: Sanjaya Balasuriya on Dec 5, 2012 2:49 PM
    Edited by: Sanjaya Balasuriya on Dec 5, 2012 2:49 PM

  • Oracle 10g: Table Compress

    Guys,
    I was reading an article about table compression that I was reading for data warehousing environment.
    http://www.oracle.com/technology/products/bi/db/10g/pdf/twp_data_compression_10gr2_0505.pdf
    I didnt understand couple of things like
    Oracle’s compression algorithm is based upon eliminating duplicate values in each block - what does eliminating duplicate values in each block mean
    ALTER TABLE ... MOVE COMPRESS works in 10g what is its equivalent in Oracle 9i.
    Also is there a concept of table compression in Oracle 9i
    Any inputs/suggestions would help
    Thanks

    what does eliminating duplicate values in each block meanThat a compression method. Have only once the same info. That doesn't drop from the table duplicate rows. Important phrase is here :
    "Duplicate values in all the rows and columns in a block are stored once at the beginning of the block, in what is called a symbol table for that block. All occurrences of such values are replaced with a short reference to the symbol table."
    Also is there a concept of table compression in Oracle 9iThere is such thing :
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_73a.htm#2128735
    Nicolas.

  • Table Compression with LOBs

    Hi,
    I need some help with the Advanced Table Compression when creating a table especially when they contain a LOB.
    Here are 3 examples:
    Exp#1
    CREATE TABLE emp (
          emp_id NUMBER, 
          first_name VARCHAR2(128), 
          last_name VARCHAR2(128)
    ) COMPRESS FOR OLTP;
    This one is ok - all elements are compressed.
    Exp#2
    CREATE TABLE photos (
          photo_id NUMBER,
          photo BLOB)
          LOB(photo) STORE AS SECUREFILE (COMPRESS LOW);
    This one I am confused - is it just the LOB(photo) that is compressed or the whole table. If it is just the LOB then what syntax do I need for the whole table?
    I also assume that the LOB is being stored in the default tablespace associated with this table - correct me if I am wrong!
    Exp#3
    CREATE TABLE images (
          image_id NUMBER,
          image BLOB)
          LOB(image) STORE AS SECUREFILE (TABLESPACE lob_tbs COMPRESS);
    This one I am confused - I think it is telling me that LOB(image) is being compresses and stored in tablespace lob_tbs and the other elements are being stored uncompressed in the default tablespace.
    Again if it is just the LOB then what syntax do I need for the whole table?
    Thanks & regards
    -A

    user12289108 wrote:
    Exp#2
    CREATE TABLE photos (
          photo_id NUMBER,
          photo BLOB)
          LOB(photo) STORE AS SECUREFILE (COMPRESS LOW);
    This one I am confused - is it just the LOB(photo) that is compressed or the whole table. If it is just the LOB then what syntax do I need for the whole table?
    I also assume that the LOB is being stored in the default tablespace associated with this table - correct me if I am wrong!
    SecureFile LOB compression is independent of table compression and vice versa - Oracle Database 11g: The Top New Features for DBAs and Developers | SecureFiles

  • Table Compression on Partitions

    Hi,
    Can any help how to implement Table compression on Partitions?
    Thanks in advance

    Here is two examples for you.
    Example 1. This table has two partitions. It has compression at the table level, one partition is compressed and one is not compressed
    SQL>create table test_compress1
    (t_id number(10),
    tname varchar2(30)) partition by range (t_id)
    (partition p0 values less than (50) compress
    ,partition p1 values less than (100) nocompress)
    compress ;
    Example 2. This table has two partitions. It has no compression at the table level, both partitions are compressed
    SQL>create table test_compress2
    (t_id number(10),
    tname varchar2(30)) partition by range (t_id)
    (partition p0 values less than (50) compress
    ,partition p1 values less than (100) compress);
    You can play with different options but you must ensure you read more about the limitations in your SQL Reference manual before using Compression for both table or partition.

  • Semantic-table compression

    Hi,
    How to compress semantic data in Oracle 11g.
    Please provide more details (example) for the table compression technique in semantic (11.2.0.3.0)

    Hi,
    Compressing the triple tables is highly recommanded for performance and storage reasons.
    However, if you are to enable versionning with Workspace Manager, it will fail during dbms_wm.disableversioning
    because the command dbms_wm.enableversioning only partially (with no exception) creates necessary oracle objects (triggers,...) on a compressed table.
    Full explanation is here [http://oracle-plsql10g.blogspot.com/2011/11/ora-20231-failed-during.html].
    (I'm not the author but I have had the same problem as described in the article).
    So, always compress triple table except if you use WM.
    Damien

  • License for Table compression

    License is required in Oracle 11g for advanced compression.
    For oracle 10g table compression, is the license required?

    The licensing guide of Oracle 11.1 makes a distinction between:
    Oracle Advanced Compression --> extra cost option on top of EE
    Direct-Load Table Compression --> No extra cost option, but requires EE
    The admin guide says:
    To enable compression for all operations you must use the COMPRESS FOR ALL OPERATIONS clause. To enable compression for direct-path inserts only, you use the COMPRESS FOR DIRECT_LOAD OPERATIONS clause. The keyword COMPRESS by itself is the same as the clause COMPRESS FOR DIRECT_LOAD OPERATIONS, and invokes the same compression behavior as previous database releases.
    So if you stick to the old way of compressing data (direct load), it is less efficient than the new way (all operations), but it does not require the extra license.
    Geert De Paep

  • Table compress  or Partition compress or both

    Hi,
    I have an oracle table with approx 250 Mill. records and approx size is around 35 gb.
    I want to save space by compressing the table.
    I am not sure which compression is more effective either table compress or partitions within table should be compressed or both ?
    Please advise,
    JP

    Hi,
    this is a compromise between manageablility and performance.
    If you work with partitions you give yourself a change to work with smaller sets of data (which under certain circumstances unload your DB with unecessary IOs).
    For the rest it (space efficiency) it depends highly on the nature of what you're compressing (normal columns, blob/clob, 'redundancy' of the data ...) and which method you're using (mormal compression, Advanced compression...)
    I would suggest you to try the different methods over a quite big sample of your table (with partitioning / not paritionning, with Advanced compression, normal compression).
    I would also test bulk inserts/update/deltes (with heavy volumes), and also try the main queries you're using against this table an compare IOs/CPU
    I suggest you to have a look to this thread:
    Implement Advanced compression
    (With such volumes, I guess you'll benefit (in most of the situation) from the compression...
    Edited by: user11268895 on Jul 22, 2010 11:11 AM

  • Question about table compression

    I administer several 10g databases, and have been asked to compress tables in several tablespaces. I am unfamiliar with using compression. I have read some Oracle documentation on the ALTER TABLE... MOVE COMPRESSION command, but still have several questions. Can anyone recommend a good white paper, or other documentation on how best to compress tables with existing data? Thank you in advance for your guidance!

    Basically, I have questions about how to select which tables will benefit from compression. I also read somewhere that, once a table has been compressed, new updates to the compressed data will not be compressed and so I will need to re-compress the tables periodically.
    I also needed to know if the ALTER TABLE statement will compress the existing data or just future inserted data. Through further research I found that by using the MOVE clause, it will compress the existing data. I will also need to rebuild the indexes once the ALTER TABLE statement is complete.
    Thank you for your help and encouragement!

  • The data from my web page insert in SQL table as question marks

    I use Farsi language in my web page for inserting customer data. The data that is inserted in webpage and submitted, showed as ???? in SQL table. A lot of developers say that I should use N' before the Unicode character, but I don't know how I can use it
    in my code. I attached the code. Can someone say me where I should insert the N in my code?
    protected void cmdInsert_Click(object sender, EventArgs e)
    //Checking the validation of required fields
    if (cboCustomerType.Text == "" || cboTitle.Text == "" || SearchableName.Text == "" ||
    FinalName.Text == "" || NationalID.Text == "" || BusinessID.Text == "" || MobilePhone.Text == "")
    lblStatus.Text = "لطفا فیلدهای اجباری را حتما پر کنید";
    return;
    //define ADO.NET objects.
    string insertSQL;
    insertSQL = "INSERT INTO Customers(";
    insertSQL += "CustomerType,CustomerTitle,CustomerFirstName,CustomerLastName,CompanyType,";
    insertSQL += "CompanyName,SearchableName,FinalName,NationalCode,BusinessID,City,Address,PostalCode,";
    insertSQL += "Zone,MobileNumber,WorkPhone1,WorkPhone2,HomePhone,FaxNumber,Email,Website,Note)";
    insertSQL += "VALUES('";
    insertSQL += cboCustomerType.Text + "','";
    insertSQL += cboTitle.Text + "','";
    insertSQL += CustomerFirstName.Text + "','";
    insertSQL += CustomerLastName.Text + "','";
    insertSQL += cboCompanyType.Text + "','";
    insertSQL += CompanyName.Text + "','";
    insertSQL += SearchableName.Text + "','";
    insertSQL += FinalName.Text + "','";
    insertSQL += NationalID.Text + "','";
    insertSQL += BusinessID.Text + "','";
    insertSQL += City.Text + "','";
    insertSQL += Address.Text + "','";
    insertSQL += PostalCode.Text + "','";
    insertSQL += Zone.Text + "','";
    insertSQL += MobilePhone.Text + "','";
    insertSQL += Phone1.Text + "','";
    insertSQL += Phone2.Text + "','";
    insertSQL += HomePhone.Text + "','";
    insertSQL += FaxNumber.Text + "','";
    insertSQL += Email.Text + "','";
    insertSQL += Website.Text + "','";
    insertSQL += Note.Text + "')";
    SqlConnection con = new SqlConnection(connectionString);
    SqlCommand cmd = new SqlCommand(insertSQL, con);
    //try to open the database and execute the insert
    int added = 0;
    try
    con.Open();
    added = cmd.ExecuteNonQuery();
    lblStatus.Text = added.ToString() + "اضافه شد";
    catch (Exception err)
    lblStatus.Text = "Error inserting record.";
    lblStatus.Text += err.Message;
    finally
    con.Close();
    //If the insert succeed, refresh the customer list.
    if (added > 0)
    FillCustomerList();
    Regards,

    Because you're composing the SQL statement with string concatenation, you would put the "N" before the single quote,
    VALUES(N'";
                insertSQL += cboCustomerType.Text + "',N'";
                insertSQL += cboTitle.Text + "',N'"; // ...etc
    However, composing SQL statements with string concatenation is not a suggested practice because it's open to SQL injection (see:
    https://technet.microsoft.com/en-us/library/ms161953(v=sql.105).aspx). A safer way to do this is to use command parameters to represent the values (see SqlCommand.Parameters
    property). If you use parameters, you can specify parameter data type as SqlDbType.NVarchar, which will ensure your text values are passed in as Unicode. Also ensure that the columns in question are defined in the database table definition as Unicode (NVARCHAR
    rather than VARCHAR).
    Hope this helps, Bob

Maybe you are looking for