Executing and interacting with the host operating system in ABAP is easy to do. SAP has created a framework for you to first configure via SM69 and then use via the delivered API SXPG_COMMAND_EXECUTE.
ABAP Trace
The SQL Trace, which is part of the Performance Trace (transaction ST05), is the most important tool to test the performance of the database. Now you as of ABAP 7.2, you execute it and other important measurements from inside the New ABAP Debugger.