psdi.configure

Class Maxinst

  • All Implemented Interfaces:
    UpgConstants


    public class Maxinst
    extends CommonShell
    implements UpgConstants
    Maxinst utility for building a new database.

    This uses as input the file that was created by Unlcvt. Also see descriptions of the -d and -i commandline parameters.

    This runs independently of MXServer.

    Click here for Maxinst flow.

    The commandline parameters for Maxinst are as follows, in addition to those in the superclass CommonShell.

    Parameter IDParameter ValueDescription
    -cSubdirectory for input fileSubdirectory under tools\maximo. For example, if the input directory should be tools\maximo\FR, then this param would equal FR. If this param is not specified then the subdirectory defaults to EN.
    -dDirectory for output fileSame as CommonShell (output directory). For Maxinst, the input file (Unlcvt) is always retrieved from the MXServer root directory.
    -iFilename for input file generated by UnlcvtThis is optional. If not specified, uses Unlcvt. (File extension is "ora" for Oracle, "sqs" for SqlServer, and "db2" for DB2.)
    -mMultiple for length of varchar columns. This defaults to 1 and should be used only in special situations related to multi-language. It will cause the native length of varchar columns to be a multiple of their normal length defined in maxattribute, up to the native maximum allowed. This value will be stored in the maxvar VARCHARMULTIPLE. In practice, it can be a value between 1 and 4. It is assumed that the native length specified in the input script's "create table" statements are based on a multiple of 1 (native length equals maxattribute length).
    -qThe -q parameter is used ONLY for DB2. When the -q parameter is used and this is DB2, then DB2 Text Search will be enabled. If the -q parameter is not supplied then DB2 text search will be disabled.
    -sSchema for index storageThis is optional. If not specified, Maxinst will not specify a tablespace for indexes. This is used when creating indexes and in updateMaximo. For SqlServer, clustered indexes use the schema from the -t parameter.
    -tSchema for table storageThis is optional. If not specified, Maxinst will not specify a tablespace for tables. This is used when creating tables and in updateMaximo. For SqlServer, this is also used for clustered indexes.
    -uUsernameSame as CommonShell, but for Maxinst, this is also used as the value for various Maximo table updates (if not equal to "MAXIMO"), see updateMaximo.
    -x(none)If Maximo will ultimately be deployed on a Unix platform, then the -x parameter must be input to Maxinst. This allows Maxinst to be run on Windows with ultimate Maximo deployment on Unix. If ultimate deployment will be Windows, this parameter should be omitted.
    -y(none)The -y parameter is used ONLY for DB2. When -y is specified, then any column whose native datatype would normally be varchar will instead be created as vargraphic. This value will be stored in the maxvar USEVARGRAPHIC.
    -z(none)The -z parameter is used ONLY for DB2 and ONLY for debugging. When the -z parameter is used and this is DB2, then the logic that enables text search for all tables is not performed from Maxinst. Instead, Maxinst will output a script containing all the relevant commands. The script name is db2text_maxinst.bat, and it is output to the same directory as the logfile. A second script, db2text_maxinst.sh, is output for Unix shell script.
    See Also:
    CommonShell
    • Field Detail

      • db2TextFile

        protected java.io.File db2TextFile
        The output file when using the -z parameter.
      • db2TextOut

        protected java.io.PrintStream db2TextOut
        The print stream when using the -z parameter.
      • db2TextFile2

        protected java.io.File db2TextFile2
        Second output file when using the -z parameter.
      • db2TextOut2

        protected java.io.PrintStream db2TextOut2
        Second print stream when using the -z parameter.
      • inFileNameDefault

        protected java.lang.String inFileNameDefault
        The output filename can be passed in via an argument. The default value, stored here, is "Unlcvt" with file extension depending on db platform.
      • reader

        protected ScriptReader reader
        Utility class for reading sql statements from the Unlcvt-generated input file.
    • Constructor Detail

      • Maxinst

        public Maxinst()
        This constructor does nothing. Used when running from the DOS prompt.
      • Maxinst

        public Maxinst(MXServer server)
    • Method Detail

      • doUnlcvtSql

        public void doUnlcvtSql()
                         throws java.lang.Exception
        Loop through all the sql statements from the input file (Unlcvt or whatever file was specified using the -i parameter) and call doOneUnlcvtLine for each.
        Throws:
        java.lang.Exception
        See Also:
        Maxinst.doOneUnlcvtLine(java.lang.String)
      • doOneUnlcvtLine

        public void doOneUnlcvtLine(java.lang.String sql)
                             throws java.lang.Exception
        Process one sql statement from the Unlcvt input file.

        If this is a "create table" statement or create clustered index statement, the selected tableSchema will be appended to the statement.

        If this is a "create index" statement (non-clustered), the selected indexSchema will be appended to the statement.

        This assumes that the "create" statement is in lower case.

        Throws:
        java.lang.Exception
        See Also:
        Util.adjustNativeSql(java.lang.String)
      • updateMaximo

        public void updateMaximo()
                          throws java.lang.Exception
        Update Maximo tables as follows.
        1. Update maxtable and maxtablecfg with the table storage partition tableSchema, updateDefaultPartitionMaxvars.
        2. Update ISDEMO maxvar via updateDemoMaxvar.
        3. Update maxsysindexes with the index storage partition indexSchema. (However, clustered indexes will use tableSchema).
        4. If not DB2, update other Maximo tables with the login user name instead of MAXIMO (if not logged in as MAXIMO). Login user name is loginUser. (This section will become obsolete when the new Merlin user tables are implemented.)
        5. Update VARCHARMULTIPLE maxvar via updateVarcharMultipleMaxvar.
        6. Update USEVARGRAPHIC maxvar via updateVargraphicMaxvar.
        7. For properties that must be encrypted (maxprop.encrypted = true), encrypt the value and store on maxpropvalue. If any mxe.security.* property was specified in the property file, they will also be encrypted on maxpropvalue. No other property values will be copied from the file to the database.
        8. Enable text search for objects needing it enableTextSearchAllTables.
        9. Start text search jobs startTextSearchJobs.
        10. Do Unix-specific data updates updateUnix.
        11. Do Oracle-specific data updates updateOracle.
        12. Do DB2-specific data updates updateDB2.
        13. Do SqlServer-specific data updates updateSqlServer.
        14. Update the alndomain, domainid DBSTORAGEPARTITION.
        15. Update passwords in maxuser table updateUserPasswords.
        16. Update other miscellaneous CRYPTO, CRYPTOX, and BLOB data bytefileUpdate.
        Throws:
        java.lang.Exception
      • updateUserPasswords

        public void updateUserPasswords()
                                 throws java.lang.Exception
        Update the maxuser table (password = userid encrypted). This also sets forceexpiration = True.
        Throws:
        java.lang.Exception
      • bytefileUpdate

        public void bytefileUpdate()
                            throws java.lang.Exception
        For maxtypes CRYPTO, CRYPTOX, and BLOB string. For maxuser password, this also sets forceexpiration = False.
        Throws:
        java.lang.Exception
      • cleanOutFulltextCatalog

        public void cleanOutFulltextCatalog(java.lang.String dropCatSql)
                                     throws java.lang.Exception
        Before executing the Sql for dropping SqlServer fulltext catalog, must make absolutely sure it is empty. This method drops any remaining tables from the catalog.
        Parameters:
        dropCatSql - The sql for dropping the catalog, in the format sp_fulltext_catalog 'textcatalog', 'drop'.
        Throws:
        java.lang.Exception
      • getMaxID

        public int getMaxID(java.lang.String tbname,
                            java.lang.String name)
                     throws java.lang.Exception
        Select (maxreserved + 1) from maxsequence for the specified table and column. Used to determine values for uniqueID for SqlServer insert statements.
        Parameters:
        tbname - Table name
        name - Column name
        Returns:
        maxreserved + 1
        Throws:
        java.lang.Exception
      • doSql

        public void doSql(java.lang.String sql)
                   throws java.lang.Exception
        Looks at params to determine whether the execute only, log only, or both execute and log. This override of CommonShell doSql does not throw an error if the command starts with DROP.
        Overrides:
        doSql in class CommonShell
        Parameters:
        sql - The Sql statement
        Throws:
        java.lang.Exception
        See Also:
        CommonShell.doSql(String), Maxinst.cleanOutFulltextCatalog(java.lang.String)
      • setupFromPropfile

        public java.lang.String setupFromPropfile(java.lang.String propfile,
                                                  java.lang.String user,
                                                  java.lang.String password,
                                                  java.lang.String url,
                                                  java.lang.String rootDirName,
                                                  java.lang.String propdir)
                                           throws java.lang.Exception
        Get security params from propfile.
        Overrides:
        setupFromPropfile in class CommonShell
        Parameters:
        propfile - Name of properties file
        user - Username when not connecting via MXServer (optional). Must be a superuser. Defaults to mxe.db.user.
        password - Password when not connecting via MXServer (optional). Must be a superuser. Defaults to mxe.db.password.
        url - Database url (alias) (optional). Defaults to mxe.db.url.
        rootDirName - The name of the MXServer root directory.
        propdir - The name of the directory containing the properties file.
        Returns:
        Database url
        Throws:
        java.lang.Exception
        See Also:
        Maxinst.cipher, Maxinst.cipherX
      • endSetupInstance

        public void endSetupInstance(java.lang.String outdir,
                                     java.lang.String outfile,
                                     java.util.HashMap params)
                              throws java.lang.Exception
        After endSetup, process -t, -i, -q, -s, -c, -x, -z parameters, set values for tableSchema, input file, indexSchema, loginUser, reader, deployUnix, db2TextScript.
        Overrides:
        endSetupInstance in class CommonShell
        Parameters:
        outdir - Output directory
        outfile - Output filename
        params - Parameters (see class javadocs).
        Throws:
        java.lang.Exception