Want to root your Galaxy Tab 2 7-inch or 11-inch?
The method is nearly identical to Galaxy Tab 10.1 except you need the correct ClockworkMod Recovery for your Tab 2 version.
For Galaxy Tab 2 7-inch, please see ClockworkMod Recovery for Tab 2 7-inch and install it.
For Galaxy Tab 2 10.1-inch, please see ClockworkMod Recovery for Tab 2 10.1-inch and install it.
Second, once you have the correct recovery installed, you can use the same instruction/files in Tab 10.1 root method to root your Tab 2.