Reset the default drupal theme with SQL

Reading Time: < 1 minuteSometimes a drupal theme can be broken and it can be needed to reset the default theme so the site can be accessed again in order to fix the problem.

As a rule of thumb I always try to use the theme "Cube" for the administrive part of drupal. that makes things a lot easier and if you breeak the theme you can at least still use the admin part.

Here is anyhow how to reset the theme using SQL:

Simply execute the three following commands:

UPDATE system SET status=1 WHERE name = 'garland';

How to find which SQL is executed by a process

Reading Time: < 1 minute

If you are looking for the last SQL query ran by a specific process, try this: 

 
select substr(sa.sql_text,1,1000) txt
from v$process p, v$session s, v$sqlarea sa
where p.addr=s.paddr
and s.username is not null
and s.sql_address=sa.address(+)
and s.sql_hash_value=sa.hash_value(+)
and spid=&SPID;