Query Whether the Oracle Database is CDB or Non-CDB

You can query the CDB column in the V$DATABASE view to see if a database is CDB. If the current database is CDB, the column value will be YES, otherwise the CDB column value will be NO.

You can get information about container in CDB with a query like below.

Connect with SQLPlus, make sure you are in the root container, and then run the query.