Oracle数据库归档日志满后造成系统宕机解决一例
第一次宕机时,初始以为是系统内存溢出,于是重启应用服务器,发现应用服务器在启动时报错,错误为无法连接到Oracle数据库。于是
第一次宕机时,初始以为是系统内存溢出,于是重启应用服务器,发现应用服务器在启动时报错,错误为无法连接到Oracle数据库。于是连接数据库服务器,打开EM后发现系统报错如图:
提示归档日志写入失败,检查服务器发现磁盘空间满了,于是清理磁盘空间后,重启数据库问题解决。随后把服务器磁盘空间扩容,直接给了oracle数据所在盘1TB的磁盘空间。
第二次又出现此问题,经过仔细检查,并与同事确认后,发现是由于ORACLE数据库的归档日志被启用了,而我们系统默认是没有启用ORACLE数据库归档日志这个功能的。
使用sql命令查看:
Sql>sqlplus / as nolog;---------------------启动sql*Plus
Sql> connect sys/password@orcl as sysdba;
Sql> archive log list;
数据库日志模式 存档模式
自动存档 启用
存档终点 USE_DB_RECOVERY_FILE_DEST
最早的联机日志序列 4888
下一个存档日志序列 4890
当前日志序列 4890
Sql> show parameter db_recovery_file_dest;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string D:\oracle\product\10.2.0/flash_recovery_area
db_recovery_file_dest_size big integer 20G
处理方法:
一、首先要处理日志空间满的情况:
1.指定数据库实例
C:/Documents and Settings/Administrator>SET ORACLE_SID =orcl
2.连接数据库
C:/Documents and Settings/Administrator>RMAN TARGET SYS/password@orcl
3.查看归档日志的状态
RMAN> list archivelog all;
4.手工删除归档日志文件
RMAN> exit
SQL> alter system set db_recovery_file_dest_size=214748364800;---设置使用空间大小(20*1024*1024*1024)
System altered
SQL> show parameter db_recovery_file_dest;---查看归档日志路径限额
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string D:\oracle\product\10.2.0/flash_recovery_area
db_recovery_file_dest_size big integer 200G
然后重启数据库后,系统可以正常使用了。
但是,由于启用了归档日志,即便设置成了200G的使用空间,按照每天2G的数据增长量,也就3个月数据就能达到了,需要定制任务定时清理归档日志,而删除归档日志只有在RMAN里才能进行,于是在数据库服务器上新建一个bat文件(文件名随意)
编辑此文件为:
rman target 'sys/password' cmdfile 'd:\cmd.txt'―――此处路径、文件名随意
在命令中对应的路径下新建cmd.txt文件,打开编辑此文件,
DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';
然后在Windows计划任务里添加任务,指定每天定时执行此bat文件。
经过一周的运行,归档日志每天定时被清理。系统正常。
在CentOS 6.4下安装Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虚拟机中安装步骤
Debian 下 安装 Oracle 11g XE R2
本文永久更新链接地址:

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



Full table scanning may be faster in MySQL than using indexes. Specific cases include: 1) the data volume is small; 2) when the query returns a large amount of data; 3) when the index column is not highly selective; 4) when the complex query. By analyzing query plans, optimizing indexes, avoiding over-index and regularly maintaining tables, you can make the best choices in practical applications.

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

The difference between clustered index and non-clustered index is: 1. Clustered index stores data rows in the index structure, which is suitable for querying by primary key and range. 2. The non-clustered index stores index key values and pointers to data rows, and is suitable for non-primary key column queries.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

In MySQL database, the relationship between the user and the database is defined by permissions and tables. The user has a username and password to access the database. Permissions are granted through the GRANT command, while the table is created by the CREATE TABLE command. To establish a relationship between a user and a database, you need to create a database, create a user, and then grant permissions.
