Tibero Migration Guide

 Tibero Migration Guide TIBERO GUIDE
Contents
1. Overview ............................................................................................................................................3 1.1 About This Document ................................................................................................... 3 1.2 Levels of Migration Difficulty ......................................................................................... 3 1.3 Before Migration .......................................................................................................... 3 1.4 Document Update History ............................................................................................. 3 2. Migration Method ...............................................................................................................................4 2.1 Using tbMigrator .......................................................................................................... 4 2.1.1 Advantages ........................................................................................................ 4 2.1.2 Disadvantages .................................................................................................... 4 2.1.3 Pre‐Migration Tasks (Optional) ............................................................................. 4 2.1.4 Usage ................................................................................................................ 4 2.2 Using a Migration Tool and tbMigrator ............................................................................ 4 2.2.1 Advantages ........................................................................................................ 4 2.2.2 Disadvantages .................................................................................................... 4 2.2.3 Recommendations .............................................................................................. 5 2.2.4 Usage ................................................................................................................ 5 2.3 Using tbLoader............................................................................................................. 5 2.3.1 Usage ................................................................................................................ 5 3. Pre‐Migration Tasks..............................................................................................................................5 3.1 Pre‐Migration Checklist ................................................................................................. 5 4. Migration Execution ...........................................................................................................................13 4.1 Object Migration Sequence ......................................................................................... 13 4.2 Generating Scripts ...................................................................................................... 14 4.2.1 Generating Database Scripts .............................................................................. 14 4.2.2 Generating Object Scripts .................................................................................. 15 4.3 Generating Scripts ...................................................................................................... 18 4.3.1 Generating the Script to Move the Database ........................................................ 18 4.3.2 Generating the Script to Move Objects ................................................................ 19 4.4 Migration .................................................................................................................. 20 4.4.1 Tablespaces ..................................................................................................... 20 4.4.2 Schemas .......................................................................................................... 20 4.4.3 Tables ............................................................................................................. 21 4.4.4 Synonyms ........................................................................................................ 21 4.4.5 Views.............................................................................................................. 21 4.4.6 Sequences ....................................................................................................... 22 © 2012 Tibero Co., Ltd. All Rights Reserved.
1
TIBERO GUIDE
4.4.7 Data................................................................................................................ 22 4.4.8 PSM (PL/SQL) ................................................................................................... 24 4.4.9 Indexes ........................................................................................................... 25 4.4.10 Constraints..................................................................................................... 26 4.4.11 Triggers ......................................................................................................... 26 4.4.12 Grants ........................................................................................................... 26 4.4.13 Other Migration Objects, Including External Procedures and Jobs .......................... 26 4.5 Migration Debugging .................................................................................................. 26 5. Verifying Migration ............................................................................................................................27 5.1 Object Counts ............................................................................................................ 27 5.2 Data Verification ........................................................................................................ 31 6. Application Migration (Other database included) ...................................................................................32 6.1 Connection Strings ..................................................................................................... 32 6.1.1 JDBC ............................................................................................................... 32 6.1.2 ODBC/OLE DB .................................................................................................. 32 6.2 Modifying the Queries in Applications (If needed) .......................................................... 33 6.3 An Alternative to Index Skip Scan ................................................................................. 33 7. References ........................................................................................................................................34 7.1 Shell Scripts ............................................................................................................... 34 7.2 Programs .................................................................................................................. 41 © 2012 Tibero Co., Ltd. All Rights Reserved.
2
TIBERO GUIDE
1. Overview 1.1 About This Document This guide is intended for database users who migrate from Oracle to Tibero. The purpose of this document is to clarify the migration procedures and methods. However, depending on the Oracle database, the DBA might have to change the settings provided in this document. 1.2 Levels of Migration Difficulty There are different levels of migration difficulty. Easy Difficult ‐ Oracle only has a few schemas (users). ‐ Oracle has 10 or more schemas (users). ‐ Schema objects are of moderate complexity. ‐ Schema objects are of high complexity. (High (Low level of dependency) level of dependency) ‐ Objects are well organized. The objects are ‐ Objects are poorly organized. The objects are not distinguished well: used and unused. All objects distinguished: used and unused. There are many are valid. invalid objects. ‐ Upgrading this kind of database might be difficult. 1.3 Before Migration To reduce data migration time, it is recommended to ask the Oracle DBA to delete invalid objects before migration. Any errors which occur in Oracle will also occur in Tibero after migration. 1.4 Document Update History Date Creator 2012.12.01 JongChul Jung Comment Changed the option for exporting scripts using Toad. Only added unchecking of Tablespace (page 19) 2011.12.02 JongChul Jung Changed the document name to Oracle Migration Guide and made some content changes. 2009.10.22 JinGyung First version of Oracle Winback Guide. Ham/MinWook Kim © 2012 Tibero Co., Ltd. All Rights Reserved.
3
TIBERO GUIDE
2. Migration Method 2.1 Using tbMigrator ‐
The only tool used during the migration process is tbMigrator. 2.1.1 Advantages ‐
Simple and easy migration. 2.1.2 Disadvantages ‐
This tool is not useful for schemas with a high level of complexity. ‐
If an error occurs, it is difficult to trace the logs without interrupting the current job. 2.1.3 Pre‐Migration Tasks (Optional) ‐
To change the path or name of the data files in an Oracle tablespace, export the script and edit it manually. ‐
To change the password or default tablespace for Oracle’s schemas (users), export the script and edit it manually. ‐
Do not skip any errors generated during this process. 2.1.4 Usage ‐ Refer to Tibero Utility Guide. 2.2 Using a Migration Tool and tbMigrator ‐
All Oracle scripts are exported using a migration tool so that they can be edited manually. tbMigrator is only used for the actual data migration. ‐
Tools used: Migration tool, tbMigrator, shell scripts, and other programs. 2.2.1 Advantages ‐
This tool helps the DBA perform an accurate migration even with schemas with a high level of complexity. 2.2.2 Disadvantages ‐
The migration process is complex and the early phases take a long time. © 2012 Tibero Co., Ltd. All Rights Reserved.
4
TIBERO GUIDE
2.2.3 Recommendations ‐
Create shell scripts to automate migration tasks. Perform a single comprehensive migration of all schemas instead of performing a schema‐by schema migration. If the shell scripts are created during the early stages of migration, DBAs can perform the migration in a more efficient and automated way. ‐
Using programs is especially recommended for repetitive tasks such as classifying scripts and creating files. Otherwise, DBAs have to handle the tasks manually every time they are necessary. The programs can be written in any language. 2.2.4 Usage ‐
Refer to 4. Migration Execution. 2.3 Using tbLoader ‐
This tool is used to import data from a plain text file (SAM file) to Tibero. This is only efficient when dealing with a few large tables. 2.3.1 Usage ‐ Refer to Tibero Utility Guide. 3. Pre‐Migration Tasks To migrate from Oracle to Tibero, it is important to understand the nature of the Oracle database. Oracle may have some variables that must be applied in Tibero. The SQL statements below may differ depending on the version of Oracle. These queries work with Oracle 10g and 11g. 3.1 Pre‐Migration Checklist ‐ Checking schemas // Selecting users select username, account_status, default_tablespace, temporary_tablespace from dba_users order by 1; // Selecting the users whose status is Open set linesize 120 set pagesize 100 © 2012 Tibero Co., Ltd. All Rights Reserved.
5
TIBERO GUIDE
select username, default_tablespace, temporary_tablespace from dba_users WHERE ACCOUNT_STATUS='OPEN' order by 1; * The table below contains Oracle schemas which are automatically created when installing Oracle. It is not necessary to migrate these schemas. Schema Name Description ANONYMOUS Used for HTTP access to XML DB BI This user is created with the oracle sample schemas. It owns the Business Intelligence schema. CTXSYS The owner of Oracle text (formerly: interMedia text). DBSNMP Part of the Oracle intelligent agent. DIP Used by the Directory Integration Platform (DIP) which synchronizes changes in the Oracle Internet Directory with applications in the database DMSYS This user is used for Data Mining EXFSYS This schema is used for expression filters. HR, IX, SCOTT Installed with Oracle sample schemas OE, PM, SH MDDATA Used by Oracle Spatial to store Geocoder and router data. MDSYS The owner of spatial (which is a part of interMedia). MGMT_VIEW Used for the Oracle Enterprise Manager Database Control. OLAPSYS The schema that owns the OLAP catalogs. ORDPLUGINS Like mdsys: part of interMedia. ORDSYS The administration account for interMedia. OUTLN Used for the query plan stability feature. SI_INFORMTN_SCHEMA Used for SQL/MM Still Image Standard. SYS Used for database administration. SYSMAN The default super user account used to set up and administer enterprise manager. SYSTEM Used for database administration. TSMSYS User for Transparent Session Migration (TSM) a Grid feature WMSYS The owner for Workspace Manager XDB Used for XML DB © 2012 Tibero Co., Ltd. All Rights Reserved.
6
TIBERO GUIDE
※ Reference http://www.adp‐gmbh.ch/ora/misc/known_schemas.html http://orafaq.com/wiki/List_of_default_database_users ‐ Checking Oracle Version select * from v$version; ‐ Checking NLS Parameters set linesize 150 set pagesize 100 col value$ format a100 select name, value$ from sys.props$ order by 1; ‐ Checking the Redo Tablespaces set linesize 150 select * from v$logfile; select group#, bytes/1024/1024 as "size(mb)", members, archived from v$log; ‐ Checking Undo Tablespaces show parameters undo_tablespace; set linesize 150 col tablespace_name format a40 col file_name format a50 select tablespace_name, file_name, bytes/1024/1024 "size(mb)", maxbytes/1024/1024 "maxsize(mb)", autoextensible from dba_data_files where tablespace_name ='UNDOTBS1'; # Enter the results for the parameter above. © 2012 Tibero Co., Ltd. All Rights Reserved.
7
TIBERO GUIDE
‐ Checking Temp TableSpaces col file_name format a50 select tablespace_name, file_name, bytes/1024/1024 "size mb", autoextensible from dba_temp_files; ‐ Checking init parameters show parameter SESSIONS show parameter OPEN_CURSORS show parameter SGA_MAX_SIZE select name, value/1024/1024 from v$sga; ‐ Checking Log Mode select log_mode from v$database; ▶ Use the following information as a checklist to migrate to Tibero. Object Schema Oracle Tibero Migrate all schemas, except for Create all tablespaces, including those automatically installed as temporary tablespaces. part of a basic installation of The Oracle database DBA must Oracle. provide information about the schemas. NLS_CHARACTERSET KO16KSC5601 MSWIN949 KO16MSWIN949 MSWIN949 UTF8/AL32UTF8 UTF8 JA16SJIS JA16SJIS JA16EUC EUC‐JP (in Tibero5) NLS_NCHAR_CHARACTERSET NLS_DATE_FORMAT UTF8 UTF8 AL16UTF16 UTF16 DD‐MON‐RR (Default) Tibero must use the same date format. REDO LOG SIZE The size of the redo logs and GROUP, Member Create redo log groups and members with a size based on the redo logs in Oracle. © 2012 Tibero Co., Ltd. All Rights Reserved.
8
TIBERO GUIDE
UNDO_RETENTION 900 (Default) Tibero must use the same parameter value. (Default: 900s) UNDO_TABLESPACE SIZE The size of the UNDO tablespace Allocate enough space for Undo tablespaces in Tibero based on the sizes of the Undo tablespaces in Oracle. TEMP Tablespaces The size of the TEMP tablespace Tibero must use the same size temporary tablespaces. Enabling Autoextend is recommended to automatically extend tablespaces. This is necessary because application migration testing requires larger tablespaces. Init parameters SESSIONS Tibero must have the same OPEN_CURSORS parameter values. SGA_MAX_SIZE Log Mode Archive/Noarchive If ARCHIVELOG mode is enabled for Oracle, the log mode for Tibero should be configured after migration is complete. ‐ Checking DB Links set linesize 150 col owner format a15 col db_link format a20 col username format a20 col host format a50 select * from dba_db_links; ‐ Checking the tnsname.ora file cat $ORACLE_HOME/network/admin/tnsnames.ora © 2012 Tibero Co., Ltd. All Rights Reserved.
9
TIBERO GUIDE
‐ Checking Tablespace Sizes set linesize 150 set pagesize 100 col tablespace_name format a40 select x.a tablespace_name , sum(x.b)/1024 "tot_size(mb)" , sum(x.c)/1024 "used_size(mb)" , sum(x.c)/sum(x.b)*100 rate from ( select b.tablespace_name a , sum(bytes)/1024 b , 0 c from dba_data_files b group by b.tablespace_name union select d.tablespace_name, 0, sum(bytes)/1024 from dba_segments d group by d.tablespace_name ) x group by x.a; ‐‐ Total Size select sum(x.b)/1024 "tot(mb)", sum(x.c)/1024 "used(mb)" from ( select sum(bytes)/1024 b, 0 c from dba_data_files b union select 0, sum(bytes)/1024 from dba_segments d ) x; © 2012 Tibero Co., Ltd. All Rights Reserved.
10
TIBERO GUIDE
‐ Checking Jobs set linesize 200 select job, schema_user, broken, instance from dba_jobs; set linesize 150 col interval format a50 select job, schema_user, next_date, broken, interval from dba_jobs; ‐ Checking Constraints set linesize 150 column owner format a30 select owner ,constraint_type ,count( constraint_name ) as "con_cnt" from dba_constraints where owner in (select username from dba_users where account_status='OPEN' ) group by owner, constraint_type order by owner ,constraint_type; ‐ Checking Object Counts /* dba_object contains already deleted objects ( BIN‐format objects). To accurately count all the objects present, refer to the information dba_tables or dba_indexes. * Refer to the excel file attached below */ col owner format a20 set pages 500 select owner, object_type, status, count(*) from dba_objects where owner in (select username from dba_users where account_status='OPEN' ) group by owner, object_Type, status order by owner, object_type, status; objects_count.xls
© 2012 Tibero Co., Ltd. All Rights Reserved.
11
TIBERO GUIDE
‐ Checking Cluster Objects SELECT * FROM DBA_OBJECTS WHERE OBJECT_TYPE LIKE '%CLUSTER%' AND OWNER NOT IN ('SYS'); ‐ Checking XML Types set linesize 200 SELECT owner, table_name, column_name, data_type FROM DBA_TAB_COLS WHERE DATA_TYPE LIKE '%XML%' AND OWNER NOT IN ('SYS'); ‐ Checking Bitmap Indexes SELECT * FROM DBA_INDEXES WHERE INDEX_TYPE LIKE '%BITMAP%'; ▶ Use the following information as a checklist to migrate to Tibero: Object Tibero DB Links Check the hosts of the database links in Oracle. tnsname.ora Contains the host information used for database links. Tablespaces Create tablespaces based on their size in Oracle. If Oracle and Tibero use the same character encoding, Tibero can use the same tablespaces. If Oracle uses over 90% of a tablespace, it is recommended to increase the size of the tablespace. If KO16KSC5601, KO16MSWIN949, or JA16SJIS are changed to UTF8 or AL32UTF8, increase the size of the tablespaces by a factor of 1.5 ‐ 2. Jobs Check the jobs in Oracle schemas. Constraints Save Oracle’s constraints to compare them to Tibero after the migration. Object Counts Create an object count as in the attached Excel file to compare them after the migration. Cluster Objects Currently not supported. Migrate tables without being clustered. XML Types Change the data type, which was specified in the column definition in the table creation statement, from sys.xmltype to xmltype. Bitmap Indexes Currently not supported. TIBERO recommends changing bitmap indexes to normal indexes. © 2012 Tibero Co., Ltd. All Rights Reserved.
12
TIBERO GUIDE
4. Migration Execution 4.1 Object Migration Sequence 1. Tablespaces 2. Users 3. Tables 4. Synonyms 5. Views 6. Sequences 7. Data Migration with tbMigrator) 8. PSMs (PL/SQL) ‐> Packages, Procedures, Functions 9. Indexes 10. Constraints 11. Triggers 12. Grants 13. Other (C, Java External Procedures, Jobs ) ‐ Synonyms can be created without specifying their Oracle objects, and their status will automatically become valid. Creating synonyms during the early stages of the migration is recommended. ‐ The migration sequence is not fixed. From steps 4 to 8, the sequence can be changed depending on the object dependencies in Oracle. Properly adjust the sequence according to the database usage. © 2012 Tibero Co., Ltd. All Rights Reserved.
13
TIBERO GUIDE
4.2 Generating Scripts 4.2.1 Generating Database Scripts An example of generating an export script using the application, Toad, is shown below: ① Type the path and name of the script file. © 2012 Tibero Co., Ltd. All Rights Reserved.
14
TIBERO GUIDE
① These settings can be saved for later use. ② Generate the scripts. 4.2.2 Generating Object Scripts © 2012 Tibero Co., Ltd. All Rights Reserved.
15
TIBERO GUIDE
① Select the schemas to migrate. ② Enter the top‐level path for the individual object DDL scripts. ① Do not migrate objects which have been deleted from Oracle. © 2012 Tibero Co., Ltd. All Rights Reserved.
16
TIBERO GUIDE
© 2012 Tibero Co., Ltd. All Rights Reserved.
17
TIBERO GUIDE
4.3 Generating Scripts 4.3.1 Generating the Script to Move the Database ‐ Generating the script to move tablespaces. ① Only copy the tablespaces that will be migrated. ② The SYSTEM, UNDO, and TEMP tablespaces are excluded because they are created when Tibero is created. ※ Temporary tablespaces which are not named ‘TEMP’ should be migrated (Example: TEMP1). ③ Oracle database exclusive tablespaces are excluded. (Example: SYSAUX) ④ Modify the path, name, and size of data files if needed. ⑤ Comment out the features that are not supported in Tibero. ⑥ Create the tablespace.sql file. ※ Features to Comment Out PERMANENT Tibero’s default option. BLOCKSIZE 4K Tibero does not specify block size in tablespaces. It should be specified with init parameters. 8K is usually used. SEGMENT SPACE Tibero only supports automatic segment space MANAGEMENT MANUAL management. FLASHBACK ON Flashback parameters are supported. TABLESPACE GROUP Not available. ‐ Generating the script to move schemas ① Type the password for each schema. Get the information from the Oracle DBA. ② Only copy the schemas that will be migrated. ※ Oracle’s default schemas are not migrated. ③ Comment out the features that are not supported in Tibero. ④ Create the user.sql file. ※ Features to Comment Out GRANT UNLIMITED Tibero’s default option. TABLESPACE TO USER_NAME ALTER USER USERNAME Cannot be individually assigned for each schema QUOTA UNLIMITED ON USERNAME © 2012 Tibero Co., Ltd. All Rights Reserved.
18
TIBERO GUIDE
PROFILE DEFAULT Tibero’s default option. 4.3.2 Generating the Script to Move Objects ‐ Generating SQL scripts for each schema object When objects are exported as shown in 4.4.2 Schemas, a folder will exist for each schema and each schema will have a folder for each object. Each object requires SQL scripts to be executed. Create SQL scripts using the source code from the Java program shown in 7.2 Programs. /* Compile */ D:\mig_script\program>javac DivideScriptFile.java /* Execute */ D:\mig_script\program>java ‐cp .;"C:\Program Files\Java\jdk1.6.0_23\bin\lib\tools\.jar" DivideScriptFile D:\mig_script\sql / ※ Enter a path for the Java program as shown above. Refer to 7.2 Programs for information about its parameters. ※ Executing the program will generate files. The file names are the same as the specified folder name but use lowercase letters. © 2012 Tibero Co., Ltd. All Rights Reserved.
19
TIBERO GUIDE
4.4 Migration ‐ Upload the generated SQL files to the server where Tibero is installed and then start the migration. ‐ Access the server with the tbSQL application with the SYS account, and declare each migration object in the format @sql_filename. If Oracle has highly complex schema objects, writing shell scripts is recommended. ‐ If dependencies and exceptions are recorded in the initial migration, the information will make the next migration easier and faster. 4.4.1 Tablespaces ‐ Migrating tablespaces using tbSQL OFAIM@tbtest:/home/tbtest/migtest # tbsql sys/tibero tbSQL 4 SP1 Copyright (c) 2008, 2009, 2011 Tibero Corporation. All rights reserved. @Connected to Tibero. SQL> @tablespace Tablespace 'ACNT' created. Tablespace 'ACNT_INDEX' created. …….. 4.4.2 Schemas ‐ Migrating schemas using tbsql OFAIM@tbtest:/home/tbtest/migtest # tbsql sys/tibero tbSQL 4 SP1 Copyright (c) 2008, 2009, 2011 Tibero Corporation. All rights reserved. @Connected to Tibero. SQL> @user User 'ACNT' created. Granted. Granted © 2012 Tibero Co., Ltd. All Rights Reserved.
20
TIBERO GUIDE
4.4.3 Tables ‐
Run the shell scripts to automatically perform migration. Only tables are migrated in this phase. ‐
Refer to 7.1 Shell Scripts for information about creating the shell scripts. ‐
Check if any tables are missing in Tibero from Oracle by comparing the number of tables. ‐
Analyze shell logs to check if any errors occurred during the migration. If any errors occurred, find the corresponding SQL files and manually re‐execute them. (Refer to 4.5 Migration Debugging) 4.4.4 Synonyms ‐
Check if any synonyms are missing in Tibero that were in Oracle by comparing the number of synonyms. ‐
Analyze shell logs to check if any errors occurred. If any errors occurred, find the corresponding SQL scripts and manually re‐execute them. (Refer to 4.5 Migration Debugging) /* Synonym Dependency */ SELECT DISTINCT REFERENCED_OWNER, REFERENCED_NAME, REFERENCED_TYPE FROM DBA_DEPENDENCIES WHERE TYPE='SYNONYM' AND REFERENCED_TYPE NOT IN ('TABLE', 'SYNONYM', 'VIEW') AND REFERENCED_NAME NOT IN ('DUAL') AND REFERENCED_NAME NOT LIKE 'DBA_%' AND OWNER NOT IN ('SYS', 'ORANGE', 'WMSYS', 'MDSYS', 'EXFSYS', 'XDB', 'SYSMAN', 'DBSNMP', 'SYSTEM' ) AND REFERENCED_OWNER NOT IN ('SYS', 'ORDSYS', 'WMSYS', 'MDSYS', 'EXFSYS', 'XDB', 'SYSMAN','SYSTEM','OLAPSYS','APEX_030200', 'CTXSYS') ORDER BY 1, 2; ※ Because synonyms are aliases for other database objects, synonyms depend on other objects. If any synonyms reference PSMs (PL/SQL), the PSMs should be migrated first. The migrated PSMs should be commented out in objects.sql so that they are not migrated again during the PSM migration phase. 4.4.5 Views ‐
Because views are defined by queries that reference other database objects, views depend on the referenced objects. Before migrating views, analyze dependencies between related database objects. If any views reference PSMs (PL/SQL), the PSMs should be migrated first. © 2012 Tibero Co., Ltd. All Rights Reserved.
21
TIBERO GUIDE
The migrated PSMs should be commented out in objects.sql so that they are not migrated again during the PSM migration phase. ‐
If the referenced objects are not found, a compilation error will occur. If this happens, define permissions of the objects that are referenced by the views first. ‐
Check if any views are missing in Tibero from Oracle by comparing the number of views. ‐
Analyze shell logs to check if any errors occurred. If any errors occurred, find the corresponding SQL scripts and manually re‐execute them. (Refer to 4.5 Migration Debugging) /* View Dependency */ SELECT OWNER, NAME, REFERENCED_OWNER, REFERENCED_NAME, REFERENCED_TYPE FROM DBA_DEPENDENCIES WHERE TYPE='VIEW' AND REFERENCED_TYPE NOT IN ('TABLE', 'SYNONYM') AND REFERENCED_NAME NOT IN ('DUAL') AND REFERENCED_NAME NOT LIKE 'DBA_%' AND OWNER NOT IN ('SYS', 'ORANGE','MDSYS', 'EXFSYS', 'XDB', 'SYSMAN', 'DBSNMP', 'SYSTEM' ) AND REFERENCED_OWNER NOT IN ('SYS', 'ORDSYS', 'WMSYS', 'MDSYS', 'EXFSYS', 'XDB', 'SYSMAN','SYSTEM','OLAPSYS', 'APEX_030200', 'CTXSYS') ORDER BY 1, 2; ※ During view migration, consider the sequence of view attributes. The owner is migrated first and the view name is migrated next. 4.4.6 Sequences ‐ There are no special migration considerations. ‐ The current values of the sequences in Oracle will be migrated to Tibero. 4.4.7 Data ‐ Only data is migrated in this phase. ‐ This is only applicable to schemas that have tables. © 2012 Tibero Co., Ltd. All Rights Reserved.
22
TIBERO GUIDE
① Selecting multiple schemas is allowed. Click the Migrate button. ※ In Migrate Option, select Migrate Table Rows. © 2012 Tibero Co., Ltd. All Rights Reserved.
23
TIBERO GUIDE
4.4.8 PSM (PL/SQL) ‐
TBR‐8053: If a ”Not authorized” error occurs, permissions of the objects referenced in the PSM must be defined first. ‐
If an error occurs for PSM queries, modify the query by referring to 6.2 Modifying the Queries in Applications. ‐
Because Tibero does not support Oracle object types, create object types in packages in Tibero. /* Oracle */ CREATE OR REPLACE PACKAGE "PK_TYPES" AS TYPE DOCUROLE_ID_OBJ IS RECORD(DOCUROLE_ID VARCHAR2(6)); TYPE DOCUROLE_ID_TAB IS TABLE OF DOCUROLE_ID_OBJ; END; CREATE OR REPLACE FUNCTION USER_DOCUROLESET(PARAM IN VARCHAR2) RETURN PK_TYPES.DOCUROLE_ID_TAB IS L_DOCUROLE_ID_TAB PK_TYPES.DOCUROLE_ID_TAB := PK_TYPES.DOCUROLE_ID_TAB(); N INTEGER := 0; BEGIN FOR R IN ( SELECT 'test' into DID FROM dual ) LOOP L_DOCUROLE_ID_TAB.EXTEND; N := N + 1; L_DOCUROLE_ID_TAB(N).DOCUROLE_ID := 'test'; END LOOP; RETURN L_DOCUROLE_ID_TAB; END; / /* Tibero */ CREATE OR REPLACE PACKAGE "PK_TYPES" AS TYPE DOCUROLE_ID_OBJ IS RECORD(DOCUROLE_ID VARCHAR2(6)); © 2012 Tibero Co., Ltd. All Rights Reserved.
24
TIBERO GUIDE
TYPE DOCUROLE_ID_TAB IS TABLE OF DOCUROLE_ID_OBJ; END; / CREATE OR REPLACE FUNCTION USER_DOCUROLESET(PARAM IN VARCHAR2) RETURN PK_TYPES.DOCUROLE_ID_TAB IS L_DOCUROLE_ID_TAB PK_TYPES.DOCUROLE_ID_TAB := PK_TYPES.DOCUROLE_ID_TAB(); N INTEGER := 0; BEGIN L_DOCUROLE_ID_TAB.EXTEND; L_DOCUROLE_ID_TAB(1).DOCUROLE_ID := 'test'; RETURN L_DOCUROLE_ID_TAB; END; / 4.4.9 Indexes ‐ Tibero does not support bitmap indexes, so change them to normal indexes. ‐ Tibero might have more indexes than Oracle because indexes for LOB columns have been created. Until Oracle Database 11g Release 2, indexes were not created for LOBs. SQL> SELECT COUNT(1) FROM DBA_INDEXES WHERE OWNER='TIBERO'; COUNT(1) ‐‐‐‐‐‐‐‐‐‐ 0 1 row selected. SQL> CREATE TABLE LOB_TEST(C1 CLOB, C2 BLOB); Table 'LOB_TEST' created. SQL> SELECT COUNT(1) FROM DBA_INDEXES WHERE OWNER='TIBERO'; COUNT(1) ‐‐‐‐‐‐‐‐‐‐ 2 © 2012 Tibero Co., Ltd. All Rights Reserved.
25
TIBERO GUIDE
4.4.10 Constraints ‐
Compare the constraints in Tibero with the Oracle database constraints which were stored before migration. (Refer to 3.1 Pre‐Migration Checklist) 4.4.11 Triggers ‐
Analyze shell logs to check if any errors occurred. If any errors occurred, find the corresponding SQL scripts and then manually re‐execute them. (Refer to 4.5 Migration Debugging) ‐
When attempting to migrate triggers which were disabled in Oracle, a syntax error will occur. Comment out the disabled triggers and execute “alter trigger trigger_name disable;”. 4.4.12 Grants ‐
Tibero does not support the following functions. The number of grants in Tibero will be different from Oracle. Î Comment out the functions below and then start the migration of grants. COMMIT REFRESH: MVIEW permission. Tibero 5 supports this. QUERY REWRITE: MVIEW permission. The query rewrite is triggered when a parameter is defined. The query rewrite privilege is not yet supported. DEBUG: PL/SQL debugging permission. Tibero does not support this. This will be available in Tibero 6 or later. FLASHBACK: The flashback is triggered when a parameter is defined. The flashback permission is not supported. 4.4.13 Other Migration Objects, Including External Procedures and Jobs ‐
Migrate other objects, including external procedures and jobs. 4.5 Migration Debugging ‐
Analyze the logs in shell scripts for debugging. /* Tables */ cat create_table.log | grep ‐v "created" | grep ‐v "File finished." | grep ‐v "Commented." | sed '/^ *$/d' /* Synonyms */ cat create_synonym.log | grep ‐v "created" | grep ‐v "File finished." | sed '/^ *$/d' © 2012 Tibero Co., Ltd. All Rights Reserved.
26
TIBERO GUIDE
/* Views */ cat create_view.log | grep ‐v "created" | grep ‐v "File finished." | grep ‐v "Commented." | sed '/^ *$/d' cat create_view.log | grep ‐v "File finished." | grep ‐v "Commented." | sed '/^ *$/d' /* PSMs */ cat create_psm.log | grep ‐v "created" | grep ‐v "File finished." | grep ‐v "No Errors."| sed '/^ *$/d' /* Indexes */ cat create_index.log | grep ‐v "created" | grep ‐v "File finished." | sed '/^ *$/d' /* Constraints */ cat create_constraint.log | grep ‐v "altered." | grep ‐v "File finished." | sed '/^ *$/d' /* Triggers */ cat create_trigger.log | grep ‐v "created." | grep ‐v "File finished." | grep ‐v "No Errors." | sed '/^ *$/d' /* Grants */ cat create_grant.log | grep ‐v "Granted." | grep ‐v "File finished." | sed '/^ *$/d' ‐
If any errors occurred, find the corresponding SQL files and manually re‐execute them. find . ‐name "*.sql" | xargs grep ‐in “find_string” 5. Verifying Migration 5.1 Object Counts /* Tables */ SET LINESIZE 150 column OWNER format a30 SELECT OWNER ,COUNT( TABLE_NAME ) AS "TABLE_CNT" FROM dba_tables GROUP BY OWNER ORDER BY OWNER; /* Views */ SET LINESIZE 150 © 2012 Tibero Co., Ltd. All Rights Reserved.
27
TIBERO GUIDE
column OWNER format a30 SELECT OWNER ,COUNT( VIEW_NAME ) AS "VIEW_CNT" FROM dba_views GROUP BY OWNER ORDER BY OWNER; /* Synonyms */ SET LINESIZE 150 column OWNER format a30 select OWNER, COUNT(1) as "syn_cnt" from dba_synonyms where OWNER NOT IN ('SYS', 'SYSCAT', 'SYSGIS', 'PUBLIC') GROUP BY OWNER ORDER BY OWNER; select ORG_OBJECT_OWNER AS "OWNER", COUNT(1) as "pub_syn_cnt" from dba_synonyms where ORG_OBJECT_OWNER NOT IN ('SYS', 'SYSCAT', 'SYSGIS') AND OWNER = 'PUBLIC' GROUP BY ORG_OBJECT_OWNER ORDER BY ORG_OBJECT_OWNER; /* Sequences */ SET LINESIZE 150 column SEQUENCE_OWNER format a30 SELECT SEQUENCE_OWNER ,COUNT( SEQUENCE_NAME ) AS "SEQ_CNT" FROM dba_sequences GROUP BY SEQUENCE_OWNER ORDER BY SEQUENCE_OWNER; /* Packages */ SET LINESIZE 150 column OWNER format a30 SELECT OWNER © 2012 Tibero Co., Ltd. All Rights Reserved.
28
TIBERO GUIDE
,COUNT( NAME ) AS "PKG_CNT" FROM dba_source WHERE TYPE = 'PACKAGE' AND OWNER NOT IN ( 'SYS', 'SYSGIS' ) GROUP BY OWNER ORDER BY OWNER; /* Package Bodies */ SET LINESIZE 150 column OWNER format a30 SELECT OWNER ,COUNT( NAME ) AS "PKGBD_CNT" FROM dba_source WHERE TYPE = 'PACKAGE BODY' AND OWNER NOT IN ( 'SYS', 'SYSGIS' ) GROUP BY OWNER ORDER BY OWNER; /* Functions */ SET LINESIZE 150 column OWNER format a30 SELECT OWNER ,COUNT( NAME ) AS "FUNC_CNT" FROM dba_source WHERE TYPE = 'FUNCTION' AND OWNER NOT IN ( 'SYS', 'SYSGIS' ) GROUP BY OWNER ORDER BY OWNER; /* Procedures */ SET LINESIZE 150 column OWNER format a30 SELECT OWNER ,COUNT( NAME ) AS "PROC_CNT" FROM dba_source © 2012 Tibero Co., Ltd. All Rights Reserved.
29
TIBERO GUIDE
WHERE TYPE = 'PROCEDURE' AND OWNER NOT IN ( 'SYS', 'SYSGIS' ) GROUP BY OWNER ORDER BY OWNER; /* Indexes */ SET LINESIZE 150 column OWNER format a30 SELECT OWNER COUNT( INDEX_NAME ) AS "INX_CNT" FROM dba_indexes WHERE OWNER NOT IN ('SYS', 'SYSGIS') GROUP BY OWNER ORDER BY OWNER; /* Constraints */ SET LINESIZE 150 column OWNER format a30 SELECT OWNER ,CONSTRAINT_TYPE ,COUNT( CONSTRAINT_NAME ) AS "CON_CNT" FROM dba_constraints WHERE OWNER NOT IN ('SYS', 'SYSGIS') GROUP BY OWNER, CONSTRAINT_TYPE ORDER BY OWNER ,CONSTRAINT_TYPE; /* Grants */ SET LINESIZE 150 column OWNER format a30 SELECT OWNER, COUNT(1) FROM DBA_TAB_PRIVS WHERE OWNER NOT IN ('SYS','SYSCAT', 'SYSGIS') GROUP BY OWNER ORDER BY OWNER; /* Triggers */ © 2012 Tibero Co., Ltd. All Rights Reserved.
30
TIBERO GUIDE
SET LINESIZE 150 column OWNER format a30 SELECT OWNER ,COUNT( TRIGGER_NAME ) AS "TRIGGER_CNT" FROM dba_triggers GROUP BY OWNER ORDER BY OWNER; 5.2 Data Verification ‐ Verifying data using tbMigrator. ※ Compares each byte of data in Oracle and Tibero. This is a highly reliable method but takes a long time. © 2012 Tibero Co., Ltd. All Rights Reserved.
31
TIBERO GUIDE
6. Application Migration 6.1 Connection Strings 6.1.1 JDBC Locate the tibero5‐jdbc.jar file in $TIBERO_HOME/client/lib/jar in the lib folder of the application. The JDBC driver version should match the Tibero database version. Otherwise, applications will have problems integrating with Tibero. /* Oracle */ String jdbc_url = "jdbc:oracle:thin:@192.168.100.1:1521:ORCL"; String user = "oracle_username"; String passwd = "oracle_passwd"; Class.forName("oracle.jdbc.driver.OracleDriver"); /* Tibero */ String jdbc_url = "jdbc:tibero:thin:@192.168.100.1:8629:tibero"; String user = "tibero_username"; String passwd = "tibero_passwd"; Class.forName("com.tmax.tibero.jdbc.TbDriver"); 6.1.2 ODBC/OLE DB Use the Tibero ODBC/OLE DB Installer. ‐ ODBC /* Oracle */ DRIVER={Microsoft ODBC for Oracle}; server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=utf8)));UID=scott;PWD=tiger; /* Tibero */ DRIVER={Tibero ODBC Driver};server=127.0.0.1;port=8629;uid=sys;pwd=tibero; © 2012 Tibero Co., Ltd. All Rights Reserved.
32
TIBERO GUIDE
‐ OLEDB /* Oracle */ Provider=msdaora;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword; /* Tibero */ Provider=tbprov.MSDTB;Data Source='127.0.0.1,8629';User ID=SYS;Password=tibero; 6.2 Modifying the Queries in Applications (If needed) ① If a join operation is performed without specifying an alias for the table or subquery in the FROM clause, and if a duplicate column exists, a syntax error will occur. Î Specify an alias name for the table or column. ② When using a UNION ALL query, if the query uses a NUMBER column but its subquery uses a VARCHAR column, a syntax error will occur. Î Only one data type can be used for the same column. ③ In Oracle, sometimes query results are sorted in a certain order without using an ORDER BY clause. In Tibero, create an ORDER BY clause to get the same result. Î Specify an ORDER BY clause. ※ For queries that only access part of the data in a large table with indexes, the results are sorted in a certain order without using an ORDER BY clause. ④ When compiling a PSM (PL/SQL), if any objects or column names are not valid, an error will occur. Î Use valid objects and column names. (In Oracle, this error will occur during the execution of the program.) ⑤ When duplicate variable names are used in PSM (PL/SQL), a syntax error will occur. Î Use the last defined name and delete the others. 6.3 An Alternative to Index Skip Scan ‐ Tibero 5 has the Index Skip Scan function, but Tibero 4 does not support it. Without this function, there may be degradation in SQL performance. Î Create a normal index as shown below as an alternative: /*SELECT SKIP SCAN */ SELECT pl.HASH_VALUE, pl.OBJECT_OWNER, pl.OBJECT_NAME, idx.TABLE_OWNER, idx.TABLE_NAME, sq.SQL_FULLTEXT FROM V$SQL_PLAN pl, V$SQLAREA sq, DBA_INDEXES idx WHERE pl.OPTIONS = 'SKIP SCAN' © 2012 Tibero Co., Ltd. All Rights Reserved.
33
TIBERO GUIDE
AND pl.OBJECT_OWNER != 'SYS' AND pl.HASH_VALUE=sq.HASH_VALUE AND pl.OBJECT_NAME= idx.index_name ORDER BY 3,4; /* SELECT Target */ SELECT DISTINCT pl.HASH_VALUE, pl.OBJECT_OWNER, pl.OBJECT_NAME, idx.TABLE_OWNER, idx.TABLE_NAME FROM V$SQL_PLAN pl, V$SQLAREA sq, DBA_INDEXES idx WHERE pl.OPTIONS = 'SKIP SCAN' AND pl.OBJECT_OWNER != 'SYS' AND pl.HASH_VALUE=sq.HASH_VALUE AND pl.OBJECT_NAME= idx.index_name ORDER BY 3,4; ※ Not all queries need to be indexed. Check information such as query patterns and frequencies using conditional queries, and only index the necessary queries. 7. References 7.1 Shell Scripts ‐ mig.sh ① Calls each object.sh. ② Creates the /Logs directory, and records logs for each object. ③ This shell script can be executed in Red Hat Linux and HP‐UX. The script may need to be changed to run on other operating systems. #!/bin/sh # Check LOG_DIR MOVE_DIR=`date +'%Y%m%d_%H%M%S'` if [ ‐d logs ]; then echo "Exist Logs Directory!! " echo "MOVE : logs ‐> logs_$MOVE_DIR" mv logs logs_$MOVE_DIR echo "Create logs Directory!!" mkdir logs else © 2012 Tibero Co., Ltd. All Rights Reserved.
34
TIBERO GUIDE
echo "Not exist Logs Directory!!" echo "Create logs Directory!!" mkdir logs fi #Create & check table echo ============================================================================= echo Create table echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) sh table.sh|tee logs/create_table.log; break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; esac done #Create & check migrator #use tbmigrator( data migration ) echo ============================================================================= echo migrator echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; © 2012 Tibero Co., Ltd. All Rights Reserved.
35
TIBERO GUIDE
esac done #Create & check synonym echo ============================================================================= echo Create synonym echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) sh synonym.sh|tee logs/create_synonym.log; break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; esac done #Create & check view echo ============================================================================= echo Create view echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) sh view.sh|tee logs/create_view.log; break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; © 2012 Tibero Co., Ltd. All Rights Reserved.
36
TIBERO GUIDE
esac done #Create & check sequence echo ============================================================================= echo Create sequence echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) sh sequence.sh|tee logs/create_sequence.log; break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; esac done #Create & check psm echo ============================================================================= echo Create psm echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) sh psm.sh|tee logs/create_psm.log; break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; © 2012 Tibero Co., Ltd. All Rights Reserved.
37
TIBERO GUIDE
esac done #Create & check index echo ============================================================================= echo Create index echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) sh index.sh|tee logs/create_index.log; break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; esac done #Create & check constraint echo ============================================================================= echo Create constraint echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) sh constraint.sh|tee logs/create_constraint.log; break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; © 2012 Tibero Co., Ltd. All Rights Reserved.
38
TIBERO GUIDE
esac done #Create & check trigger echo ============================================================================= echo Create trigger echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) sh trigger.sh|tee logs/create_trigger.log; break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; esac done #Create & check grant echo ============================================================================= echo Create grant echo ============================================================================= while true; do printf "Do you want to progress [y/n]?" read yn case $yn in [Yy]* ) sh grant.sh|tee logs/create_grant.log; break;; [Nn]* ) printf "Skip\n"; break;; * ) echo "Please answer yes or no.";; © 2012 Tibero Co., Ltd. All Rights Reserved.
39
TIBERO GUIDE
esac done echo Program End!! ‐ table.sh (view.sh, synonym.sh, sequence.sh, …) ① Creates object.sh, which is called by mig.sh. ② Changes the WORK_FD path to the directory where the shell scripts exist. ③ Locates the exported shell scripts in WORK_FD/sql. ④ Adds all users with permissions on the object. The path, username, and password should be changed for each user. ⑤ Runs an SQL query to get the count of objects in WORK_FD/check. (Refer to 5.1 Object Count) #!/bin/sh WORK_FD="/home/tbtest/migtest" echo `date` #Execute query echo ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ echo "Create TABLE..." # Repeated part for each user. echo ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ echo "Continue ACNT" cd sql/ACNT tbsql ‐s acnt/acnt123 @tables.sql < $WORK_FD/quit.sql cd $WORK_FD # Repeated part for each user. echo ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ echo "Continue ADFF" cd sql/ADFF tbsql ‐s adff/adff123 @tables.sql < $WORK_FD/quit.sql cd $WORK_FD echo "Create TABLE end ..." echo ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ © 2012 Tibero Co., Ltd. All Rights Reserved.
40
TIBERO GUIDE
#PAUSE #Check TABLE echo ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ echo "Check TABLE..." tbsql ‐s sys/tibero @check/table_check.sql< $WORK_FD/quit.sql echo "Check TABLE end..." echo ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ echo `date` 7.2 Programs ‐ DivideScriptFile /** * @author jjc * Contains individual object folders for each schema. * Reads the object file name which is in each object folder and then creates the Objects.sql file. * First argument: Top‐level SQL folder * Second argument: directory identifier in sql files (specifies a Unix‐style user identifier to be used in Windows environment.) * * [Usage] : DivideScriptFile ScriptRootFolder [file_separator] */ import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; public class DivideScriptFile { public DivideScriptFile() { } // TODO Auto‐generated constructor stub © 2012 Tibero Co., Ltd. All Rights Reserved.
41
TIBERO GUIDE
/** * [Usage] : DivideScriptFile ScriptRootFolder [file_separator] */ public static void main(String[] args) throws FileNotFoundException, IOException { if( args.length < 2 ) { System.out.println("[Usage] : DivideScriptFile ScriptRootFolder [file_separator]"); return; } String fileExt = ".sql"; String fseparator = File.separator; System.out.println("args[0] : " + args[0] ); System.out.println("args[1] : " + args[1] ); if( args[1] != null || !"".equals(args[1].toString()) ) { } File fRootFolder = new File( args[0] ); File[] fSchemaList = fRootFolder.listFiles(); File[] fObjectList = null; File[] fEachObject = null; String sFileName = null; String sFilePath = null; String sDividePath = null; BufferedWriter out = null; // Check Schema List for( File fSchema : fSchemaList ) { // Check Directory fseparator = args[1].toString(); © 2012 Tibero Co., Ltd. All Rights Reserved.
42
TIBERO GUIDE
if( !fSchema.isDirectory() ) { } // Skip Share Folder if( "01.Common".equals(fSchema.getName()) ) { } fObjectList = fSchema.listFiles(); // Object List for( File sObj : fObjectList ) { // Check Directory if( !sObj.isDirectory() ) { } fEachObject = sObj.listFiles(); // Set Output File sFilePath = sObj.getPath(); sDividePath = sFilePath.substring( sFilePath.lastIndexOf(File.separator)+1 ); String sOutFileNm = fSchema.getPath() + File.separator + sDividePath.toLowerCase() + out = new BufferedWriter(new FileWriter(sOutFileNm)); // sort NONFK, FK if( "Constraints".equals(sDividePath) ) { ArrayList<String> arFK = new ArrayList<String>(); for( File fTemp : fEachObject ) { // ignore directory continue; continue; continue; fileExt; © 2012 Tibero Co., Ltd. All Rights Reserved.
43
TIBERO GUIDE
if( fTemp.isDirectory() ) { } sFileName = fTemp.getName(); if( sFileName.contains("NonFK") ) { out.append("@"+sDividePath + fseparator + out.newLine(); continue; sFileName ); } else { // FK is appended in last arFK.add("@"+sDividePath + fseparator + sFileName); } } if( arFK.size() > 0 ) { int iLoopCnt = arFK.size(); for( int i = 0; i < iLoopCnt; i++ ) { out.append(arFK.get(i) ); out.newLine(); } } // close file out.close(); } else { for( File fTemp : fEachObject ) { // ignore directory if( fTemp.isDirectory() ) { } sFileName = fTemp.getName(); © 2012 Tibero Co., Ltd. All Rights Reserved.
44
continue; TIBERO GUIDE
out.append("@"+sDividePath + fseparator + sFileName ); out.newLine(); } // close file out.close(); } } } // Schema For System.out.println( "divide complete!!"); } } © 2012 Tibero Co., Ltd. All Rights Reserved.
45
TIBERO GUIDE
Total enterprise solution provider, TIBERO
© 2012 Tibero Co., Ltd. All Rights Reserved.
46