Oracle Migration Data Files

Source: Internet
Author: User

The scenario is as follows:

[Email protected] ~]# df-h

Filesystem capacity used% mount point available

/dev/sda2 28G 26G 585M 98%/

/DEV/SDA1 190M 12M 169M 7%/boot

None 2.0G 0 2.0G 0%/dev/shm

/DEV/SDB3 99G 93M 94G 1%/u02

    1. The root directory is full,

    2. /U02 has a relatively large space,

    3. Now to take the root directory of large space datafile, migrating to a large space/u02 up

The steps are as follows:

1. Migrate the data files to the/u02 corresponding directory

[Email protected] hsbop]$ MV/U01/APP/ORACLE/ORADATA/ORCL/ACPTDAT.DBF/U02/ORADATA/HSBOP/ACPTDAT.DBF

[Email protected] hsbop]$ MV/U01/APP/ORACLE/ORADATA/ORCL/ACPTIDX.DBF/U02/ORADATA/HSBOP/ACPTIDX.DBF

[Email protected] hsbop]$ MV/U01/APP/ORACLE/ORADATA/ORCL/ARCHDAT.DBF/U02/ORADATA/HSBOP/ARCHDAT.DBF

[Email protected] hsbop]$ MV/U01/APP/ORACLE/ORADATA/ORCL/ARCHIDX.DBF/U02/ORADATA/HSBOP/ARCHIDX.DBF

2. Database boot to Mount state

Sql> Startup Mount

ORACLE instance started.

Total System Global area 536870912 bytes

Fixed Size 1220408 bytes

Variable Size 171966664 bytes

Database buffers 356515840 bytes

Redo buffers 7168000 bytes

Database mounted.

3. Rename the data file

sql> ALTER DATABASE rename file '/u01/app/oracle/oradata/orcl/acptdat.dbf ' to '/u02/oradata/hsbop/acptdat.dbf ';

Database altered.

sql> ALTER DATABASE rename file '/u01/app/oracle/oradata/orcl/acptidx.dbf ' to '/u02/oradata/hsbop/acptidx.dbf ';

Database altered.

sql> ALTER DATABASE rename file '/u01/app/oracle/oradata/orcl/archdat.dbf ' to '/u02/oradata/hsbop/archdat.dbf ';

Database altered.

sql> ALTER DATABASE rename file '/u01/app/oracle/oradata/orcl/archidx.dbf ' to '/u02/oradata/hsbop/archidx.dbf ';

Database altered.

4. Open the Database

sql> ALTER DATABASE open;

Database altered.

###### if the MV when the Xshell disconnected, and re-MV a bit, will result in incomplete data files,

###### test environment can play a bit, by the data file construction to and control file record consistency to cheat Oracle, this time actually the data has lost a part of

sql> ALTER DATABASE open;

ALTER DATABASE Open

*

ERROR at line 1:

Ora-01122:database file failed verification check

Ora-01110:data file: '/u02/oradata/hsbop/ykhdat.dbf '

ora-01200:actual file size of 21087 is smaller than correct size of 64000

Blocks

Sql> Select 64000-21087 cnt from dual;

Cnt

----------

42913

sql>!dd if=/dev/zero of=/u02/oradata/hsbop/ykhdat.dbf bs=8192 count=42913 seek=21088

42913+0 Records in

42913+0 Records out

sql> ALTER DATABASE open;

Database altered.

Oracle Migration 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.