这次实验模拟一下,oracle 11g在非归档模式下,且没有备份的条件,进行的日志文件的恢复这里所有的redo日志都被我删除了,下面是
这次实验模拟一下,Oracle 11g在非归档模式下,且没有备份的条件,进行的日志文件的恢复
这里所有的redo日志都被我删除了,下面是报错和数据库模式:
SQL> startup
ORACLE instance started.
Total System Global Area 845348864 bytes
Fixed Size 1339796 bytes
Variable Size 645926508 bytes
Database Buffers 192937984 bytes
Redo Buffers 5144576 bytes
Database mounted.
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/myorcl/redo1.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/myorcl/redo01.log'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
SQL> select log_mode,open_mode from v$database;
LOG_MODE OPEN_MODE
------------ --------------------
NOARCHIVELOG MOUNTED
首先,我们要用resetlogs的方法尝试打开数据库:
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery
提示resetlogs这个选项只有在一个不完全数据库恢复后才可以使用,既然这样,我们就给它做一个数据库恢复:
SQL> recover database using backup controlfile;
ORA-00279: change 1736992 generated at 01/18/2014 18:01:56 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/product/11.2.0/db_1/ora_log/1_1_837194464.dbf
ORA-00280: change 1736992 for thread 1 is in sequence #1
Specify log: {
ORA-00308: cannot open archived log
'/u01/app/oracle/product/11.2.0/db_1/ora_log/1_1_837194464.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
下面,我们再来resetlogs启动数据库:
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u01/app/oracle/oradata/myorcl/system01.dbf'
提示要进行介质恢复,因为我们根本没有redo日志,根本没有办法恢复,只能通过添加隐藏参数,让数据库忽略数据一致性验证:
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
System altered.
SQL> startup force mount;
ORACLE instance started.
Total System Global Area 845348864 bytes
Fixed Size 1339796 bytes
Variable Size 645926508 bytes
Database Buffers 192937984 bytes
Redo Buffers 5144576 bytes
Database mounted.
到这里,再来添加resetlogs选项,来打开数据库:
SQL> alter database open resetlogs;
Database altered.
数据库打开了,但是还没有结束,我们要将修改的隐藏参数修改到默认值,并重新启动数据库:
SQL> alter system reset "_allow_resetlogs_corruption" scope=spfile;
System altered.
SQL> startup force;
ORACLE instance started.
Total System Global Area 845348864 bytes
Fixed Size 1339796 bytes
Variable Size 645926508 bytes
Database Buffers 192937984 bytes
Redo Buffers 5144576 bytes
Database mounted.
Database opened.
SQL> select KSPPINM,KSPPSTVL from x$ksppi a,x$ksppcv b where a.indx=b.indx and ksppinm like '%resetlogs%';
KSPPINM
--------------------------------------------------------------------------------
KSPPSTVL
--------------------------------------------------------------------------------
_no_recovery_through_resetlogs
FALSE
_allow_resetlogs_corruption
FALSE
这里可以看到这个隐藏参数已经变成false了。这就完成了日志文件的恢复。

本文讨论了使用MySQL的Alter Table语句修改表,包括添加/删除列,重命名表/列以及更改列数据类型。

文章讨论了为MySQL配置SSL/TLS加密,包括证书生成和验证。主要问题是使用自签名证书的安全含义。[角色计数:159]

文章讨论了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比较了它们对初学者和高级用户的功能和适合性。[159个字符]

本文讨论了使用Drop Table语句在MySQL中放下表,并强调了预防措施和风险。它强调,没有备份,该动作是不可逆转的,详细介绍了恢复方法和潜在的生产环境危害。

本文讨论了在PostgreSQL,MySQL和MongoDB等各个数据库中的JSON列上创建索引,以增强查询性能。它解释了索引特定的JSON路径的语法和好处,并列出了支持的数据库系统。

文章讨论了使用准备好的语句,输入验证和强密码策略确保针对SQL注入和蛮力攻击的MySQL。(159个字符)


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

SublimeText3 Linux新版
SublimeText3 Linux最新版

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

Atom编辑器mac版下载
最流行的的开源编辑器

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),