你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle 12C ADG删除PDB

[日期:2017-10-25] 来源:Linux社区  作者:lyzbg [字体: ]

背景:Oracle 12.2搭建ADG,在主库创建pdb时发现备库告警ORA-600。DBCA删除主库的pdb后,备库pdb没有自动删除,故手动删除备库的PDB。

备库:
[oracle@master2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Wed Oct 25 01:29:10 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show pdbs;

    CON_ID CON_NAME                      OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
        2 PDB$SEED                      READ ONLY  NO
        3 ORCLPDB                        READ ONLY  NO
        4 TEST                          READ ONLY  NO
        5 TEST2                          READ ONLY  NO
        6 TEST3                          MOUNTED

SQL> alter system set enabled_PDBs_on_standby=ORCLPDB,TEST,TEST2 ;

System altered.

SQL> show parameter enabled_PDBs_on_standby;

NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
enabled_PDBs_on_standby              string      ORCLPDB, TEST, TEST2
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area  318767104 bytes
Fixed Size                  8792152 bytes
Variable Size            251660200 bytes
Database Buffers          50331648 bytes
Redo Buffers                7983104 bytes
SQL> alter database mount standby database;

Database altered.

SQL> alter database open;

Database altered.

SQL> show pdbs;

    CON_ID CON_NAME                      OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
        2 PDB$SEED                      READ ONLY  NO
        3 ORCLPDB                        MOUNTED
        4 TEST                          MOUNTED
        5 TEST2                          MOUNTED
        6 TEST3                          MOUNTED

SQL> show parameter ENABLED_PDBS_ON_STANDBY

NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
enabled_PDBs_on_standby              string      ORCLPDB, TEST, TEST2
SQL>
SQL>
SQL> alter database recover managed standby database using current logfile disconnect;
alter database recover managed standby database using current logfile disconnect
*
ERROR at line 1:
ORA-01153: an incompatible media recovery is active

SQL> show pdbs;

    CON_ID CON_NAME                      OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
        2 PDB$SEED                      READ ONLY  NO
        3 ORCLPDB                        MOUNTED
        4 TEST                          MOUNTED
        5 TEST2                          MOUNTED
SQL> exit 
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@master2 ~]$ cd
[oracle@master2 ~]$ cd /u01/
[oracle@master2 u01]$ ls
app  arch
[oracle@master2 u01]$  d app/oracle/oradata/
-bash: d: command not found
[oracle@master2 u01]$ ls
app  arch
[oracle@master2 u01]$ cd app/oracle/
[oracle@master2 oracle]$ ls
admin  cfgtoollogs  checkpoints  diag  oradata  product  tfa
[oracle@master2 oracle]$ cd oradata/
[oracle@master2 oradata]$ ls
orclstdydb
[oracle@master2 oradata]$ cd orclstdydb/
[oracle@master2 orclstdydb]$ ls
control01.ctl  pdbseed    redo03.log          standby_redo03.log  system01.dbf  test2          users01.dbf
control02.ctl  redo01.log  standby_redo01.log  standby_redo04.log  temp01.dbf    test3
orclpdb        redo02.log  standby_redo02.log  sysaux01.dbf        test          undotbs01.dbf

删除test03 pdb的数据库目录
[oracle@master2 orclstdydb]$ rm -rf test3/
[oracle@master2 orclstdydb]$ ls
control01.ctl  pdbseed    redo03.log          standby_redo03.log  system01.dbf  test2
control02.ctl  redo01.log  standby_redo01.log  standby_redo04.log  temp01.dbf    undotbs01.dbf
orclpdb        redo02.log  standby_redo02.log  sysaux01.dbf        test          users01.dbf
[oracle@master2 orclstdydb]$ clear
[oracle@master2 orclstdydb]$
[oracle@master2 orclstdydb]$
[oracle@master2 orclstdydb]$ ls
control01.ctl  pdbseed    redo03.log          standby_redo03.log  system01.dbf  test2
control02.ctl  redo01.log  standby_redo01.log  standby_redo04.log  temp01.dbf    undotbs01.dbf
orclpdb        redo02.log  standby_redo02.log  sysaux01.dbf        test          users01.dbf
[oracle@master2 orclstdydb]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Wed Oct 25 01:40:48 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show pdbs;

    CON_ID CON_NAME                      OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
        2 PDB$SEED                      READ ONLY  NO
        3 ORCLPDB                        MOUNTED
        4 TEST                          MOUNTED
        5 TEST2                          MOUNTED
SQL> alter system set enabled_PDBs_on_standby='*';
SQL> alter database recover managed standby database cancel;

Database altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  318767104 bytes
Fixed Size                  8792152 bytes
Variable Size            251660200 bytes
Database Buffers          50331648 bytes
Redo Buffers                7983104 bytes
SQL> alter database mount standby database;

Database altered.

SQL> alter database open;

Database altered.

SQL>  alter database recover managed standby database using current logfile disconnect;

Database altered.

SQL> show pdbs;

    CON_ID CON_NAME                      OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
        2 PDB$SEED                      READ ONLY  NO
        3 ORCLPDB                        MOUNTED
        4 TEST                          MOUNTED
        5 TEST2                          MOUNTED
SQL> alter pluggable database all open;

Pluggable database altered.

SQL> show pdbs;

    CON_ID CON_NAME                      OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
        2 PDB$SEED                      READ ONLY  NO
        3 ORCLPDB                        READ ONLY  NO
        4 TEST                          READ ONLY  NO
        5 TEST2                          READ ONLY  NO

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新链接地址http://www.linuxidc.com/Linux/2017-10/147974.htm

linux
相关资讯       删除PDB  Oracle 12C ADG 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款