Best approach to run a simple query against all users So, I could easily do this in SQL Server. I created a cursor, but to be even more simple, I just ran SP_MSFOREACHDB with a simple query:

select top 1 * from Database..Table order by Date desc

I created a global temp table, and populated it with the data of the select.

But, How can I do this on oracle? 

I tried with cursors, union, and creating some loops but as a SQL Server DBA, I'm pretty bad with PL-SQL. 

So, How can I run a simple select over all users? Cursor? Loops? create all selects and use union ?

Thanks.
select * from dba_users


You need the DBA role or similar access to select from this table.
In Oracle 12 the columns available are

USERNAME    VARCHAR2
USER_ID NUMBER
PASSWORD    VARCHAR2
ACCOUNT_STATUS  VARCHAR2
LOCK_DATE   DATE
EXPIRY_DATE DATE
DEFAULT_TABLESPACE  VARCHAR2
TEMPORARY_TABLESPACE    VARCHAR2
CREATED DATE
PROFILE VARCHAR2
INITIAL_RSRC_CONSUMER_GROUP VARCHAR2
EXTERNAL_NAME   VARCHAR2
PASSWORD_VERSIONS   VARCHAR2
EDITIONS_ENABLED    VARCHAR2
AUTHENTICATION_TYPE VARCHAR2
PROXY_ONLY_CONNECT  VARCHAR2
COMMON  VARCHAR2
LAST_LOGIN  TIMESTAMP(9) WITH TIME ZONE
ORACLE_MAINTAINED   VARCHAR2