oracle-04063,ORA-04063 错误问题(package body "SYS.DBMS_LOGSTDBY" has errors)

在尝试创建和授权Oracle的DBMS_LOGSTDBY包时遇到了ORA-04063错误,该错误提示视图'SYS.DBA_LOGSTDBY_PROGRESS'和'SYS.DBA_LOGSTDBY_LOG'存在错误。通过运行utlrp.sql进行重新编译无效对象,但发现DBMS_INTERNAL_LOGSTDBY包体也存在错误。最终,发现有22个与DBMS相关的对象状态变为INVALID。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

SQL> @?/rdbms/admin/dbmslsby.sql

Package created.

No errors.

Synonym created.

PL/SQL procedure successfully completed.

Grant succeeded.

CREATE ROLE logstdby_administrator

*

ERROR at line 1:

ORA-01921: role name 'LOGSTDBY_ADMINISTRATOR' conflicts with another user or

role name

Grant succeeded.

Grant succeeded.

Grant succeeded.

Library created.

SQL> @?/rdbms/admin/prvtlsby.plb

Warning: Package Body created with compilation errors.

Errors for PACKAGE BODY SYS.DBMS_LOGSTDBY:

LINE/COL ERROR

-------- -----------------------------------------------------------------

646/3    PL/SQL: SQL Statement ignored

647/10   PL/SQL: ORA-04063: view "SYS.DBA_LOGSTDBY_PROGRESS" has errors

grant select on dba_logstdby_progress to select_catalog_role

*

ERROR at line 1:

ORA-04063: view "SYS.DBA_LOGSTDBY_PROGRESS" has errors

grant select on dba_logstdby_log to select_catalog_role

*

ERROR at line 1:

ORA-04063: view "SYS.DBA_LOGSTDBY_LOG" has errors

0 rows updated.

Commit complete.

SQL>

SQL> @?/rdbms/admin/utlrp.sql

TIMESTAMP

--------------------------------------------------------------------------------

COMP_TIMESTAMP UTLRP_BGN  2012-12-22 20:20:47

DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid

DOC>   objects in the database. Recompilation time is proportional to the

DOC>   number of invalid objects in the database, so this command may take

DOC>   a long time to execute on a database with a large number of invalid

DOC>   objects.

DOC>

DOC>   Use the following queries to track recompilation progress:

DOC>

DOC>   1. Query returning the number of invalid objects remaining. This

DOC>      number should decrease with time.

DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);

DOC>

DOC>   2. Query returning the number of objects compiled so far. This number

DOC>      should increase with time.

DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;

DOC>

DOC>   This script automatically chooses serial or parallel recompilation

DOC>   based on the number of CPUs available (parameter cpu_count) multiplied

DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).

DOC>   On RAC, this number is added across all RAC nodes.

DOC>

DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel

DOC>   recompilation. Jobs are created without instance affinity so that they

DOC>   can migrate across RAC nodes. Use the following queries to verify

DOC>   whether UTL_RECOMP jobs are being created and run correctly:

DOC>

DOC>   1. Query showing jobs created by UTL_RECOMP

DOC>         SELECT job_name FROM dba_scheduler_jobs

DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';

DOC>

DOC>   2. Query showing UTL_RECOMP jobs that are running

DOC>         SELECT job_name FROM dba_scheduler_running_jobs

DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';

DOC>#

DECLARE

*

ERROR at line 1:

ORA-04063: package body "SYS.DBMS_INTERNAL_LOGSTDBY" has errors

ORA-06508: PL/SQL: could not find program unit being called:

"SYS.DBMS_INTERNAL_LOGSTDBY"

ORA-06512: at "SYS.UTL_RECOMP", line 827

ORA-04063: package body "SYS.DBMS_INTERNAL_LOGSTDBY" has errors

ORA-06508: PL/SQL: could not find program unit being called:

"SYS.DBMS_INTERNAL_LOGSTDBY"

ORA-06512: at line 4

TIMESTAMP

--------------------------------------------------------------------------------

COMP_TIMESTAMP UTLRP_END  2012-12-22 20:20:48

DOC> The following query reports the number of objects that have compiled

DOC> with errors (objects that compile with errors have status set to 3 in

DOC> obj$). If the number is higher than expected, please examine the error

DOC> messages reported with each object (using SHOW ERRORS) to see if they

DOC> point to system misconfiguration or resource constraints that must be

DOC> fixed before attempting to recompile these objects.

DOC>#

OBJECTS WITH ERRORS

-------------------

59

DOC> The following query reports the number of errors caught during

DOC> recompilation. If this number is non-zero, please query the error

DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors

DOC> are due to misconfiguration or resource constraints that must be

DOC> fixed before objects can compile successfully.

