SecureFiles Migration O R A C L E W H I T E P A P E R F E B R U A R Y

Similar documents
Veritas NetBackup and Oracle Cloud Infrastructure Object Storage ORACLE HOW TO GUIDE FEBRUARY 2018

Creating Custom Project Administrator Role to Review Project Performance and Analyze KPI Categories

Generate Invoice and Revenue for Labor Transactions Based on Rates Defined for Project and Task

An Oracle White Paper November Primavera Unifier Integration Overview: A Web Services Integration Approach

Tutorial on How to Publish an OCI Image Listing

Hybrid Columnar Compression (HCC) on Oracle Database 18c O R A C L E W H IT E P A P E R FE B R U A R Y

Load Project Organizations Using HCM Data Loader O R A C L E P P M C L O U D S E R V I C E S S O L U T I O N O V E R V I E W A U G U S T 2018

Oracle Secure Backup. Getting Started. with Cloud Storage Devices O R A C L E W H I T E P A P E R F E B R U A R Y

Oracle CIoud Infrastructure Load Balancing Connectivity with Ravello O R A C L E W H I T E P A P E R M A R C H

Oracle Data Provider for.net Microsoft.NET Core and Entity Framework Core O R A C L E S T A T E M E N T O F D I R E C T I O N F E B R U A R Y

Oracle DIVArchive Storage Plan Manager

Oracle Flashback Data Archive (FDA) O R A C L E W H I T E P A P E R M A R C H

JD Edwards EnterpriseOne Licensing

SecureFiles with Oracle Database 18c O R A C L E W H I T E P A P E R F E B R U A R Y

Correction Documents for Poland

Automatic Data Optimization with Oracle Database 12c O R A C L E W H I T E P A P E R S E P T E M B E R

An Oracle White Paper June Exadata Hybrid Columnar Compression (EHCC)

! "# " "$ %&' ($$$ )%&' *+),%&' -.*&*/

An Oracle White Paper September Security and the Oracle Database Cloud Service

Using the Oracle Business Intelligence Publisher Memory Guard Features. August 2013

August 6, Oracle APEX Statement of Direction

An Oracle White Paper December, 3 rd Oracle Metadata Management v New Features Overview

April Understanding Federated Single Sign-On (SSO) Process

Working with Time Zones in Oracle Business Intelligence Publisher ORACLE WHITE PAPER JULY 2014

Oracle Cloud Applications. Oracle Transactional Business Intelligence BI Catalog Folder Management. Release 11+

An Oracle White Paper October Advanced Compression with Oracle Database 11g

Deploy VPN IPSec Tunnels on Oracle Cloud Infrastructure. White Paper September 2017 Version 1.0

An Oracle White Paper February Optimizing Storage for Oracle PeopleSoft Applications

Leverage the Oracle Data Integration Platform Inside Azure and Amazon Cloud

RAC Database on Oracle Ravello Cloud Service O R A C L E W H I T E P A P E R A U G U S T 2017

Automatic Receipts Reversal Processing

Pricing Cloud: Upgrading to R13 - Manual Price Adjustments from the R11/R12 Price Override Solution O R A C L E W H I T E P A P E R A P R I L

Installation Instructions: Oracle XML DB XFILES Demonstration. An Oracle White Paper: November 2011

Hard Partitioning with Oracle VM Server for SPARC O R A C L E W H I T E P A P E R J U L Y

StorageTek ACSLS Manager Software Overview and Frequently Asked Questions

Oracle NoSQL Database For Time Series Data O R A C L E W H I T E P A P E R D E C E M B E R

Oracle WebLogic Portal O R A C L E S T A T EM EN T O F D I R E C T IO N F E B R U A R Y 2016

Using Oracle In-Memory Advisor with JD Edwards EnterpriseOne

Configuring Oracle Business Intelligence Enterprise Edition to Support Teradata Database Query Banding

WebCenter Portal Task Flow Customization in 12c O R A C L E W H I T E P A P E R J U N E

October Oracle Application Express Statement of Direction

