Friday 18 November 2022

How to delete MGMTDB


Ref : 

  • How to Move/Recreate GI Management Repository (GIMR / MGMTDB) to Different Shared Storage  (Doc ID 1589394.1)
  • 12.2: How to Create GI Management Repository (Doc ID 2246123.1)
    MDBUtil: GI Management Repository configuration tool (Doc ID 2065175.1)


 MGMTDB:

. oraenv

+ASM1

as a root user for grid

crsctl stop res ora.crf -init  //node 1

crsctl stop res ora.crf -init  //node2

perfom in both the node:

crsctl modify res ora.crf -attr ENABLED=0 -init

crsctl modify res ora.crf -attr ENABLED=0 -init


srvctl status mgmtdb


as oracle user perform the below

$ORACLE_HOME/bin/dbca -silent -deleteDatabase -sourceDB -MGMTDB

$ORACLE_HOME/bin/dbca -silent -deleteDatabase -sourceDB -MGMTDB


SUCCESSFULLY DELETED MGMTDB


++++++++++++++++++++++++++++++++++++++++++++++++++++


TO  recreate the MGMTDB in Oracle Database (12.2) required to use a perl script mdbutil.pl 


REF : MDBUtil: GI Management Repository configuration tool (Doc ID 2065175.1)



./mdbutil.pl -h


./mdbutil.pl --addmdb --target=+DATA02


AS A ROOT USER FROM GRID HOME


crsctl modify res ora.crf -attr ENABLED=1 -init


crsctl start res ora.crf -init


REPEAT ON NODE 2


Prerequisite Check “CheckActiveFilesAndExecutables” Failed --19c -issue

 issues:



Patch: /u01/patch/33182768/33192793

Log: /u01/app/19c/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-18_12-54-47PM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Prerequisite check "CheckActiveFilesAndExecutables" failed.


Patch: /u01/patch/33182768/33208107

Log: /u01/app/19c/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-18_12-54-47PM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Prerequisite check "CheckActiveFilesAndExecutables" failed.


Patch: /u01/patch/33182768/33208123

Log: /u01/app/19c/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-18_12-54-47PM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Prerequisite check "CheckActiveFilesAndExecutables" failed.


Patch: /u01/patch/33182768/33239955

Log: /u01/app/19c/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-18_12-54-47PM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Prerequisite check "CheckActiveFilesAndExecutables" failed.


solution :


/sbin/fuser /u01/app/19c/lib/libclntsh.so.19.1

       

 /u01/app/19c/lib/libclntsh.so.19.1 29785M


ps -ef |grep 29785


kill -9 29785                             

/sbin/fuser /u01/app/19c/lib/libasmclntsh19.so

/u01/app/19c/lib/libasmclntsh19.so  98766M

kill -9 98766

After fixing the cause of failure Run opatchauto resume      



Thursday 3 November 2022

How to create restore points for PDB and perform flashback at PDB level and when flashback is off

select * from database_properties where property_name='LOCAL_UNDO_ENABLED';

PROPERTY_NAME PROPERTY_VALUE

-------------------- ---------------

LOCAL_UNDO_ENABLED TRUE 



SQL> alter session set container=CDB$ROOT;

SQL> create restore point test2 for pluggable database hdprd;

SQL> create restore point test3 for pluggable database hdprd guarantee flashback database;


SQL> select NAME,TIME,SCN,PDB_RESTORE_POINT,GUARANTEE_FLASHBACK_DATABASE from V$RESTORE_POINT;

NAME                                     TIME                                            SCN PDB GUA

---------------------------------------- ---------------------------------------- ---------- --- ---

TEST3                                    03-NOV-22 02.10.11.000000000 PM             4706851 YES YES

TEST2                                    03-NOV-22 01.42.15.000000000 PM             4699251 YES NO


RMAN> list restore point all;


using target database control file instead of recovery catalog

SCN              RSP Time  Type       Time      Name

---------------- --------- ---------- --------- ----

4699251                               03-NOV-22 TEST2

4706851                    GUARANTEED 03-NOV-22 TEST3

if it using local undo

SQL> alter pluggable database hdprd close;

SQL> flashback pluggable database hdprd to restore point TEST2;

SQL> alter pluggable database test2 open resetlogs;


if it shared undo and restore point created when pdb was open;

RMAN> alter pluggable database hdprd close;

RMAN> flashback pluggable database hdprd to restore point TEST2 auxiliary destination '/U01/app/oracle/';

RMAN> alter pluggable database HDPRD open resetlogs;


SQL> alter pluggable database hdprd close;

SQL> flashback pluggable database hdprd to clean restore point TEST1;

SQL> alter pluggable database hdprd open resetlogs;


if flashback is off then we can restore only with guarantee flashback:

SQL> alter pluggable database hdprd close immediate instances=all;

RMAN> flashback pluggable database hdprd to restore point TEST3 auxiliary destination '+RECO_01';

RMAN> alter pluggable database hdprd open resetlogs;

once it is up ,drop the old restore point and create a new restore point then start the services




 







Featured post

Postgres commads

 [oracle@Tesdb ~]$ systemctl status postgresql-15 ● postgresql-15.service - PostgreSQL 15 database server    Loaded: loaded (/usr/lib/system...