码迷,mamicode.com
首页 > 其他好文 > 详细

RAC中数据文件创建到了本地路径(非系统表空间) 使用rman转移

时间:2017-07-29 20:20:52      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:type   11.2   sni   ora   number   sed   htm   name   user   

环境: 11.2.0.1 + RHEL5.8

 參考文档ID:1678747.1

1.模拟创建
一节点:
SQL> create tablespace tdb datafile '/u02/app/oracle/datafile/tdb.dbf' size 10m autoextend off;

Tablespace created.

2.查看数据文件
一节点:
     FILE# NAME
---------- ----------------------------------------------------------------------------------------------------
         4 +DATA/orcl/datafile/users.257.901333687
         3 +DATA/orcl/datafile/undotbs1.264.901333687
         2 +DATA/orcl/datafile/sysaux.256.901333685
         1 +DATA/orcl/datafile/system.265.901333685
         5 +DATA/orcl/datafile/undotbs2.266.901333943
         6 /u02/app/oracle/datafile/tdb.dbf

二节点:
SQL> select file_name,file_id,ONLINE_STATUS,tablespace_name from dba_data_files;
ERROR:
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u02/app/oracle/datafile/tdb.dbf'

3.将数据文件offline
SQL> alter database datafile 6 offline;

Database altered.

4.使用RMAN移动本地文件到asm

RMAN> copy datafile '/u02/app/oracle/datafile/tdb.dbf' to '+DATA';

Starting backup at 03-FEB-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=35 instance=orcl1 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u02/app/oracle/datafile/tdb.dbf
output file name=+DATA/orcl/datafile/tdb.268.902813699 tag=TAG20160203T053456 RECID=1 STAMP=902813699
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 03-FEB-16

5.重命名文件

SQL> alter database rename file '/u02/app/oracle/datafile/tdb.dbf' to '+DATA/orcl/datafile/tdb.268.902813699';

Database altered.

6.查看数据文件状态
FILE_NAME                                                       FILE_ID ONLINE_ TABLESPACE_NAME
------------------------------------------------------------ ---------- ------- ----------------------------------------
+DATA/orcl/datafile/users.257.901333687                               4 ONLINE  USERS
+DATA/orcl/datafile/undotbs1.264.901333687                            3 ONLINE  UNDOTBS1
+DATA/orcl/datafile/sysaux.256.901333685                              2 ONLINE  SYSAUX
+DATA/orcl/datafile/system.265.901333685                              1 SYSTEM  SYSTEM
+DATA/orcl/datafile/undotbs2.266.901333943                            5 ONLINE  UNDOTBS2
+DATA/orcl/datafile/tdb.dbf                                           6 RECOVER TDB

7.对数据文件recover一下
SQL> recover datafile 6;
Media recovery complete.


FILE_NAME                                                       FILE_ID ONLINE_ TABLESPACE_NAME
------------------------------------------------------------ ---------- ------- ----------------------------------------
+DATA/orcl/datafile/users.257.901333687                               4 ONLINE  USERS
+DATA/orcl/datafile/undotbs1.264.901333687                            3 ONLINE  UNDOTBS1
+DATA/orcl/datafile/sysaux.256.901333685                              2 ONLINE  SYSAUX
+DATA/orcl/datafile/system.265.901333685                              1 SYSTEM  SYSTEM
+DATA/orcl/datafile/undotbs2.266.901333943                            5 ONLINE  UNDOTBS2
+DATA/orcl/datafile/tdb.dbf                                           6 OFFLINE TDB

8.将数据文件online
SQL> alter database datafile 6 online;

Database altered.

9.检查数据文件
FILE_NAME                                                       FILE_ID ONLINE_ TABLESPACE_NAME
------------------------------------------------------------ ---------- ------- ----------------------------------------
+DATA/orcl/datafile/users.257.901333687                               4 ONLINE  USERS
+DATA/orcl/datafile/undotbs1.264.901333687                            3 ONLINE  UNDOTBS1
+DATA/orcl/datafile/sysaux.256.901333685                              2 ONLINE  SYSAUX
+DATA/orcl/datafile/system.265.901333685                              1 SYSTEM  SYSTEM
+DATA/orcl/datafile/undotbs2.266.901333943                            5 ONLINE  UNDOTBS2
+DATA/orcl/datafile/tdb.dbf                                           6 ONLINE  TDB

RAC中数据文件创建到了本地路径(非系统表空间) 使用rman转移

标签:type   11.2   sni   ora   number   sed   htm   name   user   

原文地址:http://www.cnblogs.com/wzzkaifa/p/7257197.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!