SQL profile suggestion
Database 12.2.0.1 Apr 2020 CPu patch
We have a sql query which ran fine until 3PM yesterday and all of a sudden it started spinning and it consumes lot of temporary tablspace. i can constantly see the wait event as "direct path write temp"
Seems query plan is changed somehow and its accumulating large number of rows whcich is getting spilled over to from PGA to Temp.
We refreshed the the test DB from prod and there query works well. So i ran the tuning advisor in Production and it gives me better Explain plan is available and it asks me to accept the sql profile which i can do . But we have lot many dynamic variable so i am afraid it may not be the right approach to accept the sql plan and when the query runs from application it will still have an issue.