Using Oracle Advanced Compression 11g to Manage Data from Cradle to Grave

Henry Lovoy – Data Manager HealthSouth Corporation, Birmingham, AL

Conservation & Efficiency .

Agenda • • • • • • Overview Challenges Solution Process Successes Question & Answers .

Operations in 26 States and Puerto Rico Network Comprised of Inpatient Rehabilitation Hospitals. Long-term Acute Care hospitals.000 Employees 250.000 Patients Served Annually at 120 Facilities with 1.HealthSouth Corporation Largest provider of Inpatient Rehabilitative Healthcare Services in the United States. Approximately 22.64 Billion in Annual Revenue . Outpatient Rehabilitative Satellites and Home Health agencies.

1 ° EMC Storage .Environment Customer Warehouse ° Kimball Design Oracle 11gR2 (11.0) ° Two Node RAC Cluster ° Partitioning ° Advanced Compression IBM P6 AIX 6.2.0.1.

Patient Accounting System

Data Warehouse

ERP

1.5 TB

Purchasing

Patient Accounting System

Data Warehouse

ERP

1.5 TB

Purchasing

1.5 TB

1.5 TB

1.5 TB

Dev

QA

Backup

Increased Storage Cost

Additional Backup Space and Window

• Natural business growth • Development of new applications • Legal requirements to retain data longer HIPAA Sarbanes-Oxley Act of 2002 HITECH Act of 2009 (Part of ARRA) .Facing the challenges of ….

400 GB per year growth Warehouse Growth 1200 1000 800 GB 600 400 200 0 Date 2006 2006 2006 2007 2007 2007 2007 2007 2007 2007 2008 2008 2008 08 11 12 03 04 05 07 08 09 12 01 02 06 .

no application changes required .Oracle Advanced Compression Reduction in storage Improved memory Minimal or no performance impact on DML Faster queries Better network bandwidth utilization Transparent to applications .

.

Began work on the Data Warehouse .

Purchased Advanced Compression .

Upgrade to 11g R1 .

Move to Production .

Full Production .

Data Lifecycle Management Design Manage your data before it is in the database Manage Maintain your data while active Archive Determine a time when the data is no longer useful .

Start in the development phase Be part of the design process Partner with development .

Uses terms of DRA to execute the data archiving process Technical Resources Technical Resources .Determine a Data Retention Agreement (DRA) Set & Meet Expectations of DRA GROUP ROLE FUNCTION Business Unit Technical Resources Provides requirements for DRA Business which is used during the data process owner lifecycle process Provides technical expertise and Technical oversight during the data lifecycle Oversight process and documents terms of DRA Technical Lead Subject Matter Expert Manages the terms of the DRA and provides proactive management of storage/disk space.

Data Lifecycle Management New Project Initiated Determine Data Retention Agreement New Tables Required Yes No Document DRA Communicate DRA End Process Data Retention Required Yes DRA Terms Understood No Yes Implement DRA No End Process .

1. .Will the table be compressed and how? SQL> create table foo (col1 number) NOCOMPRESS. SQL> create table foo (col1 number) COMPRESS FOR ALL OPERATIONS. SQL> create table foo (col1 number) COMPRESS FOR DIRECT_LOAD OPERATIONS.0 or higher. * COMPRESS FOR ALL OPERATIONS option requires the COMPATIBLE initialization parameter to be set to 11.

How much data will be stored in production tables? Two years + Current Year Active Customers Sanitized Data .

dmp Archive Tables Archive Database Archive Data File .Where will the production data reside and for how long? foo.

dmp arch_odsgl50.dmp arch_od_hist.dmp arch_dwdiag.dmp arch_odsgl2.dmp .dmp $ arch_odsgl04.dmp arch_olockwd.When can the data be moved to tape? $ls arch_aqadm.dmp arch_aqadm1.

Data Lifecycle Management Design Re-design Manage your data before after it is in the database Manage Maintain your data while active Archive Determine a time when the data is no longer useful .

9 order by 5 desc . segment_name. tablespace_name Having round(sum(bytes)/1024/1024/1024. round(sum(bytes)/1024/1024/1024.2) > . segment_type. tablespace_name.2) GB from dba_segments where segment_type like '%TABLE%' and tablespace_name like 'TBLSXL' group by owner.Target Top Tables SQL> select owner. segment_name. segment_type.

