1@echo off
2pushd .
3set help=
4if "%1" == "-h" (set help=true)
5if "%1" == "/h" (set help=true)
6if "%1" == "--help" (set help=true)
7if "%help%"=="true" (
8  echo The Columnstore Support Report creates a report that can be sent to Columnstore
9  echo for help with field support. There are no options to this command.
10  set help=
11  exit /B 0
12)
13
14echo.
15echo Running the Columnstore Support Report, outputting to ColumnstoreSupportReport.txt
16
17call :func > ColumnstoreSupportReport.txt 2>&1
18
19echo.
20echo Report finished
21
22popd
23exit /B 0
24
25:ErrorExit
26
27echo.
28echo Error - Failed to find Columnstore Install Directory in Windows Registry, Exiting
29popd
30exit /B 1
31
32:func
33
34  setlocal
35  set key="HKLM\SOFTWARE\Columnstore\Columnstore"
36  set homeValue=ColumnstoreHome
37  set configValue=ConfigFile
38
39  for /f "tokens=3,*" %%a in ('reg query %key% /ve 2^>NUL ^| findstr REG_SZ') do (
40    set ColumnstoreInstall=%%b
41   )
42
43  if "%ColumnstoreInstall%" == "" (
44  	for /f "tokens=2,*" %%a in ('reg query %key% /ve 2^>NUL ^| findstr REG_SZ') do (
45    	set ColumnstoreInstall=%%b
46   	)
47  )
48
49  ::error out if can't locate Install Directory
50  if "%ColumnstoreInstall%" == "" GOTO ErrorExit
51
52echo #######################################################################
53echo #                                                                     #
54echo #     Columnstore Support Report - %date% %time%
55echo #                                                                     #
56echo #######################################################################
57echo.
58echo.
59echo =======================================================================
60echo =                    Software/Version Report                          =
61echo =======================================================================
62echo.
63echo.
64echo -- Columnstore Software Version --
65type %ColumnstoreInstall%\etc\ColumnstoreVersion.txt
66echo.
67echo -- mysql Software Version --
68mysql --user=root -e status
69echo.
70echo -- Windows Version --
71ver
72echo.
73echo.
74echo =======================================================================
75echo =                    Status Report                                    =
76echo =======================================================================
77echo.
78echo.
79echo -- Columnstore Process Status --
80echo.
81
82tasklist /FI "Imagename eq mysqld.exe"
83tasklist /FI "Imagename eq controllernode.exe"
84tasklist /FI "Imagename eq workernode.exe"
85tasklist /FI "Imagename eq PrimProc.exe"
86tasklist /FI "Imagename eq ExeMgr.exe"
87tasklist /FI "Imagename eq DDLProc.exe"
88tasklist /FI "Imagename eq DMLProc.exe"
89tasklist /FI "Imagename eq WriteEngineServer.exe"
90
91echo.
92echo.
93echo =======================================================================
94echo =                    Configuration Report                             =
95echo =======================================================================
96echo.
97echo -- Windows Columnstore Registry Values --
98echo.
99
100  echo ColumnstoreInstall = %ColumnstoreInstall%
101
102  for /f "tokens=2,*" %%a in ('reg query %key% /v %homeValue% 2^>NUL ^| findstr %homeValue%') do (
103    set ColumnstoreHome=%%b
104  )
105  echo ColumnstoreHome    = %ColumnstoreHome%
106
107  for /f "tokens=2,*" %%a in ('reg query %key% /v %configValue% 2^>NUL ^| findstr %configValue%') do (
108    set ConfigFile=%%b
109  )
110  echo ConfigFile     = %ConfigFile%
111echo.
112echo.
113echo -- Columnstore System Configuration Information --
114echo.
115cd %ColumnstoreInstall%\bin
116for /f "delims=" %%a in ('getConfig.exe DBBC NumBlocksPct') do @echo NumBlocksPct = %%a
117for /f "delims=" %%a in ('getConfig.exe HashJoin TotalUmMemory') do @echo TotalUmMemory = %%a
118for /f "delims=" %%a in ('getConfig.exe VersionBuffer VersionBufferFileSize') do @echo VersionBufferFileSize = %%a
119for /f "delims=" %%a in ('getConfig.exe ExtentMap FilesPerColumnPartition') do @echo FilesPerColumnPartition = %%a
120for /f "delims=" %%a in ('getConfig.exe ExtentMap ExtentsPerSegmentFile') do @echo ExtentsPerSegmentFile = %%a
121echo.
122echo.
123echo -- Columnstore System Configuration File --
124echo.
125type "%ConfigFile%"
126echo.
127echo.
128echo -- System Process Status --
129echo.
130tasklist /v
131echo.
132echo =======================================================================
133echo =                   Resource Usage Report                             =
134echo =======================================================================
135echo.
136echo -- System Information--
137echo.
138systeminfo
139echo.
140echo -- IP Configuration Information --
141echo.
142ipconfig
143echo.
144echo  -- Disk BRM Data files --
145echo.
146dir "%ColumnstoreInstall%\dbrm\"
147echo.
148echo  -- View Table Locks --
149echo.
150cd %ColumnstoreInstall%\bin\
151viewtablelock.exe
152echo.
153echo.
154echo   -- BRM Extent Map  --
155echo.
156cd %ColumnstoreInstall%\bin\
157editem.exe -i
158echo.
159echo.
160echo =======================================================================
161echo =                   Log Report                                        =
162echo =======================================================================
163echo.
164echo -- Columnstore Platform Logs --
165echo.
166type "%ColumnstoreInstall%\log\ColumnstoreLog.txt"
167echo.
168echo.
169echo -- Columnstore MySQl log --
170echo.
171type "%ColumnstoreInstall%\mysqldb\*.err"
172echo.
173echo.
174echo -- Columnstore Bulk Load Logs --
175echo.
176dir "%ColumnstoreInstall%\bulk\data"
177echo.
178dir "%ColumnstoreInstall%\bulk\log"
179echo.
180dir "%ColumnstoreInstall%\bulk\job"
181echo.
182echo -- Check for Errors in Bulk Logs --
183echo.
184cd "%ColumnstoreInstall%\bulk\log"
185findstr /spin /c:"error" *
186findstr /spin /c:"failed" *
187cd "%ColumnstoreInstall%\bulk\job"
188findstr /spin /c:"error" *
189findstr /spin /c:"failed" *
190echo.
191echo =======================================================================
192echo =                    DBMS Report                                      =
193echo =======================================================================
194echo.
195echo -- DBMS Columnstore Mysql Version --
196echo.
197mysql --user=root -e status
198echo.
199echo -- DBMS Mysql Columnstore System Column  --
200echo.
201mysql --user=root -e "desc columnstoresys.syscolumn"
202echo.
203echo -- DBMS Mysql Columnstore System Table  --
204echo.
205mysql --user=root -e "desc columnstoresys.systable"
206echo.
207echo -- DBMS Mysql Columnstore System Table Data --
208echo.
209mysql --user=root -e "select * from columnstoresys.systable"
210echo.
211echo -- DBMS Mysql Columnstore Databases --
212echo.
213mysql --user=root -e "show databases"
214echo.
215echo -- DBMS Mysql Columnstore variables --
216echo.
217mysql --user=root -e "show variables"
218echo.
219echo -- DBMS Mysql Columnstore config file --
220echo.
221type "%ColumnstoreInstall%\my.ini"
222echo.
223echo -- Active Queries --
224
225::cd \Columnstore\genii\oamapps\columnstoreSupport
226
227
228