DOC>#

ERRORS DURING RECOMPILATION

---------------------------

0

Function created.

PL/SQL procedure successfully completed.

Function dropped.

Warning: XDB now invalid, could not find xdbconfig

PL/SQL procedure successfully completed.

SQL> select object_name,status from dba_objects where status like '%INVALID%' and owner='SYS' and object_name like '%DBMS%';

OBJECT_NAME                              STATUS

---------------------------------------- -------

DBMS_XSTREAM_UTL_IVK                     INVALID

DBMS_XSTREAM_ADM_UTL                     INVALID

DBMS_STREAMS_SM                          INVALID

DBMS_STREAMS_MC                          INVALID

DBMS_STREAMS_AUTO_INT                    INVALID

DBMS_STREAMS_ADM                         INVALID

DBMS_RCVMAN                              INVALID

DBMS_LOGSTDBY                            INVALID

DBMS_LOGREP_UTIL                         INVALID

DBMS_LOGMNR_SESSION                      INVALID

DBMS_LOGMNR_LOGREP_DICT                  INVALID

DBMS_LOGMNR_INTERNAL                     INVALID

DBMS_LOGMNR_FFVTOLOGMNRT                 INVALID

DBMS_INTERNAL_LOGSTDBY                   INVALID

DBMS_CAPTURE_SWITCH_INTERNAL             INVALID

DBMS_CAPTURE_SWITCH_ADM                  INVALID

DBMS_CAPTURE_PROCESS                     INVALID

DBMS_CAPTURE_ADM_INTERNAL                INVALID

DBMS_CAPTURE_ADM                         INVALID

DBMS_APPLY_HANDLER_ADM                   INVALID

DBMS_APPLY_ADM_INTERNAL                  INVALID

DBMS_APPLY_ADM                           INVALID

22 rows selected.

### 解决 IntelliJ IDEA 中 `@Autowired` 注解导致的红色波浪线错误 在使用 Spring 框架时,如果遇到 `@Autowired` 注解下的依赖注入对象显示为红色波浪线错误或者黄色警告的情况,通常是由以下几个原因引起的: #### 1. **Spring 插件未启用** 如果 Spring 支持插件未被激活,则可能导致 IDE 无法识别 `@Autowired` 或其他 Spring 特定的功能。可以通过以下方式解决问题- 打开设置菜单:`File -> Settings -> Plugins`。 - 确认已安装并启用了名为 “Spring Framework Support” 的官方插件[^1]。 #### 2. **项目配置文件缺失或不正确** Spring 需要通过 XML 文件、Java Config 类或其他形式来定义 Bean 定义。如果没有正确加载这些配置文件,可能会导致 `@Autowired` 报错。 - 确保项目的 `applicationContext.xml` 或者基于 Java 的配置类(带有 `@Configuration` 和 `@Bean` 注解)已被正确定义和引入。 - 对于 Spring Boot 项目,确认是否存在 `spring.factories` 文件以及是否包含了必要的组件扫描路径[^3]。 #### 3. **模块依赖关系问题** 当前模块可能缺少对 Spring Core 或 Context 组件库的有效引用。这可能是由于 Maven/Gradle 构建工具中的依赖项声明不足造成的。 - 检查 `pom.xml` (Maven) 或 `build.gradle` (Gradle),确保包含如下核心依赖之一: ```xml <!-- For Maven --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> ``` ```gradle // For Gradle implementation 'org.springframework:spring-context:${springVersion}' ``` - 更新项目依赖树以应用更改:右键点击项目根目录 -> `Maven -> Reload Project` 或运行命令 `./gradlew build --refresh-dependencies`。 #### 4. **IDE 缓存损坏** Intellij IDEA 的缓存机制有时会因各种因素而失效,从而引发误报错误。清除缓存可以有效缓解此类情况。 - 使用快捷组合键 `Ctrl + Alt + Shift + S` 进入项目结构对话框;也可以尝试执行操作序列:`File -> Invalidate Caches / Restart... -> Invalidate and Restart`. #### 5. **启动异常影响正常解析** 若之前存在类似 `com.intellij.diagnostic.PluginException` 的严重初始化失败日志记录,则表明某些关键服务未能成功加载,进而干扰到后续功能表现[^2]。建议重新下载最新稳定版本的 IDEA 并按照标准流程完成初次部署工作。 ```java // 示例代码片段展示如何正确运用 @Autowired 注解实现自动装配 @Service public class StudentService { private final Repository repository; public StudentService(@Qualifier("specificRepository") Repository repo){ this.repository = repo; } } @Component class SpecificComponent{ @Autowired private transient StudentService studentService; // 此处应无任何编译期告警现象发生 } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值