So first you have to the database from the mirror session, then do the necessary change actions and restore the mirror session. Ex,
SET PARTNER OFF
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
On the mirrored database:
- The database could not be exclusively locked to perform the operation.
- The operation cannot be performed on database it is involved in a database mirroring session or an availability group