280 likes | 773 Views
Migration to Exadata. Arup Nanda Longtime DBA and now DMA. What Is This Session About?. Various Methods for Migrating Application from non-Exadata to Exadata Will use only three commonly used methods skip well understood methods, e.g. backup/restore discuss tips and gotchas.
E N D
Migration to Exadata Arup Nanda Longtime DBA and now DMA
What Is This Session About? • Various Methods for Migrating Application from non-Exadata to Exadata • Will • use only three commonly used methods • skip well understood methods, e.g. backup/restore • discuss tips and gotchas Migration to Exadata
Why Migration is Necessary • Exadata is • Oracle 11.2 Database • ASM Storage • Clustered • If source system is different from any one of the above, it becomes complex Migration to Exadata
Considerations for Migration • Source • Data • O/S, Storage • Changes to data layout • Re-partitioning, sorting • Downtime tolerance • Is compression needed • Changes to • block size • datafile layout • characterset • extent size Migration to Exadata
Logical Migration • Data Pump Export/Import • Pros • Restructuring is possible • Data layout, sorting, partitioning, • Charactersets • Cons • Time Source Exadata File File Migration to Exadata
Saving Time • Fiber makes it fast to export • Extra NIC Card helps in import • You can use all the nodes of Exadata for import • You can use another intermediate server for NFS Source Machine Exadata Node1 NFS Exadata Node2 Switch Source Fiber Source Migration to Exadata
Tips • Put the Exadata DB in NOARCHIVELOG mode • Pre-create all the tablespaces with autoextend on • Create the empty table structure • Disable triggers and constraints (incl. PK and UK) alter table xyz disable trigger t1; alter table xyz disable constraint c1; • Create indexes after import • With parallel degree and NOLOGGING • Enable triggers and constraints with novalidate alter table xyz enable constraint c1 novalidate; Migration to Exadata
Tips Contd. • Performs a Metadata Export from Source $ expdp … contents=metadata_only • Import this into Exadata $ impdp … full=y • This will create all objects and grants • Do this twice to make sure you get all the objects Migration to Exadata
Precreate all Tables • Pre-create all the tables by SQLFILE $ impdp … sqlfile=cr_tables.sql include=TABLE • This will create an SQL script containing all the tables. • If you decide to use a multibytecharacterset, here is your chance: create table xyz ( col1 varchar2(20 BYTE) …) • Change to create table xyz ( col1 varchar2(20 CHAR) …) Migration to Exadata
Create Index Scripts • Create index creation scripts for all indexes by schema $ impdp … contents=metadata_only schema=s1 sqlfile=s1_in.sql • Create all indexes after the schema’s table import is complete • Grant Privileges after the indexes are created • Create all constraints after the indexes are created and privileges granted Migration to Exadata
Other Tips • Compression $ expdp … COMPRESSION=ALL • Helps if you are I/O bound but have enough CPU • Parallel Export and Import $ expdp … PARALLEL=n DUMPFILE=exp%U.dmp Migration to Exadata
Sample Sequence • Export all Metadata • Create all objects (no data) in Exadata, except MVs • Disable triggers, constraints and drop indexes • Export all data from source • Import all data to Exadata • Create indexes of the schema after it’s imported • Enable constraints and triggers • Import Metadata one last time Migration to Exadata
CTAS • Create database link to Source create table s1.xyz nologging as select * from s1.xyz@link1; • Create indexes after the table is imported • Grant all privileges • Re-enable constraints and triggers after the index is created Source Machine Exadata Node1 NFS Exadata Node2 Switch Source Migration to Exadata
DPI • Pre-create all tables • With privileges, triggers, etc. but not indexes or constraints • Direct Path Insert over DB Link insert /*+ append */ into xyz select * from xyz@link1; • Can be parallelized • Can load partition by partition • Can load older partition ahead of time • Create indexes, etc. after the table load is over. • Fastest way overall Migration to Exadata
Sequence Time Insert T1 T1 Indexes Insert T2 T1 Constraints T2 Indexes Migration to Exadata
Tuning Network LISTENER.ORA LISTENER = (DESCRIPTION = (ADDRESS = … (SEND_BUF_SIZE=<wm>) (RECV_BUF_SIZE=<rm>) ) … /etc/sysctl.conf net.core.rmem_default = <rd> net.core.rmem_max = <rm> net.core.wmem_default = <rd> net.core.wmem_max = <wm> TNSNAMES.ORA DWP = (DESCRIPTION = (SDU=<ds>) (ADDRESS = … (SEND_BUF_SIZE=<rm>) (RECV_BUF_SIZE=<wm>) ) (CONNECT_DATA = … SQLNET.ORA DEFAULT_SDU_SIZE=<ds> Migration to Exadata
Transportable Tablespace Source Machine Exadata DB DB • Copy all the files • Import the metadata to plug-in • Plug in the tablespace Migration to Exadata
Byte Order Change • If the source system is big-endian, e.g. HP-UX, Solaris, AIX, etc., you can’t directly plug in • You will need to convert it to little endian first. RMAN> convert datafile myts1.dbf from platform 'HP-UX (64-bit)' db_file_name_convert '/mydb/myts1.dbf','+MYDG'; Migration to Exadata
Thank You! Migration to Exadata