1 package com.rapide_act;
3 import java.io.BufferedInputStream;
4 import java.io.FileInputStream;
5 import java.io.IOException;
6 import java.io.InputStream;
8 import java.io.FileReader;
9 import java.io.FileWriter;
10 import java.io.BufferedWriter;
11 import java.io.BufferedReader;
12 import java.io.PrintWriter;
13 import java.io.PrintWriter;
14 import java.util.Date;
15 import java.util.ArrayList;
16 import java.util.Iterator;
17 import java.util.Properties;
18 import java.util.regex.Pattern;
19 import java.sql.Connection;
20 import java.sql.DriverManager;
21 import java.sql.ResultSet;
22 import java.sql.ResultSetMetaData;
23 import java.sql.SQLException;
24 import java.sql.PreparedStatement;
25 import java.sql.Timestamp;
29 public class RapideMetaUnloader{
31 private static final int FL_TABLE = 0;
32 private static final int FL_INDEX = 1;
33 private static final int FL_VIEW = 2;
34 private static final int FL_PROCEDURE = 3;
35 private static final int FL_SEQ = 4;
36 private static final int FL_SYNONYM = 5;
37 private static final int FL_OBJ = 6;
38 private static final int FL_FK = 7;
39 private static final String [] FILE_NAME = {
49 private static final String [][] sql = {
52 + "a.table_name as table_name,"
53 + "replace(replace(b.comments, chr(13), ''), chr(10), '') as table_comments,"
54 + "c.column_name as column_name, "
55 + "replace(replace(d.comments, chr(13), ''), chr(10), '') as column_comments, "
56 + "decode(c.data_type, 'TIMESTAMP(6)', 'TIMESTAMP',c.data_type) as data_type, "
57 + "c.data_length as data_length,"
58 + "c.data_precision as data_precision,"
59 + "c.data_scale as data_scale,"
60 + "decode(c.nullable, 'N', '
\81\9b', null) as nullable,"
61 + "c.data_default as data_default "
62 + "from user_tables a "
63 + "inner join user_tab_comments b "
64 + "on a.table_name = b.table_name "
65 + "inner join user_tab_columns c "
66 + "on a.table_name = c.table_name "
67 + "inner join user_col_comments d "
68 + "on c.table_name = d.table_name "
69 + " and c.column_name = d.column_name "
70 + "order by a.table_name,c.column_id",
75 + " c.constraint_type,"
77 + " b.column_position "
80 + " user_ind_columns b,"
81 + " user_constraints c "
83 + " a.table_name = b.table_name and"
84 + " a.index_name = b.index_name and"
85 + " a.table_name = c.table_name(+) and"
86 + " a.index_name = c.constraint_name(+) "
90 + " b.column_position",
93 + " replace(replace(c.comments, chr(13), ''), chr(10), '') as comments "
96 + " user_tab_comments c "
98 + " a.view_name = c.table_name(+) "
106 + " where object_type in('PACKAGE','PROCEDURE','FUNCTION','TRIGGER','TYPE')"
107 + " group by object_name,object_type"
108 + " order by object_name,object_type",
111 + " to_char(min_value) as min_value,"
112 + " to_char(max_value) as max_value,"
113 + " to_char(increment_by) as increment_by,"
116 + " to_char(cache_size) as cache_size,"
117 + " to_char(last_number) as last_number "
118 + " from user_sequences "
119 + " order by sequence_name",
125 + "from user_synonyms "
126 + "order by synonym_name,table_owner,table_name",
135 + " a.freelist_groups,"
137 + " a.tablespace_name, "
143 + " table_name as object_name,"
144 + " 'TABLE' as object_type,"
149 + " freelist_groups,"
151 + " tablespace_name, "
157 + " index_name as object_name,"
158 + " 'INDEX' as object_type,"
160 + " null as pct_used,"
163 + " freelist_groups,"
165 + " tablespace_name, "
177 + " where a.object_name = b.segment_name "
178 + " and a.object_type = b.segment_type "
183 + " a.table_name as table_name, "
184 + " a.constraint_name as constraint_name, "
185 + " b.column_name as column_name, "
186 + " b.position as position,"
187 + " c.table_name as r_table_name, "
188 + " c.constraint_name as r_constraint_name, "
189 + " d.column_name as r_column_name, "
190 + " d.position as r_position "
192 + " user_constraints a, "
193 + " user_cons_columns b,"
194 + " user_constraints c, "
195 + " user_cons_columns d "
197 + " a.constraint_type = 'R'"
198 + " and a.owner = b.owner"
199 + " and a.table_name = b.table_name"
200 + " and a.constraint_name = b.constraint_name"
201 + " and c.constraint_type in('P','U')"
202 + " and c.owner = b.owner"
203 + " and c.table_name = d.table_name"
204 + " and c.constraint_name = d.constraint_name"
205 + " and a.r_owner = c.owner"
206 + " and a.r_constraint_name = c.constraint_name"
208 + " a.table_name,a.constraint_name,b.position,d.position"
211 private static String sql_view_text = "select text from user_views where view_name = ?";
212 private static String sql_view_column_and_comment = "select "
214 + " replace(replace(d.comments, chr(13), ''), chr(10), '') as comments "
216 + " user_tab_columns b,"
217 + " user_col_comments d "
219 + " b.table_name = ? and"
220 + " b.table_name = d.table_name(+) and"
221 + " b.column_name = d.column_name(+) "
224 private static String sql_proc = "select text from user_source where name = ? order by line";
226 private String database = null;
228 public static void main(String args[]){
230 if (args.length > 0){
231 RapideMetaUnloader RapideMetaUnloader = new RapideMetaUnloader(args[0]);
232 RapideMetaUnloader.metaUnload();
234 RapideMetaUnloader RapideMetaUnloader = new RapideMetaUnloader(null);
235 RapideMetaUnloader.metaUnload();
237 } catch (Exception e) {
242 RapideMetaUnloader(String _database) {
244 database = _database;
248 private void metaUnload(){
249 Connection conn = null;
250 PreparedStatement stmt = null;
251 BufferedReader [] br = new BufferedReader[4];
252 PrintWriter [] pw = new PrintWriter[6];
254 File subFolder = null;
255 String strLine = null;
256 String strLine2 = null;
257 String [][] strSplit = new String[4][];
258 String strContents = null;
259 ArrayList<String> alData = null;
260 ArrayList<String> alData2 = null;
262 String tableName = null;
263 String tableCmnt = null;
264 String colName = null;
265 String colCmnt = null;
266 String colType = null;
267 String colLen = null;
268 String colPrec = null;
269 String colScale = null;
270 String colNoN = null;
271 String colDflt = null;
272 String indexName = null;
273 String indexType = null;
274 String constraintType = null;
275 String colPos = null;
276 String seqName = null;
277 String minVal = null;
278 String maxVal = null;
282 String cacheSz = null;
284 String synmOwner = null;
285 String synmName = null;
286 String tbOwner = null;
287 String tbName = null;
289 String userName = null;
290 String passWord = null;
292 String created = null;
293 String acStat = null;
294 String defTbsp = null;
295 String tmpTbsp = null;
296 String grntee = null;
297 String grntor = null;
298 String grntrl = null;
300 String grntabl = null;
303 String objName = null;
304 String objTyp = null;
305 String pctFree = null;
306 String pctUsed = null;
307 String iniTrns = null;
308 String freeLst = null;
309 String flstGrp = null;
310 String bufPool = null;
311 String tblSpace = null;
312 String logging = null;
313 String segByts = null;
315 String fkName = null;
317 String fkColPos = null;
318 String rtbName = null;
319 String rfkName = null;
320 String rfkCol = null;
321 String rfkColPos = null;
324 CmnAccessObjects dao = null;
328 cp.setProperty(database);
330 if (cp.dbType != cp.DB_TYPE_ORACLE){
331 throw new Exception("
\83f
\81[
\83^
\83x
\81[
\83X
\82ª
\91Î
\8fÛ
\8aO
\82Å
\82·
\81B[" + cp.DB_TYPE_NAME[cp.dbType] + "]");
333 if(cp.outFolder != null){
334 folder = new File(cp.outFolder);
336 if(database != null){
337 folder = new File(cp.DEFAULT_OUT_FOLDER + "/DDL_" + database.toUpperCase() + "_" + CmnUtils.getYmdhm());
339 folder = new File(cp.DEFAULT_OUT_FOLDER + "/DDL_" + cp.DB_TYPE_NAME[cp.dbType].toUpperCase() + "_" + CmnUtils.getYmdhm());
344 CmnUtils.infoPrint("-->
\8fo
\97Í
\90æ
\83t
\83H
\83\8b\83_='" + folder + "'");
345 CmnUtils.infoPrint("
\83\81\83^
\83f
\81[
\83^
\83A
\83\93\83\8d\81[
\83h
\82ð
\8aJ
\8en
\82µ
\82Ü
\82µ
\82½
\81B");
348 dao = new CmnAccessObjects(cp);
349 conn = dao.connect();
350 // Def tsv Writing start
351 for(int i=0;i<sql[cp.dbType].length;i++){
352 dao.select(sql[cp.dbType][i]);
353 CmnUtils.writeSeparator(folder + "/" + FILE_NAME[i] + "_" + database +"." + cp.fileExtension, dao.getColumnCount(), dao.getArrayList(), cp.delimiter);
355 // Def tsv Writing end
357 // Table Contents start
358 br[0] = new BufferedReader(new FileReader(folder + "/" + FILE_NAME[FL_TABLE] + "_" + database + "." + cp.fileExtension));
359 subFolder = new File(folder + "/TABLES");
361 pw[1] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_TABLE]))));
362 pw[2] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.DROP_TABLE]))));
363 pw[3] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.TRUNCATE_TABLE]))));
376 StringBuffer sbTbCnts = new StringBuffer();
377 StringBuffer sbTbCmnt = new StringBuffer();
378 while((strLine=br[0].readLine()) != null){
379 if(!strLine.equals("")){
380 strSplit[0] = CmnUtils.split(strLine, cp.delimiter);
381 if (!tableName.equals("")){
382 sbTbCnts.append(" " + cp.sqlQuoted + colName + cp.sqlQuoted);
383 sbTbCnts.append(" " + colType);
384 if(!colCmnt.equals(""))sbTbCmnt.append("COMMENT ON COLUMN " + cp.sqlQuoted + tableName + cp.sqlQuoted + "." + cp.sqlQuoted + colName + cp.sqlQuoted + " IS '" + colCmnt.replaceAll("'","''") + "';");
385 if(!colCmnt.equals(""))sbTbCmnt.append(cp.lineSeparator);
386 if(CmnUtils.isColPrec(colType, colPrec)){
387 sbTbCnts.append("(" + colPrec);
388 if (!colScale.equals(""))sbTbCnts.append("," + colScale);
389 sbTbCnts.append(")");
390 } else if (CmnUtils.isColLength(colType, colLen)){
391 sbTbCnts.append("(" + CmnUtils.getColLength(colType, colLen) + ")");
393 if (!colDflt.equals(""))sbTbCnts.append(" DEFAULT " + colDflt.trim());
394 if (colNoN.equals("
\81\9b"))sbTbCnts.append(" NOT NULL");
395 if (!strSplit[0][0].equals(tableName)){
396 pw[1].println("@TABLES/" + tableName + ".sql");
397 pw[2].println("DROP TABLE " + cp.sqlQuoted + tableName + cp.sqlQuoted + " CASCADE CONSTRAINT PURGE;");
398 pw[3].println("TRUNCATE TABLE " + cp.sqlQuoted + tableName + cp.sqlQuoted + ";");
399 sbTbCnts.append(cp.lineSeparator);
400 sbTbCnts.append(");");
401 sbTbCnts.append(cp.lineSeparator);
402 pw[0] = new PrintWriter(new BufferedWriter(new FileWriter(new File(subFolder + "/" + tableName + ".sql"))));
403 strSplit[1] = CmnUtils.splitCrLf(sbTbCnts.toString());
404 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[0].println(strSplit[1][i]);
405 strSplit[2] = CmnUtils.splitCrLf(sbTbCmnt.toString());
406 for(int i=0;i<strSplit[2].length;i++)if(!strSplit[2][i].trim().equals(""))pw[0].println(strSplit[2][i]);
409 sbTbCnts = new StringBuffer();
410 sbTbCmnt = new StringBuffer();
411 sbTbCnts.append("CREATE TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted);
412 sbTbCnts.append(cp.lineSeparator);
413 sbTbCnts.append("(");
414 sbTbCnts.append(cp.lineSeparator);
415 if(!strSplit[0][1].equals(""))sbTbCmnt.append("COMMENT ON TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " IS '" + strSplit[0][1].replaceAll("'","''") +"';");
416 if(!strSplit[0][1].equals(""))sbTbCmnt.append(cp.lineSeparator);
418 sbTbCnts.append(",");
419 sbTbCnts.append(cp.lineSeparator);
423 sbTbCnts.append("CREATE TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted);
424 sbTbCnts.append(cp.lineSeparator);
425 sbTbCnts.append("(");
426 sbTbCnts.append(cp.lineSeparator);
427 if(!strSplit[0][1].equals(""))sbTbCmnt.append("COMMENT ON TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " IS '" + strSplit[0][1].replaceAll("'","''") +"';");
428 if(!strSplit[0][1].equals(""))sbTbCmnt.append(cp.lineSeparator);
430 for(int i=0;i<strSplit[0].length;i++)CmnUtils.debugPrint("'" + strSplit[0][i] + "'");
432 tableName = strSplit[0][0];
433 tableCmnt = strSplit[0][1];
434 colName = strSplit[0][2];
435 colCmnt = strSplit[0][3];
436 colType = strSplit[0][4];
437 colLen = strSplit[0][5];
438 colPrec = strSplit[0][6];
439 colScale = strSplit[0][7];
440 colNoN = strSplit[0][8];
441 colDflt = strSplit[0][9];
445 if (!tableName.equals("")){
446 sbTbCnts.append(" " + cp.sqlQuoted + colName + cp.sqlQuoted);
447 sbTbCnts.append(" " + colType);
448 if(!colCmnt.equals(""))sbTbCmnt.append("COMMENT ON COLUMN " + cp.sqlQuoted + tableName + cp.sqlQuoted + "." + cp.sqlQuoted + colName + cp.sqlQuoted + " IS '" + colCmnt.replaceAll("'","''") + "';");
449 if(!colCmnt.equals(""))sbTbCmnt.append(cp.lineSeparator);
450 if(CmnUtils.isColPrec(colType, colPrec)){
451 sbTbCnts.append("(" + colPrec);
452 if (!colScale.equals(""))sbTbCnts.append("," + colScale);
453 sbTbCnts.append(")");
454 } else if (CmnUtils.isColLength(colType, colLen)){
455 sbTbCnts.append("(" + CmnUtils.getColLength(colType, colLen) + ")");
457 if (!colDflt.equals(""))sbTbCnts.append(" DEFAULT " + colDflt.trim());
458 if (colNoN.equals("
\81\9b"))sbTbCnts.append(" NOT NULL");
459 pw[1].println("@TABLES/" + tableName + ".sql");
460 pw[2].println("DROP TABLE " + cp.sqlQuoted + tableName + cp.sqlQuoted + " CASCADE CONSTRAINT PURGE;");
461 pw[3].println("TRUNCATE TABLE " + cp.sqlQuoted + tableName + cp.sqlQuoted + ";");
462 sbTbCnts.append(cp.lineSeparator);
463 sbTbCnts.append(");");
464 sbTbCnts.append(cp.lineSeparator);
465 pw[0] = new PrintWriter(new BufferedWriter(new FileWriter(new File(subFolder + "/" + tableName + ".sql"))));
466 strSplit[1] = CmnUtils.splitCrLf(sbTbCnts.toString());
467 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[0].println(strSplit[1][i]);
468 strSplit[2] = CmnUtils.splitCrLf(sbTbCmnt.toString());
469 for(int i=0;i<strSplit[2].length;i++)if(!strSplit[2][i].trim().equals(""))pw[0].println(strSplit[2][i]);
473 for(int i=1;i<4;i++)pw[i].close();
474 for(int i=1;i<4;i++)pw[i]=null;
477 // Table Contents end
479 // Index Contents start
480 br[0] = new BufferedReader(new FileReader(folder + "/" + FILE_NAME[FL_INDEX] + "_" + database + "." + cp.fileExtension));
481 pw[0] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_PKEY]))));
482 pw[1] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_UKEY]))));
483 pw[2] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_INDEX]))));
484 pw[3] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.DROP_PKEY]))));
485 pw[4] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.DROP_UKEY]))));
486 pw[5] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.DROP_INDEX]))));
495 StringBuffer sbIxCnts = new StringBuffer();
496 StringBuffer sbIx2Cnts = new StringBuffer();
497 StringBuffer sbIx3Cnts = new StringBuffer();
500 while((strLine=br[0].readLine()) != null){
501 if(!strLine.equals("")){
502 strSplit[0] = CmnUtils.split(strLine, cp.delimiter);
503 //Not 1st Line Process
504 if (!indexName.equals("")){
505 if (!strSplit[0][1].equals(indexName)){
507 if (colPos.equals("1")){
508 sbIxCnts.append(cp.sqlQuoted + colName + cp.sqlQuoted);
509 if (constraintType.equals("U"))sbIx2Cnts.append(cp.sqlQuoted + colName + cp.sqlQuoted);
511 sbIxCnts.append(", " + cp.sqlQuoted + colName + cp.sqlQuoted);
512 if (constraintType.equals("U"))sbIx2Cnts.append(", " + cp.sqlQuoted + colName + cp.sqlQuoted);
514 sbIxCnts.append(");");
515 sbIxCnts.append(cp.lineSeparator);
516 if (constraintType.equals("U"))sbIx2Cnts.append(");");
517 sbIx2Cnts.append(cp.lineSeparator);
518 sbIx3Cnts.append(cp.lineSeparator);
521 if (constraintType.equals("P")){
522 strSplit[1] = CmnUtils.splitCrLf(sbIxCnts.toString());
523 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[0].println(strSplit[1][i]);
524 strSplit[2] = CmnUtils.splitCrLf(sbIx2Cnts.toString());
525 for(int i=0;i<strSplit[2].length;i++)if(!strSplit[2][i].trim().equals(""))pw[3].println(strSplit[2][i]);
526 } else if (constraintType.equals("U")){
527 strSplit[1] = CmnUtils.splitCrLf(sbIxCnts.toString());
528 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[1].println(strSplit[1][i]);
529 strSplit[2] = CmnUtils.splitCrLf(sbIx2Cnts.toString());
530 for(int i=0;i<strSplit[2].length;i++)if(!strSplit[2][i].trim().equals(""))pw[4].println(strSplit[2][i]);
531 } else if (constraintType.equals("")){
532 strSplit[1] = CmnUtils.splitCrLf(sbIxCnts.toString());
533 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[2].println(strSplit[1][i]);
535 strSplit[3] = CmnUtils.splitCrLf(sbIx3Cnts.toString());
536 for(int i=0;i<strSplit[3].length;i++)if(!strSplit[3][i].trim().equals(""))pw[5].println(strSplit[3][i]);
539 sbIxCnts = new StringBuffer();
540 sbIx2Cnts = new StringBuffer();
541 sbIx3Cnts = new StringBuffer();
543 //Index Changed Process
544 if (strSplit[0][3].equals("P")){
545 sbIxCnts.append("ALTER TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " ADD CONSTRAINT " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + " PRIMARY KEY(");
546 sbIx2Cnts.append("ALTER TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " DROP CONSTRAINT " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + ";");
547 } else if (strSplit[0][3].equals("U")){
548 sbIxCnts.append("ALTER TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " ADD CONSTRAINT " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + " UNIQUE(");
549 sbIx2Cnts.append("ALTER TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " DROP UNIQUE(");
550 } else if (strSplit[0][3].equals("")){
551 sbIxCnts.append("CREATE INDEX " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + " ON " + strSplit[0][0] + "(");
553 sbIx3Cnts.append("DROP INDEX " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + ";");
554 } else if (strSplit[0][1].equals(indexName)){
555 if (colPos.equals("1")){
556 sbIxCnts.append(cp.sqlQuoted + colName + cp.sqlQuoted);
557 if (constraintType.equals("U"))sbIx2Cnts.append(cp.sqlQuoted + colName + cp.sqlQuoted);
559 sbIxCnts.append(", " + cp.sqlQuoted + colName + cp.sqlQuoted);
560 if (constraintType.equals("U"))sbIx2Cnts.append(", " + cp.sqlQuoted + colName + cp.sqlQuoted);
567 if (strSplit[0][3].equals("P")){
568 sbIxCnts.append("ALTER TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " ADD CONSTRAINT " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + " PRIMARY KEY(");
569 sbIx2Cnts.append("ALTER TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " DROP CONSTRAINT " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + ";");
570 } else if (strSplit[0][3].equals("U")){
571 sbIxCnts.append("ALTER TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " ADD CONSTRAINT " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + " UNIQUE(");
572 sbIx2Cnts.append("ALTER TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " DROP UNIQUE(");
573 } else if (strSplit[0][3].equals("")){
574 sbIxCnts.append("CREATE INDEX " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + " ON " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + "(");
576 sbIx3Cnts.append("DROP INDEX " + cp.sqlQuoted + strSplit[0][1] + cp.sqlQuoted + ";");
578 for(int i=0;i<strSplit[0].length;i++)CmnUtils.debugPrint("'" + strSplit[0][i] + "'");
580 tableName = strSplit[0][0];
581 indexName = strSplit[0][1];
582 indexType = strSplit[0][2];
583 constraintType = strSplit[0][3];
584 colName = strSplit[0][4];
585 colPos = strSplit[0][5];
588 if (!indexName.equals("")){
590 if (colPos.equals("1")){
591 sbIxCnts.append(cp.sqlQuoted + colName + cp.sqlQuoted);
592 if (constraintType.equals("U"))sbIx2Cnts.append(cp.sqlQuoted + colName + cp.sqlQuoted);
594 sbIxCnts.append(", " + cp.sqlQuoted + colName + cp.sqlQuoted);
595 if (constraintType.equals("U"))sbIx2Cnts.append(", " + cp.sqlQuoted + colName + cp.sqlQuoted);
597 sbIxCnts.append(");");
598 sbIxCnts.append(cp.lineSeparator);
599 if (constraintType.equals("U"))sbIx2Cnts.append(");");
600 sbIx2Cnts.append(cp.lineSeparator);
601 sbIx3Cnts.append(cp.lineSeparator);
604 if (constraintType.equals("P")){
605 strSplit[1] = CmnUtils.splitCrLf(sbIxCnts.toString());
606 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[0].println(strSplit[1][i]);
607 strSplit[2] = CmnUtils.splitCrLf(sbIx2Cnts.toString());
608 for(int i=0;i<strSplit[2].length;i++)if(!strSplit[2][i].trim().equals(""))pw[3].println(strSplit[2][i]);
609 } else if (constraintType.equals("U")){
610 strSplit[1] = CmnUtils.splitCrLf(sbIxCnts.toString());
611 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[1].println(strSplit[1][i]);
612 strSplit[2] = CmnUtils.splitCrLf(sbIx2Cnts.toString());
613 for(int i=0;i<strSplit[2].length;i++)if(!strSplit[2][i].trim().equals(""))pw[4].println(strSplit[2][i]);
614 } else if (constraintType.equals("")){
615 strSplit[1] = CmnUtils.splitCrLf(sbIxCnts.toString());
616 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[2].println(strSplit[1][i]);
618 strSplit[3] = CmnUtils.splitCrLf(sbIx3Cnts.toString());
619 for(int i=0;i<strSplit[3].length;i++)if(!strSplit[3][i].trim().equals(""))pw[5].println(strSplit[3][i]);
623 for(int i=0;i<6;i++)pw[i].close();
624 for(int i=0;i<6;i++)pw[i]=null;
627 // Index Contents end
629 // View Contents start
630 br[0] = new BufferedReader(new FileReader(folder + "/" + FILE_NAME[FL_VIEW] + "_" + database + "." + cp.fileExtension));
631 subFolder = new File(folder + "/VIEWS");
633 pw[1] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_VIEW]))));
634 pw[2] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.DROP_VIEW]))));
635 while((strLine=br[0].readLine()) != null){
636 strSplit[0] = CmnUtils.split(strLine, cp.delimiter);
637 CmnUtils.debugPrint("'" + strSplit[0][0] + "'");
638 pw[1].println("@VIEWS/" + strSplit[0][0] + ".sql");
639 pw[2].println("DROP VIEW " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + ";");
640 if (strSplit[0].length>1)CmnUtils.debugPrint("'" + strSplit[0][1] + "'");
641 pw[0] = new PrintWriter(new BufferedWriter(new FileWriter(new File(subFolder + "/" + strSplit[0][0] + ".sql"))));
642 stmt = dao.prepareSql(sql_view_column_and_comment);
643 stmt.setString(1,strSplit[0][0]);
645 alData = dao.getArrayList();
646 columnCount = dao.getColumnCount();
647 pw[0].println("/* " + strSplit[0][0] + " */");
648 pw[0].println("CREATE OR REPLACE VIEW " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted);
650 for(int i=0;i<alData.size();i++){
651 if ((i+1) % columnCount == 1){
653 if (!alData.get(i+1).equals("")){
654 pw[0].println(" " + alData.get(i) + " -- " + alData.get(i+1));
656 pw[0].println(" " + alData.get(i));
659 if (!alData.get(i+1).equals("")){
660 pw[0].println(" ," + alData.get(i) + " -- " + alData.get(i+1));
662 pw[0].println(" ," + alData.get(i));
669 stmt = dao.prepareSql(sql_view_text);
670 stmt.setString(1,strSplit[0][0]);
672 alData2 = dao.getArrayList();
673 strContents = alData2.get(0).trim();
674 strSplit[1] = CmnUtils.splitCrLf(strContents);
675 for(int i=0;i<strSplit[1].length;i++)if(!strSplit[1][i].trim().equals(""))pw[0].println(strSplit[1][i].replaceAll("\"\"","\"").replaceAll(Pattern.quote(cp.user.toUpperCase() + "."),"").replaceAll(Pattern.quote(cp.user.toLowerCase() + "."),""));
677 if (!strSplit[0][1].equals(""))pw[0].println("COMMENT ON TABLE " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + " IS '" + strSplit[0][1].replaceAll("'","''") + "';");
678 for(int i=0;i<alData.size();i++){
679 if ((i+1) % columnCount == 0){
680 if (!alData.get(i).equals(""))pw[0].println("COMMENT ON COLUMN " + cp.sqlQuoted + strSplit[0][0] + cp.sqlQuoted + "." + alData.get(i-1) + " IS '" + alData.get(i).replaceAll("'","''") + "';");
686 for(int i=1;i<3;i++)pw[i].close();
687 for(int i=1;i<3;i++)pw[i]=null;
692 // Procedure Contents start
693 br[0] = new BufferedReader(new FileReader(folder + "/" + FILE_NAME[FL_PROCEDURE] + "_" + database + "." + cp.fileExtension));
694 subFolder = new File(folder + "/PROCEDURES");
696 pw[1] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_PROCEDURE]))));
697 pw[2] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.DROP_PROCEDURE]))));
698 while((strLine=br[0].readLine()) != null){
699 strSplit[0] = CmnUtils.split(strLine, cp.delimiter);
700 CmnUtils.debugPrint("'" + strSplit[0][0] + "'");
701 pw[1].println("@PROCEDURES/" + strSplit[0][0] + ".sql");
702 pw[2].println("DROP " + strSplit[0][1] + " " + strSplit[0][0] + ";");
703 if (strSplit[0].length>1)CmnUtils.debugPrint("'" + strSplit[0][1] + "'");
704 pw[0] = new PrintWriter(new BufferedWriter(new FileWriter(new File(subFolder + "/" + strSplit[0][0] + ".sql"))));
705 pw[0].println("/* " + strSplit[0][0] + " */");
706 pw[0].print("CREATE OR REPLACE ");
707 stmt = dao.prepareSql(sql_proc);
708 stmt.setString(1,strSplit[0][0]);
710 alData = dao.getArrayList();
711 for(int i=0;i<alData.size();i++){
712 strContents = alData.get(i);
713 if(!strContents.equals(""))pw[0].println(strContents.replaceAll(Pattern.quote(cp.user.toUpperCase() + "."),"").replaceAll(Pattern.quote(cp.user.toLowerCase() + "."),""));
715 //pw[0].println("/");
719 for(int i=1;i<3;i++)pw[i].close();
720 for(int i=1;i<3;i++)pw[i]=null;
723 // Procedure Contents end
725 // Sequence Contents start
726 br[0] = new BufferedReader(new FileReader(folder + "/" + FILE_NAME[FL_SEQ] + "_" + database + "." + cp.fileExtension));
727 pw[1] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SEQUENCE]))));
728 pw[2] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.DROP_SEQUENCE]))));
730 while((strLine=br[0].readLine()) != null){
731 strSplit[0] = CmnUtils.split(strLine, cp.delimiter);
732 seqName = strSplit[0][0];
733 minVal = strSplit[0][1];
734 maxVal = strSplit[0][2];
735 incSz = strSplit[0][3];
736 cycFg = strSplit[0][4];
737 odFg = strSplit[0][5];
738 cacheSz = strSplit[0][6];
739 if(cacheSz.equals("0"))cacheSz="10";
740 lstNo = strSplit[0][7];
741 pw[1].print("CREATE SEQUENCE " + cp.sqlQuoted + seqName + cp.sqlQuoted + " MINVALUE " + minVal + " MAXVALUE " + maxVal + " INCREMENT BY " + incSz + " START WITH " + lstNo + " CACHE " + cacheSz);
742 if (odFg.equals("N")){
743 pw[1].print(" NOORDER");
745 pw[1].print(" ORDER");
747 if (cycFg.equals("N")){
748 pw[1].print(" NOCYCLE");
750 pw[1].print(" CYCLE");
753 pw[2].println("DROP SEQUENCE " + cp.sqlQuoted + seqName + cp.sqlQuoted + ";");
754 for(int i=0;i<strSplit[0].length;i++)CmnUtils.debugPrint("'" + strSplit[0][i] + "'");
756 for(int i=1;i<3;i++)pw[i].close();
757 for(int i=1;i<3;i++)pw[i]=null;
760 // Sequence Contents end
762 // Synonym Contents start
763 br[0] = new BufferedReader(new FileReader(folder + "/" + FILE_NAME[FL_SYNONYM] + "_" + database + "." + cp.fileExtension));
764 pw[1] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SYNONYM]))));
765 pw[2] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.DROP_SYNONYM]))));
767 while((strLine=br[0].readLine()) != null){
768 strSplit[0] = CmnUtils.split(strLine, cp.delimiter);
769 synmName = strSplit[0][0];
770 tbOwner = strSplit[0][1];
771 tbName = strSplit[0][2];
772 dbLnk = strSplit[0][3];
774 pw[1].print("CREATE SYNONYM " + cp.sqlQuoted + synmName + cp.sqlQuoted + " FOR ");
775 if(dbLnk.equals("")){
776 pw[1].print(cp.sqlQuoted + tbOwner + cp.sqlQuoted + "." + cp.sqlQuoted + tbName + cp.sqlQuoted );
778 pw[1].print(cp.sqlQuoted + tbName + cp.sqlQuoted + "@" + cp.sqlQuoted + dbLnk + cp.sqlQuoted );
781 pw[2].println("DROP SYNONYM " + cp.sqlQuoted + synmName + cp.sqlQuoted + ";");
782 for(int i=0;i<strSplit[0].length;i++)CmnUtils.debugPrint("'" + strSplit[0][i] + "'");
784 for(int i=1;i<3;i++)pw[i].close();
785 for(int i=1;i<3;i++)pw[i]=null;
788 // Synonym Contents end
791 File tsvFile = new File(folder + "/" + FILE_NAME[FL_FK] + "_" + database + "." + cp.fileExtension);
792 if (tsvFile.length() > 0) {
793 br[0] = new BufferedReader(new FileReader(folder + "/" + FILE_NAME[FL_FK] + "_" + database + "." + cp.fileExtension));
794 pw[1] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_FK]))));
795 pw[2] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.DROP_FK]))));
805 while((strLine=br[0].readLine()) != null){
806 strSplit[0] = CmnUtils.split(strLine, cp.delimiter);
807 if(!fkName.equals(strSplit[0][1]) && !fkName.equals("")){
808 pw[1].println("ALTER TABLE " + cp.sqlQuoted + tbName + cp.sqlQuoted + " ADD CONSTRAINT " + cp.sqlQuoted + fkName + cp.sqlQuoted + " FOREIGN KEY (" + cp.sqlQuoted + fkCol + cp.sqlQuoted + ") REFERENCES " + cp.sqlQuoted + rtbName + cp.sqlQuoted + " (" + cp.sqlQuoted + rfkCol + cp.sqlQuoted + ");");
809 pw[2].println("ALTER TABLE " + cp.sqlQuoted + tbName + cp.sqlQuoted + " DROP CONSTRAINT " + cp.sqlQuoted + fkName + cp.sqlQuoted + ";");
810 for(int i=0;i<strSplit[0].length;i++)CmnUtils.debugPrint("'" + strSplit[0][i] + "'");
811 tbName = strSplit[0][0];
812 fkName = strSplit[0][1];
813 fkCol = strSplit[0][2];
814 fkColPos = strSplit[0][3];
815 rtbName = strSplit[0][4];
816 rfkName = strSplit[0][5];
817 rfkCol = strSplit[0][6];
818 rfkColPos = strSplit[0][7];
820 if(fkName.equals("")){
821 tbName = strSplit[0][0];
822 fkName = strSplit[0][1];
823 fkCol = strSplit[0][2];
824 fkColPos = strSplit[0][3];
825 rtbName = strSplit[0][4];
826 rfkName = strSplit[0][5];
827 rfkCol = strSplit[0][6];
828 rfkColPos = strSplit[0][7];
830 if (strSplit[0][3].equals(strSplit[0][7])) {
831 fkCol = fkCol + cp.sqlQuoted + ", " + cp.sqlQuoted + strSplit[0][2];
832 rfkCol = rfkCol + cp.sqlQuoted + ", " + cp.sqlQuoted + strSplit[0][6];
838 pw[1].println("ALTER TABLE " + cp.sqlQuoted + tbName + cp.sqlQuoted + " ADD CONSTRAINT " + cp.sqlQuoted + fkName + cp.sqlQuoted + " FOREIGN KEY (" + cp.sqlQuoted + fkCol + cp.sqlQuoted + ") REFERENCES " + cp.sqlQuoted + rtbName + cp.sqlQuoted + " (" + cp.sqlQuoted + rfkCol + cp.sqlQuoted + ");");
839 pw[2].println("ALTER TABLE " + cp.sqlQuoted + tbName + cp.sqlQuoted + " DROP CONSTRAINT " + cp.sqlQuoted + fkName + cp.sqlQuoted + ";");
840 for(int i=1;i<3;i++)pw[i].close();
841 for(int i=1;i<3;i++)pw[i]=null;
847 // Rhysical Contents start
849 // physical index setting
850 br[0] = new BufferedReader(new FileReader(folder + "/" + FILE_NAME[FL_OBJ] + "_" + database + "." + cp.fileExtension));
851 br[1] = new BufferedReader(new FileReader(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_PKEY]));
852 br[2] = new BufferedReader(new FileReader(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_UKEY]));
853 br[3] = new BufferedReader(new FileReader(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_INDEX]));
854 pw[1] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_PKEY] + ".phy"))));
855 pw[2] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_UKEY] + ".phy"))));
856 pw[3] = new PrintWriter(new BufferedWriter(new FileWriter(new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_INDEX] + ".phy"))));
857 alData = new ArrayList<String>();
860 while((strLine=br[0].readLine()) != null){
861 strSplit[0] = CmnUtils.split(strLine, cp.delimiter);
862 for(int i=0;i<strSplit[0].length;i++)alData.add(strSplit[0][i]);
864 while((strLine=br[1].readLine()) != null){
865 strSplit[0] = CmnUtils.splitSpace(strLine);
866 rowNo = CmnUtils.getArrayRowNo(alData, 12, 1, strSplit[0][5].replaceAll(cp.sqlQuoted,""));
868 rowData = rowData = CmnUtils.getArrayRowData(alData, 12, rowNo);
869 CmnUtils.debugPrint(strSplit[0][5] + ":" + rowNo);
870 for(int i=0;i<rowData.length;i++)CmnUtils.debugPrint(rowData[i]);
872 objName = rowData[1];
874 pctFree = rowData[3];
875 pctUsed = rowData[4];
876 iniTrns = rowData[5];
877 freeLst = rowData[6];
878 flstGrp = rowData[7];
879 bufPool = rowData[8];
880 tblSpace = rowData[9];
881 logging = rowData[10];
882 segByts = rowData[11];
883 pw[1].print(strLine.replace(';',' '));
884 pw[1].print("USING INDEX PCTFREE " + pctFree);
885 pw[1].print(" INITRANS " + iniTrns + " STORAGE(");
886 if(!freeLst.equals(""))pw[1].print(" FREELISTS " + freeLst);
887 if(!flstGrp.equals(""))pw[1].print(" FREELIST GROUPS " + flstGrp);
888 pw[1].print(" BUFFER_POOL " + bufPool + ")");
889 pw[1].print(" TABLESPACE " + cp.sqlQuoted + tblSpace + cp.sqlQuoted);
890 if(logging.equals("NO")){
891 pw[1].println(" NOLOGGING;");
896 pw[1].println(strLine);
897 CmnUtils.errorPrint(strSplit[0][5] + ",UNUSABLE INDEX");
900 while((strLine=br[2].readLine()) != null){
901 strSplit[0] = CmnUtils.splitSpace(strLine);
902 rowNo = CmnUtils.getArrayRowNo(alData, 12, 1, strSplit[0][5].replaceAll(cp.sqlQuoted,""));
904 rowData = rowData = CmnUtils.getArrayRowData(alData, 12, rowNo);
905 CmnUtils.debugPrint(strSplit[0][5] + ":" + rowNo);
906 for(int i=0;i<rowData.length;i++)CmnUtils.debugPrint(rowData[i]);
908 objName = rowData[1];
910 pctFree = rowData[3];
911 pctUsed = rowData[4];
912 iniTrns = rowData[5];
913 freeLst = rowData[6];
914 flstGrp = rowData[7];
915 bufPool = rowData[8];
916 tblSpace = rowData[9];
917 logging = rowData[10];
918 segByts = rowData[11];
919 pw[2].print(strLine.replace(';',' '));
920 pw[2].print("USING INDEX PCTFREE " + pctFree);
921 pw[2].print(" INITRANS " + iniTrns + " STORAGE(");
922 if(!freeLst.equals(""))pw[2].print(" FREELISTS " + freeLst);
923 if(!flstGrp.equals(""))pw[2].print(" FREELIST GROUPS " + flstGrp);
924 pw[2].print(" BUFFER_POOL " + bufPool + ")");
925 pw[2].print(" TABLESPACE " + cp.sqlQuoted + tblSpace + cp.sqlQuoted);
926 if(logging.equals("NO")){
927 pw[2].println(" NOLOGGING;");
932 pw[2].println(strLine);
933 CmnUtils.errorPrint(strSplit[0][5] + ",UNUSABLE INDEX");
936 while((strLine=br[3].readLine()) != null){
937 strSplit[0] = CmnUtils.splitSpace(strLine);
938 rowNo = CmnUtils.getArrayRowNo(alData, 12, 1, strSplit[0][2].replaceAll(cp.sqlQuoted,""));
939 CmnUtils.debugPrint("rowNo=" + rowNo);
941 rowData = CmnUtils.getArrayRowData(alData, 12, rowNo);
942 for(int i=0;i<rowData.length;i++)CmnUtils.debugPrint(rowData[i]);
944 objName = rowData[1];
946 pctFree = rowData[3];
947 pctUsed = rowData[4];
948 iniTrns = rowData[5];
949 freeLst = rowData[6];
950 flstGrp = rowData[7];
951 bufPool = rowData[8];
952 tblSpace = rowData[9];
953 logging = rowData[10];
954 segByts = rowData[11];
955 pw[3].print(strLine.replace(';',' '));
956 pw[3].print("PCTFREE " + pctFree);
957 pw[3].print(" INITRANS " + iniTrns + " STORAGE(");
958 if(!freeLst.equals(""))pw[3].print(" FREELISTS " + freeLst);
959 if(!flstGrp.equals(""))pw[3].print(" FREELIST GROUPS " + flstGrp);
960 pw[3].print(" BUFFER_POOL " + bufPool + ")");
961 pw[3].print(" TABLESPACE " + cp.sqlQuoted + tblSpace + cp.sqlQuoted);
962 if(logging.equals("NO")){
963 pw[3].println(" NOLOGGING;");
968 pw[3].println(strLine);
969 CmnUtils.errorPrint(strSplit[0][2] + ",UNUSABLE INDEX");
972 for(int i=1;i<4;i++)pw[i].close();
973 for(int i=1;i<4;i++)pw[i]=null;
974 for(int i=0;i<4;i++)br[i].close();
975 for(int i=0;i<4;i++)br[i]=null;
977 File [] fmFl = new File[6];
978 File [] toFl = new File[6];
980 fmFl[0] = new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_PKEY] + ".phy");
981 fmFl[1] = new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_UKEY] + ".phy");
982 fmFl[2] = new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_INDEX] + ".phy");
983 toFl[0] = new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_PKEY]);
984 toFl[1] = new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_UKEY]);
985 toFl[2] = new File(folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_INDEX]);
986 for(int i=0;i<3;i++){
987 CmnUtils.debugPrint(fmFl[i].toString() + ">" + toFl[i].toString());
989 fmFl[i].renameTo(toFl[i]);
992 // physical table setting
993 File tbDir = new File(folder + "/TABLES");
994 File [] tbFiles = tbDir.listFiles();
997 for(int i=0;i<tbFiles.length;i++){
999 tbName = tb.getName().replaceAll(".sql","");
1000 oTb = new File(tb + ".phy");
1001 CmnUtils.debugPrint(tbName);
1002 br[0] = new BufferedReader(new FileReader(tb));
1003 pw[0] = new PrintWriter(new BufferedWriter(new FileWriter(oTb)));
1004 while((strLine=br[0].readLine()) != null){
1005 if(strLine.equals(");")){
1006 rowNo = CmnUtils.getArrayRowNo(alData, 12, 1, tbName);
1008 rowData = CmnUtils.getArrayRowData(alData, 12, rowNo);
1009 CmnUtils.debugPrint(tbName + ":" + rowNo);
1010 //for(int j=0;j<rowData.length;i++)CmnUtils.debugPrint(rowData[j]);
1011 tbName = rowData[0];
1012 objName = rowData[1];
1013 objTyp = rowData[2];
1014 pctFree = rowData[3];
1015 pctUsed = rowData[4];
1016 iniTrns = rowData[5];
1017 freeLst = rowData[6];
1018 flstGrp = rowData[7];
1019 bufPool = rowData[8];
1020 tblSpace = rowData[9];
1021 logging = rowData[10];
1022 segByts = rowData[11];
1023 pw[0].print(") PCTFREE " + pctFree);
1024 if(!pctUsed.equals(""))pw[0].print(" PCTUSED " + pctUsed);
1025 pw[0].print(" INITRANS " + iniTrns + " STORAGE(");
1026 if(!freeLst.equals(""))pw[0].print(" FREELISTS " + freeLst);
1027 if(!flstGrp.equals(""))pw[0].print(" FREELIST GROUPS " + flstGrp);
1028 pw[0].print(" BUFFER_POOL " + bufPool + ")");
1029 pw[0].print(" TABLESPACE " + cp.sqlQuoted + tblSpace + cp.sqlQuoted);
1030 if(logging.equals("NO")){
1031 pw[0].println(" NOLOGGING;");
1036 pw[0].println(");");
1039 pw[0].println(strLine);
1050 // Rhysical Contents end
1054 for(int i=0;i<sql[cp.dbType].length;i++){
1055 fl= new File(folder + "/" + FILE_NAME[i] + "_" + database + "." + cp.fileExtension);
1056 CmnUtils.debugPrint(fl.toString());
1060 // disconnect database
1062 CmnUtils.infoPrint("
\83\81\83^
\83f
\81[
\83^
\83A
\83\93\83\8d\81[
\83h
\82ð
\8fI
\97¹
\82µ
\82Ü
\82µ
\82½
\81B");
1064 } catch(SQLException se) {
1066 CmnUtils.errorPrint(se.toString());
1067 se.printStackTrace();
1068 se = se.getNextException();
1070 System.out.println(se.getMessage());
1073 } catch (Exception see) {}
1074 } catch (Exception e) {
1076 CmnUtils.errorPrint(e.toString());
1077 e.printStackTrace();
1079 } catch (Exception ee) {}
1082 for(int i=0;i<6;i++){
1088 for(int i=0;i<4;i++){
1094 } catch (Exception e) {}