Solution to insufficient disk space for Oracle databases on a Linux Virtual Machine

Source: Internet
Author: User

Problem description: Recently, We need to export all the data in the test database and import it to Oracle locally installed in the Linux Virtual Machine. Since the disk space allocated to Linux was only 8 GB, at present, the remaining space is less than 500 mb, while the DMP file exported from the test database has more than 2 GB, which is obviously insufficient disk space.

Solution: append the hard disk to the Linux virtual machine, format the partition, mount it to the file system, specify the tablespace to the new file system, and then import the table space. The specific steps are as follows:

1. append the hard disk

Shut down the Linux operating system in the VM, click "Edit Virtual Machine Settings", and append a hard disk (I tried it. It seems that the size of the attached hard disk cannot exceed 4 GB, I append a 3.5gb file)

2. Partition and format the attached hard disk

A. Start Linux in VM

B. Assume that there is already a hard disk/dev/SDA in Linux, then the new hard disk is/dev/SDB, and the new one is/dev/SDC... and so on,

C. Log On As A root user

D. Use the fdisk command to partition the hard disk.
Fdisk/dev/SDB
P print Partition Table
T-converted Partition Table
W write into Partition Table
N create a new partition (up to four primary partitions, the first partition is/dev/sdb1, and the second partition is/dev/sdb2 ...... and so on)
D. delete a partition.
V check Partition

E. format the new partition.
Mkfs-supports ext2, ext3, vfat, msdos, JFS, and reiserfs.
Usage 1: mkfs-T
Example: # mkfs-T ext3/dev/sdb1
Usage 2: mkfs.
Example: # mkfs. vfat/dev/sdb1

Mke2fs-supports ext2/ext3 file systems
Usage: mke2fs [-J]
Example: # mke2fs-J/dev/sdb1
NOTE: If-J is added to mke2fs, it means adding logs, that is, partitions of ext3.

3. Mount the attached hard disk to the file system

Mount/dev/sdb1/oracledata
Note: The/oracledata directory should be created in advance. If the DF-am command is successful in the previous operations, you can see the newly mounted hard disk. In this case, it can be used normally.

4. Start Oracle and delete the original tablespace. Assume that the tablespace name is test. The SQL statement is as follows:

Drop tablespace test including contents and datafiles;

5. Create a tablespace on the New Hard Disk

Create tablespace test datafile '/oracledata/test. dbf' size 5 m autoextend on next 10 m maxsize unlimited;

6. Import Data

IMP PCRs/pcrs@10.10.10.3: 1521/PCRs full = y file = D: \ pcrs0918.dmp ignore = y

Note: The source database tablespace of exp should be consistent with that of test.

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.