Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> ฐานข้อมูล

การแปลง Oracle 11i เป็นรูปแบบ Tablespace ของ Oracle Applications: คู่มือการย้ายข้อมูลแบบขั้นตอน

บล็อกนี้ครอบคลุมกระบวนการแปลงฐานข้อมูลเวอร์ชัน 11i ให้เป็นรูปแบบ Oracle Applications Tablespace Model (OATM) โดยใช้ OATM Migration Utility ที่มี 12 locally managed tablespaces สำหรับทุกผลิตภัณฑ์

บทนำ

OATM ถูกนำเสนอใน Oracle Applications และเรียกอีกอย่างว่า Consolidated Tablespace Model โดยใช้ 12 consolidated tablespaces (รวมถึง 3 system tablespaces: temporary, system และ undo segments) และรองรับ locally managed tablespaces OATM ถูกนำเสนอใน Release 11i.10 ก่อนหน้านี้ในการปล่อย 11i ของ Oracle E-Business Suite แต่ละผลิตภัณฑ์ได้รับการจัดสรร 2 tablespaces หนึ่งสำหรับข้อมูลและอีกหนึ่งสำหรับดัชนี

Migration Utility เป็นโปรแกรม PERL แบบเมนูพร้อมรายงานการประมาณขนาดหลายรายงาน ที่ช่วยให้สามารถแปลงสคีม่าแอปพลิเคชันของ Oracle E-Business Suite ได้ทั้งในรูปแบบการย้ายครั้งเดียว (comprehensive migration) หรือแบบขั้นตอนตามสคีม่า (phased, schema-by-schema migration) Oracle แนะนำให้ทำ comprehensive migration แต่ต้องการ downtime และพื้นที่ดิสก์มาก Oracle ไม่รองรับการย้าย tablespaces แบบบางส่วน เมื่อทำ phased migration ต้องย้ายทุกสคีม่ายังคงต้องทำ

ประโยชน์ของ OATM

  • Tablespaces น้อยลงและรวมศูนย์กลางมากขึ้น
  • Locally-managed tablespaces
  • คำนึงถึงลักษณะ I/O ของออบเจ็กต์
  • คืนพื้นที่หลังการย้าย
  • รองรับ Real Application Cluster (RAC)

ข้อกำหนดก่อนการย้าย OATM

ก่อนเริ่ม OATM migration ให้ดำเนินการต่อไปนี้:

  • ตรวจสอบว่า Oracle Database version เป็น RDBMS 9.2.0.4 หรือสูงกว่า
  • หาก Database Version เป็น 9.2.0.6 ให้รันคำสั่ง: $FND_TOP/patch/115/sql/fndupglb.sql
  • Unregister สคีม่า custom ที่ไม่ต้องการย้าย เช่น สคีม่า non-Oracle ที่ลงทะเบียนกับ Oracle Applications โดยการ disable สคีม่าเหล่านั้น สคีม่าอื่นที่อาจต้องการ disable รวมถึง XXBOL และ XXCON
  • เนื่องจากสคีม่า CTXSYS ไม่ใช่ APPS schema ให้ลงทะเบียนโดยขั้นตอน:
    1. จากเมนู เลือก System Administrator Responsibility → Security → ORACLE → Register
    2. เลือก Schema CTXSYS และตั้งค่าสิทธิ์เป็น Enabled

ติดตั้ง OATM Migration Utility

ขั้นที่ 1: นำแพตช์และการตั้งค่าไปใช้

  • นำแพตช์ 3942506 ไปใช้เพื่อรับและบันทึกสคริปต์สำหรับ OATM migration คือ $FND_TOP/bin/fndtsmig.pl
  • รับพารามิเตอร์ที่จำเป็นตาม Oracle Note 404954.1
  • วางฐานข้อมูลในโหมด no archive log

ขั้นที่ 2: อัปเดตพารามิเตอร์ฐานข้อมูล

ก่อนเริ่ม OATM migration ให้เพิ่มค่าพารามิเตอร์ต่อไปนี้:

  • undo_retention=10200
  • job_queue_processes=0
  • aq_tm_processes=0
  • db_files=1500 (จำเป็นสำหรับ OATM)
$ sqlplus '/as sysdba'
SQL> alter system set undo_retention=10200 scope=spfile;
SQL> alter system set job_queue_processes=0 scope=spfile;
SQL> alter system set aq_tm_processes=0 scope=spfile;
SQL> alter system set db_files=1500 scope=spfile;

ปิดฐานข้อมูลและเริ่มใหม่เพื่อยืนยันการตั้งค่าพารามิเตอร์

ขั้นที่ 3: ปรับขนาด Temporary Tablespace และทำความสะอาดฐานข้อมูล

