Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Dave Moore
Neon Enterprise Software
Oracle ACE
Using Oracle since 1991
Product Author at Neon Enterprise Software
Creator of OracleUtilities.com
Author of “Oracle Utilities” from Rampant
Tech Press
Core competencies include performance,
utilities and data management
Database Archiving:
The process of removing selected data records from
operational databases that are not expected to be referenced
again and storing them in an archive data store where
they can be retrieved if needed.
Purge
Production
Database
Data
Extract
Recall
Database
Archive Store
Archive Data
Query Access Metadata Data &
Policies
History
Metadata
Archive
Administration
Why :
— Metadata changes frequently
— Applications are re-engineered periodically
– Change DBMS platform
– Change System platform
– Replace with new application
– Consolidate after merger or acquisition
Implications:
— Archive must support multiple variations of an application
— Archive must deal with metadata changes
How:
— Manage applications as major archive streams having
multiple minor streams with metadata differences
— Achieve independence from operating environment
Implications:
— Archive must encapsulate metadata
— Metadata must be improved
How:
— Metadata Capture, Validate, Enhance capabilities
— Store structure that encapsulates with data
— Keeps multiple versions of metadata
Why :
— Cannot depend on application environment
Implications:
— Full access capability within archive system
How:
— Industry standard interface (e.g. JDBC)
— LOAD format output for
– For load into a database
– May be different from source database
— Requires full and accurate metadata
— Ability to review metadata
— Ability to function across metadata changes
Why :
— Legal exposure for data kept too long
Implications:
— Data cannot be kept in archive beyond retention period
— Must be removed with no exposure to forensic software
How:
— Policy based discard
— System level function
— Tightly controlled and audited
— True “zero out” capability
— Discard from backups as well
Performance
Space
Compliance
Must be Available
Must Be Secure
Not Needed
DBA_SEGMENTS (bytes)
DBA_TABLES (num_rows)
or based on I/O
Self Managing
Mostly based on DATE
Utilize DBMS Features
— Partitioning
— Transportable Tablespaces
– Exchange Partition
– Set tablespace read only
– Expdp
– Copy export file and data file
P1 … … P47
Cheap as
Storage Profile Not so fast Fast,
you can get
or expensive expensive
Transportable Tablespaces
Exports
Backups
Oracle
Export Files & Import
Datafiles Version 16Z
Trans Tsp
Year 2007
Year 2030
Range Partitioning
Hash Partitioning
List Partitioning
Interval Partitioning
REF partitioning
SQL DELETE
CTAS / DROP / RENAME
TRUNCATE
Row Marking
DROP PARTITION
What would you do before you drop it?
Exchange partition with table
Transportable tablespace.
Begin
dbms_auto_task_admin.enable(
client_name => ‘auto optimizer stats collection’,
operation => NULL,
window_name => NULL);
END;
/
DROP or TRUNCATE
Multiple OTHER ways to do this depending on version
In v9 … alter table move tablespace [tsp name];
— Row movement must be enabled
— Tablespace must be a LMT
— Can move into same tablespace
— Will occupy 2X space temporarily
— Must then rebuild indexes
In v10 … alter table <table_name> shrink space;
Table created.
COUNT(*)
----------
296463
SQL> commit;
Nothing Changed !
Total blocks: 8
Unused blocks: 4
Unused bytes: 32768
Last Used Block: 4
Last Used Block ID: 5129
Last Used Ext File ID: 4
COL1
ON DELETE CASCADE
CHILD
Questions?