NOLOGGING to LOGGING


======================================================================
Check tables as in NOLOGGING
======================================================================
SELECT LOGGING,COUNT(*) FROM dba_tables WHERE owner = 'Schema_Name' AND TEMPORARY = 'N' GROUP
BY LOGGING ORDER BY 2 DESC;

======================================================================
If found tables in NOLOGGING the move change to LOGGING from the script.
======================================================================
SELECT 'ALTER TABLE Schema_Name.'||table_name|| ' LOGGING;'
FROM dba_tables WHERE LOGGING='NO' AND owner = 'Schema_Name' AND TEMPORARY = 'N';

======================================================================
Check indexes as in NOLOGGING
---------------------------------------
SELECT LOGGING,COUNT(*) FROM dba_indexes WHERE owner = 'Schema_Name' AND TEMPORARY = 'N' GROUP
BY LOGGING ORDER BY 2 DESC;

========================================================================
 If found indexes in NOLOGGING the move change to LOGGING from the script.
========================================================================
SELECT 'ALTER INDEX Schema_Name.'||index_name|| ' LOGGING;'
FROM dba_indexes WHERE LOGGING='NO' AND owner = 'Schema_Name' AND TEMPORARY = 'N' ;

========================================================================

No comments:

Post a Comment

View running queries in postgresql

 View running queries in postgreSQL: SELECT * FROM pg_stat_activity;