ปรับขนาด temporary (temp) tablespace ให้เป็น 50 GB หรือมากกว่า และทำความสะอาดฐานข้อมูล รวมถึง tools, undo และ tablespaces อื่นๆ

ขั้นที่ 4: เรียกใช้ OATM Migration Utility

รันคำสั่งต่อไปนี้เพื่อเริ่มการย้าย:

$FND_TOP/bin> perl fndtsmig.pl
Main Menu
1. Migration Sizing Reports
2. Create New Tablespaces
3. Generate Migration Commands
4. Execute Migration Commands
5. Run Migration Status Reports
6. Run Post Migration Steps
7. Run Customization Steps
8. Run Migration in Batch Mode
Please enter your option -

ขั้นที่ 2: กำหนดพื้นที่ที่จำเป็นสำหรับ Tablespaces ใหม่

เลือก 1. Migration Sizing Reports จากเมนูหลักเพื่อกำหนดพื้นที่ที่ต้องการ:

1. Generate a Report with the list of all the Oracle Application product schemas that can be migrated
2. Calculate total space required by each new tablespace to Migrate all Oracle Application product schemas (relevant for a complete migration)
3. Calculate total space required by each new tablespace to migrate each Oracle Application product schema (relevant for a schema-by-schema migration)
4. Calculate total space required by each Oracle Applications schema, with details for each object
5. Display Sizing Exception report
Please enter your option - Press Return key to continue...

เลือก 2. Calculate total space required ... เพื่อรับข้อกำหนดพื้นที่ ตามรายงาน Sizing ให้จัดหาพื้นที่จัดเก็บที่จำเป็นและดำเนินต่อ

ขั้นที่ 3: สร้างสคริปต์ Tablespace

เลือก 2. Create New Tablespaces จากเมนูหลัก:

Create New Tablespaces
1. Generate new tablespace creation script
2. Create new tablespaces
Please enter your option - Press Return key to continue...

เลือก 1. Generate new tablespace creation script เพื่อสร้างสคริปต์

ขั้นที่ 4: สร้างรายงาน Invalid Indexes

เลือก 3. Generate Migration Commands จากเมนูหลัก แล้วเลือก 1. Invalid Indexes Report.:

Report created /oracldb/oracledbappl/admin/oracldb/log/fndinvld.txt

ขั้นที่ 5: Disable Custom Schemas และ Enable CTXSYS Schema

หากยังไม่ได้ทำตามส่วน Prerequisites ให้ทำในขั้นตอนนี้

ขั้นที่ 6: สร้างสคริปต์การย้ายสำหรับทุกสคีม่า

จากเมนู Generate Migration Commands เลือก 2. Generate migration commands for all schemas:

Generating Migration commands for all schemas. This may take upto 30min. Please wait... Press Return key to continue...

ขั้นที่ 7: สร้างคำสั่งการย้ายสำหรับ CTXSYS

จากเมนู Generate Migration Commands เลือก 3. Generate migration commands for a list of schemas และป้อน CTXSYS:

Please enter your option - 3
Enter a comma separated list of Schema names: CTXSYS

ขั้นที่ 8: ตั้งค่า Autoextend Option

SQL> spool autoextend_ts.sql
SQL> select 'alter database datafile ''' || file_name || ''' ' || ' autoextend on;' from dba_data_files;
SQL> spool off
$ autoextend_ts.sql

ขั้นที่ 9: รันคำสั่งการย้ายและรายงานสถานะ

จากเมนูหลักเลือก 4. Execute Migration Commands แล้วเลือก 1. Migrate all Schemas ตอบ Y และระบุ 8 parallel processes:

Are you sure you want to migrate all schemas[N]: Y
Enter the maximum number of parallel processes for oracledb[8]: 8
Starting the Migration process for all schemas. Please wait...

สรุป

OATM มีประสิทธิภาพมากขึ้นและจัดการง่ายกว่าด้วย tablespaces ที่น้อยลง ให้ประโยชน์ด้านการใช้พื้นที่อย่างมีประสิทธิภาพ ประสิทธิภาพมาจากการรองรับ locally managed tablespaces แทน dictionary-managed tablespace ที่รูปแบบการย้ายอื่นใช้

OATM เป็นสิ่งบังคับสำหรับเวอร์ชัน R12 แต่ควรอัปเกรดเป็น OATM ก่อนอัปเกรดเป็น R12 OATM ให้ประโยชน์เพิ่มเติมเมื่อนำ RAC ไปใช้

สำหรับข้อมูลเพิ่มเติมเกี่ยวกับ OATM migration utility ดู Note 248857.1 - OATM Release 11i - Tablespace Migration Utility