public class Unlcvt extends CommonShell implements UpgConstants
Unlcvt.
(File extension is "ora" for Oracle, "sqs" for SqlServer, and "ddl" for DB2.)
Also see the -o parameter.
Developers with an existing Maximo database who are performing a refresh using a
MAXIMO tablespace can run this script as is, using SQL*Plus or ISQL.
Anyone who is creating a new database must run this via
Maxinst.
This runs independently of MXServer. MXServer should NOT be running at the same time as this program, otherwise the database may be changing at the same time that this program is trying to determine what to output.
The commandline parameters for Unlcvt are as follows, in addition to those in the superclass
CommonShell.
| Parameter ID | Parameter Value | Description |
|---|---|---|
| -b | (none) | Output format for inserting data supports PreparedStatement in Maxinst. This is to support very large databases. |
| -d | (none) | The output directory parameter is ignored; the file is always output to the MXServer root. |
| -e | (none) | "Execute sql" is always True for Unlcvt, hence the commandline param is not used. |
| -l | (none) | "Log sql" is always True for Unlcvt, hence the commandline param is not used. |
| -m | Integer | Will limit output file size to the specified number of lines. If more lines are needed then additional output files will be written, using the same filename as the original plus a number (2, 3, 4, etc.). Maxinst will be able to read in these multiple files. |
| -o | Output filename | Output filename; defaults to "Unlcvt" + appropriate extension for db platform. Created in the MXServer root directory. |
| -x | Output database platform | This is optional.
If not specified, the output file will be formatted for the same
database platform as the input database (Oracle to Oracle, or SQLServer to SQLServer).
If this parameter is specified, the output will be for the specified platform.
Valid values are in UpgConstants.
|
CommonShelllistStreamDB2, doNotUpdateACTION, doNotUpdateALNDOMAIN, doNotUpdateAPPLICATIONAUTH, doNotUpdateAUTOKEY, doNotUpdateCONDITION, doNotUpdateCONTRACTPROPERTY, doNotUpdateCONTRACTTYPE, doNotUpdateCROSSOVERDOMAIN, doNotUpdateDOCTYPES, doNotUpdateLANGUAGE, doNotUpdateMAXAPPS, doNotUpdateMAXCONDDETAIL, doNotUpdateMAXCONTROLVALUE, doNotUpdateMAXDOMAIN, doNotUpdateMAXLOGAPPENDER, doNotUpdateMAXLOGGER, doNotUpdateMAXMENU, doNotUpdateMAXMESSAGES, doNotUpdateMAXMODULES, doNotUpdateMAXPROP, doNotUpdateMAXPROPVALUE, doNotUpdateMAXROLE, doNotUpdateMAXSEQUENCE, doNotUpdateMAXSERSECURITY, doNotUpdateMAXSERVICE, doNotUpdateMAXTABLEDOMAIN, doNotUpdateMAXVARS, doNotUpdateMAXVARTYPE, doNotUpdateMXCOLLAB, doNotUpdateMXCOLLABREF, doNotUpdateNUMERICDOMAIN, doNotUpdateNUMRANGEDOMAIN, doNotUpdatePORTLET, doNotUpdatePRICALC, doNotUpdateSECURITYRESTRICT, doNotUpdateSIGOPTION, doNotUpdateSYNONYMDOMAIN, doNotUpdateTAXTYPE, doNotUpdateWORKPRIORITY, doNotUpdateWORKTYPE, doNotUpdateWPEDITSETTING, messageCache, NEWONLY, OLDANDNEW, OLDONLY, ORACLE, SQLINET, SQLMICROSOFT, SQLSERVER, SYSDATATABLES, SYSTEMTABLES, UNKNOWN| Constructor and Description |
|---|
Unlcvt()
This constructor does nothing.
|
Unlcvt(MXServer server)
This constructor accepts parameter for MXServerRemote and
sets value for
mxs. |
| Modifier and Type | Method and Description |
|---|---|
void |
buildGrants()
Write the "grant..." statements (none for DB2).
|
void |
cacheSequences()
Cache the sequences for later use in
createSequences. |
void |
createCatalog()
Create catalog for SqlServer text search.
|
void |
createIndexes()
Write "drop index" and "create index" statements.
|
void |
createLexer()
Create lexer for Oracle text search.
|
void |
createOutfile(java.lang.String outdir,
java.lang.String outfile)
Create "Unlcvt" + appropriate extension in MXServer root directory.
|
void |
createRowstampTriggers()
Write sql to create the rowstamp triggers.
|
void |
createSequences()
Sql to drop and create Oracle and DB2 sequences.
|
void |
createTablesAndViews()
Write the "drop table" and "create table" statements.
|
void |
endSetup(java.lang.String outdir,
java.lang.String outfile,
java.util.HashMap params)
Determine values for
dbOut and outFileNameDefault,
then call super. |
java.util.TreeMap |
getMetadata()
Get the metadata for all Maximo tables.
|
void |
loadTables()
Write the "insert into (table ...)" statements.
|
static void |
main(java.lang.String[] argv)
Main.
|
void |
miscFinalStuff()
Any miscellaneous final commands should be invoked from this method.
|
void |
printCommit()
Print a "commit" statement.
|
void |
printHeader()
Print the header text at the beginning of the script.
|
void |
process()
Main processing method for this program.
|
void |
setup(java.util.HashMap params)
|
void |
showMsg(java.lang.String str)
Display a one-line message to the console and to the logfile.
|
void |
updateMaxSequence()
Update maxsequence.mareserved with the proper values.
|
void |
writeSql(java.util.ArrayList list)
Write a series of sql statements to the output file.
|
void |
writeSql(java.lang.String sql)
Write a sql statement to the output file.
|
doCall, doDB2TextSearchCall, doSql, doSql, doSql, doSql, doWait, endProcess, endProcessInstance, endSetupInstance, execRuntime, getDisplayMessage, getDisplayMessage, getOutfile, getOutstream, getProperty, getRootDirName, logSql, reformatForDB2, reformatForSqlsvr, setConnection, setDB2TextOutput, setupFromPropfile, setupInstance, setupNested, setupNestedInstance, setUserLangCode, showMXException, showMXExceptionpublic Unlcvt()
public void process()
throws java.lang.Exception
process in class CommonShelljava.lang.ExceptionUtil.mxServerIsUp(java.lang.String),
printHeader(),
createLexer(),
createCatalog(),
createSequences(),
getMetadata(),
createTablesAndViews(),
buildGrants(),
loadTables(),
createIndexes(),
createRowstampTriggers(),
miscFinalStuff(),
updateMaxSequence(),
printCommit()public void printHeader()
throws java.lang.Exception
java.lang.Exceptionpublic void cacheSequences()
throws java.lang.Exception
createSequences.java.lang.Exceptionsequencespublic void createSequences()
throws java.lang.Exception
java.lang.ExceptionUtil.buildSequences(java.util.HashSet, boolean)public void printCommit()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.TreeMap getMetadata()
throws java.lang.Exception
java.lang.ExceptioncacheSequences(),
Util.getObjectMeta(java.lang.String, boolean, boolean, boolean, boolean, boolean, boolean, boolean)public void createTablesAndViews()
throws java.lang.Exception
public void loadTables()
throws java.lang.Exception
java.lang.ExceptionUtil.writeDumpTable(java.lang.String, java.util.TreeMap, java.io.PrintStream),
printCommit()public void buildGrants()
throws java.lang.Exception
java.lang.ExceptionUtil.buildGrants(java.lang.String, boolean, boolean)public void createIndexes()
throws java.lang.Exception
java.lang.ExceptionUtil.getIndexMeta(String, boolean),
Util.rebuildIndexes(java.util.TreeMap, boolean, boolean, boolean, boolean)public void miscFinalStuff()
throws java.lang.Exception
java.lang.Exceptionpublic void createRowstampTriggers()
throws java.lang.Exception
java.lang.ExceptionUtil.getRowstampTriggerSql(java.lang.String, boolean)public void updateMaxSequence()
throws java.lang.Exception
java.lang.ExceptionUtil.updateMaxSequence(java.util.HashSet)public void createLexer()
throws java.lang.Exception
java.lang.Exceptionpublic void createCatalog()
throws java.lang.Exception
java.lang.Exceptionpublic void writeSql(java.util.ArrayList list)
throws java.lang.Exception
list - List of sql statementsjava.lang.ExceptionwriteSql(String)public void writeSql(java.lang.String sql)
throws java.lang.Exception
";" on the next line,
else writes "go" on the next line.sql - The sql statementjava.lang.Exceptionpublic void showMsg(java.lang.String str)
showMsg in class CommonShellstr - The one-line message to be displayed.public void setup(java.util.HashMap params)
throws java.lang.Exception
setup in class CommonShellparams - Parameters (see class javadocs).java.lang.ExceptionCommonShell.setup(java.util.HashMap)public void endSetup(java.lang.String outdir,
java.lang.String outfile,
java.util.HashMap params)
throws java.lang.Exception
dbOut and outFileNameDefault,
then call super.endSetup in class CommonShelloutdir - Output directory (ignored -- uses MXServer root).outfile - Output filename (ignored -- uses value calculated in this method).params - HashMap of parameters.java.lang.ExceptionCommonShell.createOutfile(java.lang.String, java.lang.String),
CommonShell.endSetupInstance(java.lang.String, java.lang.String, java.util.HashMap)public void createOutfile(java.lang.String outdir,
java.lang.String outfile)
throws java.lang.Exception
-o parameter may be used to specify a different output filename.)createOutfile in class CommonShelloutdir - This is ignored.outfile - Output filename.java.lang.Exceptionpublic static void main(java.lang.String[] argv)