關(guān)閉
1.先關(guān)數(shù)據(jù)庫(kù):
代碼如下:
[oracle@oeltan1 ~]$ srvctl stop database -d tantest
2.再關(guān)閉crs服務(wù)
代碼如下:
root@oeltan1 ~]# crsctl stop crs
啟動(dòng):
代碼如下:
[root@oeltan1 ~]# crsctl start crs
[oracle@oeltan1 ~]$srvctl start asm -n node_name
上述開(kāi)機(jī)一般已經(jīng)啟動(dòng)
代碼如下:
[oracle@oeltan1 ~]$ srvctl start database -d tantest
歸檔設(shè)置:
1. 分別創(chuàng)建兩個(gè)實(shí)例的ASM目錄
任意一個(gè)實(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';
還可以通過(guò)asmcmd創(chuàng)建目錄:
123 ASMCMD> pwd +FRI/TANTEST ASMCMD> mkdir ARCH2
2.修改歸檔參數(shù)
任意一個(gè)實(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.兩個(gè)節(jié)點(diǎn)上分別都執(zhí)行:
1234 SQL> SHUTDOWN IMMEDIATE; SQL> STARTUP MOUNT; SQL> ALTER DATABASE ARCHIVELOG; SQL> ALTER DATABASE OPEN;
--修改一個(gè)實(shí)例時(shí),另一個(gè)實(shí)例不能在open狀態(tài),否則報(bào)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>
更多信息請(qǐng)查看IT技術(shù)專欄