123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- @echo off
- rem Licensed Materials - Property of IBM
- rem IBM Cognos Products: Moser
- rem (C) Copyright IBM Corp. 2020
- rem US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- @echo off
- setlocal
- REM This batch file assumes it is being executed from bin or bin64 directory.
- REM migrates uploaded files from older version to the new one
- REM ParquetMigrate - A tool to migrate uploaded files from disk to CM
- REM Usage:
- REM Options:
- REM -h : url pointing to the cognos server [optional]
- REM -n : Authentication namespace, -u and -p required if specified [optional]
- REM -u : Namespace user, -n and -p required if specified [optional]
- REM -p : Namespace password, -n and -u required if specified [optional]
- REM -d : display the information about the parquet files that needed an upgrade [optional]
- REM -k : ignore the SSL certificate validation [optional]
- REM -l : apply to only to the number of last used files [optional]
- REM -t : filter displayed results by task id (only works with -d) [optional]
- REM -s : store id (will apply the command down to the hierarchy starting with the provided store ID)[optional]
- REM -m : smarts upgrade after the parquet conversion [optional]
- REM -a : smarts version upgrade only [optional]
- REM
- REM Examples:
- REM Display parquet files/datasets info:
- REM ParquetMigrate -d -n namespace -u username -p password
- REM or
- REM ParquetMigrate -d -h http://localhost:9300 -n namespace -u username -p password
- REM
- REM Upgrade parquet files/datasets:
- REM ParquetMigrate -n namespace -u username -p password
- REM
- REM Upgrade parquet files/datasets and apply deep smart analysis:
- REM ParquetMigrate -m -n namespace -u username -p passwordword
- rem Change directories to where this script lives
- CD /d %~dp0
- rem ----- Verify and Set Required Environment Variables -----------------------
- rem check if we need to run the local jre
- rem Shift the first argument: -java:local
- if "%1" == "-java:local" (shift & echo Option -java:local is not supported. Ignore it.)
- rem Try first the use of JAVA_HOME
- goto useEnvVar
- :useEnvVarOnly
- rem JAVA_HOME should be defined first.
- if "%JAVA_HOME%" == "" goto JavaHomeError
- set J_HOME=%JAVA_HOME%
- echo Looking for JRE in: %J_HOME%\bin...
- if exist "%J_HOME%\bin\java.exe" goto gotJava
- set J_HOME=%JAVA_HOME%\jre
- echo Looking for JRE in: %J_HOME%\jre\bin...
- if exist "%J_HOME%\bin\java.exe" goto gotJava
- :JavaHomeError
- echo You have specified the argument '-java:env'.
- echo However, the environment variable JAVA_HOME is not defined or incorrectly defined.
- echo Please define JAVA_HOME first before using the argument '-java:env'.
- goto finish
- rem Did not find a JRE in the local location, display error and exit.
- goto error
- :useEnvVar
- rem Shift the first argument: -java:env
- if "%1" == "-java:env" (shift & echo Option -java:env is not supported. Ignore it.)
- rem Using the distribution referred by JAVA_HOME because
- rem -java:local was NOT specified and the JAVA_HOME environment
- rem variable is defined.
- if "%JAVA_HOME%" == "" (
- set J_HOME=.
- ) else (
- set J_HOME=%JAVA_HOME%
- )
- echo Looking for JRE in: %J_HOME%\bin...
- if exist "%J_HOME%\bin\java.exe" goto gotJava
- if "%JAVA_HOME%" == "" (
- set J_HOME=..\ibm-jre\jre
- ) else (
- set J_HOME=%JAVA_HOME%\jre
- )
- echo Looking for JRE in: %J_HOME%\bin...
- if exist "%J_HOME%\bin\java.exe" goto gotJava
- rem Did not find a JRE in the environment variable's location.
- :error
- echo Could not find a JRE. Cannot run IBM Cognos Configuration.
- goto finish
- :gotJava
- rem ----- Prepare Appropriate Java Execution Commands -------------------------
- @set JAVA="%J_HOME%\bin\java"
- @echo off
- set params=%1
- :getParam
- shift
- if "%~1"=="" goto end
- set params=%params% %1
- goto :getParam
- :end
- rem Create the Classpath
- @set CRN_LIB_HOME=..\webapps\p2pd\WEB-INF\lib
- @set CLASSPATH=.
- @set CLASSPATH=%CLASSPATH%;%CRN_LIB_HOME%\*
- @set CLASSPATH=%CLASSPATH%;..\flint\libs\*
- @set CLASSPATH=%CLASSPATH%;..\bin\slf4j-api-1.7.23.jar
- @set CLASSPATH=%CLASSPATH%;..\bin\slf4j-nop-1.7.23.jar
- @set JAVA=%JAVA% -Dcom.ibm.jsse2.overrideDefaultTLS=true
- @echo running:
- @%JAVA% -cp %CLASSPATH% com.ibm.bi.platform.moser.common.utils.ParquetUpgrade %params%
- :end
-
|