How do i create a database template from the command line?
Hi,
As part of implementing a backup and recovery strategy for a client (including disaster recovery) I want to automate the creation of a database template From an Existing Database (Structure as well as data) via a script that will run every night.
The background to this is that we will also be using RMAN to take backups of the database concerned but the client does not want to wait while an RMAN backup is restored and so wants an additional level of insurance in the form of a ‘standby’ clone database.
The idea is that nightly we will run a script that creates a database template from the Existing Database (Structure as well as data) and then transfers the 2 files involved e.g. DB_data_included.dbc and DB_data_included.DFB across to a standby server where they can be used to recreate the database in the event of us needing to after e.g. a complete server failure.
So I have a couple of questions about this that I would be very grateful if something could answer for me:
1) Is it possible? That is, can a database template be created from some utility by supplying a series of parameter=value pairs on the command line?
2) If yes how do I go about it, what utility do I use (the emca utility?). and what parameters do I need to supply on the command line to create the template?
3) The intention is that the script to create the template will run in the early hours of the morning when no-one is using the database but what state does the database need to be in when the template creation script runs i.e. up, down, mounted and does the creation of a template affect the state of an already up database i.e. if I kick off the template creation script and the database is up will it switch it into mount mode or anything like that? My concern here is that I want to make sure I understand exactly what is going on so that no users or connected external systems are affected?
Thanks in anticipation of someone being able to guide me on what to do or what documentation to read.
Also if you require any clarification on what i'm asking please post up your query and i'll respond ASAP.
Kind Regards,
George Johnston
OCP 9i DBA