Code Monkey home page Code Monkey logo

Comments (9)

biemond avatar biemond commented on June 18, 2024

I never tried this , but you can look at these ones dbtemplate dbt for 11g and 12c https://github.com/biemond/biemond-oradb/tree/master/templates and see the differences.

do you have an example of this

from biemond-oradb.

chandragarapati avatar chandragarapati commented on June 18, 2024

Yes, I can see there are differences in the ones that oracle provides and the ones here. I'm using *.dbc template (Which contains both the structure and the physical datafiles).

https://docs.oracle.com/cd/E24628_01/install.121/e22624/appdx_seed_db_template.htm#EMBSC242

Is there a possibility to include *.dbc extension capability in the database.pp class? Right now, it is hard coded to use only *.dbt.erb only. I've tried renaming my *.dbc to *.dbt format and then actual dbca command fails as there is difference between both the formats.

+++ hard coded in database.pp +++
if ( $template ) {
$templatename = "${download_dir}/${template}_${sanitized_title}.dbt"
file { $templatename:
ensure => present,
content => template("${mountPoint}/${template}.dbt.erb"),
mode => '0775',
owner => $user,
group => $group,
before => Exec["oracle database ${title}"],
}
}
++++

from biemond-oradb.

biemond avatar biemond commented on June 18, 2024

there is a diffence between dbc and dbt
.dbc - Database Clone (for a new database)
.dbt - Template Database (for an existing database)

so without template I use the demo templates such as Data_Warehouse.dbc, General_Purpose.dbc, Transaction_Processing.dbc, and New_Database.dbt

this is really fast but with dbt it creates it from nothing and is basically no clone.

for dbc I probably only need to know the location of dbc (probably all on 1 vm) and its dbca parameters. This shouldn't be that hard.

from biemond-oradb.

chandragarapati avatar chandragarapati commented on June 18, 2024

Appreciate for your quick response! You are right..!

You may download the Oracle provided preconfigured repository template zip from OTN and extract it to a location accessible :
http://www.oracle.com/technetwork/oem/enterprise-manager/downloads/db-templates-2205022.html

I've tried the dbca manually using the already existing parameters in database.pp for 12.1 DB version and it worked like a charm.

dbca -silent -createDatabase -templateName /opt/oracle/product/12.1.0/dbhome_1/assistants/dbca/templates/12.1.0.2.0_Database_Template_for_EM12_1_0_5_0_Small_deployment.dbc -gdbname XXXX -responseFile NO_VALUE -sysPassword XXXX -systemPassword XXXX -dbsnmpPassword XXXX -asmsnmpPassword XXXX -storageType FS -emConfiguration NONE

++++ Actual command from database.pp ++++
$command = "${oracle_home}/bin/dbca -silent -createDatabase -templateName ${templatename} -gdbname ${globaldb_name} -createAsContainerDatabase ${container_database} -responseFile NO_VALUE -sysPassword ${sys_password} -systemPassword ${system_password} -dbsnmpPassword ${db_snmp_password} -asmsnmpPassword ${asm_snmp_password} -storageType ${storage_type} -emConfiguration ${em_configuration}"
+++++

from biemond-oradb.

biemond avatar biemond commented on June 18, 2024

oh nice,

that looks easy to add.
👍

from biemond-oradb.

edestecd avatar edestecd commented on June 18, 2024

How about allowing to set the $templatename via param, so we can reference a dbc file that we placed.

With dbc you likely also have sql and data files, so a single template is not sufficient. When $templatename is specified then no template is managed...

if ( !$templatename and $template ) {
    $templatename = "${download_dir}/${template}_${sanitized_title}.dbt"
    file { $templatename:
      ensure  => present,
      content => template("${mountPoint}/${template}.dbt.erb"),
      mode    => '0775',
      owner   => $user,
      group   => $group,
      before  => Exec["oracle database ${title}"],
    }
  }

  if $action == 'create' {
    if ( $templatename ) {
      if ( $version == '11.2' or $container_database == false ) {
        $command = "${oracle_home}/bin/dbca -silent -createDatabase -templateName ${templatename} -gdbname ${globaldb_name} -responseFile NO_VALUE -sysPassword ${sys_password} -systemPassword ${system_password} -dbsnmpPassword ${db_snmp_password} -asmsnmpPassword ${asm_snmp_password} -storageType ${storage_type} -emConfiguration ${em_configuration}"
      } else {
        $command = "${oracle_home}/bin/dbca -silent -createDatabase -templateName ${templatename} -gdbname ${globaldb_name} -createAsContainerDatabase ${container_database} -responseFile NO_VALUE -sysPassword ${sys_password} -systemPassword ${system_password} -dbsnmpPassword ${db_snmp_password} -asmsnmpPassword ${asm_snmp_password} -storageType ${storage_type} -emConfiguration ${em_configuration}"
      }
    } else {
      $command = "${oracle_home}/bin/dbca -silent -responseFile ${download_dir}/database_${sanitized_title}.rsp"
    }

from biemond-oradb.

edestecd avatar edestecd commented on June 18, 2024

@biemond what were your thoughts on adding support for dbc or specifically the em dbc?

from biemond-oradb.

biemond avatar biemond commented on June 18, 2024

look ok, maybe we should use template_seeded as database.pp param and use $templatename internally which can handle dbt and dbc

Send me a Pull Request so you can have the credits

from biemond-oradb.

edestecd avatar edestecd commented on June 18, 2024

Will do

from biemond-oradb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.