ParquetMigrate.bat 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. @echo off
  2. rem Licensed Materials - Property of IBM
  3. rem IBM Cognos Products: Moser
  4. rem (C) Copyright IBM Corp. 2020
  5. rem US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. @echo off
  7. setlocal
  8. REM This batch file assumes it is being executed from bin or bin64 directory.
  9. REM migrates uploaded files from older version to the new one
  10. REM ParquetMigrate - A tool to migrate uploaded files from disk to CM
  11. REM Usage:
  12. REM Options:
  13. REM -h : url pointing to the cognos server [optional]
  14. REM -n : Authentication namespace, -u and -p required if specified [optional]
  15. REM -u : Namespace user, -n and -p required if specified [optional]
  16. REM -p : Namespace password, -n and -u required if specified [optional]
  17. REM -d : display the information about the parquet files that needed an upgrade [optional]
  18. REM -k : ignore the SSL certificate validation [optional]
  19. REM -l : apply to only to the number of last used files [optional]
  20. REM -t : filter displayed results by task id (only works with -d) [optional]
  21. REM -s : store id (will apply the command down to the hierarchy starting with the provided store ID)[optional]
  22. REM -m : smarts upgrade after the parquet conversion [optional]
  23. REM -a : smarts version upgrade only [optional]
  24. REM
  25. REM Examples:
  26. REM Display parquet files/datasets info:
  27. REM ParquetMigrate -d -n namespace -u username -p password
  28. REM or
  29. REM ParquetMigrate -d -h http://localhost:9300 -n namespace -u username -p password
  30. REM
  31. REM Upgrade parquet files/datasets:
  32. REM ParquetMigrate -n namespace -u username -p password
  33. REM
  34. REM Upgrade parquet files/datasets and apply deep smart analysis:
  35. REM ParquetMigrate -m -n namespace -u username -p passwordword
  36. rem Change directories to where this script lives
  37. CD /d %~dp0
  38. rem ----- Verify and Set Required Environment Variables -----------------------
  39. rem check if we need to run the local jre
  40. rem Shift the first argument: -java:local
  41. if "%1" == "-java:local" (shift & echo Option -java:local is not supported. Ignore it.)
  42. rem Try first the use of JAVA_HOME
  43. goto useEnvVar
  44. :useEnvVarOnly
  45. rem JAVA_HOME should be defined first.
  46. if "%JAVA_HOME%" == "" goto JavaHomeError
  47. set J_HOME=%JAVA_HOME%
  48. echo Looking for JRE in: %J_HOME%\bin...
  49. if exist "%J_HOME%\bin\java.exe" goto gotJava
  50. set J_HOME=%JAVA_HOME%\jre
  51. echo Looking for JRE in: %J_HOME%\jre\bin...
  52. if exist "%J_HOME%\bin\java.exe" goto gotJava
  53. :JavaHomeError
  54. echo You have specified the argument '-java:env'.
  55. echo However, the environment variable JAVA_HOME is not defined or incorrectly defined.
  56. echo Please define JAVA_HOME first before using the argument '-java:env'.
  57. goto finish
  58. rem Did not find a JRE in the local location, display error and exit.
  59. goto error
  60. :useEnvVar
  61. rem Shift the first argument: -java:env
  62. if "%1" == "-java:env" (shift & echo Option -java:env is not supported. Ignore it.)
  63. rem Using the distribution referred by JAVA_HOME because
  64. rem -java:local was NOT specified and the JAVA_HOME environment
  65. rem variable is defined.
  66. if "%JAVA_HOME%" == "" (
  67. set J_HOME=.
  68. ) else (
  69. set J_HOME=%JAVA_HOME%
  70. )
  71. echo Looking for JRE in: %J_HOME%\bin...
  72. if exist "%J_HOME%\bin\java.exe" goto gotJava
  73. if "%JAVA_HOME%" == "" (
  74. set J_HOME=..\ibm-jre\jre
  75. ) else (
  76. set J_HOME=%JAVA_HOME%\jre
  77. )
  78. echo Looking for JRE in: %J_HOME%\bin...
  79. if exist "%J_HOME%\bin\java.exe" goto gotJava
  80. rem Did not find a JRE in the environment variable's location.
  81. :error
  82. echo Could not find a JRE. Cannot run IBM Cognos Configuration.
  83. goto finish
  84. :gotJava
  85. rem ----- Prepare Appropriate Java Execution Commands -------------------------
  86. @set JAVA="%J_HOME%\bin\java"
  87. @echo off
  88. set params=%1
  89. :getParam
  90. shift
  91. if "%~1"=="" goto end
  92. set params=%params% %1
  93. goto :getParam
  94. :end
  95. rem Create the Classpath
  96. @set CRN_LIB_HOME=..\webapps\p2pd\WEB-INF\lib
  97. @set CLASSPATH=.
  98. @set CLASSPATH=%CLASSPATH%;%CRN_LIB_HOME%\*
  99. @set CLASSPATH=%CLASSPATH%;..\flint\libs\*
  100. @set CLASSPATH=%CLASSPATH%;..\bin\slf4j-api-1.7.23.jar
  101. @set CLASSPATH=%CLASSPATH%;..\bin\slf4j-nop-1.7.23.jar
  102. @set JAVA=%JAVA% -Dcom.ibm.jsse2.overrideDefaultTLS=true
  103. @echo running:
  104. @%JAVA% -cp %CLASSPATH% com.ibm.bi.platform.moser.common.utils.ParquetUpgrade %params%
  105. :end