sqlplus sys@ as sysdba 1521 手动修改srv对应的pdb

++ Connecting via rman to CDBROOT and running commands fail with below error showing rman is connected to PDB instead of CDBROOT :

rman target 'sys@"<scan_name>.<domain_name>:1521/<db_unique_name>.<domain_name>:DEDICATED"'

Recovery Manager: Release 12.1.0.2.0 - Production on Wed Jun 7 13:38:56 2023

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

target database Password:

connected to target database: DBA21CDB (DBID=1393061330)

RMAN> configure compression algorithm 'low';

using target database control file instead of recovery catalog

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of configure command at 06/07/2023 13:39:23

RMAN-07536: command not allowed when connected to a Pluggable Database

Cause

++ Connecting from sqlplus using same connect string shows connections are going to PDB instead of CDB$ROOT :

sqlplus 'sys@"<scan_name>.<domain_name>:1521/<db_unique_name>.<domain_name>:DEDICATED" as sysdba'

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED


3 PDB1 READ WRITE NO

++ Output of below query shows service is pointing to PDB (con_id=3) instead of CDB$ROOT :

select name, network_name, con_id# from cdb_service$;

<db_unique_name>.<domain_name> <db_unique_name>.<domain_name> 3 <<<<<<<<<<<<<<<<<<<service is pointing to CON_ID 3

Solution

Drop and recreate the service for CDB

OR

  1. update cdb_service$ with correct container id for PDB service -

sql> update cdb_service$ set con_id#=1 where name='<db_unique_name>.<domain_name> ';

SQL> commit;

  1. Restart CDB using srvctl

srvctl stop databsae -db <db_unique_name>

srvctl start database -db <db_unique_name>

  1. After restart again check cdb_service$ is pointing to CON_ID# 1

SQL> select name, network_name, con_id# from cdb_service$

<db_unique_name>.<domain_name> <db_unique_name>.<domain_name> 1

相关推荐
—Miss. Z—4 小时前
备份与恢复
数据库·oracle
这个DBA有点耶8 小时前
Oracle 迁移金仓兼容性评估指南:5 大维度深度拆解
数据库·oracle·架构
Suhan4210 小时前
SQLAlchemy的两种查询query()查询、stmt=select()查询
数据库·python·sql·oracle
—Miss. Z—12 小时前
第11章 故障管理
网络·数据库·oracle
大眼、不聚光14 小时前
2.oracle--表空间管理
数据库·oracle
坚持学习前端日记1 天前
Python SQLAlchemy ORM 从0到1精通实战手册(基础到复杂高阶)
数据库·python·oracle
这个DBA有点耶1 天前
MySQL迁移实战:从mysqldump到专业工具的完整选型指南
数据库·mysql·dba
小白说大模型1 天前
LLM集成数据库的幻觉治理:当AI给出的SQL建议是错的
数据库·人工智能·sql·oracle·重构·开源
曹牧1 天前
Oracle:空值排序
数据库·oracle