ORA-00227: corrupt block detected in control file: (block 16, # blocks 1)

Oracle数据库:解决ORA-00227错误
当遇到ORA-00227错误,表示控制文件中检测到损坏块。解决方法是重建控制文件。本文分享了如何处理这一问题。


ORA-00227: corrupt block detected in control file: (block 16, # blocks 1)


 解决办法:重建控制文件

[oracle@OCPLHR dbs]$ sas
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 29 14:57:47 2019
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@OCPLHR1> startup force 
ORACLE instance started.
Total System Global Area  626327552 bytes
Fixed Size                  2230952 bytes
Variable Size             553649496 bytes
Database Buffers           62914560 bytes
Redo Buffers                7532544 bytes
ORA-00227: corrupt block detected in control file: (block 16, # blocks 1)
ORA-00202: control file: '/u01/app/oracle/oradata/OCPLHR1/control01.ctl'
[oracle@OCPLHR dbs]$ 
[oracle@OCPLHR dbs]$ cp snapcf_OCPLHR1.f /u01/app/oracle/oradata/OCPLHR1/control01.ctl
[oracle@OCPLHR dbs]$ sas
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 29 15:06:26 2019
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@OCPLHR1> alter database backup controlfile to trace as '/home/oracle/ctl.txt';
Database altered.
SYS@OCPLHR1> startup force nomount
ORACLE instance started.
Total System Global Area  626327552 bytes
Fixed Size                  2230952 bytes
Variable Size             553649496 bytes
Database Buffers           62914560 bytes
Redo Buffers                7532544 bytes
SYS@OCPLHR1> CREATE CONTROLFILE REUSE DATABASE "OCPLHR1" NORESETLOGS  ARCHIVELOG
  2      MAXLOGFILES 16
  3      MAXLOGMEMBERS 3
  4      MAXDATAFILES 100
  5      MAXINSTANCES 8
  6      MAXLOGHISTORY 292
  7  LOGFILE
  8    GROUP 1 '/u01/app/oracle/oradata/OCPLHR1/redo01.log'  SIZE 50M BLOCKSIZE 512,
  9    GROUP 2 '/u01/app/oracle/oradata/OCPLHR1/redo02.log'  SIZE 50M BLOCKSIZE 512,
 10    GROUP 3 '/u01/app/oracle/oradata/OCPLHR1/redo03.log'  SIZE 50M BLOCKSIZE 512
 11  -- STANDBY LOGFILE
 12  DATAFILE
 13    '/u01/app/oracle/oradata/OCPLHR1/system01.dbf',
 14    '/u01/app/oracle/oradata/OCPLHR1/sysaux01.dbf',
 15    '/u01/app/oracle/oradata/OCPLHR1/undotbs01.dbf',
 16    '/u01/app/oracle/oradata/OCPLHR1/users01.dbf',
 17    '/u01/app/oracle/oradata/OCPLHR1/example01.dbf',
 18    '/u01/app/oracle/oradata/OCPLHR1/a.dbf',
 19    '/u01/app/oracle/oradata/OCPLHR1/ocplhr1_test01.dbf',
 20    '/u01/app/oracle/oradata/OCPLHR1/trpdata.dbf'
 21  CHARACTER SET ZHS16GBK
 22  ;
Control file created.
SYS@OCPLHR1> 
SYS@OCPLHR1> startup force
ORACLE instance started.
Total System Global Area  626327552 bytes
Fixed Size                  2230952 bytes
Variable Size             553649496 bytes
Database Buffers           62914560 bytes
Redo Buffers                7532544 bytes
Database mounted.
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u01/app/oracle/oradata/OCPLHR1/system01.dbf'
SYS@OCPLHR1> recover database;
Media recovery complete.
SYS@OCPLHR1> 
SYS@OCPLHR1> alter database open;
alter database open
*
ERROR at line 1:
ORA-00603: ORACLE server session terminated by fatal error
ORA-00600: internal error code, arguments: [2662], [0], [3545903], [0], [3551857], [12583040], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [2662], [0], [3545902], [0], [3551857], [12583040], [], [], [], [], [], []
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00600: internal error code, arguments: [2662], [0], [3545900], [0], [3551857], [12583040], [], [], [], [], [], []
Process ID: 14562
Session ID: 96 Serial number: 3
SYS@OCPLHR1> startup force
ORA-24324: service handle not initialized
ORA-01041: internal error. hostdef extension doesn't exist
SYS@OCPLHR1> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@OCPLHR dbs]$ 
[oracle@OCPLHR dbs]$ 
[oracle@OCPLHR dbs]$ sas
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 29 15:10:44 2019
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to an idle instance.
SYS@OCPLHR1> startup force
ORACLE instance started.
Total System Global Area  626327552 bytes
Fixed Size                  2230952 bytes
Variable Size             553649496 bytes
Database Buffers           62914560 bytes
Redo Buffers                7532544 bytes
Database mounted.
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/u01/app/oracle/oradata/OCPLHR1/system01.dbf'
SYS@OCPLHR1> recover database;
Media recovery complete.
SYS@OCPLHR1> alter database open;
Database altered.
SYS@OCPLHR1> 
SYS@OCPLHR1> alter system switch logfile;
System altered.
SYS@OCPLHR1> alter system switch logfile;
System altered.
SYS@OCPLHR1> startup force
ORACLE instance started.
Total System Global Area  626327552 bytes
Fixed Size                  2230952 bytes
Variable Size             553649496 bytes
Database Buffers           62914560 bytes
Redo Buffers                7532544 bytes
Database mounted.
Database opened.
SYS@OCPLHR1> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@OCPLHR dbs]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Jul 29 15:11:55 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: OCPLHR1 (DBID=2909198110)
RMAN> backup database;
Starting backup at 2019-07-29 15:12:09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=129 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/OCPLHR1/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/OCPLHR1/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/OCPLHR1/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/OCPLHR1/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/OCPLHR1/users01.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/OCPLHR1/trpdata.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/OCPLHR1/a.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/OCPLHR1/ocplhr1_test01.dbf
channel ORA_DISK_1: starting piece 1 at 2019-07-29 15:12:11
channel ORA_DISK_1: finished piece 1 at 2019-07-29 15:13:46
piece handle=/u01/app/oracle/fast_recovery_area/OCPLHR1/backupset/2019_07_29/o1_mf_nnndf_TAG20190729T151210_gmx72cd9_.bkp tag=TAG20190729T151210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2019-07-29 15:13:47
channel ORA_DISK_1: finished piece 1 at 2019-07-29 15:13:48
piece handle=/u01/app/oracle/fast_recovery_area/OCPLHR1/backupset/2019_07_29/o1_mf_ncsnf_TAG20190729T151210_gmx75chn_.bkp tag=TAG20190729T151210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2019-07-29 15:13:48
RMAN> sql 'alter system switch logfile';
sql statement: alter system switch logfile
RMAN> backup archivelog all ;
Starting backup at 2019-07-29 15:15:18
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=1 STAMP=1014909024
input archived log thread=1 sequence=2 RECID=2 STAMP=1014909024
input archived log thread=1 sequence=3 RECID=3 STAMP=1014909024
input archived log thread=1 sequence=4 RECID=4 STAMP=1014909073
input archived log thread=1 sequence=5 RECID=5 STAMP=1014909090
input archived log thread=1 sequence=6 RECID=6 STAMP=1014909092
input archived log thread=1 sequence=7 RECID=7 STAMP=1014909108
input archived log thread=1 sequence=8 RECID=8 STAMP=1014909304
input archived log thread=1 sequence=9 RECID=9 STAMP=1014909318
channel ORA_DISK_1: starting piece 1 at 2019-07-29 15:15:18
channel ORA_DISK_1: finished piece 1 at 2019-07-29 15:15:19
piece handle=/u01/app/oracle/fast_recovery_area/OCPLHR1/backupset/2019_07_29/o1_mf_annnn_TAG20190729T151518_gmx786b1_.bkp tag=TAG20190729T151518 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2019-07-29 15:15:19
RMAN> backup current controlfile;
Starting backup at 2019-07-29 15:15:36
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 2019-07-29 15:15:37
channel ORA_DISK_1: finished piece 1 at 2019-07-29 15:15:38
piece handle=/u01/app/oracle/fast_recovery_area/OCPLHR1/backupset/2019_07_29/o1_mf_ncnnf_TAG20190729T151536_gmx78swd_.bkp tag=TAG20190729T151536 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2019-07-29 15:15:38
RMAN> exit
Recovery Manager complete.
[oracle@OCPLHR dbs]$ sas
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 29 15:15:44 2019
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@OCPLHR1> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     8
Next log sequence to archive   10
Current log sequence           10
SYS@OCPLHR1>




About Me

........................................................................................................................

● 本文作者:小麦苗,部分内容整理自网络,若有侵权请联系小麦苗删除

● 本文在itpub、博客园、优快云和个人微 信公众号( xiaomaimiaolhr )上有同步更新

● 本文itpub地址: http://blog.itpub.net/26736162

● 本文博客园地址: http://www.cnblogs.com/lhrbest

● 本文优快云地址: https://blog.youkuaiyun.com/lihuarongaini

● 本文pdf版、个人简介及小麦苗云盘地址: http://blog.itpub.net/26736162/viewspace-1624453/

● 数据库笔试面试题库及解答: http://blog.itpub.net/26736162/viewspace-2134706/

● DBA宝典今日头条号地址: http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826

........................................................................................................................

● QQ群号: 230161599 (满) 、618766405

● 微 信群:可加我微 信,我拉大家进群,非诚勿扰

● 联系我请加QQ好友 646634621 ,注明添加缘由

● 于 2019-07-01 06:00 ~ 2019-07-31 24:00 在西安完成

● 最新修改时间:2019-07-01 06:00 ~ 2019-07-31 24:00

● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解

● 版权所有,欢迎分享本文,转载请保留出处

........................................................................................................................

小麦苗的微店 https://weidian.com/s/793741433?wfr=c&ifr=shopdetail

小麦苗出版的数据库类丛书 http://blog.itpub.net/26736162/viewspace-2142121/

小麦苗OCP、OCM、高可用网络班 http://blog.itpub.net/26736162/viewspace-2148098/

小麦苗腾讯课堂主页 https://lhr.ke.qq.com/

........................................................................................................................

使用 微 信客户端 扫描下面的二维码来关注小麦苗的微 信公众号( xiaomaimiaolhr )及QQ群(DBA宝典)、添加小麦苗微 信, 学习最实用的数据库技术。

........................................................................................................................

欢迎与我联系

 

 



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26736162/viewspace-2652072/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26736162/viewspace-2652072/

### Oracle 数据库导出导入错误解决方案 在执行 `EXPDP` 或 `IMPDP` 操作时,遇到的 ORA-39002、ORA-39070 和 ORA-29283 错误通常与日志文件路径设置不正确或权限不足有关。以下是详细分析及解决方案: #### 1. **错误原因分析** - **ORA-39002: 操作无效** 此错误表明当前操作无法完成,通常与其他错误(如 ORA-39070)关联[^1]。 - **ORA-39070: 无法打开日志文件** 表示指定的日志文件路径存在问题,可能是因为路径不存在或权限不足[^2]。 - **ORA-29283: 文件操作无效** 提示尝试访问的文件或目录没有足够的权限,或者指定的路径无效[^3]。 - **ORA-06512: 在 "SYS.UTL_FILE" 出现错误** 这个错误进一步确认了问题与文件系统权限或路径相关[^4]。 #### 2. **解决方案** ##### (1) 检查并创建正确的目录对象 确保用于存储导出/导入文件的目录对象已正确创建,并赋予了适当的权限。例如: ```sql CREATE DIRECTORY dmp_dir AS '/path/to/directory'; -- 替换为实际路径 GRANT READ, WRITE ON DIRECTORY dmp_dir TO rui; -- 确保用户有读写权限 ``` 如果使用的是 Windows 系统,请确保路径格式正确,例如 `C:\temp` 应写为 `'C:/temp'`[^2]。 ##### (2) 验证操作系统级权限 检查操作系统中指定路径是否存在,并验证 Oracle 用户对该路径具有读写权限。例如,在 Linux 上可以运行以下命令: ```bash ls -ld /path/to/directory chmod 755 /path/to/directory chown oracle:oinstall /path/to/directory ``` ##### (3) 修改日志文件路径 如果日志文件路径有问题,可以通过调整 `LOGFILE` 参数来指定一个有效的路径。例如: ```bash expdp rui/rui DIRECTORY=dmp_dir dumpfile=studyfull_expdp.dmp FULL=y logfile=/path/to/directory/studyfullexpdp.log job_name=expdp_job ``` ##### (4) 使用绝对路径 有时相对路径可能导致问题,建议始终使用绝对路径指定 `DIRECTORY` 和 `LOGFILE` 参数[^3]。 ##### (5) 检查表空间或模式状态 如果涉及特定表空间或模式的导出/导入,请确保这些对象处于正常状态,且未被锁定或删除[^4]。 #### 3. **代码示例** 以下是一个完整的 `EXPDP` 命令示例,结合上述解决方案: ```bash expdp rui/rui DIRECTORY=dmp_dir dumpfile=/path/to/directory/studyfull_expdp.dmp FULL=y logfile=/path/to/directory/studyfullexpdp.log job_name=expdp_job ``` 对于 `IMPDP`,可以参考类似配置: ```bash impdp rui/rui DIRECTORY=dmp_dir DUMPFILE=studyfull_expdp.dmp LOGFILE=/path/to/directory/importlog.log ``` --- ###
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值