====== 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 * SELECT owner, table_name FROM all_tables where owner in ('JWARS') - get all tables * * select 'select count(*) from '||table_name||';' from all_tables where owner = 'JWARS'; "creates sql" * 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; get table space usage * describe a table in another schema: describe user2.flights; * select table_name, num_rows counter from dba_tables where owner = 'XXX' order by table_name; * alter user jwars account unlock; fix ora-28000. account get locks after 10 failed logins. * ora-01017 - user/pass are now case sensitive == 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;