“ORA-06550: 第 1 行, 第 7 列”解决方法

2016/10/27日
将本机能正常运行的维修生产日志代码发布到公司内测环境里无法正常运行,报错如下:

execute() - pls–QuartzJob.java–quartzjob 开始执行!
java.sql.SQLException: ORA-06550: 第 1 行, 第 7 列:
PLS-00201: identifier ‘MONITORCHANGEPLS.MCP_ISCHANGE’ must be declared
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
at com.szair.smartme.productlogsys.dao.LogEditDao 85.doInHibernate(LogEditDao.java:3310)atorg.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)atorg.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)atcom.szair.smartme.productlogsys.dao.LogEditDao.getChangeValue(LogEditDao.java:3288)atcom.szair.smartme.productlogsys.dao.LogEditDao FastClassByCGLIB ec6980fb.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxy CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)atcom.szair.smartme.productlogsys.dao.LogEditDao EnhancerByCGLIB e33f2ad0.getChangeValue()atcom.szair.smartme.productlogsys.service.LogeditServer.getChangeValue(LogeditServer.java:1224)atcom.szair.smartme.productlogsys.service.LogeditServer FastClassByCGLIB a3f1c07d.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxy CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)atcom.szair.smartme.productlogsys.service.LogeditServer EnhancerByCGLIB f4a0e4fa.getChangeValue()atcom.szair.smartme.productlogsys.service.QuartzJob.execute(QuartzJob.java:60)atcom.szair.smartme.productlogsys.service.QuartzJob FastClassByCGLIB 29dcb96e.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxy CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)atcom.szair.smartme.productlogsys.service.QuartzJob EnhancerByCGLIB c475e8c1.execute()atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:606)atorg.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)atorg.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:311)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
execute() - pls–QuartzJob.java–execute() - 没有更新的数据!


在网上查询资料,有用的建议如下:
1 ,
http://www.th7.cn/program/java/201510/620030.shtml
我自己在做 Oracle 存储过程 结果集 练习时碰到的问题!
我开始是plsql developer 工具建立的存储空间,但是查看属性是 owner 是 sys
但是在java代码中确显示以上错误。
原因是 权限问题 。
解决方法 :把上面这个 存储过程 删掉;然后打开Oracle 自带的 sql plus (用java代码中调用都用户名登陆Oracle 不是sys)把建立存储过程的代码直接粘贴过去,这样你在 执行java代码就OK了!

2,
http://bbs.csdn.net/topics/390100723
2.1 因为包的拥有者和你程序中连接数据库的用户不一。 比如包的拥有者用户为m ,而你程序连接数据库的用户为t.
这样的话t用户是访问不了 m 用户下的包。 需要创建同义词,赋予执行权限.
2.2 我遇到过,是因为数据表与包建立在sysdba权限状态下,所以普通权限访问不了,希望能帮到你


之后我就将oracle数据库中原本我自己新建的那个包及下面的存储过程删除,准备重新新建一个,就在这个过程中,本地程序一直在跑,在删除包还没新建之前,控制台报错:

execute() - pls–QuartzJob.java–quartzjob 开始执行!
java.sql.SQLException: ORA-06550: 第 1 行, 第 7 列:
PLS-00201: identifier ‘MONITORCHANGEPLS.MCP_ISCHANGE’ must be declared
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.__xr__14__executeQuery(OraclePreparedStatement.java:3329)
at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.__invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.zeroturnaround.xrebel.runtime.oracle.jdbc.driver.OraclePreparedStatementinv14____xr__14__executeQuery.invoke(OraclePreparedStatementinv14____xr__14__executeQuery.java)
at com.zeroturnaround.xrebel.analyzer.XRPreparedStatementSpy.invoke(XRebel:43)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java)
at com.szair.smartme.productlogsys.dao.LogEditDao 85.doInHibernate(LogEditDao.java:3310)atorg.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)atorg.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)atcom.szair.smartme.productlogsys.dao.LogEditDao.getChangeValue(LogEditDao.java:3288)atcom.szair.smartme.productlogsys.dao.LogEditDao FastClassByCGLIB ec6980fb.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)atorg.springframework.aop.framework.Cglib2AopProxy CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:692)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)atcom.szair.smartme.productlogsys.dao.LogEditDao EnhancerByCGLIB 7c34ab1d.getChangeValue()atcom.szair.smartme.productlogsys.service.LogeditServer.getChangeValue(LogeditServer.java:1224)atcom.szair.smartme.productlogsys.service.LogeditServer FastClassByCGLIB a3f1c07d.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)atorg.springframework.aop.framework.Cglib2AopProxy CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:692)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)atcom.szair.smartme.productlogsys.service.LogeditServer EnhancerByCGLIB 4258661f.getChangeValue()atcom.szair.smartme.productlogsys.service.QuartzJob.execute(QuartzJob.java:60)atcom.szair.smartme.productlogsys.service.QuartzJob FastClassByCGLIB 29dcb96e.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)atorg.springframework.aop.framework.Cglib2AopProxy CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:692)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)atcom.szair.smartme.productlogsys.service.QuartzJob EnhancerByCGLIB 41170d0.execute()  
  at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)  
  at sun.reflect.DelegatingMethodAccessorImpl.__invoke(Unknown Source)  
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
  at java.lang.reflect.Method.invoke(Unknown Source)  
  at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)  
  at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean
MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:264)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
execute() - pls–QuartzJob.java–execute() - 没有更新的数据!

对比可以发现,两者报的错几乎是一样,说明测试环境里报错就是因为无法访问到数据库里的包及下面的存储过程。

最后经检查,发现测试环境里的datasource设置的用户名和本机不一致,所以才访问不到其他账号建立的存储过程。本机配置是前几天才从测试库上down下来的,谁知道没几天就被别人改了,而且还没被告知,以后需小心。

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值