Oracle Scripts

Oracle password has expired
jwars has a profile of DEFAULT
alter profile DEFAULT limit password_life_time UNLIMITED; ⇐==== passwords never expire
alter user jwars identified by password account unlock; ⇐============= works
username/password is jwars/password !!!!
 -- get all tables
SELECT owner, table_name FROM all_tables 
 -- get table space usage
SELECT a.tablespace_name, a.file_name, a.bytes allocated_bytes, b.free_bytes FROM dba_data_files a, (SELECT file_id, SUM(bytes) free_bytes FROM dba_free_space b GROUP BY file_id) b WHERE a.file_id=b.file_id ORDER BY a.tablespace_name;
quit; 
 -- describe a table in another schema:     
describe user2.flights;
 -- “creates sql”
select 'select count(*) from '||table_name||';' from all_tables where owner = 'JWARS'; x
 -- fix ora-28000. account get locks after 10 failed logins.
alter user jwars account unlock; 
 -- get all tables
SELECT owner, table_name FROM all_tables 
 -- get all tables
SELECT owner, table_name FROM all_tables 
 -- get all tables
SELECT owner, table_name FROM all_tables 
 -- get all tables
SELECT owner, table_name FROM all_tables 

quit; get table space usage

count JWARS rows
column table_name heading 'table name' 
column table_name format a30
column num_rows heading 'num_rows'
select table_name, num_rows from all_tables where owner in ('JWARS');
quit;
select owner, table_name, nvl(num_rows,-1) from all_tables where owner in ('JWARS') order  by table_name;
quit;