Requirement: To clone an existing test database for the application team on the same database server with a planned downtime window for the test database.
Solution: The test database can be cloned by using the traditional cold backup technique, which is as follows -
1. Collect metadata (information about the control file trace, data files, temp files and online redo log files) about the test database using SQL*Plus.
2. Create a pfile for the new database, which will be cloned from the existing test database.
3. Perform a clean shutdown of the test database on the database server.
4. Perform an image copy of the test database files to the corresponding new locations.
5. Startup the new database in NOMOUNT mode.
6. Create the control file of the new database.
7. Open the new database using the RESETLOGS option.
8. Create the tempfile(s) of the new database.
9. Create the spfile of the new database, and bounce the new database.
10. Create the listener entry and TNS entry for the new database, and register the database with the listener.
11. Add the database instance entry to the oratab file.
12. Startup the existing test database on the database server.
Kindly note that the above technique cannot be used in a production environment unless an outage window has been agreed with the customer. In a production environment, we generally use the RMAN Active Duplication technique to clone a database, which is mostly in ARCHIVELOG mode.
Total Duration: 1-2 Hour(s)
Solution: The test database can be cloned by using the traditional cold backup technique, which is as follows -
1. Collect metadata (information about the control file trace, data files, temp files and online redo log files) about the test database using SQL*Plus.
2. Create a pfile for the new database, which will be cloned from the existing test database.
3. Perform a clean shutdown of the test database on the database server.
4. Perform an image copy of the test database files to the corresponding new locations.
5. Startup the new database in NOMOUNT mode.
6. Create the control file of the new database.
7. Open the new database using the RESETLOGS option.
8. Create the tempfile(s) of the new database.
9. Create the spfile of the new database, and bounce the new database.
10. Create the listener entry and TNS entry for the new database, and register the database with the listener.
11. Add the database instance entry to the oratab file.
12. Startup the existing test database on the database server.
Kindly note that the above technique cannot be used in a production environment unless an outage window has been agreed with the customer. In a production environment, we generally use the RMAN Active Duplication technique to clone a database, which is mostly in ARCHIVELOG mode.
Total Duration: 1-2 Hour(s)