Monday, July 11, 2011

HTTP Error 404.15 – Not Found: The request filtering module is configured to deny a request where the query string is too long

Use Case

Query string exceeds reasonable size for HTTP GET.

Solution

Quick and dirty solution is to increase the maximum querystring size by setting the maxQueryString attribute on the requestLimitselement in the system.webServer/security/requestFiltering configuration section in your application’s web.config:

<system.webServer>
    <security>
        <requestFiltering>
            <requestLimits maxQueryString="NEW_VALUE_IN_BYTES" />
        </requestFiltering>
    </security>
</system.webServer>

http://mvolo.com/blogs/serverside/archive/2007/12/08/IIS-7.0-Breaking-Changes-ASP.NET-2.0-applications-Integrated-mode.aspx

Or use HTTP POST, if you can.

Drop all user objects in the schema

Use Case

Drop objects in schema without deletion of user

Solution

Very helpful script can be found at: http://stackoverflow.com/questions/842530/plsql-drop-all-database-objects-of-a-user



create or replace
FUNCTION                DROP_ALL_SCHEMA_OBJECTS RETURN NUMBER AS
PRAGMA AUTONOMOUS_TRANSACTION;
cursor c_get_objects is
  select object_type,'"'||object_name||'"'||decode(object_type,'TABLE' ,' cascade constraints',null) obj_name
  from user_objects
  where object_type in ('TABLE','VIEW','PACKAGE','SEQUENCE','SYNONYM', 'MATERIALIZED VIEW','FUNCTION','PROCEDURE') AND object_name <> 'DROP_ALL_SCHEMA_OBJECTS'
  order by object_type;
cursor c_get_objects_type is
  select object_type, '"'||object_name||'"' obj_name
  from user_objects
  where object_type in ('TYPE');
BEGIN
  begin
    for object_rec in c_get_objects loop
      execute immediate ('drop '||object_rec.object_type||' ' ||object_rec.obj_name);
    end loop;
    for object_rec in c_get_objects_type loop
      begin
        execute immediate ('drop '||object_rec.object_type||' ' ||object_rec.obj_name);
      end;
    end loop;
  end;
  RETURN 0;
END DROP_ALL_SCHEMA_OBJECTS;


Usage is easy:


select DROP_ALL_SCHEMA_OBJECTS from dual;