有一个表空间数据文件所在的磁盘使用率达到100%,将文件改到新的路径下,方法如下:
[root@oracle9ivm ~]# su - oracle
[oracle@oracle9ivm ~]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Sat Jun 12 19:23:32 2010
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> select file#,status,name from v$datafile;
FILE# STATUS NAME
---------- ------- -----------------------------------
1 SYSTEM /u01/oradata/ora10g/system01.dbf
2 ONLINE /u01/oradata/ora10g/undotbs01.dbf
3 ONLINE /u01/oradata/ora10g/cwmlite01.dbf
4 ONLINE /u01/oradata/ora10g/drsys01.dbf
5 ONLINE /u01/oradata/ora10g/example01.dbf
6 ONLINE /u01/oradata/ora10g/indx01.dbf
7 ONLINE /u01/oradata/ora10g/odm01.dbf
8 ONLINE /u01/oradata/ora10g/tools01.dbf
9 ONLINE /u01/oradata/ora10g/users01.dbf
10 ONLINE /u01/oradata/ora10g/xdb01.dbf
11 ONLINE /u01/oradata/ora10g/testtbs01.dbf
FILE# STATUS NAME
---------- ------- -----------------------------------
12 ONLINE /u01/oradata/ora10g/app01.dbf
13 ONLINE /u01/oradata/app02.dbf
13 rows selected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
--将文件移动到新的目录
[root@oracle9ivm ora10g]# ll
total 3015032
-rw-r----- 1 oracle oinstall 10493952 Jun 12 19:16 app01.dbf
-rw-r----- 1 oracle oinstall 10493952 Jun 12 19:07 app02.dbf
drwxr-xr-x 2 oracle oinstall 4096 Jun 6 16:34 arch
-rw-r----- 1 oracle oinstall 2039808 Jun 12 19:23 control01.ctl
-rw-r----- 1 oracle oinstall 2039808 Jun 12 19:23 control02.ctl
-rw-r----- 1 oracle oinstall 2039808 Jun 12 19:23 control03.ctl
-rw-r--r-- 1 oracle oinstall 20979712 Jun 12 19:16 cwmlite01.dbf
-rw-r--r-- 1 oracle oinstall 20979712 Jun 12 19:16 drsys01.dbf
-rw-r--r-- 1 oracle oinstall 156639232 Jun 12 19:16 example01.dbf
-rw-r--r-- 1 oracle oinstall 26222592 Jun 12 19:16 indx01.dbf
-rw-r--r-- 1 oracle oinstall 20979712 Jun 12 19:16 odm01.dbf
-rw-r----- 1 oracle oinstall 104858112 Jun 12 19:16 redo01.log
-rw-r----- 1 oracle oinstall 104858112 Jun 12 19:15 redo02.log
-rw-r----- 1 oracle oinstall 104858112 Jun 12 19:15 redo03.log
-rw-r--r-- 1 oracle oinstall 524296192 Jun 12 19:16 system01.dbf
-rw-r--r-- 1 oracle oinstall 44048384 Jun 4 2011 temp01.dbf
-rw-r----- 1 oracle oinstall 94380032 Jun 12 19:16 testtbs01.dbf
-rw-r--r-- 1 oracle oinstall 10493952 Jun 12 19:16 tools01.dbf
-rw-r--r-- 1 oracle oinstall 1751130112 Jun 12 19:16 undotbs01.dbf
-rw-r--r-- 1 oracle oinstall 26222592 Jun 12 19:16 users01.dbf
-rw-r--r-- 1 oracle oinstall 47194112 Jun 12 19:16 xdb01.dbf
[root@oracle9ivm ora10g]# rm -f app02.dbf
[root@oracle9ivm ora10g]# cp ../app02.dbf .
[root@oracle9ivm ora10g]# ll
total 3015032
-rw-r----- 1 oracle oinstall 10493952 Jun 12 19:24 app01.dbf
-rw-r----- 1 root root 10493952 Jun 12 19:24 app02.dbf
drwxr-xr-x 2 oracle oinstall 4096 Jun 6 16:34 arch
-rw-r----- 1 oracle oinstall 2039808 Jun 12 19:24 control01.ctl
-rw-r----- 1 oracle oinstall 2039808 Jun 12 19:24 control02.ctl
-rw-r----- 1 oracle oinstall 2039808 Jun 12 19:24 control03.ctl
-rw-r--r-- 1 oracle oinstall 20979712 Jun 12 19:24 cwmlite01.dbf
-rw-r--r-- 1 oracle oinstall 20979712 Jun 12 19:24 drsys01.dbf
-rw-r--r-- 1 oracle oinstall 156639232 Jun 12 19:24 example01.dbf
-rw-r--r-- 1 oracle oinstall 26222592 Jun 12 19:24 indx01.dbf
-rw-r--r-- 1 oracle oinstall 20979712 Jun 12 19:24 odm01.dbf
-rw-r----- 1 oracle oinstall 104858112 Jun 12 19:24 redo01.log
-rw-r----- 1 oracle oinstall 104858112 Jun 12 19:24 redo02.log
-rw-r----- 1 oracle oinstall 104858112 Jun 12 19:24 redo03.log
-rw-r--r-- 1 oracle oinstall 524296192 Jun 12 19:24 system01.dbf
-rw-r--r-- 1 oracle oinstall 44048384 Jun 4 2011 temp01.dbf
-rw-r----- 1 oracle oinstall 94380032 Jun 12 19:24 testtbs01.dbf
-rw-r--r-- 1 oracle oinstall 10493952 Jun 12 19:24 tools01.dbf
-rw-r--r-- 1 oracle oinstall 1751130112 Jun 12 19:24 undotbs01.dbf
-rw-r--r-- 1 oracle oinstall 26222592 Jun 12 19:24 users01.dbf
-rw-r--r-- 1 oracle oinstall 47194112 Jun 12 19:24 xdb01.dbf
[root@oracle9ivm ora10g]# chown oracle.oinstall app02.dbf
[root@oracle9ivm ora10g]# ll
total 3015032
-rw-r----- 1 oracle oinstall 10493952 Jun 12 19:24 app01.dbf
-rw-r----- 1 oracle oinstall 10493952 Jun 12 19:24 app02.dbf
drwxr-xr-x 2 oracle oinstall 4096 Jun 6 16:34 arch
-rw-r----- 1 oracle oinstall 2039808 Jun 12 19:24 control01.ctl
-rw-r----- 1 oracle oinstall 2039808 Jun 12 19:24 control02.ctl
-rw-r----- 1 oracle oinstall 2039808 Jun 12 19:24 control03.ctl
-rw-r--r-- 1 oracle oinstall 20979712 Jun 12 19:24 cwmlite01.dbf
-rw-r--r-- 1 oracle oinstall 20979712 Jun 12 19:24 drsys01.dbf
-rw-r--r-- 1 oracle oinstall 156639232 Jun 12 19:24 example01.dbf
-rw-r--r-- 1 oracle oinstall 26222592 Jun 12 19:24 indx01.dbf
-rw-r--r-- 1 oracle oinstall 20979712 Jun 12 19:24 odm01.dbf
-rw-r----- 1 oracle oinstall 104858112 Jun 12 19:24 redo01.log
-rw-r----- 1 oracle oinstall 104858112 Jun 12 19:24 redo02.log
-rw-r----- 1 oracle oinstall 104858112 Jun 12 19:24 redo03.log
-rw-r--r-- 1 oracle oinstall 524296192 Jun 12 19:24 system01.dbf
-rw-r--r-- 1 oracle oinstall 44048384 Jun 4 2011 temp01.dbf
-rw-r----- 1 oracle oinstall 94380032 Jun 12 19:24 testtbs01.dbf
-rw-r--r-- 1 oracle oinstall 10493952 Jun 12 19:24 tools01.dbf
-rw-r--r-- 1 oracle oinstall 1751130112 Jun 12 19:24 undotbs01.dbf
-rw-r--r-- 1 oracle oinstall 26222592 Jun 12 19:24 users01.dbf
-rw-r--r-- 1 oracle oinstall 47194112 Jun 12 19:24 xdb01.dbf
[root@oracle9ivm ora10g]#
SQL> startup mount;
ORACLE instance started.
Total System Global Area 236000356 bytes
Fixed Size 451684 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> select file#,status,name from v$datafile;
FILE# STATUS NAME
---------- ------- -----------------------------------
1 SYSTEM /u01/oradata/ora10g/system01.dbf
2 ONLINE /u01/oradata/ora10g/undotbs01.dbf
3 ONLINE /u01/oradata/ora10g/cwmlite01.dbf
4 ONLINE /u01/oradata/ora10g/drsys01.dbf
5 ONLINE /u01/oradata/ora10g/example01.dbf
6 ONLINE /u01/oradata/ora10g/indx01.dbf
7 ONLINE /u01/oradata/ora10g/odm01.dbf
8 ONLINE /u01/oradata/ora10g/tools01.dbf
9 ONLINE /u01/oradata/ora10g/users01.dbf
10 ONLINE /u01/oradata/ora10g/xdb01.dbf
11 ONLINE /u01/oradata/ora10g/testtbs01.dbf
FILE# STATUS NAME
---------- ------- -----------------------------------
12 ONLINE /u01/oradata/ora10g/app01.dbf
13 ONLINE /u01/oradata/app02.dbf
13 rows selected.
SQL> alter database datafile 13 offline;
Database altered.
SQL> alter database rename file '/u01/oradata/app02.dbf' to '/u01/oradata/ora10g/app02.dbf';
Database altered.
SQL> select file#,status,name from v$datafile;
FILE# STATUS NAME
---------- ------- -----------------------------------
1 SYSTEM /u01/oradata/ora10g/system01.dbf
2 ONLINE /u01/oradata/ora10g/undotbs01.dbf
3 ONLINE /u01/oradata/ora10g/cwmlite01.dbf
4 ONLINE /u01/oradata/ora10g/drsys01.dbf
5 ONLINE /u01/oradata/ora10g/example01.dbf
6 ONLINE /u01/oradata/ora10g/indx01.dbf
7 ONLINE /u01/oradata/ora10g/odm01.dbf
8 ONLINE /u01/oradata/ora10g/tools01.dbf
9 ONLINE /u01/oradata/ora10g/users01.dbf
10 ONLINE /u01/oradata/ora10g/xdb01.dbf
11 ONLINE /u01/oradata/ora10g/testtbs01.dbf
FILE# STATUS NAME
---------- ------- -----------------------------------
12 ONLINE /u01/oradata/ora10g/app01.dbf
13 OFFLINE /u01/oradata/ora10g/app02.dbf
13 rows selected.
SQL> alter database datafile 13 online;
Database altered.
SQL> select file#,status,name from v$datafile;
FILE# STATUS NAME
---------- ------- -----------------------------------
1 SYSTEM /u01/oradata/ora10g/system01.dbf
2 ONLINE /u01/oradata/ora10g/undotbs01.dbf
3 ONLINE /u01/oradata/ora10g/cwmlite01.dbf
4 ONLINE /u01/oradata/ora10g/drsys01.dbf
5 ONLINE /u01/oradata/ora10g/example01.dbf
6 ONLINE /u01/oradata/ora10g/indx01.dbf
7 ONLINE /u01/oradata/ora10g/odm01.dbf
8 ONLINE /u01/oradata/ora10g/tools01.dbf
9 ONLINE /u01/oradata/ora10g/users01.dbf
10 ONLINE /u01/oradata/ora10g/xdb01.dbf
11 ONLINE /u01/oradata/ora10g/testtbs01.dbf
FILE# STATUS NAME
---------- ------- -----------------------------------
12 ONLINE /u01/oradata/ora10g/app01.dbf
13 ONLINE /u01/oradata/ora10g/app02.dbf
13 rows selected.
SQL> alter database open;
Database altered.
SQL>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16400082/viewspace-732726/ ,如需转载,请注明出处,否则将追究法律责任。