Loading User Update Requests Using HCM Data Loader

Achieving High Availability with Oracle Cloud Infrastructure Ravello Service O R A C L E W H I T E P A P E R J U N E

Oracle Business Activity Monitoring 12c Best Practices ORACLE WHITE PAPER DECEMBER 2015

Handling Memory Ordering in Multithreaded Applications with Oracle Solaris Studio 12 Update 2: Part 2, Memory Barriers and Memory Fences

Migration Best Practices for Oracle Access Manager 10gR3 deployments O R A C L E W H I T E P A P E R M A R C H 2015

Oracle NoSQL Database Parent-Child Joins and Aggregation O R A C L E W H I T E P A P E R A P R I L,

Oracle Data Masking and Subsetting

An Oracle White Paper October Deploying and Developing Oracle Application Express with Oracle Database 12c

Oracle JD Edwards EnterpriseOne Object Usage Tracking Performance Characterization Using JD Edwards EnterpriseOne Object Usage Tracking

Frequently Asked Questions Oracle Content Management Integration. An Oracle White Paper June 2007

Repairing the Broken State of Data Protection

Bastion Hosts. Protected Access for Virtual Cloud Networks O R A C L E W H I T E P A P E R F E B R U A R Y

Oracle Exadata Statement of Direction NOVEMBER 2017

Oracle Fusion Configurator

Oracle Spatial and Graph: Benchmarking a Trillion Edges RDF Graph ORACLE WHITE PAPER NOVEMBER 2016

Oracle Advanced Compression. An Oracle White Paper June 2007

Cloud Operations for Oracle Cloud Machine ORACLE WHITE PAPER MARCH 2017

Migrating VMs from VMware vsphere to Oracle Private Cloud Appliance O R A C L E W H I T E P A P E R O C T O B E R

Oracle Communications Interactive Session Recorder and Broadsoft Broadworks Interoperability Testing. Technical Application Note

DATA INTEGRATION PLATFORM CLOUD. Experience Powerful Data Integration in the Cloud

An Oracle White Paper October Release Notes - V Oracle Utilities Application Framework

Oracle Clusterware 18c Technical Overview O R A C L E W H I T E P A P E R F E B R U A R Y

TABLE OF CONTENTS DOCUMENT HISTORY 3

Siebel CRM Applications on Oracle Ravello Cloud Service ORACLE WHITE PAPER AUGUST 2017

Deploying Custom Operating System Images on Oracle Cloud Infrastructure O R A C L E W H I T E P A P E R M A Y

Establishing secure connections between Oracle Ravello and Oracle Database Cloud O R A C L E W H I T E P A P E R N O V E M E B E R

Technical Upgrade Guidance SEA->SIA migration

Optimizing Storage with SAP and Oracle Database 12c O R A C L E W H I T E P A P E R M A Y

PeopleSoft Fluid Navigation Standards

Oracle Service Registry - Oracle Enterprise Gateway Integration Guide

Extreme Performance Platform for Real-Time Streaming Analytics

An Oracle White Paper September Upgrade Methods for Upgrading to Oracle Database 11g Release 2

VISUAL APPLICATION CREATION AND PUBLISHING FOR ANYONE

An Oracle White Paper August Building Highly Scalable Web Applications with XStream

Oracle JD Edwards EnterpriseOne Object Usage Tracking Performance Characterization Using JD Edwards EnterpriseOne Object Usage Tracking

Oracle Enterprise Performance Reporting Cloud. What s New in September 2016 Release (16.09)

See What's Coming in Oracle CPQ Cloud

Benefits of an Exclusive Multimaster Deployment of Oracle Directory Server Enterprise Edition

Transitioning from Oracle Directory Server Enterprise Edition to Oracle Unified Directory

Implementing Information Lifecycle Management (ILM) with Oracle Database 18c O R A C L E W H I T E P A P E R F E B R U A R Y

Subledger Accounting Reporting Journals Reports

Configure ODBC on ISE 2.3 with Oracle Database

Oracle Enterprise Data Quality New Features Overview

