Laur IVAN

Postgres: Show Schema Sizes in a Database

Posted by in Software

While loading a large database from files to a Postgres schema, I found very useful to know how much space on disk it actually occupies (just in case I need to re-size the disk). I found this answer online:

Which results in a list like: HTH, PS: All credit goes to this StackOverflow answer! A little experiment: If you find this post and ad below useful, please check the ad out :-)

Use Oracle’s RegisterSchema with Large Schemas (from Python)

Posted by in Software

An important note when loading XSDs in Oracle is that DBMS_XMLSCHEMA.registerSchema() requires the actual content of the xsd is loaded in a string. A side effect is that strings in Oracle have limits and schemas can exceed those limits. Therefore, such strings must be fragmented. In this case, we need to employ PL/SQL. A processed fragment could look something like this:

Now, all you need to do is populate the fragments (where I’ve placed 'long-string-fragment') with the actual content. A rule of thumb I’ve got is to have a…read more

Drop an Oracle-Loaded XSD in Python

Posted by in Software

A loaded schema can be dropped if: No other schema depends on it No data using the schema is loaded I think you may force unloading schemas even if there is data loaded but I haven’t tried that. The code to drop a schema is:

You can use it if e.g. schema is updated or we don’t need it anymore. The full code in Python is:

Several notes: The order of removal is, of course, the reversed order of insertion. This way, complex XSDs are removed firse leaving…read more