What's the difference between quiesce the instance and enable restricted session? You can set the database in quiesced mode by the following command.


  alter system quiesce restricted;


After running this command all sessions except the ones that have DBA privileges will hang there.

Also you can enable the restricted session like this:


  alter system enable restricted session;


After running this command, just the users that have enough privileges can connect to the database.

My question is: are there any other differences between them? When should use them?

Thanks,
In quiesce restricted, all running sessions complete their current task, then at the point that they become INACTIVE in v$session, they cannot execute any more SQL until the system is unquiesced. In enable restricted session no new connections can be made, but you will need to kill existing sessions or they will simply continue. Quiescing is much less impactful, as your users might only notice the database pauses then resumes. Restricted session I use most often in combination with startup force if I absolutely need to perform some maintenance that cannot be done online, then I disable it and do another startup force and reconnect the apps.