Browsing Posts tagged Oracle

I found very useful Open Source alternative for TOAD. Check It!

There are several useful queries for Oracle DB: select TABLE_NAME from SYS.ALL_TABLES where OWNER=’schema’ – select all tables for given schema select USERNAME from SYS.ALL_USERS order by USERNAME – select all schemas select VIEW_NAME from SYS.ALL_VIEWS where OWNER=’schema’ order by VIEW_NAME – select all views for given schema select OBJECT_NAME, OWNER from SYS.ALL_OBJECTS where UPPER(OBJECT_TYPE) [...]

Sometimes output from Sqlplus is a little bit confusing. Fortunately there are ways how to improve that. column column_name format a20 – make the column column_name smaller (20 characters), only for strings and dates column column_name format 99990 – make the column column_name smaller (5 digits), for numbers set pagesize 5000 – set the bigger [...]

I needed to save output from SQL query into file. I found this solution: SQL>SPOOL /tmp/data.dat SQL>select * from table; SQL>SPOOL OFF

Typ BLOB (Binary Large Object) v Oracle databázích slouží k uložení velkých binárních dat (obrázky, videa) (až 4 GB). Pokud potřebujete tyto data porovnávat, například v klauzuli WHERE, tak se to dělá následovně: dbms_lob.compare(bytesB, bytesA) = 0