Skip to content

Instantly share code, notes, and snippets.

@schlueter
Last active February 9, 2016 03:00
Show Gist options
  • Save schlueter/fc7a418a8f8a5fac5a84 to your computer and use it in GitHub Desktop.
Save schlueter/fc7a418a8f8a5fac5a84 to your computer and use it in GitHub Desktop.
Useful Oracle Queries
# discover what programs are still connected to a db
select sid,serial#,program from v$session where username = '<your_schema>';
# and forcibly disconnect them
select 'alter system kill session ''' || sid || ',' || serial# || ''';' from v$session where username = '<your_schema>'
#Shutdown and restart cdb and pdb
shutdown;
#then
startup;
#then
startup pluggable database <service_name>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment