ORACLE RAC
增加数据文件后报:
ORA-01157: 无法标识/锁定数据文件 21 - 请参阅 DBWR 跟踪文件 ORA-01110: 数据文件 21: '/dev/rlvsas_8g_data06'
执行'alter system check datafiles'后恢复;
alter system check datafiles设计用来在rac环境对数据文件访问进行检测。当磁盘被多个机器共享访问时,有可能个别文件只能被当个机器访问,而其它机器不能访问。一般是由于配置或者操作系统的问题。
假定有个数据文件标示为offline,而且为rac环境。当你想online该数据文件时,你发现其中一个节点不能访问数据文件所在磁盘,这时这个实例不能够验证该数据文件。然后在另外一个实例中,控制文件会将该文件标示为online。但是数据文件仍然不能正常访问,并加载入SGA。此时alter system check datafiles命令可以用来纠正这个问题,使数据文件能够正常访问,将触发实例重新识别并验证这个数据文件。然后使数据库能够正常工作。
描述如下:
Paul Sherman wrote 'I tried an 'alter system check datafiles'
I had never come across that command before and looked at the documentation which states that 'in a distributed database system, such as an Oracle Parallel Server environment, updates an instance's SGA from the database control file to reflect information on all online datafiles'. Global actions against all nodes , local against the current instance only.?
I did check out the OPS install/config guide but did not found anything more in there. I was failing to understand in which circumstances the command would be required, knowing that we are running a number of OPS set ups and I had never used it. Looking further on Metalink I found the following note (Note:1071756.6)
When running "ALTER SYSTEM CHECK DATAFILES" it delivers a "STATEMENT PROCESSED" but there is no recorded activity. There is no alert file even though the book says there is. 燳ou can do an ALTER SYSTEM CHECK DATAFILES if the database is only mounted. But the command does not return an error if a datafile is missing. Solution Description:
The ALTER SYSTEM CHECK DATAFILES command was designed to solve a particular problem of file accessibility.?This most often has to do with OPS, and disks that are shared among several machines.?There are cases where a disk may be accessible on one machine, but not another, because of configuration or OS problems. Imagine that you have a datafile that is marked OFFLINE.?If the disk where that datafile lives is accessible to a particular machine in an OPS installation, then you can bring it ONLINE.?If, however, another machine can't get to that disk at the time you bring it ONLINE, then that instance won't be able to verify the datafile.?Hence in that instance, the controlfile will have the datafile listed as ONLINE, but the datafile still will not be properly accessible and entered in the SGA.? Explanation:
The ALTER SYSTEM CHECK DATAFILES command was designed to allow you to correct the problem from the OS perspective and make the disk accessible. This would then trigger the instance into recognizing this fact, verifying the datafile, and thereby making it available to Oracle in that instance. So the command does not quite do what might be implied by the current documentation.?It does not verify access to all online datafiles,rather, it only looks at those that are now online, but which were not previously verified.?Once a datafile has been verified, it is considered verified for all time, until you OFFLINE the file or until the database is dismounted in that instance.
I hope someone founds that useful, at least I have learnt a bit more by checking it out. Thanks Paul for mentioning it, if only in passing.
分享到:
相关推荐
alter system set audit_trail=none scope=spfile; truncate table SYS.AUD$; ``` 这将清理审计表和释放系统表空间,释放更多的空间。 解决ORA-01654处理表空间不足问题需要通过查看表空间使用情况、查看表空间...
SQL> DROP TABLESPACE ydyx INCLUDING CONTENTS AND DATAFILES; ``` 6. **重建表空间和用户**:完成上述步骤后,可以重新创建被删除的表空间及用户。 ```plaintext SQL> CREATE TABLESPACE ydyx DATAFILE 'F:\...
从描述中可以看到,系统试图打开数据库时遇到了ORA-10458和ORA-01196错误,指出数据文件1(+DATA/htdb7/datafile/system.313.884996245)由于介质恢复会话失败而不一致。进一步查询`v$archived_log`视图显示了部分...
DROP TABLESPACE XXX INCLUDING CONTENTS AND DATAFILES; ``` 然后,可以创建一个新的、更大的表空间来替代它。 **处理资源繁忙问题:** 在删除表空间时,可能会遇到ORA-00054错误,这意味着资源正被其他事务...
FROM DBA_TABLESPACES T, DBA_DATA_FILES D WHERE T.TABLESPACE_NAME = D.TABLESPACE_NAME AND T.TABLESPACE_NAME = 'USERS' ORDER BY TABLESPACE_NAME, FILE_NAME; ``` 修改表空间为自动增长的 SQL 语句为: ```sql...
- `ALTER SYSTEM`:用于全局系统级别的更改,如修改初始化参数。 - `SELECT * FROM V$INSTANCE`:查看数据库实例信息。 - `SELECT * FROM USER_TABLES`/`DBA_TABLES`:列出用户或所有用户的表。 - `SHOW ...
from dba_data_files order by tablespace_name; ``` 第二步:增大所需表空间的尺寸。可以使用 alter database 语句来扩展表空间的大小。例如: ```sql alter database datafile '表空间储存位置' resize 新的尺寸; ...
但如果在此过程中丢失了必要的日志,那么数据文件无法恢复,只能通过`DROP TABLESPACE XXX INCLUDING CONTENTS AND DATAFILES;`命令删除整个表空间。 总结来说,删除Oracle表空间数据文件是一项需要谨慎操作的任务...
SQL> drop tablespace 表空间名 including contents and datafiles; ``` #### 五、总结 本文详细介绍了Oracle物理表空间删除和修复的相关命令及其应用场景。对于数据库管理员来说,了解这些命令的操作方法是非常...
例如,`ORA-1126`通常表示在尝试切换日志时出现问题,`ORA-01157`和`ORA-01110`涉及数据文件无法识别或锁定。 5. **控制文件状态**: 控制文件是数据库的关键组件,通过`SELECT status, name FROM v$controlfile;`...
ORA-01110: data file 9: 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SCSSTZ01.DBF' ORA-27041: unable to open file OSD-04002: unable to open file O/S-Error: (OS2) 文件不存在 ``` 2. **确定受影响的数据...
Recover_Truncate_data.prepare_files(tgtowner, tgttable, datapath, datadir, rects, recfile, rstts, rstfile, blksz); Recover_Truncate_data.fill_blocks(tgtowner, tgttable, datadir, rects, recfile, ...
Oracle数据库的错误信息通常记录在`alert_SID.log`文件中,可以通过`cat /u01/app/oracle/admin/ORCL/bdump/alert_ORCL.log | grep -i ora-`这样的命令来查找特定的错误代码(如ORA-1126或ORA-01157)。同样,可以...
FROM dba_data_files; ``` - **结果示例**: | FILE_NAME | STATUS | |-------------------------------------|------------| | /u01/app/oracle/oradata/orcl/data.dbf| AVAILABLE | | ... | ... | - **...
DROP TABLESPACE tablespace_name INCLUDING CONTENTS AND DATAFILES; ALTER DATABASE DATAFILE '/XXX/xxx/datafile_name1.ora' OFFLINE DROP; ``` - **临时表空间:** ```sql DROP TABLESPACE tablespace_...
DROP TABLESPACE data01 INCLUDING CONTENTS AND DATAFILES; - **修改表空间大小**: sql ALTER DATABASE DATAFILE '/path/NADDate05.dbf' RESIZE 100M; - **移动表至另一表空间**: sql ALTER TABLE ...
3. **ORA-01110:文件14:‘E:\test\test.dbf’:** 这个错误给出了具体的文件名和位置,表明问题可能出现在文件路径或者文件本身。 ### 四、数据库对象管理 在Oracle数据库中,可以创建、修改和删除各种数据库...
9. **删除表空间**:需先删除其中的所有对象,然后使用`DROP TABLESPACE INCLUDING CONTENTS AND DATAFILES`,注意这会永久删除数据文件: ```sql DROP TABLESPACE demoindexts01 INCLUDING CONTENTS AND DATA...
alter system set log_archive_start=true scope=spfile; ``` - 验证归档模式是否启用: ```sql archive log list; ``` 2. **联机备份** - 查找需要备份的表空间文件路径: ```sql select file_name from ...