Sie sind auf Seite 1von 64

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
HealthSouth Corporation
Largest provider of Inpatient
Rehabilitative Healthcare Services in the
United States, Operations in 26 States and
Puerto Rico

Network Comprised of Inpatient


Rehabilitation Hospitals, Long-term Acute
Care hospitals, Outpatient Rehabilitative
Satellites and Home Health agencies.
Approximately 22,000 Employees
250,000 Patients Served Annually at 120
Facilities with 1.64 Billion in Annual
Revenue
Environment

Customer Warehouse
° Kimball Design
Oracle 11gR2 (11.2.0.1.0)
° Two Node RAC Cluster
° Partitioning
° Advanced Compression
IBM P6 AIX 6.1
° EMC Storage
Patient Data Warehouse
Accounting
System

ERP 1.5 TB

Purchasing
Patient Data Warehouse
Accounting
System

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
Facing the challenges of ….

• Natural business growth


• Development of new applications
• Legal requirements to retain data longer
Sarbanes-Oxley
HIPAA Act of 2002
HITECH Act of 2009 (Part of ARRA)
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
Oracle Advanced Compression
Reduction in storage
Improved memory
Minimal or no performance impact on DML
Faster queries
Better network bandwidth utilization
Transparent to applications - no application
changes required
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
Determine a Data Retention Agreement (DRA)
Set & Meet Expectations of DRA

GROUP ROLE FUNCTION


Provides requirements for DRA
Business Business
which is used during the data
Unit process owner
lifecycle process
Provides technical expertise and
Technical Technical oversight during the data lifecycle
Resources Oversight process and documents terms of
DRA
Manages the terms of the DRA and
Technical Technical
provides proactive management of
Resources Lead
storage/disk space.
Subject
Technical Uses terms of DRA to execute the
Matter
Resources data archiving process
Expert
Data Lifecycle Management
New Project
Initiated

Determine
Data
Retention
New Agreement
Tables
Required Yes Document Communicate
DRA DRA
No

DRA No
End Process Terms
Data Yes
Retention Understood
Required Yes
No

Implement
End Process
DRA
Will the table be compressed
and how?
SQL> create table foo (col1
number) NOCOMPRESS;
SQL> create table foo (col1
number) COMPRESS FOR DIRECT_LOAD
OPERATIONS;
SQL> create table foo (col1
number) COMPRESS FOR ALL
OPERATIONS;

* COMPRESS FOR ALL OPERATIONS option


requires the COMPATIBLE initialization
parameter to be set to 11.1.0 or higher.
How much data will be stored in
production tables?
Two years + Current Year

Active Customers

Sanitized Data
Where will the production data
reside and for how long?

foo.dmp

Archive Archive Archive


Tables Database Data File
When can the data be moved
to tape?

$ls
arch_aqadm.dmp arch_odsgl04.dmp
arch_od_hist.dmp arch_aqadm1.dmp
arch_odsgl2.dmp arch_olockwd.dmp
arch_dwdiag.dmp arch_odsgl50.dmp
$
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
Target Top Tables
SQL> select owner, segment_name,
segment_type, tablespace_name,
round(sum(bytes)/1024/1024/1024,2) GB
from dba_segments
where segment_type like '%TABLE%'
and tablespace_name like 'TBLSXL'
group by owner, segment_name,
segment_type, tablespace_name
Having round(sum(bytes)/1024/1024/1024,2)
> .9
order by 5 desc
Initial 20 Target Tables

OWNER SEGMENT_NAME SEGMENT_TYPE TABLESPACE GB


TABLE
OPS WRK_ATT_ACCT_TXN_DTL PARTITION TBLSPXL 73
TABLE
ODSCOM MST_COM_DPT PARTITION TBLSPXL 39
TABLE
OPS FCT_ATT_ACCT_TXN_DTL PARTITION TBLSPXL 35
ADM DIM_ATT_SCD TABLE TBLSPXL 34
OPS SUM_AGING TABLE TBLSPXL 26
ODSCOM STG_COM_PT TABLE TBLSPXL 19
STG DIM_ATT_SCD TABLE TBLSPXL 18
TABLE
OPS FCT_PAT PARTITION TBLSPXL 18
TABLE
OPS SUM_AGING PARTITION TBLSPXL 16
ATTENP WK_SNAPSHOT TABLE TBLSPXL 15
SUM_AGING
SQL>

