oracle11g RAC 啟動歸檔模式

煙花丶易冷發表於2018-02-10

根據客戶要求,需要將歸檔日誌存放在ASM上。因此需要在ASM建歸檔路徑

ASMCMD> mkdir arch

ASMCMD> cd arch

ASMCMD> pwd
+data1/kdcs/arch

修改歸檔路徑引數

SQL> alter system set log_archive_dest_1='location=+data1/kdcs/arch' scope=spfile sid='*';

System altered.

關閉資料庫,全部節點都要關閉

[grid@zhcs-db1 ~]$ srvctl stop database -d kdcs

檢查資料庫關閉後狀態

[grid@zhcs-db1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.LISTENER.lsnr
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.OCR_DISK.dg
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.asm
               ONLINE  ONLINE       zhcs-db1                 Started            
               ONLINE  ONLINE       zhcs-db2                 Started            
ora.gsd
               OFFLINE OFFLINE      zhcs-db1                                    
               OFFLINE OFFLINE      zhcs-db2                                    
ora.net1.network
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.ons
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.registry.acfs
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       zhcs-db1                                    
ora.cvu
      1        OFFLINE OFFLINE                                                  
ora.kdcs.db
      1        OFFLINE OFFLINE                               Instance Shutdown  
      2        OFFLINE OFFLINE                               Instance Shutdown  
ora.kdcs.ser_scanip.svc
      1        OFFLINE OFFLINE                                                  
      2        OFFLINE OFFLINE                                                  
ora.oc4j
      1        ONLINE  ONLINE       zhcs-db2                                    
ora.scan1.vip
      1        ONLINE  ONLINE       zhcs-db1                                    
ora.zhcs-db1.vip
      1        ONLINE  ONLINE       zhcs-db1                                    
ora.zhcs-db2.vip
      1        ONLINE  ONLINE       zhcs-db2         

將一個節點資料庫啟動到mount狀態

[grid@zhcs-db1 ~]$ srvctl start instance -d kdcs -i kdcs1 -o mount

修改資料庫的歸檔模式並啟動資料庫

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

檢查狀態
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +DATA1/kdcs/arch
Oldest online log sequence     86
Next log sequence to archive   87
Current log sequence           87
SQL>

啟動2節點資料庫

[grid@zhcs-db1 ~]$ srvctl start instance -d kdcs -i kdcs2

檢查叢集狀態

[grid@zhcs-db1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.LISTENER.lsnr
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.OCR_DISK.dg
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.asm
               ONLINE  ONLINE       zhcs-db1                 Started            
               ONLINE  ONLINE       zhcs-db2                 Started            
ora.gsd
               OFFLINE OFFLINE      zhcs-db1                                    
               OFFLINE OFFLINE      zhcs-db2                                    
ora.net1.network
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.ons
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
ora.registry.acfs
               ONLINE  ONLINE       zhcs-db1                                    
               ONLINE  ONLINE       zhcs-db2                                    
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       zhcs-db1                                    
ora.cvu
      1        OFFLINE OFFLINE                                                  
ora.kdcs.db
      1        ONLINE  ONLINE       zhcs-db1                 Open               
      2        ONLINE  ONLINE       zhcs-db2                 Open               
ora.kdcs.ser_scanip.svc
      1        ONLINE  ONLINE       zhcs-db1                                    
      2        ONLINE  ONLINE       zhcs-db2                                    
ora.oc4j
      1        ONLINE  ONLINE       zhcs-db2                                    
ora.scan1.vip
      1        ONLINE  ONLINE       zhcs-db1                                    
ora.zhcs-db1.vip
      1        ONLINE  ONLINE       zhcs-db1                                    
ora.zhcs-db2.vip
      1        ONLINE  ONLINE       zhcs-db2                                    
[grid@zhcs-db1 ~]$

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29618264/viewspace-2151016/,如需轉載,請註明出處,否則將追究法律責任。

相關文章