欢迎光临
我们一直在努力

oracle 数据文件迁移

环境:win 2008   oracle 11g
   应开发人员申请,将本地automap数据文件迁移到磁阵上。
   数据库非归档模式
数据文件迁移:
SQL>select  name  from  v$datafile;
 D:\app\oradata\orcl\automap01.dbf
 D:\app\oradata\orcl\automap02.dbf
……………
SQL>shutdown immediate
(以下的$move命令 应该等同于操作系统的剪切粘贴命令)

SQL> $move D:\app\oradata\orcl\automap01.dbf  E:\app\oradata\orcl\automap01.db’
SQL> $move D:\app\oradata\orcl\automap02.dbf  E:\app\oradata\orcl\automap02.db’

SQL> startup mount

ORACLE 例程已经启动。

Total System Global Area  209715200 bytes

Fixed Size                  1248140 bytes

Variable Size              92275828 bytes

Database Buffers          113246208 bytes

Redo Buffers                2945024 bytes

数据库装载完毕。

SQL>  alter database rename file ‘D:\app\oradata\orcl\automap01.dbf’ to  ‘E:\app\oradata\orcl\automap01.db’;

SQL>  alter database rename file ‘D:\app\oradata\orcl\automap02.dbf’ to  ‘E:\app\oradata\orcl\automap02.db’;

    

SQL> alter database open;

数据库已更改。

SQL> select name,status from v$datafile;

此外,其他移动数据文件的方法(在数据库启动归档的情况下,可以开机迁移):

 

移动Oracle数据库表空间文件

目的:把oracle表空间文件从一个地方移动到另外一个地方。

详细操作步骤:

第一、启用介质恢复模式:

A、Shutdown immdiate;

B、Startup mount;

C、Alter database archivelog;

D、Alter database open;

第二、卸载表空间:

A、Alter tablespace 表空间名字 offline;(注:如果为非归档模式后面加Drop);

第三、在操作系统下移动文件到新位置。

第四、告诉表空间数据文件已经移动:

A、Alter database rename file ‘原文件路径’ to ‘新文件路径’;

第五、装载表空间:

A、Alter tablespace 表空间名字 online;

第六、关闭数据库:

A、Shutdown;

第七、启动数据库:

A、Startup force;

Oracle数据库表空间文件移动成功。

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。