Initial 20 Target Tables OWNER OPS ODSCOM OPS ADM OPS ODSCOM STG OPS OPS ATTENP SEGMENT_NAME WRK_ATT_ACCT_TXN_DTL MST_COM_DPT FCT_ATT_ACCT_TXN_DTL DIM_ATT_SCD SUM_AGING STG_COM_PT DIM_ATT_SCD FCT_PAT SUM_AGING WK_SNAPSHOT SEGMENT_TYPE TABLE PARTITION TABLE PARTITION TABLE PARTITION TABLE TABLE TABLE TABLE TABLE PARTITION TABLE PARTITION TABLE TABLESPACE GB TBLSPXL TBLSPXL TBLSPXL TBLSPXL TBLSPXL TBLSPXL TBLSPXL TBLSPXL TBLSPXL TBLSPXL 73 39 35 34 26 19 18 18 16 15 .

031 .073.SUM_AGING SQL> RECORD COUNT 228.

SUM_AGING.rowid_block_number(rowid)) "TABLE BLOCK COUNT" from lovoyh.868 .099.SUM_AGING SQL> select count (distinct dbms_rowid.073.031 TABLE BLOCK COUNT 1. TABLE BLOCK COUNT ----------------1099868 SQL> RECORD COUNT 228.

868 AVERAGE RECORDS PER BLOCK AVERAGE RECORDS PER BLOCK ------------------------207.073.SUM_AGING SQL> select count (distinct dbms_rowid.rowid_block_number(rowid) RECORD COUNT 228.SUM_AGING group by dbms_rowid.099.4 .364003 207. TABLE BLOCK COUNT ----------------1099868 SQL> select avg(count(*)) "AVERAGE RECORDS PER BLOCK" from lovoyh.SUM_AGING.rowid_block_number(rowid)) "TABLE BLOCK COUNT" from lovoyh.031 TABLE BLOCK COUNT 1.

SUM_AGING_COMPRESSED SQL> .

SUM_AGING_COMPRESSED tablespace DBRCTA01 compress for all operations as select * from lovoyh.SUM_AGING_COMPRESSED SQL> create table lovoyh. Table created.073.SUM_AGING. SQL> RECORD COUNT 228.031 .

SUM_AGING. Table created. SQL> RECORD COUNT 228.031 .SUM_AGING_COMPRESSED tablespace DBRCTA01 compress for all operations as select * from lovoyh.SUM_AGING_COMPRESSED SQL> create table lovoyh.073.

------------ENABLED OLTP DISABLED RECORD COUNT 228.073. compression. compress_for from dba_tables where table_name in ('SUM_AGING'.SUM_AGING_COMPRESSED SQL> select table_name.031 SQL> . TABLE_NAME -------------------SUM_AGING_COMPRESSED SUM_AGING COMPRESSION COMPRESS_FOR ----------.'SUM_AGING_COMPRESSED').

.'SUM_AGING_COMPRESSED').SUM_AGING_COMPRESSED SQL> select table_name. COMPRESSION ----------ENABLED DISABLED ENABLED COMPRESS_FOR ------------OLTP BASIC RECORD COUNT 228. compression..073. compress_for from dba_tables where table_name in ('SUM_AGING'. TABLE_NAME -------------------SUM_AGING_COMPRESSED SUM_AGING .031 SQL> .

073.SUM_AGING_COMPRESSED SQL> RECORD COUNT 228.031 TABLE BLOCK COUNT .

031 TABLE BLOCK COUNT 272.rowid_block_number(rowid)) "TABLE BLOCK COUNT" from lovoyh. TABLE BLOCK COUNT ----------------272630 SQL> RECORD COUNT 228.SUM_AGING_COMPRESSED SQL> select count (distinct dbms_rowid.073.SUM_AGING_COMPRESSED.630 .

6 .630 AVERAGE RECORDS PER BLOCK AVERAGE RECORDS PER BLOCK ------------------------836.rowid_block_number(rowid) RECORD COUNT 228.SUM_AGING_COMPRESSED.SUM_AGING_COMPRESSED group by dbms_rowid.rowid_block_number(rowid)) "TABLE BLOCK COUNT" from lovoyh.SUM_AGING_COMPRESSED SQL> select count (distinct dbms_rowid.566156 836.073. TABLE BLOCK COUNT ----------------272630 SQL> select avg(count(*)) "AVERAGE RECORDS PER BLOCK" from lovoyh.031 TABLE BLOCK COUNT 272.

6 .SUM_AGING_COMPRESSED SQL> RECORD COUNT 228.073.630 AVERAGE RECORDS PER BLOCK 836.031 TABLE BLOCK COUNT 272.

630 AVERAGE RECORDS PER BLOCK 836. round(sum(bytes)/1024/1024/1024.073.2) GB from dba_segments where segment_name like 'SUM_AGING%‘ group by segment_name RECORD COUNT 228.SUM_AGING_COMPRESSED SQL> select segment_name.68 26.8 272.6 .031 TABLE BLOCK COUNT SEGMENT_NAME ---------------SUM_AGING_COMPRESSED SUM_AGING GB ----5.

6 207.099.073.630 AVERAGE RECORDS PER BLOCK 1.868 AVERAGE RECORDS PER BLOCK 836.4 .073.031 TABLE BLOCK COUNT 272.SUM_AGING_COMPRESSED SUM_AGING RECORD COUNT RECORD COUNT 228.031 TABLE BLOCK COUNT 228.

073.4 .868 AVERAGE RECORDS PER BLOCK 836.SUM_AGING_COMPRESSED SUM_AGING RECORD COUNT 26.68 GB RECORD COUNT 228.099.6 207.8 GB compressed to 5.073.630 AVERAGE RECORDS PER BLOCK 1.031 TABLE BLOCK COUNT 272.031 TABLE BLOCK COUNT 228.

dmp .Final Stages of the Lifecycle Archive Tables Archive to Database Archive to Disk Archive to Tape .

Archive Tables Keep separate archive tables in production Use Compression. Partitioning. & Views .

Archive Tables Keep separate archive tables in production Use Compression. & Views SQL> select * from SUM_AGING union all Select * from ARCH_SUM_AGING_COMPRESSED . Partitioning.

Archive Database Oracle database links between production and archive .

Archive Database Oracle database links between production and archive SQL> select * from SUM_AGING union all Select * from ARCH_SUM_AGING_COMPRESSED@ARCHPROD .

Data Pump to Disk $ more arch_sum_aging.dmp LOGFILE=arch_sum_aging.dmp .par DIRECTORY=DATAPUMP_ARCHIVE DUMPFILE=arch_sum_aging.par: END .SUM_AGING_COMPRESSED arch_sum_aging.log COMPRESSION=ALL TABLES=LOVOYH.

Data Pump to Disk $ more arch_sum_aging.par: END .log COMPRESSION=ALL TABLES=LOVOYH.dmp LOGFILE=arch_sum_aging.dmp .SUM_AGING_COMPRESSED arch_sum_aging.par DIRECTORY=DATAPUMP_ARCHIVE DUMPFILE=arch_sum_aging.

SQL> .SUM_AGING_COMPRESSED Table truncated.dmp .Data Pump to Disk SQL> TRUNCATE TABLE LOVOYH.

exported "LOVOYH"..661 GB Processing object type TABLE_EXPORT/TABLE/TABLE .0 .. Real Application Clusters and Automatic Storage Management options Starting "SYSTEM"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded ********************************************************************* Dump file set for SYSTEM.1."SYS_EXPORT_TABLE_01" successfully completed at 15:14:51 .2.0.Data Pump to Disk with COMPRESSION=ALL Connected to: Oracle Database 11g Enterprise Edition Release 11. .dmp ."SUM_AGING_COMPRESSED" 2.dmp Job "SYSTEM".SYS_EXPORT_TABLE_01 is: /arch/arch_sum_aging."SYS_EXPORT_TABLE_01": system/******** parfile=arch_sum_aging.par Estimate in progress using BLOCKS method. Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 5.281 GB 228073031 rows Master table "SYSTEM".64bit Production With the Partitioning.

SYS_EXPORT_TABLE_01 is: /arch/arch_sum_aging."SUM_AGING_COMPRESSED" 2.2. Real Application Clusters and Automatic Storage Management options Starting "SYSTEM"..0 ."SYS_EXPORT_TABLE_01": system/******** parfile=arch_sum_aging.661 GB Processing object type TABLE_EXPORT/TABLE/TABLE . Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 5."SYS_EXPORT_TABLE_01" successfully loaded/unloaded ********************************************************************* Dump file set for SYSTEM.dmp .dmp Job "SYSTEM".281 GB 228073031 rows Master table "SYSTEM".0. .Data Pump to Disk with COMPRESSION=ALL Connected to: Oracle Database 11g Enterprise Edition Release 11. exported "LOVOYH"."SYS_EXPORT_TABLE_01" successfully completed at 15:14:51 .64bit Production With the Partitioning..1.par Estimate in progress using BLOCKS method.

"SYS_EXPORT_TABLE_02": system/******** parfile=arch_sum_aging2."SUM_AGING_COMPRESSED" 23.0.dmp Job "SYSTEM".1.SYS_EXPORT_TABLE_02 is: /arch/arch_sum_aging2. .dmp .661 GB Processing object type TABLE_EXPORT/TABLE/TABLE .Data Pump to Disk without COMPRESSION=ALL Connected to: Oracle Database 11g Enterprise Edition Release 11. Real Application Clusters and Automatic Storage Management options Starting "SYSTEM"..par Estimate in progress using BLOCKS method.0 ."SYS_EXPORT_TABLE_02" successfully loaded/unloaded ********************************************************************** Dump file set for SYSTEM.64bit Production With the Partitioning.52 GB 228073031 rows Master table "SYSTEM". Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 5."SYS_EXPORT_TABLE_02" successfully completed at 15:39:57 .. exported "LOVOYH".2.

. exported "LOVOYH".dmp .1.64bit Production With the Partitioning.."SYS_EXPORT_TABLE_02": system/******** parfile=arch_sum_aging2.52 GB 228073031 rows Master table "SYSTEM"."SYS_EXPORT_TABLE_02" successfully completed at 15:39:57 .."SYS_EXPORT_TABLE_02" successfully loaded/unloaded ********************************************************************** Dump file set for SYSTEM.2.0 .661 GB Processing object type TABLE_EXPORT/TABLE/TABLE .dmp Job "SYSTEM". Real Application Clusters and Automatic Storage Management options Starting "SYSTEM". Processing object type TABLE_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 5.par Estimate in progress using BLOCKS method.Data Pump to Disk without COMPRESSION=ALL Connected to: Oracle Database 11g Enterprise Edition Release 11."SUM_AGING_COMPRESSED" 23.0.SYS_EXPORT_TABLE_02 is: /arch/arch_sum_aging2.

Archive to Tape $ls arch_aqadm.dmp arch_aqadm1.dmp arch_dwdiag.dmp arch_olockwd.dmp .dmp arch_odsgl2.dmp arch_odsgl50.dmp arch_od_hist.dmp $ arch_odsgl04.

8 27 14.7 .9 25 7.6 Savings (GB) 73 43.9 37.9 18.4 6.6 15.1 23.4 11.4 20.1 17.9 10 9.1 16.5 10.7 24.8 17 7.6 4.5 30 15.433 GB in Total Savings Table Type Archive Table Fact Table Staging Table Fact Table Fact Table Summary Table Fact Table Fact Table Fact Table Archive Table Original Size Compressed Size (GB) (GB) 91.4 24.3 12.7 10.8 59.2 13.

Compressed 95 tables out of 865 total tables in the warehouse .433 GB in Total Savings The storage savings of the initial 20 tables was approximately 165 GB by using compression.

QA.Successes 400 GB to 600 GB per year growth to 10 GB in 2009 Current database size 500 GB 1. & Backup 1.5 TB Dev QA Backup .5 TB 1.5 TB 1.5 TB Total Savings ~1.5 TB from DEV.

5 TB from DEV. & Backup 500 GB 500 GB 500 GB Dev QA Backup .Successes 400 GB to 600 GB per year growth to 10 GB in 2009 Current database size 500 GB 500 GB Total Savings ~1. QA.

Next Steps PeopleSoft Financials PeopleSoft HR/Payroll Intranet .

com .Thank You Henry Lovoy Data Manager HealthSouth Corporation (205) 969-5622 henry.lovoy@healthsouth.