After you allocate shared memory for SQL text, Adaptive Server saves a copy of each SQL batch whenever you enable an Adaptive Server Monitor event summary that includes SQL batches.
You may also have to reconfigure Adaptive Server Monitor’s event buffer scan interval for SQL text. See the Adaptive Server Monitor documentation for more information.