今天在Oracle 12.1.0.2.0 版本中RMAN 連接PDB 用戶時和連接CDB 顯示提示信息一樣connected to target database: CNDBA (DBID=215559030)懷疑自己是不是做錯了,檢查tnsname.ora 有以下內容並沒有錯,於是查視圖 v$pdbs 結果是對的,於是同樣的操作 在 Oracle 12.2.0.1.0 測試結果RMAN 連接PDB 目標庫是提示 connected to target database: CNDBA:PDBCNDBA (DBID=4271691857) 檢查 v$pdbs也是對的,Oracle 12.2.0.1.0 做了改進,可以直接提示連接PDB,不會誤導操作。
pdbcndba=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.11)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=pdbcndba)
(SERVER=DEDICATED)
)
)
說明:以下實驗test 具有sysdba 權限,pdbcndba 是tnsname.ora 文件配置的連接PDB 的網絡服務名。
1) Oracle 12.1.0.2.0 數據庫中RMAN 連接CDB,PDB 目標庫操作,連接提示信息一樣。
[oracle@host1 ~]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Wed Aug 9 16:02:01 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: CNDBA (DBID=215559030)
RMAN> select con_id,dbid,name from v$pdbs;
using target database control file instead of recovery catalog
CON_ID DBID NAME
---------- ---------- ------------------------------
2 3250260069 PDB$SEED
3 766063609 PDBCNDBA
[oracle@host1 ~]$ rman target test/test@pdbcndba
Recovery Manager: Release 12.1.0.2.0 - Production on Wed Aug 9 16:03:29 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: CNDBA (DBID=215559030)
RMAN> select con_id,dbid,name from v$pdbs;
using target database control file instead of recovery catalog
CON_ID DBID NAME
---------- ---------- ------------------------------
3 766063609 PDBCNDBA
2) Oracle 12.2.0.1.0 數據庫中RMAN 連接CDB,PDB 目標庫操作,連接成功的提示信息有區別,連接PDB 時提示 CDB 後面跟着PDB (CNDBA:PDBCNDBA)很明顯的知道連接到PDB
[oracle@dg2 admin]$ rman target /
Recovery Manager: Release 12.2.0.1.0 - Production on Wed Aug 9 16:05:21 2017
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: CNDBA (DBID=209386493)
RMAN> select con_id,dbid,name from v$pdbs;
using target database control file instead of recovery catalog
CON_ID DBID NAME
---------- ---------- ------------------------------
2 3932609193 PDB$SEED
3 4271691857 PDBCNDBA
[oracle@dg2 ~]$ rman target test/test@pdbcndba
Recovery Manager: Release 12.2.0.1.0 - Production on Wed Aug 9 16:07:26 2017
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: CNDBA:PDBCNDBA (DBID=4271691857)
RMAN> select con_id,dbid,name from v$pdbs;
using target database control file instead of recovery catalog
CON_ID DBID NAME
---------- ---------- ------------------------------
3 4271691857 PDBCNDBA