Posts

Showing posts from June, 2024

Finding User Objects with Tablespaces in Oracle Database

   The query below shows what tablespaces does user have files and what are the total sizes of their objects in there:   SELECT  o.owner,     s.tablespace_name, FLOOR(SUM(s.bytes) / (1024 * 1024)) AS size_mb  FROM      dba_objects o JOIN      dba_segments s ON      o.object_name = s.segment_name     AND o.owner = s.owner     group by  o.owner,     s.tablespace_name   order by owner;

Remove Expire Without Changing Password on a User in Oracle Database

  SELECT 'ALTER USER '|| name ||' IDENTIFIED BY VALUES '''|| spare4 ||';'|| password ||''';' FROM sys.user$ WHERE name='MYUSER'; ALTER USER MYUSER IDENTIFIED BY VALUES 'S:5F20FE3B04A699B37E5D68F20C597E411AF0E541A0315C7D20B3F56A37C1;T:CADDBF4C3A94AE641BE5EB56718E1F323EA39157FCBBD3511232EA54C7EBD52FCBD2061BFB6120E70A525FD08E2556ECC17878DFC581894C7169E64BF394AD82D57C2671F2C4AC5651D9AFA47DF58052;';