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

Posted 旧巷里的旧少年

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了“ORA-06550: 第 1 行, 第 7 列”解决方法相关的知识,希望对你有一定的参考价值。

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

 

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.LogEditDao85.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.LogEditDao85.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.LogEditDaoFastClassByCGLIBFastClassByCGLIBec6980fb.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxyec6980fb.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxyCglibMethodInvocation.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.Cglib2AopProxyDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)atcom.szair.smartme.productlogsys.dao.LogEditDaoDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)atcom.szair.smartme.productlogsys.dao.LogEditDaoEnhancerByCGLIBEnhancerByCGLIBe33f2ad0.getChangeValue()atcom.szair.smartme.productlogsys.service.LogeditServer.getChangeValue(LogeditServer.java:1224)atcom.szair.smartme.productlogsys.service.LogeditServere33f2ad0.getChangeValue()atcom.szair.smartme.productlogsys.service.LogeditServer.getChangeValue(LogeditServer.java:1224)atcom.szair.smartme.productlogsys.service.LogeditServerFastClassByCGLIBFastClassByCGLIBa3f1c07d.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxya3f1c07d.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxyCglibMethodInvocation.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.Cglib2AopProxyDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)atcom.szair.smartme.productlogsys.service.LogeditServerDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)atcom.szair.smartme.productlogsys.service.LogeditServerEnhancerByCGLIBEnhancerByCGLIBf4a0e4fa.getChangeValue()atcom.szair.smartme.productlogsys.service.QuartzJob.execute(QuartzJob.java:60)atcom.szair.smartme.productlogsys.service.QuartzJobf4a0e4fa.getChangeValue()atcom.szair.smartme.productlogsys.service.QuartzJob.execute(QuartzJob.java:60)atcom.szair.smartme.productlogsys.service.QuartzJobFastClassByCGLIBFastClassByCGLIB29dcb96e.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxy29dcb96e.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxyCglibMethodInvocation.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.Cglib2AopProxyDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)atcom.szair.smartme.productlogsys.service.QuartzJobDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)atcom.szair.smartme.productlogsys.service.QuartzJobEnhancerByCGLIBEnhancerByCGLIBc475e8c1.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.MethodInvokingJobDetailFactoryBeanc475e8c1.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.MethodInvokingJobDetailFactoryBeanMethodInvokingJob.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.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.LogEditDao85.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.LogEditDao85.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.LogEditDaoFastClassByCGLIBFastClassByCGLIBec6980fb.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)atorg.springframework.aop.framework.Cglib2AopProxyec6980fb.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)atorg.springframework.aop.framework.Cglib2AopProxyCglibMethodInvocation.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.Cglib2AopProxyDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)atcom.szair.smartme.productlogsys.dao.LogEditDaoDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)atcom.szair.smartme.productlogsys.dao.LogEditDaoEnhancerByCGLIBEnhancerByCGLIB7c34ab1d.getChangeValue()atcom.szair.smartme.productlogsys.service.LogeditServer.getChangeValue(LogeditServer.java:1224)atcom.szair.smartme.productlogsys.service.LogeditServer7c34ab1d.getChangeValue()atcom.szair.smartme.productlogsys.service.LogeditServer.getChangeValue(LogeditServer.java:1224)atcom.szair.smartme.productlogsys.service.LogeditServerFastClassByCGLIBFastClassByCGLIBa3f1c07d.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)atorg.springframework.aop.framework.Cglib2AopProxya3f1c07d.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)atorg.springframework.aop.framework.Cglib2AopProxyCglibMethodInvocation.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.Cglib2AopProxyDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)atcom.szair.smartme.productlogsys.service.LogeditServerDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)atcom.szair.smartme.productlogsys.service.LogeditServerEnhancerByCGLIBEnhancerByCGLIB4258661f.getChangeValue()atcom.szair.smartme.productlogsys.service.QuartzJob.execute(QuartzJob.java:60)atcom.szair.smartme.productlogsys.service.QuartzJob4258661f.getChangeValue()atcom.szair.smartme.productlogsys.service.QuartzJob.execute(QuartzJob.java:60)atcom.szair.smartme.productlogsys.service.QuartzJobFastClassByCGLIBFastClassByCGLIB29dcb96e.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)atorg.springframework.aop.framework.Cglib2AopProxy29dcb96e.invoke()atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)atorg.springframework.aop.framework.Cglib2AopProxyCglibMethodInvocation.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.Cglib2AopProxyDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)atcom.szair.smartme.productlogsys.service.QuartzJobDynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:625)atcom.szair.smartme.productlogsys.service.QuartzJobEnhancerByCGLIBEnhancerByCGLIB41170d0.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.MethodInvokingJobDetailFactoryBean41170d0.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.MethodInvokingJobDetailFactoryBeanMethodInvokingJob.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下来的,谁知道没几天就被别人改了,而且还没被告知,以后需小心。

以上是关于“ORA-06550: 第 1 行, 第 7 列”解决方法的主要内容,如果未能解决你的问题,请参考以下文章

ORA-06550:第 1 行,第 7 列:\nPLS-00905:对象 TEST.CMPPROJECTPROC 无效\nORA-06550:第 1 行,第 7 列:\nPL/SQL:语句被忽略&qu

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

ORA-06550:PLS-00306: 调用中的参数数量或类型错误;ORA-06550:

ORA-06550,PLS-00306;向 Oracle 过程插入数据时出错

过程中的动态sql错误

PLS-00306: 调用 'SYNCRN' 时参数个数或类型错误