[20171031]rman xxx Failure.txt
[20171031]rman xxx Failure.txt
--//簡單測試 List Failure, Advise Failure and Repair Failure命令在11g下,也許以後工作需要.
--//雖然我自己很少使用這個命令,感覺這個有點傻瓜化.
1.環境:
SYS@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
RMAN> report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name BOOK
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 760 SYSTEM *** /mnt/ramdisk/book/system01.dbf
2 940 SYSAUX *** /mnt/ramdisk/book/sysaux01.dbf
3 865 UNDOTBS1 *** /mnt/ramdisk/book/undotbs01.dbf
4 128 USERS *** /mnt/ramdisk/book/users01.dbf
5 346 EXAMPLE *** /mnt/ramdisk/book/example01.dbf
6 40 TEA *** /mnt/ramdisk/book/tea01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 414 TEMP 32767 /mnt/ramdisk/book/temp01.dbf
2.建立測試環境:
--//建立備份:
delete archivelog all;
backup database format '/home/oracle/backup/full_%U';
backup archivelog all format '/home/oracle/backup/archive_%U';
--//過程略.
3.關閉資料庫,刪除一個資料檔案:
RMAN> shutdown immediate ;
database closed
database dismounted
Oracle instance shut down
$ mv /mnt/ramdisk/book/tea01.dbf /mnt/ramdisk/book/tea01.dbf_20171031
4.啟動資料庫:
SYS@book> startup
ORACLE instance started.
Total System Global Area 634732544 bytes
Fixed Size 2255792 bytes
Variable Size 197133392 bytes
Database Buffers 427819008 bytes
Redo Buffers 7524352 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/mnt/ramdisk/book/tea01.dbf'
SYS@book> select open_mode from v$database ;
OPEN_MODE
--------------------
MOUNTED
5.透過以下命令觀察:
--//List Failure;
RMAN> List Failure;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71648 HIGH OPEN 2017-10-31 15:48:51 One or more non-system datafiles are missing
RMAN> List Failure detail;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71648 HIGH OPEN 2017-10-31 15:48:51 One or more non-system datafiles are missing
Impact: See impact for individual child failures
List of child failures for parent failure ID 71648
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71651 HIGH OPEN 2017-10-31 15:48:51 Datafile 6: '/mnt/ramdisk/book/tea01.dbf' is missing
Impact: Some objects in tablespace TEA might be unavailable
RMAN> List Failure 71651;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71651 HIGH OPEN 2017-10-31 15:48:51 Datafile 6: '/mnt/ramdisk/book/tea01.dbf' is missing
Impact: Some objects in tablespace TEA might be unavailable
--//Advise Failure
RMAN> Advise Failure;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------------- -------
71648 HIGH OPEN 2017-10-31 15:48:51 One or more non-system datafiles are missing
analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=28 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=41 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=54 device type=DISK
analyzing automatic repair options complete
Mandatory Manual Actions
========================
no manual actions available
Optional Manual Actions
=======================
1. If file /mnt/ramdisk/book/tea01.dbf was unintentionally renamed or moved, restore it
Automated Repair Options
========================
Option Repair Description
------ ------------------
1 Restore and recover datafile 6
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_4210181035.hm
$ cat /u01/app/oracle/diag/rdbms/book/book/hm/reco_4210181035.hm
# restore and recover datafile
restore datafile 6;
recover datafile 6;
sql 'alter database datafile 6 online';
--//可以發現修復指令碼.再次執行Advise Failure ;還是在目錄/u01/app/oracle/diag/rdbms/book/book/hm/生產不同的檔案.
--//Repair Failure
RMAN> Repair Failure preview;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_3211653773.hm
contents of repair script:
# restore and recover datafile
restore datafile 6;
recover datafile 6;
sql 'alter database datafile 6 online';
RMAN> Repair Failure ;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/book/book/hm/reco_3211653773.hm
contents of repair script:
# restore and recover datafile
restore datafile 6;
recover datafile 6;
sql 'alter database datafile 6 online';
Do you really want to execute the above repair (enter YES or NO)? yes
executing repair script
Starting restore at 2017-10-31 15:55:10
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to /mnt/ramdisk/book/tea01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/full_gdsidcrr_1_1
channel ORA_DISK_1: piece handle=/home/oracle/backup/full_gdsidcrr_1_1 tag=TAG20171031T154706
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2017-10-31 15:55:12
Starting recover at 2017-10-31 15:55:12
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 2017-10-31 15:55:12
sql statement: alter database datafile 6 online
repair failure complete
Do you want to open the database (enter YES or NO)? YES
database opened
SYS@book> select open_mode from v$database ;
OPEN_MODE
--------------------
READ WRITE
--//OK現在資料庫正常開啟了.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2146649/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20171031]rman備份壓縮模式.txt模式
- netbackup RMAN-03009: failure of allocate command on XXXX channelAI
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- Error building Player: Win32Exception: ApplicationName=‘xxxxxxxxxxxxxxxxxx//sdk\tools\zipalign.exe' ...ErrorUIWin32ExceptionAPP
- Internal Error with background job scheduling XXXXXXXXXXXXX.Error
- // @require file://C:xxxxxxxxx.jsUIJS
- mysql Incorrect key file for table ‘/xxxxxxxx/xxxx.MYI'; try to repair itMySqlAI
- undefine macro xxxxxMac
- Spring:錯誤No bean named 'xxxxxxx' availableSpringBeanAI
- (徵文模板參考)xx技能樹/職業路線評測-xxxxxxxx
- Linux下編譯國標GB28181視訊推流元件EasyGBD報錯undefined reference to `xxxxxxxx@GLIBC_xxxxx‘解決Linux編譯元件Undefined
- Maven專案報錯:No bean named 'xxxxxx' availableMavenBeanAI
- [Linux] mutt /xxxx/xxxx/sent is not a mailbox.LinuxAI
- C++ vector<std::tuple<XXX, XXX, XXX>>C++
- could not connect to redis Instance at xxx.xxx.xxx.xxx:6379Redis
- 報錯xxxx of undefinedUndefined
- Action Script for resource 'ora.xxxx.xxxx2.inst' stdout redirection failed forAI
- 表結構遷移檔案Identifier name 'xxxxxx' is too long解決IDE
- Struts2中there is no action mapped for acion name (/XXXXX)APP
- 【20171031】在mac安裝蘋果提供的機器學習開發工具coremltoolsMac蘋果機器學習REM
- a commponent required a bean of type XXXXXX that could not be found-2022新專案UIBean
- CentOS 報錯 java.net.UnknownHostException: xxxxxx: 未知的名稱或服務CentOSJavaException
- java.sql.BatchUpdateException: Date truncation: Out of range value for column xxxxxJavaSQLBATException
- value xxx for the flexfield segment customer:does not exist in the value set xxxxFlex
- windows解壓檔案時,出錯:不能建立符號連結xxxxxxx客戶端沒有所需得特權Windows符號客戶端
- 關於cocopods更新第三方庫報ld: library not found for -lXXXXXX錯誤
- 使用req.session.xxx時出現 Cannot set property ‘xxxx‘ of undefinedSessionUndefined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxxxx' iSpringFrameworkBeanException
- 正規表示式 \uxxxx 元字元UX字元
- “Host ‘xxxx‘ is not allowed to connect to this MySQL server“MySqlServer
- Permission denied:user=xxx,access=WRITE,inode=xxx
- Oracle Error:emcp:EKBL043: emcp_pseudo_ctl_ioctl: Invalid cmd 0xxxxxx, proc nameOracleError
- 【IOS】關於cocopods更新第三方庫報ld: library not found for -lXXXXXX錯誤iOS
- PostgreSQL cache lookup failed for type XXXX 錯誤SQLAI
- Linux awk 中 xxxx的應用Linux
- 關於報錯Error creating bean with name 'xxxxx': Invocation of init method....ErrorBean
- Oracle 表 XXXXX 發生了變化, 觸發器/函式不能讀它.Oracle觸發器函式
- 記解決OEM起不來提示C4J_DBConsole_xxxx(hostname)_xxxx(sid) not found