oracle数据文件的一次恢复经历
环境介绍:双机操作系统:solaris10数据库版本:oracle11gR164bit1、半夜接到电话,说数据库报大量错误,起来查看数据库,发现数据库已崩溃,查看alert日志,发
环境介绍:
双机 操作系统:solaris 10 数据库版本:oracle 11g R1 64bit1、半夜接到电话,说数据库报大量错误,起来查看数据库,发现数据库已崩溃,查看alert日志,发现I/O报错:
Wed Dec 18 00:36:57 2013 KCF: write/open error block=0x98abe online=1 file=89 /dev/raw/raw03 error=27063 txt: 'SVR4 Error: 5: I/O error Additional information: -1 Additional information: 8192' Wed Dec 18 00:36:57 2013 KCF: write/open error block=0x9d70f online=1 file=91 /dev/raw/raw05 error=27063 txt: 'SVR4 Error: 5: I/O error Additional information: -1 Additional information: 8192' Automatic datafile offline due to write error onAutomatic datafile offline due to write error on2、之前出过因为工程队碰到线,导致现网问题,问机房人员今晚是否有工程,机房人员说,今晚有新设备接入SAN网络,但经了解,无人碰到线,查看本机系统日志,报错如下:
Dec 17 23:33:10 fly-db01 scsi: [ID 107833 kern.warning] WARNING: /scsi_vhci/ssd@fly6000c5d0008a0000006b131400440 (ssd28): Dec 17 23:33:10 fly-db01 SCSI transport failed: reason 'tran_err': retrying command Dec 17 23:33:10 fly-db01 scsi: [ID 107833 kern.warning] WARNING: /scsi_vhci/ssd@fly6000c5d0008a0000006b131400930 (ssd52):3、查看其他使用到SAN存储的服务器数据库运行情况,alert日志,操作系统日志是否报错,以及挂载的为SAN存储的文件系统是否变成只读,,发现部分数据库也已崩溃,部分主机的文件系统变成只读,操作系统日志报lpfc的错误,之前也出现过这个错误,一般在出现lpfc的错误一段时间后,文件系统就会出现只读
lpfc错误: fly008:/var/log # cat messages | grep lpfc Dec 18 00:34:05 fly008 kernel: [10201542.768302] lpfc 0000:03:00.0: 0:(0):0203 Devloss timeout on WWPN 21:4g:00:0b:5e:6a:18:14 NPort x014400 Data: x40000 x1 x0 Dec 18 00:34:07 fly008 kernel: [10201544.816750] lpfc 0000:03:00.0: 0:(0):0203 Devloss timeout on WWPN 21:4h:00:0b:5e:6a:18:14 NPort x014500 Data: x0 x7 x0 Dec 18 00:34:07 fly008 kernel: [10201544.816802] lpfc 0000:03:00.0: 0:(0):0203 Devloss timeout on WWPN 21:4k:00:0b:5e:6a:18:14 NPort x014600 Data: x0 x7 x0 文件系统只读错误: fly008~ #df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_fly008_app-lv_fly008_app 99G 41G 53G 44% /home/fly008 fly008~ # cd /home/fly008 fly008/home/fly008 # touch 1.txt touch: cannot touch `1.txt': Read-only file system4、对今晚所做配置进行回退,问题消失,重新拉起数据库,数据库正常启动,拉起应用,应用拉起失败,在应用的日志中,报如下错误:
SQLErrorCode: 376 ORA-00376: file 92 cannot be read at this time ORA-01110: data file 92: '/dev/raw/raw06'5、在数据库的alert日志,也报相关错误
DDE: Problem Key 'ORA 1110' was flood controlled (0x5) (no incident) ORA-01110: 数据文件 92: '/dev/raw/raw06' *** 2013-12-18 05:04:16.284 ORA-12012: 自动执行作业 226 出错 ORA-00372: 此时无法修改文件 92 ORA-06512: 在 "FLY.DELETE_FLY_EXCEPTION_INFO", line 8 ORA-06512: 在 line 16、查看数据文件的状态,标记为recover,需要进行恢复操作
SQL> SELECT file_name, file_id, tablespace_name, status, online_status FROM DBA_DATA_FILES ORDER BY TABLESPACE_NAME; FILE_NAME FILE_ID TABLESPACE_NAME STATUS ONLINE_STATUS /dev/raw/raw06 92 FLY AVAILABLE RECOVER7、数据库开启了归档,有数据库的备份,对92的文件进行恢复操作
# su - oracle $ sqlplus / as sysdba SQL> archive log list; SQL> recover datafile 92; SQL> alter database datafile 92 online8、恢复后,应用拉起正常,业务测试正常。
本文出自 “斜阳悠悠寸草心” 博客,请务必保留此出处

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.