RECORD COUNT

228,073,031
SUM_AGING
SQL> select count (distinct
dbms_rowid.rowid_block_number(rowid))
"TABLE BLOCK COUNT"
from lovoyh.SUM_AGING; RECORD COUNT

TABLE BLOCK COUNT 228,073,031


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

TABLE BLOCK COUNT 228,073,031


-----------------
TABLE BLOCK
1099868
COUNT
SQL> select avg(count(*)) "AVERAGE RECORDS
PER BLOCK"
1,099,868
from lovoyh.SUM_AGING group by AVERAGE
dbms_rowid.rowid_block_number(rowid) RECORDS PER
BLOCK
AVERAGE RECORDS PER BLOCK
-------------------------
207.4
207.364003
SUM_AGING_COMPRESSED
SQL>
SUM_AGING_COMPRESSED
SQL> create table
lovoyh.SUM_AGING_COMPRESSED
tablespace DBRCTA01
compress for all operations as RECORD COUNT
select * from lovoyh.SUM_AGING;
228,073,031
Table created.

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

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

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

SQL>
SUM_AGING_COMPRESSED
SQL>

RECORD COUNT

228,073,031
TABLE BLOCK
COUNT
SUM_AGING_COMPRESSED
SQL> select count (distinct
dbms_rowid.rowid_block_number(rowid))
"TABLE BLOCK COUNT"
from lovoyh.SUM_AGING_COMPRESSED; RECORD COUNT

TABLE BLOCK COUNT 228,073,031


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

TABLE BLOCK COUNT 228,073,031


-----------------
TABLE BLOCK
272630
COUNT
SQL> select avg(count(*)) "AVERAGE RECORDS
PER BLOCK"
272,630
from lovoyh.SUM_AGING_COMPRESSED group by AVERAGE
dbms_rowid.rowid_block_number(rowid) RECORDS PER
BLOCK
AVERAGE RECORDS PER BLOCK
-------------------------
836.6
836.566156
SUM_AGING_COMPRESSED
SQL>

RECORD COUNT

228,073,031
TABLE BLOCK
COUNT

272,630
AVERAGE
RECORDS PER
BLOCK

836.6
SUM_AGING_COMPRESSED
SQL> select segment_name,
round(sum(bytes)/1024/1024/1024,2) GB
from dba_segments
where segment_name like 'SUM_AGING%‘ RECORD COUNT
group by segment_name
228,073,031
TABLE BLOCK
SEGMENT_NAME GB COUNT

---------------- ----- 272,630


SUM_AGING_COMPRESSED 5.68
AVERAGE
SUM_AGING 26.8
RECORDS PER
BLOCK

836.6
SUM_AGING_COMPRESSED
SUM_AGING

RECORD COUNT

RECORD COUNT
228,073,031
TABLE BLOCK
228,073,031 COUNT
TABLE BLOCK
COUNT
272,630
AVERAGE
1,099,868 RECORDS PER
BLOCK
AVERAGE
RECORDS PER
BLOCK
836.6
207.4
SUM_AGING_COMPRESSED
SUM_AGING

RECORD COUNT

228,073,031
26.8 GB RECORD COUNT
TABLE BLOCK
228,073,031 COUNT
compressed to TABLE BLOCK
272,630
COUNT
5.68 GB 1,099,868 AVERAGE
RECORDS PER
BLOCK
AVERAGE
RECORDS PER
BLOCK
836.6
207.4
Final Stages of the Lifecycle

Archive Tables

Archive to Database

Archive to Disk .dmp

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,
Partitioning, &
Views

SQL> select * from SUM_AGING union all


Select * from ARCH_SUM_AGING_COMPRESSED
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.par

DIRECTORY=DATAPUMP_ARCHIVE
DUMPFILE=arch_sum_aging.dmp
LOGFILE=arch_sum_aging.log
COMPRESSION=ALL
TABLES=LOVOYH.SUM_AGING_COMPRESSED
arch_sum_aging.par: END

.dmp
Data Pump to Disk
$ more arch_sum_aging.par

DIRECTORY=DATAPUMP_ARCHIVE
DUMPFILE=arch_sum_aging.dmp
LOGFILE=arch_sum_aging.log
COMPRESSION=ALL
TABLES=LOVOYH.SUM_AGING_COMPRESSED
arch_sum_aging.par: END

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