Oracle NoSQL Database Parent-Child Joins and Aggregation O R A C L E W H I T E P A P E R M A Y,

Oracle Database 12c: JMS Sharded Queues

CONTAINER CLOUD SERVICE. Managing Containers Easily on Oracle Public Cloud

NOSQL DATABASE CLOUD SERVICE. Flexible Data Models. Zero Administration. Automatic Scaling.

Oracle Advanced Compression Helps Global Fortune 500 Company Meet Storage Savings Initiative O R A C L E W H I T E P A P E R F E B R U A R Y

Technical White Paper August Recovering from Catastrophic Failures Using Data Replicator Software for Data Replication

An Oracle White Paper July Methods for Downgrading from Oracle Database 11g Release 2

An Oracle White Paper September, Oracle Real User Experience Insight Server Requirements

An Oracle White Paper June StorageTek In-Drive Reclaim Accelerator for the StorageTek T10000B Tape Drive and StorageTek Virtual Storage Manager

Oracle Database Vault

MySQL CLOUD SERVICE. Propel Innovation and Time-to-Market

New Oracle NoSQL Database APIs that Speed Insertion and Retrieval

Oracle Database Exadata Cloud Service Exadata Performance, Cloud Simplicity DATABASE CLOUD SERVICE

Oracle Service Cloud Agent Browser UI. November What s New

Product Release Notes

Integrating Oracle SuperCluster Engineered Systems with a Data Center s 1 GbE and 10 GbE Networks Using Oracle Switch ES1-24

Transcription:

SecureFiles Migration O R A C L E W H I T E P A P E R F E B R U A R Y 2 0 1 8

Table of Contents Disclaimer 1 Introduction 2 Using SecureFiles 2 Migration Techniques 3 Migration with Online Redefinition 4 Moving to SecureFiles without Migration 10 Conclusion 12 Disclaimer The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. 1 P a g e S e c u r e F i l e s M i g r a t i o n

