OracleRAC新增asm磁碟組並設定歸檔位置
VMware Server2+RHEL4+ASM+10gRAC
新增共享磁碟
編輯rac1節點的.vmx檔案,新增紅色字型部分
disk.locking = "FALSE"
disklib.dataCacheMaxSize = "0"
disklib.dataCacheMaxReadAheadSize = "0"
disklib.dataCacheMinReadAheadSize = "0"
disklib.dataCachePageSize = "4096"
disklib.maxUnsyncedWrites = "0"
scsi1:0.deviceType = "disk"
scsi1:1.deviceType = "disk"
scsi1:2.deviceType = "disk"
scsi1:3.deviceType = "disk"
scsi1:4.deviceType = "disk"
scsi1:5.deviceType = "disk"
編輯rac2節點的.vmx檔案,新增紅色字型部分
disk.locking = "FALSE"
disklib.dataCacheMaxSize = "0"
disklib.dataCacheMaxReadAheadSize = "0"
disklib.dataCacheMinReadAheadSize = "0"
disklib.dataCachePageSize = "4096"
disklib.maxUnsyncedWrites = "0"
scsi1:0.deviceType = "disk"
scsi1:1.deviceType = "disk"
scsi1:2.deviceType = "disk"
scsi1:3.deviceType = "disk"
scsi1:4.deviceType = "disk"
scsi1:5.deviceType = "disk"
scsi1:5.present = "TRUE"
scsi1:5.fileName = "E:\Virtual Machines\ShareStorage\arvhice.vmdk"
scsi1:5.writeThrough = "TRUE"
scsi1:5.mode = "independent-persistent"
啟動兩個節點rac1,rac2
在rac1節點上
[root@rac1 ~]# fdisk -l
… … … …
Disk /dev/sdg: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdg doesn't contain a valid partition table
[root@rac1 ~]# fdisk /dev/sdg
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044):
Using default value 1044
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
檢視rac2節點的磁碟分割槽情況
[root@rac2 ~]# fdisk -l
… … … …
Disk /dev/sdg: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdg1 1 1044 8385898+ 83 Linux
在rac1節點上建立asm磁碟
[root@rac1 ~]# service oracleasm createdisk VOL4 /dev/sdg1
Marking disk "VOL4" as an ASM disk: [ OK ]
[root@rac1 ~]# service oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
重新配置下rac2節點的asm
[root@rac2 ~]# service oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface [oracle]:
Default group to own the driver interface [dba]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@rac2 ~]# service oracleasm listdisks
VOL1
VOL2
VOL3
VOL4
下面新增asm磁碟組
在rac1節點上
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ export ORACLE_SID=+ASM1
[oracle@rac1 ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N N 512 4096 1048576 8189 8096 0 8096 0 ARCHIVE/
MOUNTED NORMAL N N 512 4096 1048576 8188 5852 0 2926 0 DG1/
MOUNTED EXTERN N N 512 4096 1048576 4094 3760 0 3760 0 RECOVERY/
可以看到rac1節點的asm已經加了archive磁碟組,並且自動mount上該磁碟組
在rac2節點上檢視下,也可以看到archive磁碟組新增成功並mount狀態
[root@rac2 ~]# su - oracle
[oracle@rac2 ~]$ export ORACLE_SID=+ASM2
[oracle@rac2 ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N N 512 4096 1048576 8189 8096 0 8096 0 ARCHIVE/
MOUNTED NORMAL N N 512 4096 1048576 8188 5852 0 2926 0 DG1/
MOUNTED EXTERN N N 512 4096 1048576 4094 3760 0 3760 0 RECOVERY/
關掉rac1和rac2兩個例項
[oracle@rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Dec 15 16:16:52 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
[oracle@rac2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Dec 15 16:18:19 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
啟動rac1例項,資料庫到mount狀態
SQL> startup mount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 104859216 bytes
Database Buffers 176160768 bytes
Redo Buffers 2973696 bytes
Database mounted.
檢視例項的歸檔狀態
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 5
Current log sequence 6
在rac1例項上設定歸檔位置
SQL> alter system set log_archive_dest_1='location=+archive/' sid='*';
System altered.
在rac1例項上切換歸檔模式
SQL> alter database archivelog;
Database altered.
在rac1例項上開啟資料庫到open狀態
SQL> alter database open;
Database altered.
在rac1例項上檢視歸檔模式
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +ARCHIVE
Oldest online log sequence 5
Next log sequence to archive 6
Current log sequence 6
開啟rac2例項並檢視歸檔狀態
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 121636432 bytes
Database Buffers 159383552 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +ARCHIVE
Oldest online log sequence 2
Next log sequence to archive 3
Current log sequence 3
在rac1和rac2例項上分別手動歸檔線上日誌檔案
在rac1例項上
SQL> alter system archive log current;
System altered.
在rac2例項上
SQL> alter system archive log current;
System altered.
在rac1例項上進行檢視驗證
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@rac1 ~]$ export ORACLE_SID=+ASM1
[oracle@rac1 ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N N 512 4096 1048576 8189 8076 0 8076 0 ARCHIVE/
MOUNTED NORMAL N N 512 4096 1048576 8188 5852 0 2926 0 DG1/
MOUNTED EXTERN N N 512 4096 1048576 4094 3760 0 3760 0 RECOVERY/
ASMCMD> cd +archive/prod/archivelog/2013_12_15
ASMCMD> ls
thread_1_seq_6.256.834252029
thread_1_seq_7.259.834252109
thread_2_seq_3.257.834252091
thread_2_seq_4.258.834252105
可以看到剛剛歸檔的兩個節點的歸檔日誌,Oracle RAC的歸檔模式就切換完畢了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26613085/viewspace-1063313/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 一次ASM新增新的磁碟組ASM
- 在ASM磁碟組中刪除歸檔日誌報ORA-15028ASM
- ASM磁碟組限制ASM
- 遷移ASM磁碟組ASM
- 遷移OCR和VotingDisk並刪除原ASM磁碟組ASM
- 【ASM】Oracle asm磁碟被格式化,如何掛載該磁碟組ASMOracle
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- ASM磁碟組更換磁碟的操作方法ASM
- ASM磁碟簡單維護,新增,刪除ASM
- ASM 磁碟組的建立及擴容ASM
- ORACLE ASM磁碟組空間溢位OracleASM
- 使用udev擴充套件ASM磁碟組dev套件ASM
- ASM磁碟組擴容操作文件ASM
- Oracle ASM磁碟組擴容(AIX7.1)OracleASMAI
- ASM磁碟組ORA-15042 ORA-15096ASM
- Oracle RAC環境下ASM磁碟組擴容OracleASM
- SharePlex跳過歸檔或從指定歸檔位置開始
- ASM重新命名包含OCR/vote file的磁碟組ASM
- RAC之grid叢集安裝及ASM磁碟組配置ASM
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- ASM單例項安裝後,需要手動設定ASM的引數檔案ASM單例
- Oracle RAC ASM磁碟組擴容時遇到的VIP漂移OracleASM
- 基於裸裝置的ASM磁碟組擴容方案ASM
- 【ASM】ASM磁碟頭被重寫,如何修復ASM
- Virtualbox中Linux新增新磁碟並建立分割槽Linux
- 從定位資料塊所在ASM磁碟到ASM strippingASM
- (grid重灌後圖形介面報錯)ASM磁碟組字元介面配置ASM字元
- 問題:未清空磁碟被新增到磁碟組觸發壞塊
- Rman在run命令塊裡臨時設定歸檔目錄,歸檔日誌能否恢復主要看預設的歸檔路徑
- asm磁碟組依賴導致資料庫自啟動報錯ASM資料庫
- 【ARCH】Oracle 判斷asm磁碟組大小,超過閾值清理指令碼OracleASM指令碼
- 設定Oracle9i為自動歸檔模式Oracle模式
- LightBD/PostgreSQL資料庫設定歸檔保留時間SQL資料庫
- Android佈局中動態新增ImageView並設定間隔AndroidView
- idea中設定maven預設位置IdeaMaven
- JavaScript設定背景圖片位置JavaScript
- 資料檔案遷移至其他磁碟組
- Oralce資料庫關閉歸檔日誌並且刪除歸檔日誌資料庫
- input 獲取游標位置與設定游標位置