Table truncated.

SQL>

.dmp
Data Pump to Disk with COMPRESSION=ALL
Connected to: Oracle Database 11g Enterprise Edition Release
11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters and Automatic Storage
Management options
Starting "SYSTEM"."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.661 GB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "LOVOYH"."SUM_AGING_COMPRESSED" 2.281 GB
228073031 rows
Master table "SYSTEM"."SYS_EXPORT_TABLE_01" successfully
loaded/unloaded
*********************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
/arch/arch_sum_aging.dmp
Job "SYSTEM"."SYS_EXPORT_TABLE_01" successfully completed at 15:14:51
.dmp
Data Pump to Disk with COMPRESSION=ALL
Connected to: Oracle Database 11g Enterprise Edition Release
11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters and Automatic Storage
Management options
Starting "SYSTEM"."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.661 GB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "LOVOYH"."SUM_AGING_COMPRESSED" 2.281 GB
228073031 rows
Master table "SYSTEM"."SYS_EXPORT_TABLE_01" successfully
loaded/unloaded
*********************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
/arch/arch_sum_aging.dmp
Job "SYSTEM"."SYS_EXPORT_TABLE_01" successfully completed at 15:14:51
.dmp
Data Pump to Disk without COMPRESSION=ALL
Connected to: Oracle Database 11g Enterprise Edition Release
11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters and Automatic Storage
Management options
Starting "SYSTEM"."SYS_EXPORT_TABLE_02": system/********
parfile=arch_sum_aging2.par
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 5.661 GB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "LOVOYH"."SUM_AGING_COMPRESSED" 23.52 GB
228073031 rows
Master table "SYSTEM"."SYS_EXPORT_TABLE_02" successfully
loaded/unloaded
**********************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_02 is:
/arch/arch_sum_aging2.dmp
Job "SYSTEM"."SYS_EXPORT_TABLE_02" successfully completed at 15:39:57
.dmp
Data Pump to Disk without COMPRESSION=ALL
Connected to: Oracle Database 11g Enterprise Edition Release
11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters and Automatic Storage
Management options
Starting "SYSTEM"."SYS_EXPORT_TABLE_02": system/********
parfile=arch_sum_aging2.par
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 5.661 GB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "LOVOYH"."SUM_AGING_COMPRESSED" 23.52 GB
228073031 rows
Master table "SYSTEM"."SYS_EXPORT_TABLE_02" successfully
loaded/unloaded
**********************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_02 is:
/arch/arch_sum_aging2.dmp
Job "SYSTEM"."SYS_EXPORT_TABLE_02" successfully completed at 15:39:57
.dmp
Archive to Tape

$ls
arch_aqadm.dmp arch_odsgl04.dmp
arch_od_hist.dmp arch_aqadm1.dmp
arch_odsgl2.dmp arch_olockwd.dmp
arch_dwdiag.dmp arch_odsgl50.dmp
$
433 GB in Total Savings
Original Size Compressed Size Savings
Table Type (GB) (GB) (GB)
Archive Table 91.9 18.8 73
Fact Table 59.6 15.9 43.8
Staging Table 37.5 10.5 27
Fact Table 30 15.9 14.1
Fact Table 25 7.7 17.4
Summary Table 24.6 4.4 20.2
Fact Table 24.4 11.1 13.3
Fact Table 23.7 10.8 12.9
Fact Table 17 7.1 10
Archive Table 16.4 6.6 9.7
433 GB in Total Savings
The storage savings of the
initial 20 tables was
approximately 165 GB by using
compression.

Compressed 95 tables out of


865 total tables in the
warehouse
Successes

400 GB to 600 GB per year


growth to 10 GB in 2009
1.5 TB
Current database size 500 GB

Total Savings ~1.5 TB from


DEV, QA, & Backup
1.5 TB 1.5 TB 1.5 TB

Dev QA Backup
Successes

400 GB to 600 GB per year


growth to 10 GB in 2009
500 GB
Current database size 500 GB

Total Savings ~1.5 TB from


DEV, QA, & Backup
500 500 500
GB GB GB
Dev QA Backup
Next Steps
PeopleSoft Financials
PeopleSoft HR/Payroll
Intranet
Thank You

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

Das könnte Ihnen auch gefallen