{"id":306,"date":"2020-10-27T15:58:39","date_gmt":"2020-10-27T07:58:39","guid":{"rendered":"http:\/\/www.821121.com\/?p=306"},"modified":"2020-12-25T10:42:29","modified_gmt":"2020-12-25T02:42:29","slug":"%e6%96%b0%e7%89%b9%e6%80%a7%ef%bc%9acdb-pdb%e7%9a%84%e7%bb%b4%e6%8a%a4%e5%91%bd%e4%bb%a4%ef%bc%9a%e5%a4%87%e4%bb%bd%e4%b8%8e%e6%81%a2%e5%a4%8d%ef%bc%881%ef%bc%89%e6%a8%a1%e6%8b%9fpdb-system%e8%a1%a8","status":"publish","type":"post","link":"http:\/\/www.821121.com\/?p=306","title":{"rendered":"\u65b0\u7279\u6027\uff1aCDB\/PDB\u7684\u7ef4\u62a4\u547d\u4ee4\uff1a\u5907\u4efd\u4e0e\u6062\u590d\uff082\uff09\u6a21\u62dfPDB system\u8868\u7a7a\u95f4\u6570\u636e\u6587\u4ef6\u5220\u9664\u540e\u6062\u590d"},"content":{"rendered":"<h1>\u6a21\u62dfPDB system\u8868\u7a7a\u95f4\u6570\u636e\u6587\u4ef6\u5220\u9664\u540e\u6062\u590d<\/h1>\n<h2>\u67e5\u770bsystem \u7684\u6570\u636e\u6587\u4ef6<\/h2>\n<pre><code class=\"language-sql\">[oracle@cat1 ~]$ sqlplus \/ as sysdba\n\nSQL*Plus: Release 19.0.0.0.0 - Production on Mon May 2 22:06:55 2005\nVersion 19.3.0.0.0\n\nCopyright (c) 1982, 2019, Oracle.  All rights reserved.\n\nConnected to:\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\nVersion 19.3.0.0.0\n\nSQL&gt; show pdbs\n\n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n         2 PDB$SEED                       READ ONLY  NO\n         3 PDB1_WHS                       READ WRITE NO\n         4 PDB2_WHS                       MOUNTED\n         5 PDB3_WHS                       MOUNTED\n\nSQL&gt; alter session set container=PDB1_WHS;\n\nSession altered.\n\nSQL&gt; select file_name from dba_data_files where tablespace_name=&#039;SYSTEM&#039;;\n\nFILE_NAME\n--------------------------------------------------------------------------------\n+DATA1\/WHS1\/B4D31742116320ECE0532900A8C025DC\/DATAFILE\/system.274.1057318911\n\nSQL&gt; shutdown immeidate\nSP2-0717: illegal SHUTDOWN option\nSQL&gt; shutdown immediate\nPluggable Database closed.\nSQL&gt; <\/code><\/pre>\n<p>ASM\u9700\u8981\u505c\u5e93\u540e\u624d\u80fd\u5220\u9664\u6587\u4ef6\uff0c\u5426\u5219\u62a5\u9519\uff1a<\/p>\n<pre><code class=\"language-sql\">ORA-15032: not all alterations performed\nORA-15028: ASM file &#039;+DATA1\/WHS1\/B4D31742116320ECE0532900A8C025DC\/DATAFILE\/system.274.1057318911&#039; not dropped; currently being accessed (DBD ERROR: OCIStmtExecute)<\/code><\/pre>\n<h2>\u5220\u9664\u6587\u4ef6\uff1a<\/h2>\n<pre><code class=\"language-sql\">[grid@cat1 ~]$ asmcmd\nASMCMD&gt; rm -rf +DATA1\/WHS1\/B4D31742116320ECE0532900A8C025DC\/DATAFILE\/system.274.1057318911<\/code><\/pre>\n<p>\u65e0\u6cd5\u5f00\u542f\u6570\u636e\u5e93<\/p>\n<pre><code class=\"language-sql\">SQL&gt; startup\nORA-01157: cannot identify\/lock data file 10 - see DBWR trace file\nORA-01110: data file 10:\n&#039;+DATA1\/WHS1\/B4D31742116320ECE0532900A8C025DC\/DATAFILE\/system.274.1057318911&#039;<\/code><\/pre>\n<h2>\u6062\u590d\u6570\u636e\u6587\u4ef6<\/h2>\n<pre><code class=\"language-sql\">[oracle@cat1 ~]$ rman target \/\n\nRecovery Manager: Release 19.0.0.0.0 - Production on Mon May 2 22:18:03 2005\nVersion 19.3.0.0.0\n\nCopyright (c) 1982, 2019, Oracle and\/or its affiliates.  All rights reserved.\n\nconnected to target database: WHS1 (DBID=2406852607)\n\nRMAN&gt; restore tablespace PDB1_WHS:SYSTEM;\n\nStarting restore at 02-MAY-05\nusing target database control file instead of recovery catalog\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=410 instance=whs11 device type=DISK\n\nchannel ORA_DISK_1: starting datafile backup set restore\nchannel ORA_DISK_1: specifying datafile(s) to restore from backup set\nchannel ORA_DISK_1: restoring datafile 00010 to +DATA1\/WHS1\/B4D31742116320ECE0532900A8C025DC\/DATAFILE\/system.274.1057318911\nchannel ORA_DISK_1: reading from backup piece \/rmanbackup\/rman0_WHS1_2_20050502\nchannel ORA_DISK_1: piece handle=\/rmanbackup\/rman0_WHS1_2_20050502 tag=LEVEL0\nchannel ORA_DISK_1: restored backup piece 1\nchannel ORA_DISK_1: restore complete, elapsed time: 00:00:15\nFinished restore at 02-MAY-05\n\nRMAN&gt; RECOVER  tablespace PDB1_WHS:SYSTEM;\n\nStarting recover at 02-MAY-05\nusing channel ORA_DISK_1\n\nstarting media recovery\nmedia recovery complete, elapsed time: 00:00:00\n\nFinished recover at 02-MAY-05\n\nRMAN&gt; ALTER PLUGGABLE DATABASE PDB1_WHS OPEN;\n\nStatement processed<\/code><\/pre>\n<p>\u9a8c\u8bc1\uff1a<\/p>\n<pre><code class=\"language-sql\">SQL&gt; show pdbs  \n\n    CON_ID CON_NAME                       OPEN MODE  RESTRICTED\n---------- ------------------------------ ---------- ----------\n         2 PDB$SEED                       READ ONLY  NO\n         3 PDB1_WHS                       READ WRITE NO\n         4 PDB2_WHS                       MOUNTED\n         5 PDB3_WHS                       MOUNTED\nSQL&gt; <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6a21\u62dfPDB system\u8868\u7a7a\u95f4\u6570\u636e\u6587\u4ef6\u5220\u9664\u540e\u6062\u590d <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-oracle-12c"],"_links":{"self":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306"}],"version-history":[{"count":3,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":309,"href":"http:\/\/www.821121.com\/index.php?rest_route=\/wp\/v2\/posts\/306\/revisions\/309"}],"wp:attachment":[{"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.821121.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}