Sometimes, we want to execute the SQL script to get insight into the current status of our Sitecore instance. It will be easy peasy lemon squeezy if you can access the server database.
Another way is to play around with SqlShell admin tool (we can execute the SQL script via Sitecore user interface) if you’re Sitecore admin + your Sitecore instance version is 8.1 Update 2 or later.
Our one is 7.2.0 and the Gatekeeper does NOT allow to access the database server. We have to go through the back-and-forth process to get the SQL query result so it takes quite much time and effort to do that.
Personally, I wanted to clear the obstacle above by injecting the admin tool SqlShell into our Sitecore 7 instance. It’s a tricky way so you should use it at your own risk 😀
How did I do that?
- install a fresh Sitecore 8.1.2 instance so that I have a good chance to avoid compatibility issue of the latest versions
- Note: should use SIM to install it very easily and quickly
- ensure to enable SqlShell admin tool
- create a Sitecore package so that I will be able to install it to Sitecore 7 later
- Note 1: SqlShell is referring to Sitecore.ExperienceContentManagement.Administration.dll so we need to package that file as well
- Note 2: you can download SqlShell_AdminTool812_InstallationWizard.zip if you’re so lazy like me 😀
- install a fresh Sitecore 7.2.0 instance
- Note: should use SIM to install it very easily and quickly
- (optional) install SqlShell_AdminTool812_InstallationWizard.zip to Sitecore 7 instance via Installation Wizard
- (optional) assume that the Gatekeeper does NOT allow to install Sitecore package so I need to download SqlShell_AdminTool812_FileExplorer.zip and then upload it to Sitecore via File Explorer:
- ensure to select Website folder in the content tree and then click Upload button to upload SqlShell_AdminTool812_FileExplorer.zip
- after clicking Next button, I would see the following dialog, ensure to check Unpack ZIP files on the server checkbox and then click Upload > button to complete
- NOTE: we should ensure to select override option if any so that we would NOT see the following error message if someone already installed it previously
- Could not load file or assembly ‘Sitecore.ExperienceContentManagement.Administration_001’ or one of its dependencies
- navigate to /sitecore/admin/sqlshell.aspx, I would see something like this
Thanks the awesome Sitecore Community and Happy Sitecore Playing!