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

相关推荐
Mr_Xuhhh6 小时前
MySQL数据表操作全解析:从创建到管理
数据库·sql·oracle
大模型玩家七七6 小时前
向量数据库实战:从“看起来能用”到“真的能用”,中间隔着一堆坑
数据库·人工智能·python·深度学习·ai·oracle
Apple_羊先森6 小时前
ORACLE数据库巡检SQL脚本--4、检查锁阻塞
数据库·sql·oracle
晚风_END7 小时前
postgresql数据库|pgbouncer连接池压测和直连postgresql数据库压测对比
数据库·postgresql·oracle·性能优化·宽度优先
xfhuangfu9 小时前
Oracle AI db 26ai中借助dbca创建pdb的过程
数据库·oracle
久违8169 小时前
SQL注入攻击核心技术深度总结
数据库·sql·oracle
「光与松果」9 小时前
Oracle中v$session视图用法
数据库·oracle
2301_8109703912 小时前
第二次渗透作业
数据库·oracle
数形长夏12 小时前
接口还是慢,也许是你的表太规范了
数据库·oracle
是桃萌萌鸭~13 小时前
oracle日志文件详解
数据库·oracle·dba