solaris10上oracle10g之asm_asmcmd和rman歸檔日誌資料不同學習
2. -bash-3.00$ export ORACLE_SID=+ASM ---配置連線asm例項的環境變數
3. -bash-3.00$ asmcmd ---進入asmcmd工具
ASMCMD> help ---檢視asmcmd工具的相關指南說明
asmcmd [-p] [command] --加上-p選項會在asmcmd中顯示當前目錄
The environment variables ORACLE_HOME and ORACLE_SID determine the
instance to which the program connects, and ASMCMD establishes a
bequeath connection to it, in the same manner as a SQLPLUS / AS
SYSDBA. The user must be a member of the SYSDBA group.
Specifying the -p option allows the current directory to be displayed
in the command prompt, like so:
ASMCMD [+DATAFILE/ORCL/CONTROLFILE] >
[command] specifies one of the following commands, along with its
parameters.
Type "help [command]" to get help on a specific ASMCMD command.
commands: ---下為asmcmd工具的相關命令
--------
cd --切換目錄(類似於solaris的cd)
du --檢視目錄已使用情況
find –檢視一個命令的用法
help
ls --類似於solaris的ls
lsct --檢視目前使用asm 例項的oracle例項(注:可能多個oracle例項共享一個asm例項,或者一個oracle例項對應一個asm例項)
lsdg --顯示碰盤組的情況(asm例項,是由多個碰盤組構成,一個磁碟組下含1或從個磁碟)
mkalias
mkdir --構建一個目錄
pwd --顯示當前目錄
rm --類似於solaris的rm
rmalias
-bash-3.00$ asmcmd -p
ASMCMD [+] > pwd --[+] 為當前目錄
+
ASMCMD [+] > ls --可以看到目錄有兩個目錄
ARCH/
DATA/
ASMCMD [+] > cd arch --切換目錄
ASMCMD [+arch] > pwd
+arch
ASMCMD [+arch] > ls
ASM10G/
ASMCMD [+arch] > cd asm10g
ASMCMD [+arch/asm10g] > ls
ARCHIVELOG/
ASMCMD [+arch/asm10g] > cd archivelog
ASMCMD [+arch/asm10g/archivelog] > pwd
+arch/asm10g/archivelog
ASMCMD [+arch/asm10g/archivelog] > ls
2009_11_26/
ASMCMD [+arch/asm10g/archivelog] > cd 2009_11_26
ASMCMD [+arch/asm10g/archivelog/2009_11_26] > ls
thread_1_seq_7.260.703906467
thread_1_seq_8.259.703906519
ASMCMD [+arch/asm10g/archivelog/2009_11_26] > rm thread_1_seq_8.259.703906519
--刪除一個歸檔日誌
ASMCMD [+arch/asm10g/archivelog/2009_11_26] > ls --再次檢視已經刪除
thread_1_seq_7.260.703906467
ASMCMD [+arch/asm10g/archivelog/2009_11_26] > exit --退出asmcmd
4. -bash-3.00$ export ORACLE_SID=asm10g --連線oracle例項
--(注:asm例項和oracle例項的ORACLE_SID是不同的,請注意)
5. -bash-3.00$ rman target / --進入rman工具
Recovery Manager: Release 10.2.0.2.0 - Production on Thu Nov 26 01:50:33 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ASM10G (DBID=40435634)
RMAN> list archivelog all; --顯示所有的歸檔日誌
--請注意:塗藍部分,可以看到在asmcmd中刪除的歸檔日誌也顯示在這兒
using target database control file instead of recovery catalog
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
2 1 2 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_2.256.703906333
1 1 3 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_3.257.703906335
3 1 4 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_4.258.703906339
4 1 5 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_5.259.703906347
5 1 6 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_6.260.703906373
6 1 7 A 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_7.260.703906467
7 1 8 A 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_8.259.703906519
RMAN> crosscheck archivelog all;--更新rman中儲存歸檔日誌的資訊
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=138 devtype=DISK
validation failed for archived log
archive log filename=+ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_2.256.703906333 recid=2 stamp=703906336
validation failed for archived log
archive log filename=+ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_3.257.703906335 recid=1 stamp=703906335
validation failed for archived log
archive log filename=+ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_4.258.703906339 recid=3 stamp=703906338
validation failed for archived log
archive log filename=+ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_5.259.703906347 recid=4 stamp=703906346
validation failed for archived log
archive log filename=+ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_6.260.703906373 recid=5 stamp=703906373
validation succeeded for archived log
archive log filename=+ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_7.260.703906467 recid=6 stamp=703906466
validation failed for archived log
archive log filename=+ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_8.259.703906519 recid=7 stamp=703906519
Crosschecked 7 objects
RMAN> list expired archivelog all;--顯示過期的歸檔日誌(過期就是已經物理刪除的歸檔)
對比發現透過asmcmd刪除的歸檔已經顯示出來
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
2 1 2 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_2.256.703906333
1 1 3 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_3.257.703906335
3 1 4 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_4.258.703906339
4 1 5 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_5.259.703906347
5 1 6 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_6.260.703906373
7 1 8 X 26-NOV-09 +ARCH/asm10g/archivelog/2009_11_26/thread_1_seq_8.259.703906519
6. 總結:
A. asmcmd是oracle為了簡化asm管理,引入的一種工具
B. asmcmd可以直接刪除oracle產生的歸檔日誌,但並未及時更新rman對應儲存歸檔日誌的資訊,所以利用rman 看到的歸檔日誌和利用asmcmd看到的歸檔日誌數量會不一樣
(也就是說rman中的list archivelog all把所有刪除和沒有刪除的歸檔全部顯示出來)
C. 不建議直接利用asmcmd刪除歸檔日誌,在生產請採用rman進行歸檔日誌的清理工作
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-620546/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rman清除歸檔日誌經典資料
- 無歸檔日誌恢復rman資料
- rman清理歸檔日誌
- RMAN備份資料檔案+控制檔案+歸檔日誌
- Oracle RMAN 清除歸檔日誌Oracle
- Oracle RMAN清除歸檔日誌Oracle
- rman維護歸檔日誌
- ORACLE RMAN 還原歸檔日誌Oracle
- 作用RMAN 刪除歸檔日誌
- 用RMAN備份歸檔日誌時檢查歸檔日誌是否存在
- RMAN delete archivelog命令刪除歸檔日誌及歸檔日誌拷貝deleteHive
- RMAN備份整庫和歸檔日誌的方法
- RMAN備份歸檔日誌指令碼指令碼
- RAC環境備份歸檔日誌和RMAN恢復啟動資料庫資料庫
- Oralce資料庫關閉歸檔日誌並且刪除歸檔日誌資料庫
- rman 還原歸檔日誌(restore archivelogRESTHive
- RMAN備份歸檔日誌多份 %c
- rman 還原歸檔日誌(restore archivelog)RESTHive
- rman刪除歸檔日誌命令集
- Oracle RAC中使用RMAN管理歸檔日誌Oracle
- 【Oracle】 rman 刪除歸檔日誌的命令Oracle
- oracle rman備份歸檔日誌需要先切換日誌嗎Oracle
- 日誌檔案和歸檔管理
- RMAN備份恢復之歸檔日誌對BLOCKRECOVER的影響BloC
- 用rman 正確地刪除歸檔日誌
- 11.2.0.3.2 RMAN無法恢復歸檔日誌
- rman刪除舊的歸檔日誌問題
- 資料檔案重建,從歸檔日誌中回退資料
- oracle之 Oracle歸檔日誌管理Oracle
- rman全庫備份備份歸檔日誌檔案
- 歸檔日誌
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- 歸檔日誌無法歸檔導致資料庫hang住資料庫
- 11gR2 RMAN歸檔日誌刪除策略
- rman 刪除指定時間點的歸檔日誌
- 兩個日誌組未能歸檔之後恢復資料庫資料庫
- 達夢資料庫DM8之刪除歸檔日誌檔案資料庫
- oracle資料庫歸檔日誌量陡增分析Oracle資料庫