Hi is there any way to fetch all the opportunity records which are in the locked state due to the approval process and as an administrator I want to unlock all the records at a time.
Assuming that this is a one-time activity you are trying to do, I would recommend you write a batch apex code and make use of the
Approval Class methods mentioned here. You can use the
unlock methods. Before you execute this code, check if you have enabled Enable record locking and unlocking in Apex under Settings > Process Automation > Process Automation Settings.
Also refer this for some more information.