Useful SQL queries.
I found the below queries to be quite useful when working in the SQL or PL/SQL environment:
You can run this query to get the database parameters:
select * from v$parameter;
To get the number of sessions for AB:
select * from AB.ps_txn order by creation_date;
Find all tables and filter them out by containing SEARCH_CRITERIA:
select owner, table_name from dba_tables where table_name like '%SEARCH_CRITERIA%' order by table_name desc;
Get table data:
desc TABLE_NAME;
Get all DB users with username UNAME:
select * from dba_users where username like '%USERNAME%'
Select 1% of table contents:
select * a_table sample (1);
You can run this query to get the database parameters:
select * from v$parameter;
To get the number of sessions for AB:
select * from AB.ps_txn order by creation_date;
Find all tables and filter them out by containing SEARCH_CRITERIA:
select owner, table_name from dba_tables where table_name like '%SEARCH_CRITERIA%' order by table_name desc;
Get table data:
desc TABLE_NAME;
Get all DB users with username UNAME:
select * from dba_users where username like '%USERNAME%'
Select 1% of table contents:
select * a_table sample (1);
Comments
Post a Comment