oracle資料檔案 dbf 的轉移

2021-06-16 22:47:50 字數 2936 閱讀 8879

移動一般表空間:

1、將該錶空間offline。

2、在os級移動資料檔案

3、alter database rename file '.......dbf' to '.......dbf';

4、將表空間online。

移動system 表空間:

1、shutdown db

2、在os級移動資料檔案

3、startup mount;

4、alter database rename file '.......dbf' to '.......dbf';

5、open db。

轉移過程:

1.先登入sqlplus:

c:/documents and settings/jbdu>sqlplus 「/as sysdba」

2.修改表空間為offline: www.2cto.com

sql> alter tablespace users offline;

3.拷貝表空間檔案

拷貝 d:/oracle/product/10.2.0/oradata/orclado/users01.dbf 到

h:/oracle/product/10.2.0/oradata/orclado/users01.dbf

4.修改oracle表空間指向位址

sql> alter database rename file 『d:/oracle/product/10.2.0/oradata/orclado/users01.dbf'to 'h:/oracle/product/10.2.0/oradata/orclado/users01.dbf';

5.修改表空間為online

sql> alter tablespace users online;

具體如下:

1、檢視表空間:

select tablespace_name from dba_tablespaces;

獲知表空間的名稱。

2、只有部分表空間能按照此方式轉移,system、temp、sysaux等表空間按照第3種方式進行轉移。

alter tablespace users offline;

alter tablespace example offline;

alter tablespace cmd_ts offline;

alter database rename file 'd:/oracle/product/10.2.0/oradata/orcl/example01.dbf' to 'h:/oracle/product/10.2.0/oradata/orcl/example01.dbf'; www.2cto.com

alter database rename file 'd:/oracle/product/10.2.0/oradata/orcl/users01.dbf' to 'h:/oracle/product/10.2.0/oradata/orcl/users01.dbf';

alter tablespace users online;

alter tablespace example online;

alter tablespace cmd_ts online;

3.對於system、temp、undotbs1、sysaux等表空間,先關閉

資料庫,然後啟動到mount狀態,再修改資料檔案名稱。

shutdown immediate;

startup mount;

alter database rename file 'd:/oracle/product/10.2.0/oradata/orcl/sysaux01.dbf' to 'h:/oracle/product/10.2.0/oradata/orcl/sysaux01.dbf';

alter database rename file 'd:/oracle/product/10.2.0/oradata/orcl/system01.dbf' to 'h:/oracle/product/10.2.0/oradata/orcl/system01.dbf';

alter database rename file 'd:/oracle/product/10.2.0/oradata/orcl/temp01.dbf' to 'h:/oracle/product/10.2.0/oradata/orcl/temp01.dbf';

alter database rename file 'd:/oracle/product/10.2.0/oradata/orcl/undotbs01.dbf' to 'h:/oracle/product/10.2.0/oradata/orcl/undotbs01.dbf';

注意如果報錯出現 www.2cto.com

ora-01113

ora-01110

就執行recover datafile 'h:/oracle/product/10.2./oradata/orcl/undotbs01.dbf';

alter database open;

再執行sql> alter tablespace users/example/... online;

www.2cto.com

%alter tablespace system offline;

%alter tablespace undotbs1 offline;

%alter tablespace sysaux offline;

%alter tablespace temp offline;

alter tablespace system online;

alter tablespace undotbs1 online;

alter tablespace sysaux online;

alter tablespace temp online;

4.查詢資料檔案名稱:

select file_name from sys.dba_data_files;

轉移oracle資料檔案 dbf

轉移過程 1.先登入sqlplus c documents and settings jbdu sqlplus as sysdba 2.修改表空間為offline sql alter tablespace users offline 3.拷貝表空間檔案 拷貝 d oracle product 10....

轉移oracle資料檔案 dbf

轉移過程 1.先登入sqlplus c documents and settings jbdu sqlplus as sysdba 2.修改表空間為offline sql alter tablespace users offline 3.拷貝表空間檔案 拷貝 d oracle product 10....

oracle資料檔案 dbf 的轉移

轉移oracle資料檔案 dbf 轉移過程 1.先登入sqlplus c documents and settings jbdu sqlplus as sysdba 2.修改表空間為offline www.2cto.com sql alter tablespace users offline 3.拷...