数据泵搭建的同步环境同步失败、cannot backup or copy active file in NOARCHIVELOG mode

1、ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode

[oracle@testos:/home/oracle]$ oerr ora 19602
19602, 00000, "cannot backup or copy active file in NOARCHIVELOG mode"
// *Cause:  You tried to copy or backup a file that was not closed cleanly,
//          and the database was in NOARCHIVELOG mode.  This is not allowed
//          because when restored, the file will require redo application
//          before it is usable, and redo is not currently being saved
//          beyond the contents of the online redo logs.
// *Action: Take the tablespace offline clean or close the database and retry
//          the copy or backup.

解决办法:

方法1、mount状态下备份

方法2、归档模式下备份

案例

1、报错记录如下:

[root@testoracle1 impdp]# bash -x /oracle/backup/scripts/rman_full_backup.sh 
++ date +%F
+ export DATE=2015-12-02
+ DATE=2015-12-02
+ export BACK_DIR=/pddata2/oracle/backup/data
+ BACK_DIR=/pddata2/oracle/backup/data
+ su - oracle -c '
mkdir -p /pddata2/oracle/backup/data/2015-12-02
rman log=/pddata2/oracle/backup/data/2015-12-02/rman_backup.log target / <<EOF
run{
        backup as compressed backupset database format '\''/pddata2/oracle/backup/data/2015-12-02/full_%d_%T_%s.bak'\'';
}
exit;
EOF
'
RMAN> 2> 3> RMAN> + su - oracle -c '
chmod 775 /pddata2/oracle/backup/data/2015-12-02/*
'
[root@testoracle1 impdp]# 
[root@testoracle1 impdp]# 
[root@testoracle1 impdp]# 
[root@testoracle1 impdp]# more /pddata2/oracle/backup/data/2015-12-02/rman_backup.log 

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Dec 2 21:15:06 2015

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: POWERDES (DBID=3391761643)

RMAN> 2> 3> 
Starting backup at 02-DEC-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=397 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/02/2015 21:15:08
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode

RMAN> 

Recovery Manager complete.
[root@testoracle1 impdp]# 
[root@testoracle1 impdp]# 

2、解决办法之泠备份

[oracle@testoracle1 ~]$ rlwrap rman target /
rlwrap: warning: your $TERM is 'xterm' but rlwrap couldn't find it in the terminfo database. Expect some problems.

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Dec 2 21:18:13 2015

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: POWERDES (DBID=3391761643)                                                                                                                                       

RMAN> shutdown immediate;                                                                                                                                                                      

using target database control file instead of recovery catalog
database closed                                                                                                                                                                                
database dismounted                                                                                                                                                                            
Oracle instance shut down                                                                                                                                                                      

RMAN> startup mount;                                                                                                                                                                           

connected to target database (not started)
Oracle instance started                                                                                                                                                                        
database mounted                                                                                                                                                                               
                                                                                                                                                                                               
Total System Global Area   11357564928 bytes

Fixed Size                     2216744 bytes
Variable Size               8254393560 bytes
Database Buffers            3087007744 bytes
Redo Buffers                  13946880 bytes
                                                                                                                                                                                               
RMAN>

3、解决办法开启归档备份
因为磁盘不够,所以此方法省略过。

4、备份控制文件

RMAN> BACKUP CURRENT CONTROLFILE FORMAT '/pddata2/oracle/backup/data/2015-12-02/cntrl_%s_%p_%t';                                                                                               

Starting backup at 02-DEC-15                                                                                                                                                                   
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1                                                                                                                                                                  
channel ORA_DISK_1: SID=6 device type=DISK
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 02-DEC-15
channel ORA_DISK_1: finished piece 1 at 02-DEC-15                                                                                                                                              
piece handle=/pddata2/oracle/backup/data/2015-12-02/cntrl_5055_1_897427607 tag=TAG20151202T212647 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 02-DEC-15

Starting Control File and SPFILE Autobackup at 02-DEC-15                                                                                                                                       
piece handle=/pddata2/oracle/backup/data/ctl_auto/c-3391761643-20151202-01 comment=NONE                                                                                                        
Finished Control File and SPFILE Autobackup at 02-DEC-15
                                                                                                                                                                                               
RMAN>   

5、备份参数文件

create pfile='/oracle/pfile01.ora'from spfile; 
SQL> create pfile='/pddata2/oracle/backup/data/2015-12-02/pfile01.ora' from spfile;                                                                                                            

File created.

SQL>

6、备份成功

[root@testoracle1 data]# bash -x /oracle/backup/scripts/rman_full_backup.sh
++ date +%F
+ export DATE=2015-12-04
+ DATE=2015-12-04
+ export BACK_DIR=/pddata2/oracle/backup/data
+ BACK_DIR=/pddata2/oracle/backup/data
+ su - oracle -c '
mkdir -p /pddata2/oracle/backup/data/2015-12-04
rman log=/pddata2/oracle/backup/data/2015-12-04/rman_backup.log target / <<EOF
run{
	BACKUP CURRENT CONTROLFILE FORMAT '\''/pddata2/oracle/backup/data/2015-12-04/cntrl_%s_%p_%t'\'';  
        backup as compressed backupset database format '\''/pddata2/oracle/backup/data/2015-12-04/full_%d_%T_%s.bak'\'';
}
sqlplus 
exit;
EOF
'
RMAN> 2> 3> 4> RMAN> RMAN> + su - oracle -c '
chmod 775 /pddata2/oracle/backup/data/2015-12-04/*
'
[root@testoracle1 data]# 

2、ORA-27046

[oracle@testos:/home/oracle]$ oerr ora 27046
27046, 00000, "file size is not a multiple of logical block size"
// *Cause:  file size as indicated by stat is not correct, additional
//          information indicates which function encountered the error
// *Action: verify that the file has not been overwritten or truncated
[oracle@testos:/home/oracle]$ 

今天用数据泵搭建的同步环境同步失败了,报错信息如下:

ORA-39002: invalid operation
ORA-31694: master table "" failed to load/unload
ORA-31640: unable to open dump file "" for read
ORA-19505: failed to identify file ""
ORA-27046: file size is not a multiple of logical block size

由于目标库和源库的db_block_size不一样,我还担心是不是这个原因呢,后来查了一下metalink,不是这个原因。后来我仔细想了想,也不会跟db_block_size有关系,不然怎么会还支持跨平台的数据导入导出呢。

解决办法是把dmp重新ftp一下,发现大小果真和之前有问题的dmp大小不一样,所以看来还是网络上造成传输时的数据丢失了。

IMPDP Fails With ORA-39002, ORA-31694, ORA-31640, ORA-19505, ORA-27046 [ID 785473.1]

修改时间 10-DEC-2010 类型 PROBLEM 状态 PUBLISHED
In this Document
Symptoms
Cause
Solution
References


Applies to:
Oracle Server - Enterprise Edition - Version: 10.1.0.2 and later [Release: 10.1 and later ]
Information in this document applies to any platform.
Symptoms
IMPDP fails with the following errors:

ORA-39002: invalid operation
ORA-31694: master table “” failed to load/unload
ORA-31640: unable to open dump file “” for read
ORA-19505: failed to identify file “”
ORA-27046: file size is not a multiple of logical block size

Cause
The exported dump file is corrupt.

Solution
If the dump file came from a different system, then check if a binary transfer has taken place to transfer it to the current system. Also check the file size and if possible the checksum of the dump file.
If the problem persists:
•recreate the dump file by restarting the EXPDP process and make sure EXPDP completes without errors
•verify that the directory pointed to by the DIRECTORY parameter can be read from and written to without any problems. This can e.g. be done by performing an EXPDP and IMPDP operation or by using the UTL_FILE PL/SQL routine to read from and write to a file in this directory

References
NOTE:206272.1 - New Method of Using UTL_FILE in Oracle9i 9.2
NOTE:266875.1 - Export/Import DataPump Parameter DIRECTORY - How to Specify a Directory

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值