關(guān)閉
1.先關(guān)數(shù)據(jù)庫:
代碼如下:
[oracle@oeltan1 ~]$ srvctl stop database -d tantest
2.再關(guān)閉crs服務(wù)
代碼如下:
root@oeltan1 ~]# crsctl stop crs
啟動:
代碼如下:
[root@oeltan1 ~]# crsctl start crs
[oracle@oeltan1 ~]$srvctl start asm -n node_name
上述開機(jī)一般已經(jīng)啟動
代碼如下:
[oracle@oeltan1 ~]$ srvctl start database -d tantest
歸檔設(shè)置:
1. 分別創(chuàng)建兩個實(shí)例的asm目錄
任意一個實(shí)例,grid用戶下:
代碼如下:
# su - grid
[grid@oeltan1 ~]$ sqlplus /as sysasm
sql> select name from v$asm_diskgroup;
name
--------------------------------------------------------------------------------
crs
data1
fri
12 sql> alter diskgroup fri add directory '+fri/tantest'; sql> alter diskgroup fri add directory '+fri/tantest/arch1';
還可以通過asmcmd創(chuàng)建目錄:
123 asmcmd> pwd +fri/tantest asmcmd> mkdir arch2
2.修改歸檔參數(shù)
任意一個實(shí)例,oracle用戶下:
12 alter system set log_archive_dest_1='location=+fri/tantest/arch1' scope=both sid='tantest1'; alter system set log_archive_dest_1='location=+fri/tantest/arch2' scope=both sid='tantest2';
3.兩個節(jié)點(diǎn)上分別都執(zhí)行:
1234 sql> shutdown immediate; sql> startup mount; sql> alter database archivelog; sql> alter database open;
--修改一個實(shí)例時,另一個實(shí)例不能在open狀態(tài),否則報ora-01126: database must be mounted in this instance and not open in any
4.分別檢查:
12345678910111213141516 sql> archive log list database log mode archive mode automatic archival enabled archive destination +fri/tantest/arch1 oldest online log sequence 14 next log sequence to archive 15 current log sequence 15 sql> archive log list database log mode archive mode automatic archival enabled archive destination +fri/tantest/arch2 oldest online log sequence 6 next log sequence to archive 7 current log sequence 7 sql>
更多信息請查看IT技術(shù)專欄