ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 怎么把数据文件从文件系统移动到asm?

怎么把数据文件从文件系统移动到asm?

原创 Linux操作系统 作者:nmgzw 时间:2019-06-30 09:12:07 0 删除 编辑

看到itpub里有人误操作把rac文件建立在文件系统上了!具体操作如下:



oral31> alter tablespace system add datafile '/u01/crs/oracle/system02.dbf' size 10m;

Tablespace altered.

Elapsed: 00:00:01.40
oral31> select name from v$datafile;

NAME
--------------------------------------------------
+DATA/oral3/datafile/system.266.605975157
+DATA/oral3/datafile/undotbs1.265.605975167
+DATA/oral3/datafile/sysaux.261.605975171
+DATA/oral3/datafile/undotbs2.268.605976117
+DATA/oral3/datafile/users.264.605975181
+DATA/oral3/datafile/jlw.260.605977817
+DATA/oral3/datafile/jlw1.269.605977827
+DATA/oral3/datafile/qm.270.605977839
+DATA/oral3/datafile/other.271.605977843
+DATA/oral3/datafile/perfstat.272.605977863
+DATA/oral3/datafile/xdb.273.605978073
+DATA/oral3/datafile/drsys.274.605978079
+DATA/oral3/datafile/indx.275.605978085
+DATA/oral3/datafile/tools.276.605978091
/u01/crs/oracle/system02.dbf

15 rows selected.

Elapsed: 00:00:00.01oral31> oral31> startup mount
ORACLE instance started.

Total System Global Area 1895825408 bytes
Fixed Size                  1994600 bytes
Variable Size             385876120 bytes
Database Buffers         1493172224 bytes
Redo Buffers               14782464 bytes
Database mounted.

$ rman target system/oracle@oral31

Recovery Manager: Release 10.2.0.1.0 - Production on 星期六 12月 9 13:08:35 2006

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


connected to target database: ORAL3 (DBID=935560612, not open)

RMAN> 
RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    530      SYSTEM               ***     +DATA/oral3/datafile/system.266.605975157
2    2000     UNDOTBS1             ***     +DATA/oral3/datafile/undotbs1.265.605975167
3    600      SYSAUX               ***     +DATA/oral3/datafile/sysaux.261.605975171
4    2000     UNDOTBS2             ***     +DATA/oral3/datafile/undotbs2.268.605976117
5    10000    USERS                ***     +DATA/oral3/datafile/users.264.605975181
6    2000     JLW                  ***     +DATA/oral3/datafile/jlw.260.605977817
7    2000     JLW1                 ***     +DATA/oral3/datafile/jlw1.269.605977827
8    1500     QM                   ***     +DATA/oral3/datafile/qm.270.605977839
9    4000     OTHER                ***     +DATA/oral3/datafile/other.271.605977843
10   200      PERFSTAT             ***     +DATA/oral3/datafile/perfstat.272.605977863
11   100      XDB                  ***     +DATA/oral3/datafile/xdb.273.605978073
12   100      DRSYS                ***     +DATA/oral3/datafile/drsys.274.605978079
13   100      INDX                 ***     +DATA/oral3/datafile/indx.275.605978085
14   100      TOOLS                ***     +DATA/oral3/datafile/tools.276.605978091
15   10       SYSTEM               ***     /u01/crs/oracle/system02.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    339      TEMP                 32767       +DATA/oral3/tempfile/temp.259.605975173

RMAN> backup as copy datafile 15 format '+DATA';

Starting backup at 09-12月-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=205 instance=oral31 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00015 name=/u01/crs/oracle/system02.dbf
output filename=+DATA/oral3/datafile/system.277.608735641 tag=TAG20061209T131400 recid=5 stamp=608735640
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 09-12月-06

RMAN> switch datafile '/u01/crs/oracle/system02.dbf' to copy;

datafile 15 switched to datafile copy "+DATA/oral3/datafile/system.277.608735641"

RMAN> 
oral31> alter database open;

Database altered.

Elapsed: 00:00:09.25
oral31>              
col name format a50
oral31> select name from v$datafile;

NAME
--------------------------------------------------
+DATA/oral3/datafile/system.266.605975157
+DATA/oral3/datafile/undotbs1.265.605975167
+DATA/oral3/datafile/sysaux.261.605975171
+DATA/oral3/datafile/undotbs2.268.605976117
+DATA/oral3/datafile/users.264.605975181
+DATA/oral3/datafile/jlw.260.605977817
+DATA/oral3/datafile/jlw1.269.605977827
+DATA/oral3/datafile/qm.270.605977839
+DATA/oral3/datafile/other.271.605977843
+DATA/oral3/datafile/perfstat.272.605977863
+DATA/oral3/datafile/xdb.273.605978073
+DATA/oral3/datafile/drsys.274.605978079
+DATA/oral3/datafile/indx.275.605978085
+DATA/oral3/datafile/tools.276.605978091
+DATA/oral3/datafile/system.277.608735641

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25702/viewspace-464275/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2002-10-18

  • 博文量
    71
  • 访问量
    65121