ASM檔案移出後的註冊和開啟資料庫

jichengjie發表於2017-12-18
本實驗是將ASM檔案利用cp命令複製到操縱系統檔案系統後,如何註冊到database,開啟資料庫
環境是linux5.7+oracle11.2.0.4
RMAN> catalog datafilecopy '/s01/oracle/USERS.268.962900225';


cataloged datafile copy
datafile copy file name=/s01/oracle/USERS.268.962900225 RECID=2 STAMP=963047096


RMAN> run
2> {
3> set newname for datafile '+DATA/DAVID/DATAFILE/USERS.268.962900225' to '/s01/oracle/USERS.268.962900225';
4> switch datafile all;
5> }


executing command: SET NEWNAME


datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=963047096 file name=/s01/oracle/USERS.268.962900225


RMAN> recover datafile 4;


Starting recover at 18-DEC-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK


starting media recovery
media recovery complete, elapsed time: 00:00:01


Finished recover at 18-DEC-17


RMAN> exit




Recovery Manager complete.
[oracle@rac1 ~]$ sqlplus  /nolog


SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 18 09:06:09 2017


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


SQL> connect / as sysdba
Connected.
SQL> alter database open;


Database altered.


SQL> select file_name
  2  from dba_data_files;


FILE_NAME
--------------------------------------------------------------------------------
/s01/oracle/USERS.268.962900225
+DATA/david/datafile/undotbs1.261.962900225
+DATA/david/datafile/sysaux.260.962900225
+DATA/david/datafile/system.270.962900225
+DATA/david/datafile/example.262.962900447


SQL> select *
  2  from scott.dept;


    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON


SQL> 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26870952/viewspace-2148788/,如需轉載,請註明出處,否則將追究法律責任。

相關文章