duplicate报ora-01017权限问题
环境:
os:redhat enterprise linux 5.8 x64
cluster:oracle grid 11.2.0.4
database:oracle database enterprise 11.2.0.4
archive:rac+dg
今天在配置dg的过程中,前期环境都已经准备好了,就差最后一步将rac数据duplicate到standby端,但是蹊跷的事情就在这一步发生了,尝试几次都无法将数据duplicate过去,当然我尝试通过拷贝rman备份到对端也无法完成恢复,死活就报ora-01017错误,经过几个小时的努力,问题最终也算是得到了比较好的解决。如下:
故障现象
rmantarget sys/oracle@jetdb auxiliary sys/oracle@standby recoverymanager: release 11.2.0.4.0 - production on mon may 26 16:14:36 2014 copyright(c) 1982, 2011, oracle and/or its affiliates. all rights reserved. connectedto target database: jetdb (dbid=2170518470) connectedto auxiliary database: jetdb (not mounted) rman>duplicate target database for standby from active database nofilenamecheck ; startingrestore at 26-may-14 usingtarget database control file instead of recovery catalog allocatedchannel: ora_disk_1 channelora_disk_1: sid=416 device type=disk channelora_disk_1: restoring control file rman-00571:=========================================================== rman-00569:=============== error message stack follows =============== rman-00571:=========================================================== rman-03002:failure of restore command at 05/26/2014 16:14:54 ora-19870:error while restoring backup piece /dbbackup/phycal/stdb_cntl_0fp98vq2_1_1.bkp ora-19504:failed to create file "+data001/jetdb/controlfile/control01.ctl" ora-17502:ksfdcre:3 failed to create file +data001/jetdb/controlfile/control01.ctl ora-15001:diskgroup "data001" does not exist or is not mounted ora-15055:unable to connect to asm instance ora-01017:invalid username/password; logon denied
问题分析:
1、 从上面告警日志来看,ora-01017可以很明显看出是由于权限问题导致。
随即,我们开始检查备库的密码文件,$oracle_home/dbs/orapw{sid}是存在的。
[oracle@standby dbs]$ ll$oracle_home/dbs/orapw* -rw-r----- 1 oracle oinstall 1536 may 2617:49 /dbsoft/oracle/product/11.2.4/dbhome_1/dbs/orapwstandby
2、 这个时候我们应该查看的是的alter告警文件:
errorsin file/dbsoft/oracle/diag/rdbms/standby/standby/trace/standby_asmb_11087.trc (incident=24130): ora-00600:internal error code, arguments: [osdep_internal], [], [], [], [], [], [], [],[], [], [], [] ora-27302:failure occurred at: skfnbeqopeni incidentdetails in:/dbsoft/oracle/diag/rdbms/standby/standby/incident/incdir_24130/standby_asmb_11087_i24130.trc useadrci or support workbench to package the incident. see note411.1 at my oracle support for error and packaging details. ora-00210:cannot open the specified control file ora-00202:control file: '+data001/jetdb/controlfile/control01.ctl' ora-17503:ksfdopn:2 failed to open file +data001/jetdb/controlfile/control01.ctl ora-15001:diskgroup "data001" does not exist or is not mounted ora-15055:unable to connect to asm instance ora-15055:unable to connect to asm instance ora-00600:internal error code, arguments: [osdep_internal], [], [], [], [], [], [], [],[], [], [], [] ora-27302:failure occurred at: skfnbeqopeni ora-1013signalled during: alter database mount... mon may26 16:31:34 2014
从告警文件中我们可以很明显的看出是asm磁盘有问题,进入进入grid用户下用srtl命令检查 asm状态:
[grid@standby~]$ srvctl status asm asm isrunning on standby sql>select name,state,free_mb from v$asm_diskgroup; name state free_mb --------------------- ---------- data001 mounted 121112 arc001 mounted 122483 bak001 mounted 122826
结果看来asm也是没有问题的,那么唯一的出问题的地方可能就是oracle哪里配置的问题。
3、这个时候我们应该先看看会不会是权限的问题:
[root@standby ~]# id oracle uid=501(oracle) gid=504(oinstall)groups=504(oinstall) ,505(dba) [root@standby ~]# id grid uid=500(grid) gid=504(oinstall) groups=504(oinstall),503(asmadmin),506(asmdba),507(asmoper)
到这里,我们发现问题可能出现在权限上。
oracle没有asmdba权限,随即添加上即可。
[root@standby~]# usermod -g 503,506 oracle [root@standby~]# id oracle uid=501(oracle)gid=504(oinstall) groups=504(oinstall),503(asmadmin),505(dba),506(asmdba)
我们可以看到如下,再次执行duplicate,成功:
[oracle@standby~]$ rman target sys/oracle@jetdb auxiliary sys/oracle@standby recoverymanager: release 11.2.0.4.0 - production on mon may 26 17:48:39 2014 copyright(c) 1982, 2011, oracle and/or its affiliates. all rights reserved. connectedto target database: jetdb (dbid=2170518470) connectedto auxiliary database: jetdb (not mounted) rman>duplicate target database for standby from active database nofilenamecheck; startingduplicate db at 26-may-14 usingtarget database control file instead of recovery catalog allocatedchannel: ora_aux_disk_1 channelora_aux_disk_1: sid=122 device type=disk contentsof memory script: { backup as copy reuse targetfile '/dbsoft/oracle/product/11.2.4/dbhome_1/dbs/orapwjetdb1' auxiliaryformat '/dbsoft/oracle/product/11.2.4/dbhome_1/dbs/orapwstandby' ; } executingmemory script startingbackup at 26-may-14 allocatedchannel: ora_disk_1 channelora_disk_1: sid=14 instance=jetdb1 device type=disk finishedbackup at 26-may-14 contentsof memory script: { backup as copy current controlfile forstandby auxiliary format '+data001/jetdb/controlfile/control01.ctl'; } executingmemory script startingbackup at 26-may-14 usingchannel ora_disk_1 channelora_disk_1: starting datafile copy copyingstandby control file outputfile name=+bak001/rman/snapcf_jetdb1.f tag=tag20140526t174956 recid=11stamp=848598598 channelora_disk_1: datafile copy complete, elapsed time: 00:00:01 finishedbackup at 26-may-14 contentsof memory script: { sql clone 'alter database mount standbydatabase'; } executingmemory script sqlstatement: alter database mount standby database rman-05529:warning: db_file_name_convert resulted in invalid asm names; names changed todisk group only. contentsof memory script: { set newname for tempfile 1 to "+data001"; switch clone tempfile all; set newname for datafile 1 to "+data001"; set newname for datafile 2 to "+data001"; set newname for datafile 3 to "+data001"; set newname for datafile 4 to "+data001"; set newname for datafile 5 to "+data001"; backup as copy reuse datafile 1 auxiliary format "+data001" datafile 2 auxiliary format "+data001" datafile 3 auxiliary format "+data001" datafile 4 auxiliary format "+data001" datafile 5 auxiliary format "+data001" ; sql 'alter system archive log current'; } executingmemory script executingcommand: set newname renamedtempfile 1 to +data001 in control file executingcommand: set newname executingcommand: set newname executingcommand: set newname executingcommand: set newname executingcommand: set newname startingbackup at 26-may-14 usingchannel ora_disk_1 channelora_disk_1: starting datafile copy inputdatafile file number=00001 name=+data001/jetdb/datafile/system.268.848240089 outputfile name=+data001/standby/datafile/system.257.848598605 tag=tag20140526t175005 channelora_disk_1: datafile copy complete, elapsed time: 00:00:15 channelora_disk_1: starting datafile copy inputdatafile file number=00002 name=+data001/jetdb/datafile/sysaux.260.848240091 outputfile name=+data001/standby/datafile/sysaux.258.848598619 tag=tag20140526t175005 channelora_disk_1: datafile copy complete, elapsed time: 00:00:07 channelora_disk_1: starting datafile copy inputdatafile file number=00003 name=+data001/jetdb/datafile/undotbs1.263.848240091 outputfile name=+data001/standby/datafile/undotbs1.259.848598627tag=tag20140526t175005 channelora_disk_1: datafile copy complete, elapsed time: 00:00:01 channelora_disk_1: starting datafile copy inputdatafile file number=00005 name=+data001/jetdb/datafile/undotbs2.264.848240331 outputfile name=+data001/standby/datafile/undotbs2.260.848598627tag=tag20140526t175005 channelora_disk_1: datafile copy complete, elapsed time: 00:00:01 channelora_disk_1: starting datafile copy inputdatafile file number=00004 name=+data001/jetdb/datafile/users.267.848240091 outputfile name=+data001/standby/datafile/users.261.848598629 tag=tag20140526t175005 channelora_disk_1: datafile copy complete, elapsed time: 00:00:02 finishedbackup at 26-may-14 sqlstatement: alter system archive log current contentsof memory script: { switch clone datafile all; } executingmemory script datafile1 switched to datafile copy inputdatafile copy recid=11 stamp=848598635 filename=+data001/standby/datafile/system.257.848598605 datafile2 switched to datafile copy inputdatafile copy recid=12 stamp=848598635 file name=+data001/standby/datafile/sysaux.258.848598619 datafile3 switched to datafile copy inputdatafile copy recid=13 stamp=848598635 filename=+data001/standby/datafile/undotbs1.259.848598627 datafile4 switched to datafile copy inputdatafile copy recid=14 stamp=848598635 file name=+data001/standby/datafile/users.261.848598629 datafile5 switched to datafile copy inputdatafile copy recid=15 stamp=848598635 filename=+data001/standby/datafile/undotbs2.260.848598627 finishedduplicate db at 26-may-14