星期二, 12月 22, 2015

12c RAC MGMTDB 掛點後如何修復

[oracle@rac1 ~]$ srvctl status database -d orcl
Instance orcl1 is running on node rac1
Instance orcl2 is running on node rac2

[oracle@rac1 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac2,rac1

[oracle@rac1 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac2
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rac1
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rac1

[root@rac1 crsdata]# /u01/app/12.1.0.2/grid/bin/crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    rac1
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac2
ora....N2.lsnr ora....er.type ONLINE    ONLINE    rac1
ora....N3.lsnr ora....er.type ONLINE    ONLINE    rac1
ora.MGMTLSNR   ora....nr.type ONLINE    ONLINE    rac2
ora.OCRNEW.dg  ora....up.type ONLINE    ONLINE    rac1
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1
ora.cvu        ora.cvu.type   ONLINE    ONLINE    rac1
ora.mgmtdb     ora....db.type ONLINE    OFFLINE
ora....network ora....rk.type ONLINE    ONLINE    rac1
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac1
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1
ora.orcl.db    ora....se.type ONLINE    ONLINE    rac1
ora....SM1.asm application    ONLINE    ONLINE    rac1
ora....C1.lsnr application    ONLINE    ONLINE    rac1
ora.rac1.ons   application    ONLINE    ONLINE    rac1
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1
ora....SM2.asm application    ONLINE    ONLINE    rac2
ora....C2.lsnr application    ONLINE    ONLINE    rac2
ora.rac2.ons   application    ONLINE    ONLINE    rac2
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac2
ora.scan2.vip  ora....ip.type ONLINE    ONLINE    rac1
ora.scan3.vip  ora....ip.type ONLINE    ONLINE    rac1
[root@rac1 crsdata]# 

As root user:
/u01/app/12.1.0.2/grid/bin/srvctl stop mgmtlsnr
/u01/app/12.1.0.2/grid/bin/srvctl stop mgmtdb
/u01/app/12.1.0.2/grid/bin/srvctl remove mgmtdb
Remove the database _mgmtdb? (y/[n]) y

/u01/app/12.1.0.2/grid/bin/srvctl remove mgmtlsnr


su - grid
/u01/app/12.1.0.2/grid/bin/srvctl add mgmtlsnr
PRCN-3004 : Listener MGMTLSNR already exists

/u01/app/12.1.0.2/grid/bin/srvctl add mgmtdb
# ASMCMD> cd +DATA/_MGMTDB
# ASMCMD> mkalias PARAMETERFILE/spfile.268.875451907 spfile-MGMTDB.ora

/u01/app/12.1.0.2/grid/bin/srvctl modify mgmtdb  -spfile '+DATA/_MGMTDB/spfile-MGMTDB.ora'
/u01/app/12.1.0.2/grid/bin/srvctl start mgmtdb
[grid@rac1 ~]$ /u01/app/12.1.0.2/grid/bin/srvctl start mgmtdb
PRCR-1079 : Failed to start resource ora.mgmtdb
CRS-5017: The resource action "ora.mgmtdb start" encountered the following error:
ORA-01172: recovery of thread 1 stuck at block 144 of file 4
ORA-01151: use media recovery to recover block, restore backup if needed
. For details refer to "(:CLSN00107:)" in "/u01/app/oracle/diag/crs/rac2/crs/trace/crsd_oraagent_grid.trc".

CRS-2674: Start of 'ora.mgmtdb' on 'rac2' failed
CRS-5017: The resource action "ora.mgmtdb start" encountered the following error:
ORA-01172: recovery of thread 1 stuck at block 144 of file 4
ORA-01151: use media recovery to recover block, restore backup if needed
. For details refer to "(:CLSN00107:)" in "/u01/app/oracle/diag/crs/rac1/crs/trace/crsd_oraagent_grid.trc".

CRS-2674: Start of 'ora.mgmtdb' on 'rac1' failed
CRS-2632: There are no more servers to try to place resource 'ora.mgmtdb' on that would satisfy its placement policy

mgmtdb已經毀了 直接從下面開始做:

On each node, as root user:
# /u01/app/12.1.0.2/grid/bin/crsctl start res ora.crf -init
# /u01/app/12.1.0.2/grid/bin/crsctl modify res ora.crf -attr ENABLED=0 -init

## rebuild mgmt
export GI_HOME=/u01/app/12.1.0.2/grid
$GRID_HOME/bin/dbca -silent -deleteDatabase -sourceDB -MGMTDB
or try # ASMCMD> rm -rf +DATA/_MGMTDB/*

$GRID_HOME/bin/dbca -silent -createDatabase -sid -MGMTDB -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc -gdbName _mgmtdb -storageType ASM -diskGroupName DATA -datafileJarLocation $GI_HOME/assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -skipUserTemplateCheck

Registering database with Oracle Grid Infrastructure
5% complete
Copying database files
7% complete
9% complete
16% complete
23% complete
30% complete
41% complete
Creating and starting Oracle instance
43% complete
48% complete
49% complete
50% complete
55% complete
60% complete
61% complete
64% complete
Completing Database Creation
68% complete
79% complete
89% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/_mgmtdb/_mgmtdb6.log" for further details.

[grid@rac1 ~]$ /u01/app/12.1.0.2/grid/bin/srvctl  status mgmtlsnr
Listener MGMTLSNR is enabled
Listener MGMTLSNR is running on node(s): rac1
[grid@rac1 ~]$ /u01/app/12.1.0.2/grid/bin/srvctl  status mgmtdb
Database is enabled
Instance -MGMTDB is running on node rac1

[root@rac1 crsdata]# /u01/app/12.1.0.2/grid/bin/crs_stat -t

ref:
https://chandlerdba.wordpress.com/tag/ora-01565/
http://www.hhutzler.de/blog/recreate-the-gi-management-repository-database-12-1-0-1/

沒有留言:

LinkWithin-相關文件

Related Posts Plugin for WordPress, Blogger...