Рубрика: MySQL, Windows | Метки: binary log, binlog, вывод строк до искомой, вывод строк после искомой, поиск строки в файле, поиск строки по шаблону, find, findstr, for, grep in windows, like as grep, mysql, mysqlbinlog, mysqlbinlog search string, offset, output lines after the search string, output lines to the search string, search string, serach string in file, skip command | Leave a reply VBScript collect events print from Windows logs These positions can then be used when restoring the database of MySQL when you want to skip some commands. These lines are also important because they contain the position of the search string and the future planned for her in the binary log. #150918 10:51:09 server id 1 end_log_pos 6679 CRC32 0x22af3729 QueryĭROP TABLE `mysalers` /* generated by server */Īs a result, we obtain the desired command to delete a table `mysalers` and 3 lines going to it. Mysqlbinlog -database=sale "c\:MySQL\data\mysql-bin.000001" > "d:\binlog.txt" | d:\findrow.bat "d:\binlog.txt" "DROP TABLE `mysalers`" -3 Need to find a command ‘DROP TABLE `mysalers`’ in the binary log mysql-bin.000001: Let’s look at a more complex case, for example, the search string in the binary log of server MySQL. %3 - include additional lines to (example, -3) or after (example, 3) search string %1 - file in which you want to search a string Rem displays the search string (and additional)įor /f "usebackq delims=" %%x in (`find /n /v "" %infile% ^| find ""`) do (set value=%%x)įile creation «findrow.bat» has three input parameters that must always be asked: findrow.bat %1 %2 %3 Rem offset - include additional lines to (example, -3) or after (example, 3) search stringįor /F "delims=:" %%i in ('findstr /N /I /C:%searchstring% %infile%') do (set par=%%i) Rem infile - file in which you want to search a string GFLAGS can also set the flag required for the kernel feature of Oh.exe, a tool that shows the handles of open windows.Create batch-file with name «findrow.bat» and save the following off
To use this utility to enable Pool tagging:
GFLAGS is a GUI tool that enables a developer or system administrator to edit the NtGlobalFlag settings for Windows NT Server or Windows NT Workstation without having to make manual changes in the registry. If you have a computer running Windows NT 4.0 and you have the resource kit, there is utility called GFLAGS. Quit Registry Editor, shutdown, and restart your computer.In the Data Field, type in either 01000000 or 00000400, depending on the version of Windows NT. In the Data Type field, select REG_DWORD and click OK.Double-click on the GlobalFlag Value on the right pane.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager Start Registry Editor (Regedt32.exe) and locate the following subkey:.To change the value of the GlobalFlag, you need to modify its value in the registry. If you are running Windows NT version 3.51 or 4.0 but do not have the Windows NT 4.0 Resource Kit, follow these steps.
The following hex values for GlobalFlag will set up memory tagging in Windows NT for the following versions: Before making changes, write down the current value of GlobalFlag so that it can be reset once running Poolmon.exe is no longer necessary. To allow Windows NT to gather pooltag information, the GlobalFlag value must be changed using Registry Editor (Regedt32.exe).
Note that you should back up the registry before you edit it.
Use Registry Editor at your own risk.įor information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system.