How to Rotate and Purge Listener Logs in 19c

A 19c new feature really makes DBA Life Easy.

Before 19c, there are very limited options to purge listener logs, which could be growing day by day up to a couple of GB size. DBAs have to write their own customised scripts to do this job.

This post demonstrates how to take advantage of 19c a new feature to rotate and purge listerer logs automatically, without a line of script necessary.

Subscribe to get access

Read more of this content when you subscribe today.

How to Recreate MGMTDB Database in 19c GI

This post demonstrates how to drop and recreate the 19c MGMTDB in a couple of minutes.

Check MGMTDB Current Status

[grid@racnode1 ~]$ srvctl status mgmtdb
Database is enabled
Instance -MGMTDB is running on node racnode1

Stop ora.crf Resource on All Nodes

[root@racnode1 ~]# /u01/app/19.0.0/grid/bin/crsctl stop res ora.crf -init
CRS-2673: Attempting to stop 'ora.crf' on 'racnode1'
CRS-2677: Stop of 'ora.crf' on 'racnode1' succeeded
[root@racnode1 ~]#
[root@racnode2 ~]# /u01/app/19.0.0/grid/bin/crsctl stop res ora.crf -init
CRS-2673: Attempting to stop 'ora.crf' on 'racnode2'
CRS-2677: Stop of 'ora.crf' on 'racnode2' succeeded
[root@racnode2 ~]#

Subscribe to get access

Read more of this content when you subscribe today.

Check MGMTDB Status after Recreation

[grid@racnode1 ~]$ srvctl status mgmtdb
Database is enabled
Instance -MGMTDB is running on node racnode2

How to Shrink Tablespace SYSMGMTDATA in -MGMTDB

Cluster Health Monitor ( CHM) tables could be fragmented in MGMTDB database

In another post Tablespace SYSMGMTDATA Is Full in GIMR Database (-MGMTDB), we introduced how to truncate Cluster Health Monitor ( CHM) tables to get space back, but did not solve the tablespace high water mark( HWM ) problem.

This post demonstrate how to shrink tablespace SYSMGMTDATA online without outage.

Subscribe to get access

Read more of this content when you subscribe today.

SHRINK tablespace SYSMGMTDATA

SYSMGMTDATA tablespace shrinked from 30GB down to 4GB, also give a maximum size to avoid out of space issue.

SQL>alter database datafile '+OCR_VOTE/_MGMTDB/FD9B43BF6A646F8CE043B6A9E80A2815/DATAFILE/sysmgmtdata.269.922884445' autoextend on maxsize 4096m;

Database altered.

Unable to get logical block size for spfile ‘+OCR_VOTE/_mgmtdb/spfile-MGMTDB.ora’

SYMPTOM

In alert log of management DB in GI ( Grid Infrastructure ) environment, there are following errors everyday:

Fri Jul 03 00:54:36 2020
ERROR: Unable to get logical block size for spfile '+OCR_VOTE/_mgmtdb/spfile-MGMTDB.ora'.
Fri Jul 03 00:54:36 2020
ERROR: Unable to get logical block size for spfile '+OCR_VOTE/_mgmtdb/spfile-MGMTDB.ora'.
Fri Jul 03 00:54:36 2020
ERROR: Unable to get logical block size for spfile '+OCR_VOTE/_mgmtdb/spfile-MGMTDB.ora'.
Fri Jul 03 00:54:36 2020
ERROR: Unable to get logical block size for spfile '+OCR_VOTE/_mgmtdb/spfile-MGMTDB.ora'.
Fri Jul 03 00:54:36 2020
ERROR: Unable to get logical block size for spfile '+OCR_VOTE/_mgmtdb/spfile-MGMTDB.ora'.

Subscribe to get access

Read more of this content when you subscribe today.