Home » RDBMS Server » Server Utilities » Script for creating template?
Script for creating template? [message #72632] Mon, 11 August 2003 13:01 Go to next message
Sid
Messages: 38
Registered: May 1999
Member
Is there any way to write a script that would automate the generation of an Oracle template?

I am guessing it is possible to do this because when you create a template using the Oracle Database Configuratio Assistant, it runs a SQL*Plus window in the background.

I ask this because this would be a preferable way for us to backup our database. Currently we backup the database by backing up the datafiles, control files, etc. but recovering from such a backup is a pain.

Any input is HIGHLY appreciated!!!

Thanks,
Sid

PS: We're using Oracle 9
Re: Script for creating template? [message #72634 is a reply to message #72632] Tue, 12 August 2003 05:50 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
what are the functionalities u are expecting from the 'Oracle template'?
BECAUSE , dbca templates are just 'create database scripts' along with path locators.

if you are looking for SUCH  script, which gives the current location of datafiles, use

> alter database backup controlfile to trace;

which will create a text file (.trc) in ur $ORACLE_BASE/admin/< sid > /udump

again, it is just a text file. how can u use it for 
backup?

Re: Script for creating template? [message #72636 is a reply to message #72634] Tue, 12 August 2003 07:56 Go to previous messageGo to next message
Sid
Messages: 38
Registered: May 1999
Member
Mahesh,

First of all, thank you so much for your reply. You are being generous by sharing your knowledge, and I appreciate it.

When I say "create a template" I am talking about the process of creating an Oracle template using the Oracle Database Configuratio Assistant in a Windows environment. The sequence of steps is:
1. Open the Oracle Database Configuration Assistant
2. Choose the option "Manage Templates"
3. Choose the option "Create a database template" and the sub-option under it of "From an existing database (structure as well as data)"
4. Specify the instance name, username and password
5. Specify the template name (say TEST)
...etc.

At this point Oracle launches a process that creates two files located in C:oracleora90assistantsdbcatemplates. The files are called TEST.dfj and TEST.dbc.

This is the process I want to automate. This is useful to us for backups because it is very easy to create a database in any machine from the above two files.

Is this possible?

Thanks in advance,
Sid

PS: As you can probably tell by my language, I am not much of a DBA, I'm more of a PL/SQL and front-end programmer :-)
Re: Script for creating template? [message #72637 is a reply to message #72636] Tue, 12 August 2003 09:09 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
first i am not sure, whether this would be a valid 'backup / restore strategy'.
I have not done this before so , i give no comment on that.
There are options for silent installation of oracle software, without gui.
I have no idea about DBCA taking command line parameters.
if it would, there might be a way to automate this.

the .dbt file is just an xml template.
which is generated from alter database backup controlf ile, and contents of init< sid >.ora

Previous Topic: Fall 2003 Atlantic Oracle Training Conference (OTC)
Next Topic: Import not working....
Goto Forum:
  


Current Time: Tue May 28 22:18:13 CDT 2024