Oracle Multitenant: New SQL Container Clause

Tiny little enhancement in Oracle Database 12.1.0.2:
The new CONTAINER clause to access data from different containers within one SQL statement. This may be very helpful, especially in case of schema consolidation. Similar things could have be done in Oracle 12.1.0.1 already by using database links – but resulting in way more complicated SQLs.

This is the new clause:

SELECT ename FROM CONTAINERS(scott.emp) WHERE CON_ID IN (45, 49);

See the documentation for more info about it.

–Mike

4 thoughts on “Oracle Multitenant: New SQL Container Clause

  1. Hi

    The containers clause has a bug, it error with ORA-600 if one of the columns is a LOB.

    Test:

    SQL> select * from containers(aud$);

    select * from containers(aud$)
    *
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [kkdoilsn2], [], [], [], [], [], [],
    [], [], [], [], []

    Cheers

    Ned

  2. Just recapping:
    I still receive the ORA-600 when selecting AUD$ regardless of the fact if I specify the schema or not. Still happens with the most recent PSU.

    This works:
    select count(*) from containers(obj$);

    This fails:
    select * from containers(sys.aud$);
    ORA-00600: internal error code, arguments: [kkdoilsn2]

Leave a Reply

Your email address will not be published. Required fields are marked *