A database template is valid for a specific Oracle version and Operating System (OS). When you install and configure a new database, it must be configured according to Primavera® Portfolio Management standards.
- Create an init.ora using any of the following methods:
- If the database uses pfile (
), copyinit.ora
frominit.ora
to%ORACLE_BASE%\admin\<SID>\pfile
%ORACLE_HOME%\database\init<SID>.ora.
For example, copy
toC:\oracle\product\11.2.0\admin\ORCL\pfile\init.ora
C:\oracle\product\11.2.0\db_1\database\initORCL.ora.
- If the database uses an spfile:
- Use the
command to automatically create the pfile in the default directory, (ORACLE_HOME\database):create pfile from spfile
sqlplus “sys/<password> as sysdba”
create pfile from spfile;
shutdown immediate
- Rename the spfile.
For example,
ren C:\oracle\product\110.2.0\db_1\database\SPFILEORCL.ORA
C:\oracle\product\110.2.0\db_1\database\SPFILEORCL.ORA.BAK
- Use the
- If the database uses pfile (
- Start the database.
sqlplus "sys / <password> as sysdba"
startup
- Resize undo tablespace to 1024M. For example:
sqlplus “sys/<password> as sysdba”
-- Find UNDO tablespace name
select tablespace_name from dba_tablespaces where tablespace_name like 'UNDO%';
-- Find UNDO tablespace datafile
select file_name, bytes from dba_data_files where tablespace_name = 'UNDOTBS1';
-- Resize the UNDO Tablespace datafile to 1G
alter database datafile 'C:\APP\QALAB\ORADATA\ORCL\UNDOTBS01.DBF' resize 1024M;
- Run the dbca utility to create a template of the database.
dbca -silent -createCloneTemplate -sourceDB <SID> -sysDBAUserName sys -sysDBAPassword <SYS_PASSWD> -templateName <VERSION> -datafileJarLocation <LOCATION>
Where:
Oracle SID of existing database installed in the previous step. For example,<SID>:
ORCL
: A password of sys user. For example,<SYS_PASSWD>
oracle.
: A template name. For example,<VERSION>
11.210.2.
: A location where the compressed datafiles will be transferred. For example,<LOCATION>
“C:\Program Files\Oracle\Primavera Portfolio Management\Portfolios\misc\ocu”
- Check for the errors in the log file,
.<ORACLE_HOME>\cfgtoollogs\dbca\silentN.log
dbca -silent -createCloneTemplate -sourceDB ORCL -sysDBAUserName sys -sysDBAPassword oracle -templateName 11.2.0.4 -datafileJarLocation
“C:\Program Files\Oracle\Primavera Portfolio Management\Portfolios\misc\ocu”
The following files will be created:
- A template file:
<ORACLE_HOME>\assistants\dbca\templates\11.2.0.4.DBC
- A data file:
C:\Program Files\Oracle\Primavera Portfolio Management\Portfolios\misc\sql\PS11.2.DFB
- A control file:
C:\Program Files\Oracle\Primavera Portfolio Management\Portfolios\misc\sql\PS11.2.CTL
- A template file:
- Test the created database templates.
- Delete the existing instance as follows:
oradim –delete –sid <SID>
Where:
: Oracle SID of the existing database. For example,<SID>
.ORCL
- Create a new database using the previously created template as follows:
dbca -silent -createDatabase -templateName <VERSION> -gdbname <SID> -sid <SID> -sysPassword <SYS_PASSWD> -systemPassword <SYSTEM PASSWD> -continueOnNonFatalErrors true -datafileJarLocation <LOCATION>
Where:
: A template name. For example,<VERSION>
11.2.0.4.
: Oracle SID of a new database. For example,<SID>
.ORCL
: A location of the compressed datafiles. For example,<LOCATION>
“C:\Program Files\Oracle\Primavera Portfolio Management\Portfolios\misc\ocu”.
- Check for the errors in the log file,
<ORACLE_HOME>\cfgtoollogs\dbca\<ORACLE_SID>\<ORACLE_SID>.log
dbca -silent -createDatabase -templateName 11.2.0.4-gdbname ORCL -sysPassword oracle -systemPassword manager -sid ORCL -continueOnNonFatalErrors true -datafileJarLocation
“C:\Program Files\Oracle\Primavera Portfolio Management\Portfolios\misc\ocu”