Rename a Data file in Data Gurad physical backup mode

Source: Internet
Author: User

Rename a data file

If the primary database re-commands one or more data files, the modification will not be automatically transmitted to the standby database.

If you want to make standby and data files consistent with primary, you can only manually operate them on your own. Even STANDBY_FILE_MANAGEMENT cannot help, whether it is auto or manual.

The following is an example:

A). Perform the offline -- primary database operation on the tablespace where the renamed data file is located.

SQL> alter tablespace users offline;

Tablespace altered.

B) manually rename the data file (Operating System)-primary database operation

C) use commands to modify the path of data files in the data dictionary and operate the online tablespace-primary database

SQL> alter tablespace users rename datafile '/u01/app/Oracle/oradata/jytest/users01.dbf' to '/u01/app/oracle/oradata/jytest/myusers01.dbf ';

Tablespace altered.

SQL> alter tablespace users online;

Tablespace altered.

SQL>

D) pause the redo application and shutdown -- standby database operations.

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> shutdown immediate;

ORA-01507: database not mounted

E). Manually rename the data file (Operating System)-standby database operations

F). Restart standby and modify the data file path (data dictionary)-standby database operations

SQL> startup mount;

ORACLE instance started.

Total System Global Area 6442450944 bytes

Fixed Size 2030368 bytes

Variable Size 1090520288 bytes

Database Buffers 5335154688 bytes

Redo Buffers 14745600 bytes

Database mounted.

SQL> alter database rename file

2'/u01/app/oracle/oradata/jytest/users01.dbf'

3 '/u01/app/oracle/oradata/jytest/myusers01.dbf ';

Tablespace changed

G). Restart the redo application.

SQL> alter system set standby_file_management = 'manual' scope = both;

System altered.

SQL> alter database rename file '/u01/app/oracle/oradata/jytest/users01.dbf' to '/u01/app/oracle/oradata/jytest/myusers01.dbf ';

Database altered.

SQL> alter system set standby_file_management = 'auto' scope = both;

System altered.

H). switch log-primary database operation

SQL> alter system switch logfile;

The system has been changed.

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.