Introduction In Oracle Database 8i, Oracle introduced the ability to store large unstructured and semistructured data as Large Objects (LOBs. In Oracle Database 11g Release 1, Oracle introduced a new LOB storage mechanism Oracle SecureFiles, which enables File system-like performance for LOBs. The previous LOB storage mechanism was called BasicFiles. In general, Oracle customers have typically seen performance improvements of 3x-6x, with some seeing even larger gains, by migrating to SecureFiles from BasicFiles. In order to get these gains, data stored in the older (BasicFile format needs to be migrated to the SecureFiles storage format. SecureFiles represents a completely new storage paradigm for Large Objects stored in the Oracle Database. It is a complete redesign and reimplementation of LOB storage. Because of the significant changes that were required to all structures and algorithms in all levels of the database code stack to create the significant performance gains SecureFiles demonstrate, it was impossible to keep on-disk compatibility with the original LOB implementation. Thus, it is impossible to perform an in-place migration from BasicFiles to SecureFiles. SecureFiles are 100% backward compatible with the various LOB APIs in the system, and migrating to SecureFiles requires no code changes to any application. This document is intended to help Database Administrators and other technical professionals decide the best way to migrate from BasicFiles to SecureFiles. Oracle Database 12c Release 2 (12.2 is available in the cloud, with Oracle Cloud at Customer, and on-premises. Using SecureFiles Requirements To use SecureFiles, the Oracle Database parameter compatible must be set to 11.1.0.0.0 or higher. Also, the tablespace the SecureFiles LOB segment (column/partition/sub-partition resides in must be configured as SEGMENT SPACE MANAGEMENT AUTO (an ASSM tablespace. Specifying SecureFiles To specify that a LOB segment be a stored as a SecureFiles, you use the SECUREFILE keyword as part of the LOB storage clause. The SECUREFILE keyword is tightly bound to the STORE AS phrase. So, in all cases where LOB storage is being specified, SECUREFILE will directly follow STORE AS and come before any other additional keywords or specifiers that might otherwise follow STORE AS. 2 P a g e S e c u r e F i l e s M i g r a t i o n

SQL DDL examples: LOB Storage Clause The SECUREFILE keyword comes after STORE AS and before the optional segment name: LOB(c_lob STORE AS SECUREFILE myclob XMLType Storage Clause For XMLType storage, the SECUREFILE keyword comes after STORE AS and before CLOB or BINARY XML. CLOB storage: XMLTYPE myxmltype STORE AS SECUREFILE CLOB BINARY XML (BLOB storage: XMLTYPE myxmltype STORE AS SECUREFILE BINARY XML VARRAY Storage For VARRAY Storage, again, the SECUREFILE keyword follows STORE AS, and either a LOB segment name or other storage options must be specified: VARRAY arr1 STORE AS SECUREFILE LOB arr1lob Or alternatively: VARRAY arr1 STORE AS SECUREFILE LOB (CACHE Migration Techniques There are several ways to migrate your applications to use SecureFiles. You can migrate entire tables to use SecureFiles storage or you can migrate a partition at a time. The methods to migrate to SecureFiles are as follows: Online Redefinition We recommend Online Redefinition as the preferred method of migration as it allows the database and the table being migrated to be online during the migration process. There are two ways of migrating using Online Redefinition: a. Redefine the entire table b. Redefine a partition at a time ALTER TABLE ADD PARTITION If you do not have a need to migrate your existing data to SecureFiles, but want the performance going forward, you can create new partitions with SecureFiles storage going forward. 3 P a g e S e c u r e F i l e s M i g r a t i o n

Creating a Partitioned Table from a Non-Partitioned Table If your table currently isn t partitioned, it is possible to leave all the current data as-is and partition your table so that new data is stored as SecureFiles. We highly recommend one of the two Online Redefinition methods of migrating to SecureFiles. A Simple Example Throughout this document, we will be using a simple partitioned table with one LOB column for our examples. The example is kept simple for clarity of explaining the principles behind the various ways to migrate from BasicFiles to SecureFiles. However, the prescribed methodologies should apply to all schemas. Sample Table create table table1( lob (c_lob store as (tablespace tbs_1 partition by range(c_id ( partition tab1_p1 values less than (1000000, partition tab1_p2 values less than (2000000, partition tab1_p3 values less than (3000000, partition tab1_p4 values less than (4000000; Migration with Online Redefinition The simplest and recommended method for migrating from BasicFiles (or LONGs to SecureFiles is to use Online Redefinition. There are many benefits to using Online Redefinition for migration: 1. The data is migrated while this system is up and available. 2. When complete all LOB data is stored in the SecureFiles storage format, and all the features and performance of SecureFiles are immediately available to your applications. 3. Addition of features such as Advanced LOB Compression, Advanced LOB Deduplication and Encryption can be done as the data is being migrated. Online Redefinition requires free space equal to of the table/partition being migrated. However, migrating a single partition at a time can mitigate this. Online redefinition uses materialized views to make the migration seamless. As the data is migrated, any changes to the source table will be picked up in the destination table. At the end of the migration, the source and destination table names are swapped so that all new updates and queries will operate against the new table. Upon completion, the destination table now holds the original data and can be dropped. Migrating an entire table 4 P a g e S e c u r e F i l e s M i g r a t i o n

This method works whether or not your table is partitioned. To migrate an entire table via online redefinition, you simply create a new table with the properties you want, in our case the LOB columns are SecureFiles, and migrate the data to that table. On completion, you can drop this newly created table, as it will be holding the original, pre-migration, data. During the migration more than 2x the space is required for the original table and LOBs. This is because the data will be stored in two locations, the original table and the migration table. Upon completion of the migration, the original data can be dropped and the space can be reused. If compression and deduplication are used on the destination SecureFiles columns, the amount of space required will be reduced appropriately. Please see the Administrator s Guide for more information/restrictions of online redefinition. Let s look at a simple example of Online Redefinition of a simple table with a single LOB column. Our source table definition: create table table1( lob (c_lob store as (tablespace tbs_1 partition by range(c_id ( partition tab1_p1 values less than (1000000, partition tab1_p2 values less than (2000000, partition tab1_p3 values less than (3000000, partition tab1_p4 values less than (4000000; Our destination table definition: create table table1_int( lob(c_lob store as SecureFile (tablespace tbs_sf1 partition by range(c_id ( partition tab1_sf_p1 values less than (1000000, partition tab1_sf_p2 values less than (2000000, partition tab1_sf_p3 values less than (3000000, partition tab1_sf_p4 values less than (4000000; Note: tbs_sf1 is an ASSM tablespace. Notice two significant changes to the original table definition. They are in bold above. The tablespace is in bold to note that SecureFiles must be created in an ASSM tablespace. If you are still using MSSM tablespaces for your (BasicFile LOB data, you will need to create or allocate ASSM tablespaces to implement the use of SecureFiles. 5 P a g e S e c u r e F i l e s M i g r a t i o n

Performing the actual redefinition is simple. For our example, we ll assume the table above, and user Scott. Create the destination table (table1_int from above. 1. Start the redefinition: dbms_redefinition.start_redef_table( 'SCOTT', 'TABLE1', 'TABLE1_INT', 'C_ID C_ID, C_LOB C_LOB'; -- <SCHEMA>, <Source table>, <dest_table>, -- <Column mapping> source.col1 dest.col1 2. Copy the table dependents: dbms_redefinition.copy_table_dependents( 'SCOTT', 'TABLE1', 'TABLE1_INT', 1, true, true, true, false, error_count; 3. Finish the redefinition (swaps the table names: dbms_redefinition.finish_redef_table('scott', 'TABLE1', 'TABLE1_INT'; 4. (Optionally Drop the destination table: DROP TABLE SCOTT.TABLE1_INT; When this process completes, TABLE1 s LOB column will be a SecureFiles LOB column, TABLE1_INT will have TABLE1 s original definition. TABLE1_INT can now be dropped to remove the space used by the original table. Migrating an Entire Table and Enabling Advanced Features When performing Online Redefinition, it is possible to enable Advanced LOB Compression, Deduplication and/or Encryption (features of Oracle Advanced Compression and Oracle Advanced Security. You can do this simply by adding one or more of these advanced features to the LOB storage clause on the destination table: create table table1_int( lob(c_lob store as SecureFile ( tablespace tbs_sf1 compress low encrypt deduplicate partition by range(c_id ( partition tab1_sf_p1 values less than (1000000, partition tab1_sf_p2 values less than (2000000, partition tab1_sf_p3 values less than (3000000, partition tab1_sf_p4 values less than (4000000; 6 P a g e S e c u r e F i l e s M i g r a t i o n

Note: tbs_sf1 is an ASSM tablespace. When Online Redefinition to this destination table is complete the CLOB column will be in stored in a compressed, deduplicated and encrypted SecureFiles column. You can enable any advanced features, which are desired for the resulting SecureFiles data, during the migration. All of the other migration techniques discussed in this document can also have the advanced features enabled during migration. Online Redefinition of a Partitioned Table One Partition at a Time If you don t have the disk capacity to migrate your entire table at one time, and the table you are migrating is partitioned, you can use online redefinition to redefine each partition one at a time. The additional space requirement here is 1x your largest partition. Thus the space required is significantly less than the space required to store your entire table and all LOB columns. Extra space is only required to hold 1 partition at a time. In this case, we are going to operate on a partitioned table with the following definition: create table scott.table1( lob (c_lob store as (tablespace tbs_1 partition by range(c_id ( partition tab1_p1 values less than (1000000, partition tab1_p2 values less than (2000000, partition tab1_p3 values less than (3000000, partition tab1_p4 values less than (4000000; The basic methodology here is to create a non-partitioned table with the SecureFiles column and to migrate each partition individually. This allows us to do the migration and only requires enough excess space to store that partition s data. The actual steps to perform the redefinition are as follows: create table scott.table1_int( lob(c_lob store as SecureFile (tablespace tbs_sf1; declare i number; begin 7 P a g e S e c u r e F i l e s M i g r a t i o n

for i in 1.. 4 loop dbms_redefinition.start_redef_table( 'SCOTT', 'TABLE1', 'TABLE1_INT', NULL, dbms_redefinition.cons_use_pk, '', 'tab1_p' i; dbms_redefinition.finish_redef_table( 'SCOTT', 'TABLE1', 'TABLE1_INT', 'tab1_p' i; execute immediate 'drop table scott.table1_int'; execute immediate 'create table scott.table1_int(' ' ' ' ' ' lob(c_lob store as ' ' SecureFile ' ' (tablespace tbs_sf1'; end loop; end; / Performing the above steps will result in a table with the following definition: SQL> select dbms_metadata.get_ddl('table','table1','scott' from dual; CREATE TABLE "SCOTT"."TABLE1" ( "C_ID" NUMBER, "C_LOB" CLOB, PRIMARY KEY ("C_ID" USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 16384 NEXT 16384 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT TABLESPACE "SYSTEM" ALTER INDEX "SCOTT"."SYS_C004577" UNUSABLE ENABLE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE( BUFFER_POOL DEFAULT TABLESPACE "SYSTEM" LOB ("C_LOB" STORE AS BASICFILE ( TABLESPACE "TBS_1" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION NOCACHE LOGGING STORAGE( BUFFER_POOL DEFAULT PARTITION BY RANGE ("C_ID" (PARTITION "TAB1_P1" VALUES LESS THAN (1000000 PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 16384 NEXT 16384 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT TABLESPACE "SYSTEM" LOB ("C_LOB" STORE AS SECUREFILE ( TABLESPACE "TBS_SF1" ENABLE STORAGE IN ROW CHUNK 8192 NOCACHE LOGGING NOCOMPRESS KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 8 P a g e S e c u r e F i l e s M i g r a t i o n

PCTINCREASE 0 BUFFER_POOL DEFAULT NOCOMPRESS, PARTITION "TAB1_P2" VALUES LESS THAN (2000000 PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 16384 NEXT 16384 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT TABLESPACE "SYSTEM" LOB ("C_LOB" STORE AS SECUREFILE ( TABLESPACE "TBS_SF1" ENABLE STORAGE IN ROW CHUNK 8192 NOCACHE LOGGING NOCOMPRESS KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT NOCOMPRESS, PARTITION "TAB1_P3" VALUES LESS THAN (3000000 PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 16384 NEXT 16384 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT TABLESPACE "SYSTEM" LOB ("C_LOB" STORE AS SECUREFILE ( TABLESPACE "TBS_SF1" ENABLE STORAGE IN ROW CHUNK 8192 NOCACHE LOGGING NOCOMPRESS KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT NOCOMPRESS, PARTITION "TAB1_P4" VALUES LESS THAN (4000000 PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 16384 NEXT 16384 MINEXTENTS 1 MAXEXTENTS 505 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT TABLESPACE "SYSTEM" LOB ("C_LOB" STORE AS SECUREFILE ( TABLESPACE "TBS_SF1" ENABLE STORAGE IN ROW CHUNK 8192 NOCACHE LOGGING NOCOMPRESS KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT NOCOMPRESS It is important to note here that even though the partition definitions changed, the column definition did not. This means that the default LOB storage for any future partitions added will be BASICFILE and not SECUREFILE, as is desired. You will have to explicitly specify SecureFiles on any columns that you might add. As we have demonstrated, the use of online redefinition is simple and can be performed with the database online. This method also allows you to create the new partitions with advanced features such as compression, encryption or deduplication and have the migration process also perform those transformations on the data automatically. This is why we strongly recommend this method for migrating from BasicFiles to SecureFiles. 9 P a g e S e c u r e F i l e s M i g r a t i o n

Moving to SecureFiles without Migration Another possible method of migrating to SecureFiles is through the use of partitions. SecureFiles can be enabled on new partitions only, leaving the data in the older format as it is. So, new data will be stored in the high performance SecureFiles format and will be able to leverage advanced features. Old data will continue to reside in the old (BasicFile format and can be migrated at a later date, if desired. ALTER TABLE ADD PARTITION This method can be of particular use if your data is already partitioned by some monotonically increasing value (for example by date or via a sequence. In this case, you can simply define any new partitions you create to have SecureFiles storage for the LOB columns. For example, consider our simple range partitioned table: create table scott.table1( lob (c_lob store as (tablespace tbs_1 partition by range(c_id ( partition tab1_p1 values less than (1000000, partition tab1_p2 values less than (2000000, partition tab1_p3 values less than (3000000, partition tab1_p4 values less than (4000000; We can add a new partition for values less than 5000000 with a simple ALTER TABLE ADD PARTITION: ALTER TABLE table1 ADD PARTITION tab1_p5 VALUES LESS THAN (5000000 LOB(col3 STORE AS SecureFile (TABLESPACE tbs_sf1; After this is completed, all LOB data inserted with a c_id value between 4000000 and 4999999 will be stored as a SecureFiles. This will allow you have your data going forward be stored in SecureFiles. This single largest detractor from this is the older data still has the performance characteristics of BasicFiles since the original partitions are not migrated to SecureFiles. So, the performance characteristics of individual LOB accesses will be different across partitions. Also, the table definition didn t change, so you also must specify the LOB column is a SecureFiles every time you add a partition. The advantages here are you make no significant changes to your system. Assuming the data that is in the older partitions is references less and less, your application will continue to perform better as more of the data current working set is stored in SecureFiles. Creating Partitions from a Non-Partitioned Table If you do not have data that is already partitioned by date or some other strictly increasing or decreasing value, then you can artificially create a partitioning scheme by creating an artificial key and adding that 10 P a g e S e c u r e F i l e s M i g r a t i o n

key column to the existing table before the partition exchange. Here s our simple example again, but as a non-partitioned table: drop table table1; drop table table1_sf; create table table1( c_id number, lob (c_lob store as (tablespace tbs_1; create sequence table1_sf_key; create table table1_sf( c_id number,, partkey$ number default 1 lob (c_lob store as SecureFile (tablespace tbs_sf1 partition by range (partkey$( partition bf values less than (1 lob(c_lob store as BasicFile, partition sf values less than (MAXVALUE ; alter table table1 add (partkey$ number default 0; ALTER TABLE table1_sf EXCHANGE PARTITION bf WITH TABLE table1 WITHOUT VALIDATION UPDATE GLOBAL INDEXES; DROP TABLE table1; RENAME table1_sf TO table1; When this is complete, partition bf contains all the data with the LOBs stored as BasicFiles, and all data going forward will be stored as SecureFiles. If your table isn t partitioned, this could be an opportunity to add a more complicated partitioning scheme than the one provided here. 11 P a g e S e c u r e F i l e s M i g r a t i o n

Conclusion SecureFiles is a significant improvement in performance and features over the previous BasicFiles LOB storage mechanism. To take advantage of the performance and new features, the LOB data must be converted to the SecureFiles format. For migration of existing data from BasicFiles to SecureFiles, we recommend online redefinition. This can be performed at the table or partition level as is necessary for your particular situation. It can be performed while the system is online and available to your applications. However, the space taken during the redefinition is roughly equivalent to 2x the storage required to store the current tables, LOBs and dependent objects. If you are limited in the available disk space such that there isn t enough space to use temporarily while the online redefinition is being performed, or if you have LOB data that is used less over time, there are other methods of migrating to SecureFiles that don t require additional space. Oracle Corporation, World Headquarters Worldwide Inquiries 500 Oracle Parkway Phone: +1.650.506.7000 Redwood Shores, CA 94065, USA Fax: +1.650.506.7200 C O N N E C T W I T H U S blogs.oracle.com/oracle facebook.com/oracle twitter.com/oracle oracle.com Copyright 2017, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only, and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document, and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. 0218 12 P a g e S e c u r e F i l e s M i g r a t i o n