Before Rooting, backup your data first (How to back up data)
Follow these steps:
1. Download Clock Work Mod recovery from Download here
2. Download cwm-root-gtab2.zip to root your device from attachment and copy the downloaded file to external sdcard. (Download here)
3. Download Fix-Recovery to erase install-recovery.sh from attachment and copy the downloaded file to external sdcard. (Download here)
4. Check USB Debugging mode in the Developers Options in the tab settings. Then turn your device off .
5. Boot into Download-Mode (Power+Vol Down) and then confirm by pressing Vol-Up to continue.
6. Start Odin. (I used Odin v3.07) (Download here)
7. Choose “GT-P31XX_ClockworkMod-Recovery_X.X.X.X.tar” as PDA which you already downloaded from here.
8. Connect your Tab to your pc. It will install the drivers. Make sure you have Samsung Kies installed.
9. Untick Reset Time and Auto Reboot on the Odin screen. ( See picture below)