今天因為需求 要做ASM轉移

未命名.png

storage HA

圖片來看

要把2040 product 硬碟跟  2040 standby 做一致

以上面看

2040 product 裡面有oracle asm 是屬於 primary server所屬

當primary server 上面oracle intsance 故障了 要讓standby server 的oracle intsance認到 2040 standby 由2040 product 做一致性的ASM

 

所以要做到兩台instance 可以共享 一台storage 而且是ASM

1.相同環境必須一樣 並且安裝cluster software only
2.將要共享硬碟連結到standby server上
3.設定asm 封包 測試是否能認到連結到的硬碟
Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
 
[root@single1 ~]# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "DATA"
 
[root@single1 ~]# /usr/sbin/oracleasm listdisks
DATA
 
4.安裝使用grid 安裝 cluster
>>install oracle grid infrastructure software only
>>不需要理會resolv.conf
跑腳本.........................
[root@single1 ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
 
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
 
.........................
/u01/app/11.2.0/grid/root.sh
 
/u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl
 

To configure Grid Infrastructure for a Cluster execute the following command:
/u01/app/11.2.0/grid/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.
 
5.檢視cluster
 
single1-> crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.cssd       ora.cssd.type  OFFLINE   OFFLINE
ora.diskmon    ora....on.type OFFLINE   OFFLINE
ora.evmd       ora.evm.type   ONLINE    ONLINE    single1
ora.ons        ora.ons.type   OFFLINE   OFFLINE
 
6.補齊正常的
single-> crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATA.dg    ora....up.type OFFLINE   OFFLINE
ora....ER.lsnr ora....er.type OFFLINE   OFFLINE
ora.asm        ora.asm.type   OFFLINE   OFFLINE
ora.cssd       ora.cssd.type  OFFLINE   OFFLINE
ora.diskmon    ora....on.type OFFLINE   OFFLINE
ora.evmd       ora.evm.type   OFFLINE   OFFLINE
ora.ons        ora.ons.type   OFFLINE   OFFLINE
ora.single.db  ora....se.type OFFLINE   OFFLINE
 
缺少了 .
ora.single.db  ora....se.type OFFLINE   OFFLINE
ora.DATA.dg    ora....up.type OFFLINE   OFFLINE
ora....ER.lsnr ora....er.type OFFLINE   OFFLINE
ora.asm        ora.asm.type   OFFLINE   OFFLINE
 
先補齊asm
######srvctl add asm -p $ORACLE_HOME/dbs/init${ORACLE_SID}.ora
srvctl add asm -p $ORACLE_HOME/dbs/spfile${ORACLE_SID}.ora
srvctl status asm
把全部節點停止 crs_stop -all
在grid腳色使用 netca 建置監聽者
把主server /u01/app/11.2.0/grid/dbs 的密碼檔案傳到standby  server
在打開 crs_start -all
 
7.安裝oracle software
>>install database software only
執行腳本..............................
 
/tmp/CVU_11.2.0.4.0_oracle/runfixup.sh
/u01/app/oracle/product/11.2.0/db_1/root.sh
把主資料庫的/u01/app/oracle/product/11.2.0/db_1/dbs內容傳給standby
 scp * 172.18.2.236:/u01/app/oracle/product/11.2.0/db_1/dbs
注意記得到standby要把權限改成oracle
 
8.檢視crs_stat -t
 
缺少了 .
ora.single.db  ora....se.type OFFLINE   OFFLINE
ora.DATA.dg    ora....up.type OFFLINE   OFFLINE
 
補齊ora.single.db
使用oracle 帳號增加
srvctl add database -d single -p +DATA/single/spfilesingle.ora -o /u01/app/oracle/product/11.2.0/db_1
切換成grid帳號
把全部節點停止 crs_stop -all
在打開 crs_start -all
 
9.檢視crs_stat -t
 
缺少ora.DATA.dg    ora....up.type OFFLINE   OFFLINE
補齊
重新開機 認到硬碟 在mount起來
mount方式 使用grid 腳色 asmca
mount all 即可
 
再次檢視crs_stat -t
 
single1-> crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    single1
ora....ER.lsnr ora....er.type ONLINE    ONLINE    single1
ora.asm        ora.asm.type   ONLINE    ONLINE    single1
ora.cssd       ora.cssd.type  ONLINE    ONLINE    single1
ora.diskmon    ora....on.type OFFLINE   OFFLINE
ora.evmd       ora.evm.type   ONLINE    ONLINE    single1
ora.ons        ora.ons.type   OFFLINE   OFFLINE
ora.single.db  ora....se.type ONLINE    OFFLINE
 
發現ora.single.db  ora....se.type ONLINE    OFFLINE 起不來
srvctl start database -d single
發現錯誤
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
 
原來是沒有建置audit
在/u01/app/oracle
建置 admin
在admin裡面再建置{ORACLE_SID}名字→
adump
dpdump
pfile
script
 
10.再開啟一次看看
single1-> crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    single1
ora....ER.lsnr ora....er.type ONLINE    ONLINE    single1
ora.asm        ora.asm.type   ONLINE    ONLINE    single1
ora.cssd       ora.cssd.type  ONLINE    ONLINE    single1
ora.diskmon    ora....on.type OFFLINE   OFFLINE
ora.evmd       ora.evm.type   ONLINE    ONLINE    single1
ora.ons        ora.ons.type   OFFLINE   OFFLINE
ora.single.db  ora....se.type ONLINE    ONLINE    single1
 
SQL>  select name from v$datafile
  2  ;
 
NAME
--------------------------------------------------------------------------------
+DATA/single/datafile/system.256.904124739
+DATA/single/datafile/sysaux.257.904124739
+DATA/single/datafile/undotbs1.258.904124739
+DATA/single/datafile/users.259.904124739
+DATA/single/datafile/example.269.904124833
+DATA/single/datafile/test.dbf
 
6 rows selected.
 
PS:如果發生錯誤記得重新開啟就可以



 

 

 

 

 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 jiade_Chen 的頭像
    jiade_Chen

    assistant engineer

    jiade_Chen 發表在 痞客邦 留言(0) 人氣()