背景,环境为RAC->RAC(ADG),在主库新添加一个PDB之后,备库提示如下报错:
PDB_NEW(4):File #15 added to control file as 'UNNAMED00015'. Originally created as:
PDB_NEW(4):'+DATA/DB/E0D7A24F1C631709E0536E28A8C06CA4/DATAFILE/system.374.1106753735'
PDB_NEW(4):because the pluggable database was created with nostandby
PDB_NEW(4):or the tablespace belonging to the pluggable database is
PDB_NEW(4):offline.
2022-06-07T15:35:40.890311+08:00
Errors in file /u01/app/oracle/diag/rdbms/dbadg/dbadg1/trace/dbadg1_dbw0_12472.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '+DATA'
1、新增前主库PDB信息
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
SQL>
2、新增前备库PDB信息
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ ONLY NO
SQL>
3、新增PDB_NEW
SQL> create pluggable database PDB_NEW from PDB;
Pluggable database created.
SQL>
–//主库日志
create pluggable database PDB_NEW from PDB
2022-06-07T15:35:35.257548+08:00
PDB(3): AUDSYS.AUD$UNIFIED (SQL_TEXT) - CLOB populated
2022-06-07T15:35:40.724303+08:00
PDB_NEW(4):Endian type of dictionary set to little
****************************************************************
Pluggable Database PDB_NEW with pdb id - 4 is created as UNUSABLE.
If any errors are encountered before the pdb is marked as NEW,
then the pdb must be dropped
local undo-1, localundoscn-0x0000000000000103
****************************************************************
queued attach DA request 0x8a64d8e0 for pdb 4, ospid 71433
2022-06-07T15:35:41.301049+08:00
Domain Action Reconfiguration started (domid 4, new da inc 1, cluster inc 2)
Instance 1 is attaching to domain 4
* allocate domain 4, valid ? 1
Global Resource Directory partially frozen for domain action
Domain Action Reconfiguration complete (total time 0.0 secs)
2022-06-07T15:35:41.320015+08:00
PDB_NEW(4):Media Recovery Start
2022-06-07T15:35:41.325063+08:00
PDB_NEW(4):Serial Media Recovery started
PDB_NEW(4):max_pdb is 4
2022-06-07T15:35:41.477481+08:00
PDB_NEW(4):Recovery of Online Redo Log: Thread 1 Group 2 Seq 138 Reading mem 0
PDB_NEW(4): Mem# 0: +DATA/DB/ONLINELOG/group_2.263.1099263823
PDB_NEW(4): Mem# 1: +DATA/DB/ONLINELOG/group_2.265.1099263823
2022-06-07T15:35:41.498748+08:00
PDB_NEW(4):Incomplete Recovery applied until change 9519711 time 06/07/2022 15:35:39
2022-06-07T15:35:41.500848+08:00
PDB_NEW(4):Media Recovery Complete (db1)
queued detach DA request 0x8a64d878 for pdb 4, ospid 71433
2022-06-07T15:35:41.686791+08:00
Domain Action Reconfiguration started (domid 4, new da inc 2, cluster inc 2)
Instance 1 is detaching from domain 4 (lazy abort? 0)
Global Resource Directory partially frozen for domain action
* domain detach - domain 4 valid ? 1
Non-local Process blocks cleaned out
Set master node info
Dwn-cvts replayed, VALBLKs dubious
All grantable enqueues granted
2022-06-07T15:35:41.777169+08:00
ALTER SYSTEM SET remote_listener='scan-cluster:1521' SCOPE=MEMORY SID='db1';
2022-06-07T15:35:41.779751+08:00
ALTER SYSTEM SET listener_networks='' SCOPE=MEMORY SID='db1';
freeing rdom 4
freeing the fusion rht of pdb 4
freeing the pdb enqueue rht
Domain Action Reconfiguration complete (total time 0.1 secs)
2022-06-07T15:35:42.089020+08:00
PDB_NEW(4):Autotune of undo retention is turned on.
2022-06-07T15:35:42.127040+08:00
PDB_NEW(4):This instance was first to open pluggable database PDB_NEW (container=4)
PDB_NEW(4):queued attach DA request 0x8a64d810 for pdb 4, ospid 71433
2022-06-07T15:35:42.176314+08:00
Domain Action Reconfiguration started (domid 4, new da inc 3, cluster inc 2)
Instance 1 is attaching to domain 4
* allocate domain 4, valid ? 1
Global Resource Directory partially frozen for domain action
Domain Action Reconfiguration complete (total time 0.0 secs)
2022-06-07T15:35:42.423768+08:00
PDB_NEW(4):Undo initialization recovery: err:0 start: 51742353 end: 51742445 diff: 92 ms (0.1 seconds)
PDB_NEW(4):[71433] Successfully onlined Undo Tablespace 2.
PDB_NEW(4):Undo initialization online undo segments: err:0 start: 51742445 end: 51742552 diff: 107 ms (0.1 seconds)
PDB_NEW(4):Undo initialization finished serial:0 start:51742353 end:51742555 diff:202 ms (0.2 seconds)
PDB_NEW(4):Database Characterset for PDB_NEW is AL32UTF8
PDB_NEW(4):JIT: pid 71433 requesting stop
PDB_NEW(4):Buffer Cache flush started: 4
PDB_NEW(4):Buffer Cache flush finished: 4
PDB_NEW(4):queued detach DA request 0x8a64d7a8 for pdb 4, ospid 71433
2022-06-07T15:35:42.938195+08:00
Domain Action Reconfiguration started (domid 4, new da inc 4, cluster inc 2)
Instance 1 is detaching from domain 4 (lazy abort? 0)
–//备库日志
2022-06-07T15:35:40.793279+08:00
Recovery created pluggable database PDB_NEW
PDB_NEW(4):Tablespace-SYSTEM during PDB create skipped since source is in r/w mode or this is a refresh clone
PDB_NEW(4):File #15 added to control file as 'UNNAMED00015'. Originally created as:
PDB_NEW(4):'+DATA/DB/E0D7A24F1C631709E0536E28A8C06CA4/DATAFILE/system.374.1106753735'
PDB_NEW(4):because the pluggable database was created with nostandby
PDB_NEW(4):or the tablespace belonging to the pluggable database is
PDB_NEW(4):offline.
2022-06-07T15:35:40.890311+08:00
Errors in file /u01/app/oracle/diag/rdbms/dbadg/dbadg1/trace/dbadg1_dbw0_12472.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '+DATA'
2022-06-07T15:35:40.890514+08:00
File 201 not verified due to error ORA-01157
2022-06-07T15:35:40.891661+08:00
Errors in file /u01/app/oracle/diag/rdbms/dbadg/dbadg1/trace/dbadg1_dbw0_12472.trc:
ORA-01186: file 202 failed verification tests
ORA-01157: cannot identify/lock data file 202 - see DBWR trace file
ORA-01110: data file 202: '+DATA'
File 202 not verified due to error ORA-01157
2022-06-07T15:35:40.949506+08:00
PDB_NEW(4):Tablespace-SYSAUX during PDB create skipped since source is in r/w mode or this is a refresh clone
PDB_NEW(4):File #16 added to control file as 'UNNAMED00016'. Originally created as:
PDB_NEW(4):'+DATA/DB/E0D7A24F1C631709E0536E28A8C06CA4/DATAFILE/sysaux.373.1106753735'
PDB_NEW(4):because the pluggable database was created with nostandby
PDB_NEW(4):or the tablespace belonging to the pluggable database is
PDB_NEW(4):offline.
2022-06-07T15:35:40.980183+08:00
Errors in file /u01/app/oracle/diag/rdbms/dbadg/dbadg1/trace/dbadg1_dbw0_12472.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '+DATA'
2022-06-07T15:35:40.980248+08:00
File 201 not verified due to error ORA-01157
2022-06-07T15:35:40.984846+08:00
Errors in file /u01/app/oracle/diag/rdbms/dbadg/dbadg1/trace/dbadg1_dbw0_12472.trc:
ORA-01186: file 202 failed verification tests
ORA-01157: cannot identify/lock data file 202 - see DBWR trace file
ORA-01110: data file 202: '+DATA'
File 202 not verified due to error ORA-01157
2022-06-07T15:35:41.037064+08:00
PDB_NEW(4):Tablespace-UNDOTBS1 during PDB create skipped since source is in r/w mode or this is a refresh clone
4、–//备库状态
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ ONLY NO
4 PDB_NEW MOUNTED
SQL>
SQL> alter session set container = PDB_NEW;
Session altered.
SQL> select con_id,file#,name from v$datafile;
CON_ID FILE# NAME
---------- ---------- ------------------------------------------------------------
4 20 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00020
4 21 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00021
4 22 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00022
4 23 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00023
4 24 /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/UNNAMED00024
–//解决办法,可以参考MOS两篇文章
5、备库取消应用
SQL> show con_name
CON_NAME
------------------------------
PDB_NEW
SQL> conn / as sysdba
Connected.
SQL> alter database recover managed standby database cancel;
Database altered.
SQL>
6、备库恢复新创建的PDB
RMAN> run
2> {
3> set newname for database to '+MGMT';
4> restore datafile 20,21,22,23,24 from service "primary";
5> switch datafile all;
6> }
executing command: SET NEWNAME
Starting restore at 07-JUN-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=29 instance=dbadg1 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service primary
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00020 to +MGMT
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service primary
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00021 to +MGMT
channel ORA_DISK_1: restore complete, elapsed time: 00:00:16
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service primary
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00022 to +MGMT
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service primary
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00023 to +MGMT
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service primary
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00024 to +MGMT
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 07-JUN-22
datafile 20 switched to datafile copy
input datafile copy RECID=27 STAMP=1106756027 file name=+MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/system.416.1106756015
datafile 21 switched to datafile copy
input datafile copy RECID=28 STAMP=1106756043 file name=+MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/sysaux.417.1106756031
datafile 22 switched to datafile copy
input datafile copy RECID=29 STAMP=1106756053 file name=+MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/undotbs1.418.1106756045
datafile 23 switched to datafile copy
input datafile copy RECID=30 STAMP=1106756060 file name=+MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/undo_2.419.1106756061
datafile 24 switched to datafile copy
input datafile copy RECID=31 STAMP=1106756061 file name=+MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/users.420.1106756061
RMAN>
–//数据库日志
2022-06-07T16:13:47.421131+08:00
PDB_NEW(4):Full restore complete of datafile 20 to datafile copy +MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/system.416.1106756015. Elapsed time: 0:00:13
PDB_NEW(4): checkpoint is 9524714
2022-06-07T16:14:03.596033+08:00
PDB_NEW(4):Full restore complete of datafile 21 to datafile copy +MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/sysaux.417.1106756031. Elapsed time: 0:00:13
PDB_NEW(4): checkpoint is 9524714
2022-06-07T16:14:13.935665+08:00
PDB_NEW(4):Full restore complete of datafile 22 to datafile copy +MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/undotbs1.418.1106756045. Elapsed time: 0:00:08
PDB_NEW(4): checkpoint is 9524714
2022-06-07T16:14:20.823544+08:00
PDB_NEW(4):Full restore complete of datafile 23 to datafile copy +MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/undo_2.419.1106756061. Elapsed time: 0:00:00
PDB_NEW(4): checkpoint is 9524714
PDB_NEW(4):Full restore complete of datafile 24 to datafile copy +MGMT/DBADG/E0D7B5FD09C61D9EE0536E28A8C01FFB/DATAFILE/users.420.1106756061. Elapsed time: 0:00:00
PDB_NEW(4): checkpoint is 9524714
2022-06-07T16:14:23.155265+08:00
Switch of datafile 20 complete to datafile copy
checkpoint is 9524714
Switch of datafile 21 complete to datafile copy
checkpoint is 9524714
Switch of datafile 22 complete to datafile copy
checkpoint is 9524714
Switch of datafile 23 complete to datafile copy
checkpoint is 9524714
Switch of datafile 24 complete to datafile copy
checkpoint is 9524714
7、查看数据文件状态
SQL> col name for a30
SQL> select con_id,status, file#,name from v$datafile;
CON_ID STATUS FILE# NAME
---------- --------------------- ---------- ------------------------------
4 SYSOFF 20 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 RECOVER 21 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 RECOVER 22 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 RECOVER 23 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 RECOVER 24 +MGMT/DBADG/E0D7B5FD09C61D9EE0
SQL> alter database datafile 20,21,22,23,24 online;
Database altered.
SQL> select con_id,status, file#,name from v$datafile;
CON_ID STATUS FILE# NAME
---------- --------------------- ---------- ------------------------------
4 SYSTEM 20 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 RECOVER 21 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 RECOVER 22 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 RECOVER 23 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 RECOVER 24 +MGMT/DBADG/E0D7B5FD09C61D9EE0
SQL>
8、recovery standby database
SQL> recover standby database;
ORA-00279: change 9527261 generated at 06/07/2022 16:17:34 needed for thread 1
ORA-00289: suggestion : +MGMT/DBADG/ARCHIVELOG/2022_06_07/thread_1_seq_138.421.1106757103
ORA-00280: change 9527261 for thread 1 is in sequence #138
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 9530191 generated at 06/07/2022 16:27:36 needed for thread 1
ORA-00289: suggestion : +MGMT/DBADG/ARCHIVELOG/2022_06_07/thread_1_seq_139.422.1106757103
ORA-00280: change 9530191 for thread 1 is in sequence #139
ORA-00278: log file '+MGMT/DBADG/ARCHIVELOG/2022_06_07/thread_1_seq_138.421.1106757103' no longer needed for this recovery
ORA-00279: change 9530492 generated at 06/07/2022 16:29:45 needed for thread 1
ORA-00289: suggestion : +MGMT/DBADG/ARCHIVELOG/2022_06_07/thread_1_seq_140.423.1106757103
ORA-00280: change 9530492 for thread 1 is in sequence #140
ORA-00278: log file '+MGMT/DBADG/ARCHIVELOG/2022_06_07/thread_1_seq_139.422.1106757103' no longer needed for this recovery
ORA-00279: change 9530767 generated at 06/07/2022 16:31:42 needed for thread 1
ORA-00289: suggestion : +MGMT
ORA-00280: change 9530767 for thread 1 is in sequence #141
ORA-00278: log file '+MGMT/DBADG/ARCHIVELOG/2022_06_07/thread_1_seq_140.423.1106757103' no longer needed for this recovery
ORA-16145: archival for thread# 1 sequence# 141 in progress
SQL>
SQL> alter database open;
Database altered.
SQL>
SQL>
SQL> select con_id,status, file#,name from v$datafile;
CON_ID STATUS FILE# NAME
---------- --------------------- ---------- ------------------------------
1 SYSTEM 1 +MGMT/DBADG/DATAFILE/system.30
1 ONLINE 3 +MGMT/DBADG/DATAFILE/sysaux.31
1 ONLINE 4 +MGMT/DBADG/DATAFILE/undotbs1.
2 SYSTEM 5 +MGMT/DBADG/DA1BEB8F239F5BCEE0
2 ONLINE 6 +MGMT/DBADG/DA1BEB8F239F5BCEE0
1 ONLINE 7 +MGMT/DBADG/DATAFILE/users.322
2 ONLINE 8 +MGMT/DBADG/DA1BEB8F239F5BCEE0
1 ONLINE 9 +MGMT/DBADG/DATAFILE/undotbs2.
3 SYSTEM 10 +MGMT/DBADG/DA1C15173891701AE0
3 ONLINE 11 +MGMT/DBADG/DA1C15173891701AE0
3 ONLINE 12 +MGMT/DBADG/DA1C15173891701AE0
CON_ID STATUS FILE# NAME
---------- --------------------- ---------- ------------------------------
3 ONLINE 13 +MGMT/DBADG/DA1C15173891701AE0
3 ONLINE 14 +MGMT/DBADG/DA1C15173891701AE0
4 SYSTEM 20 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 ONLINE 21 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 ONLINE 22 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 ONLINE 23 +MGMT/DBADG/E0D7B5FD09C61D9EE0
4 ONLINE 24 +MGMT/DBADG/E0D7B5FD09C61D9EE0
18 rows selected.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ ONLY NO
4 PDB_NEW MOUNTED
SQL> alter pluggable database PDB_NEW open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ ONLY NO
4 PDB_NEW READ ONLY NO
SQL>
今天的文章oracle主备库不同步_怎么在ad上添加库[通俗易懂]分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/86071.html