Transfer An Oracle Data File "*. DBF"

Source: Internet
Author: User

Transfer Process:
1. log on to sqlplus first:
C:/Documents and Settings/jbdu> sqlplus "/As sysdba"
2. Change the tablespace to offline:
SQL> alter tablespace users offline;
3. Copy tablespace files
Copy
D:/Oracle/product/10.2.0/oradata/orclado/users01.dbf
H:/Oracle/product/10.2.0/oradata/orclado/users01.dbf

4. Modify the Oracle tablespace pointing address
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. Change the tablespace to online.
SQL> alter tablespace users online;
The details are as follows:
1. view the tablespace:
Select tablespace_name from dba_tablespaces;

The name of the tablespace.

2. Only some tablespaces can be transferred in this way, and system, temp, sysaux, and other tablespaces can be transferred in 3rd ways.
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 ';
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 into _ts online;
3. For system, temp, undotbs1, sysaux, and other tablespaces, first shut down the database, then start to the Mount state, and then modify the data file name.
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 ';
Note: if an error is reported
Ora-01113
Ora-01110
Run
Recover datafile'H:/Oracle/product/10.2./oradata/orcl/undotbs01.dbf';

Alter database open;
Run again
SQL> alter tablespace users/example/... online;

% 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. query the data file name:
Select file_name from SYS. dba_data_files;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.