1Z0-052 · Question #230
You need to rename a data file of a tablespace. How would you perform this?
The correct answer is C. take the tablespace that contains the data file offline, rename the data file using the operating. To rename a datafile online, you must take only the affected tablespace offline, rename the file at the OS level, then synchronize Oracle's control file using ALTER TABLESPACE ... RENAME DATAFILE.
Question
You need to rename a data file of a tablespace. How would you perform this?
Options
- Abring the database to the NOMOUNT state, rename the data file using the operating system, and
- Btake the tablespace that contains the data file offline, rename the data file using the operating
- Ctake the tablespace that contains the data file offline, rename the data file using the operating
- Dmake the tablespace that contains the data file read only, rename the data file using the operating
How the community answered
(51 responses)- A4% (2)
- B14% (7)
- C76% (39)
- D6% (3)
Why each option
To rename a datafile online, you must take only the affected tablespace offline, rename the file at the OS level, then synchronize Oracle's control file using ALTER TABLESPACE ... RENAME DATAFILE.
Placing the database in NOMOUNT state is used for control file creation or restoration and takes the entire database offline, which is unnecessarily disruptive for renaming a single tablespace datafile.
This option is incorrect because it omits the required ALTER TABLESPACE ... RENAME DATAFILE command, leaving Oracle's control file pointing to the old, now non-existent path after the OS rename.
Taking the tablespace offline ensures no I/O occurs against the datafile while the OS-level rename is performed, preventing corruption. After the rename, the command ALTER TABLESPACE tablespace_name RENAME DATAFILE 'old_path' TO 'new_path' updates the control file and data dictionary so Oracle resolves the correct file location. The tablespace can then be brought back online without requiring a full database restart.
Setting the tablespace to read-only does not prevent Oracle from referencing the datafile and does not safely stop I/O against the file, making the OS-level rename unsafe.
Concept tested: Renaming a tablespace datafile using ALTER TABLESPACE RENAME DATAFILE
Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/admin/managing-data-files-and-temp-files.html
Topics
Community Discussion
No community discussion yet for this question.