Precautions for copying an Oracle database

Source: Internet
Author: User

Precautions for copying an Oracle database

The number of files in the production database copied this time is 9.18 TB, the actual size of the allocated data is 5.16 TB, and the size of the data after compression and backup using RMAN is 1.1 TB.

The replication database uses the single-instance ASM storage method for management. The Oracle database version is 11.2.0.4. The DATA file directory is + DATA, 14.5 TB, and the archive log directory is + ARCH, 2 TB.

Production database data file size
SQL> select sum (bytes)/1024/1024/1024 GB from dba_segments;

GB
----------
5287.02454

Actual size of production database allocation
SQL> select sum (bytes)/1024/1024/1024 GB from dba_data_files;

GB
----------
9402.70592

Note 1: Avoid files with the same name in the set newname script.

When using set newname in rman, You can manually name the file to keep the file name consistent with that in the production database. For example:

Set newname for datafile 1 to '+ DATA/cmsdb/datafile/system01.dbf ';

This method poses a potential risk. If data files with the same name are stored in different directories in the production database, duplicate names may occur when writing scripts, this causes an error in RMAN restore.

Select name from v $ datafile where name like '% DATA_P008.dbf % ';
/Sgpmdb/oradata/u01/DATA_P008.dbf
/Sgpmdb/oradata/u06/DATA_P008.dbf

When I use the vi editing command to change the directory/sgpmdb/oradata/u01 to + DATA/sgpmdb/datafile, the file with the same name will be created by myself. It is difficult to see this problem at a glance in hundreds of lines of scripts.

: % S #/sgpmdb/oradata/u01/# + DATA/cmsdb/datafile/# g

Run {
...
Set newname for datafile 1 to '+ DATA/cmsdb/datafile/DATA_P008.dbf ';
...
Set newname for datafile 2 to '+ DATA/cmsdb/datafile/DATA_P008.dbf ';
...
}

The error message for executing RMAN restore is as follows:

ORA-19504: failed to create file "+ DATA/cmsdb/datafile/data_p008.dbf"
ORA-17502: ksfdcre: 4 Failed to create file + DATA/cmsdb/datafile/data_p008.dbf
ORA-15005: name "cmsdb/datafile/data_p008.dbf" is already used by an existing alias

Therefore, we recommend that you use the following method for oracle to define alias and keep the file name unique.
Run {
Set newname for datafile 1 to '+ data ';
Set newname for datafile 2 to '+ data ';
Set newname for datafile 3 to '+ data ';
......
}

NOTE 2: nohup execution in the background

After editing the RMAN script, we recommend that you use the nohup command in the background to avoid interference during the execution process.

Nohup./rman_scripts.cmd &

When rman is executed in the background, there is no output on the screen. You can monitor rman output by using tail-f./nohup. out.

You can also use ps-ef | grep to check whether the program is executed in the background. Note that what is entered after ps-ef | grep?

The easy mistake is ps-ef | grep nohup.

This command does not return results. If the entered command does not work, and the execution of nohup./rman_scripts.cmd again occurs, the tragedy arises. This script has been executed twice!

If the restore command is used, and set newname for datafile 1 to '+ data'; is used, there will be two DATA files in the + DATA disk group, eventually, the disk space will burst.

The correct usage is ps-ef | grep rman_scripts.cmd.

All of the above are problems in this project. During the long database recovery process, every error will delay a lot of time, so be careful.

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

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.