biemond / biemond-oradb

Puppet Oracle Database Module
Apache License 2.0
59 stars 113 forks source link

Oradb::Database - 18.3 dbca failing with [DBT-11152] error #256

Open umaha01 opened 5 years ago

umaha01 commented 5 years ago

I am using oradb:database module to create 18.3 database, and after passing all the parameters the db creation from puppet is failing with below error. [FATAL] [DBT-11152] National character set specified ("AL16UTF16") is invalid

Here is my review: Upon on checking current code is passing -responseFile NO_VALUE for 18.3 Software.

Please advise.

biemond commented 5 years ago

Hi,

see https://github.com/biemond/biemond-oradb/blob/puppet4_3_data/manifests/database.pp#L264 did you specify a template and no container db is set. pdb is needs to be set with 18.

      oracle_base               => lookup('oracle_base_dir'),
      oracle_home               => lookup('oracle_home_dir'),
      version                   => lookup('dbinstance_version'),
      action                    => 'create',
      db_name                   => lookup('oracle_database_name'),
      db_domain                 => lookup('oracle_database_domain_name'),
      sys_password              => lookup('oracle_database_sys_password'),
      system_password           => lookup('oracle_database_system_password'),
      # template                  => 'dbtemplate_12.2',
      template                  => 'dbtemplate_18.3_vars',
      character_set             => 'AL32UTF8',
      nationalcharacter_set     => 'UTF8',
      sample_schema             => 'TRUE',
      memory_percentage         => 40,
      memory_total              => 1200,
      database_type             => 'MULTIPURPOSE',
      em_configuration          => 'NONE',
      data_file_destination     => lookup('oracle_database_file_dest'),
      recovery_area_destination => lookup('oracle_database_recovery_dest'),
      template_variables        => {'location01' => '/oracle/oradata/', 
                                    'location02' => '/oracle/oradata/' },
      init_params               => {'open_cursors'        => '1000',
                                    'processes'           => '600',
                                    'job_queue_processes' => '4' },
      container_database        => true,
      require                   => Db_listener['startlistener'],
    }
umaha01 commented 5 years ago

Thank you very much for quick response, this is what I am calling and our goal is to create only CDB not PDB. 18c does allow CDB creation without PDB.

  oracle_base               => lookup('ora_18320_base_dir'),
  oracle_home               => lookup('ora_18320_home_dir'),
  version                   => '18.3',
  user                      => lookup('ora_rdbms_install_user'),
  group                     => lookup('ora_rdbms_install_group'),
  download_dir              => lookup('ora_18320_rdbms_download_dir'),
  template                  => "${template_name}",
  template_variables        => { 'location01' => '/appl/oradata/' , 'location02' => '/appl/orafra/' },
  puppet_download_mnt_point => "${template_location}",
  action                    => 'create',
  db_name                   => "${db_name}",
  db_domain                 => 'oradb.albertsons.com',
  db_port                   => lookup('ora_18320_lsnr_port'),
  sys_password              => lookup('ora_18320_sys_password'),
  system_password           => lookup('ora_18320_system_password'),
  data_file_destination     => lookup('ora_18320_data_file_destination'),
  recovery_area_destination => lookup('ora_18320_recovery_area_destination'),
  character_set             => "${character_set}",
  nationalcharacter_set     => "${national_character_set}",
  #init_params               => {'db_recovery_file_dest_size'        => "$orafrasizegb" },
  memory_percentage         => 80,
  memory_total              => 2800,
  database_type             => 'MULTIPURPOSE',
  em_configuration          => 'NONE',
  storage_type              => "${db_storage_type}",
  db_snmp_password          => lookup('ora_oem_13c_db_snmp_password'),
  container_database        => true,
  automatic_memory_management => false,
}

Oradb version -> 3.0.18 Looks like below code may need little review, the else condition is kept out of the loop hence it is not using the response file section.

  if $action == 'create' {
    if ( $templatename ) {

      if ( $template_variables != undef ) {
        file { "${download_dir}/vars_${sanitized_title}.txt":
          ensure  => present,
          content => epp('oradb/dbca_vars.epp', { 'vars' => $template_variables }),
          mode    => '0775',
          owner   => $user,
          group   => $group,
          before  => Exec["oracle database ${title}"],
        }
      }

      if ( $version == '11.2' or $container_database == false ) {
        $command_pre = "${elevation_prefix}${oracle_home}/bin/dbca -silent -createDatabase -templateName ${templatename} -gdbname ${globaldb_name} -sid ${db_name} -characterSet ${character_set} -responseFile NO_VALUE -sysPassword ${sys_password} -systemPassword ${system_password} -dbsnmpPassword ${db_snmp_password} -asmsnmpPassword ${asm_snmp_password} -emConfiguration ${em_configuration} "
      } else {
        $command_pre = "${elevation_prefix}${oracle_home}/bin/dbca -silent -createDatabase -templateName ${templatename} -gdbname ${globaldb_name} -sid ${db_name} -characterSet ${character_set} -createAsContainerDatabase ${container_database} -responseFile NO_VALUE -sysPassword ${sys_password} -systemPassword ${system_password} -dbsnmpPassword ${db_snmp_password} -asmsnmpPassword ${asm_snmp_password} -emConfiguration ${em_configuration} "
      }

      if ( $template_variables != undef) {
        $command_var = " -variablesFile ${download_dir}/vars_${sanitized_title}.txt"
      } else {
        $command_var = ''
      }

      if ( $data_file_destination != undef) {
        $command_data_file = " -datafileDestination ${data_file_destination}"
      } else {
        $command_data_file = ''
      }

      if ( $init_params != undef) {
        $command_init = " -initParams ${sanitized_init_params}"
      } else {
        $command_init = ''
      }

      if ( $cluster_nodes != undef) {
        $command_nodes = " -nodelist ${cluster_nodes}"
      } else {
        $command_nodes = ''
      }

      if ( $storage_type != undef) {
        $command_storage = " -storageType ${storage_type}"
      } else {
        $command_storage = ''
      }

      $command = "${command_pre} ${command_storage} ${command_data_file} ${command_var} ${command_init} ${command_nodes} ${elevation_suffix}"

    } else {
      if ( $version in ['12.2','18.3']) {
        $command = "${elevation_prefix}${oracle_home}/bin/dbca -silent -createDatabase -responseFile ${download_dir}/database_${sanitized_title}.rsp${elevation_suffix}"
      } else {
        $command = "${elevation_prefix}${oracle_home}/bin/dbca -silent -responseFile ${download_dir}/database_${sanitized_title}.rsp${elevation_suffix}"
      }
    }

Thank you

umaha01 commented 5 years ago

Appreciate all the help you do. **Additional information:

  1. This is the Error reported during puppet execution.
  2. I have also tested using dbca using GUI, to see ensure PDB is not mandatory - We will be able to create empty CDB in 18c(i.e. PDB creation is not mandatory)
  3. I have tested dbca by passing response file (REPLACED NO_VALUE from below error), and it went to success as well**

**Notice:

/Stage[main]/Profile::Database::Oracle::Ora18320::Linux_ora_18c_database_cdbcreate/Oradb::Database[v18.3.2.0_cdb_create]/Exec[oracle database v18.3tional character set specified ("AL16UTF16") is invalid.
Error: 'su - oracle -c "/bin/ksh -c \"/oracle/18c/bin/dbca -silent -createDatabase -templateName /oracle/18c/assistants/dbca/templates/.dbt -gdbname DB1.oradb.albertsons.com -sid DB1 -characterSet AL32UTF8 -createAsContainerDatabase true -responseFile NO_VALUE -sysPassword abc123 abacda13 -asmsnmpPassword xyz123 -emConfiguration NONE   -storageType FS  -datafileDestination /data  -variablesFile /oracle/oracle.0_cdb_create.txt   \""' returned 254 instead of one of [0]**
biemond commented 5 years ago

So I think this is the issue

-templateName /oracle/18c/assistants/dbca/templates/.dbt

on this https://github.com/biemond/biemond-oradb/blob/puppet4_3_data/manifests/database.pp#L229

can you check this

umaha01 commented 5 years ago

that .dbt was a typo, the template name is thr.... Notice: /Stage[main]/Profile::Database::Oracle::Ora18320::Linux_ora_18c_database_cdbcreate/Oradb::Database[v18.3.2.0_cdb_create]/Exec[oracle database v18.3tional character set specified ("AL16UTF16") is invalid. Error: 'su - oracle -c "/bin/ksh -c \"/oracle/18c/bin/dbca -silent -createDatabase -templateName /oracle/18c/assistants/dbca/templates/template18c.var.dbt -gdbname DB1.oradb.albertsons.com -sid DB1 -characterSet AL32UTF8 -createAsContainerDatabase true -responseFile NO_VALUE -sysPassword abc123 abacda13 -asmsnmpPassword xyz123 -emConfiguration NONE -storageType FS -datafileDestination /data -variablesFile /oracle/oracle.0_cdb_create.txt \""' returned 254 instead of one of [0]

biemond commented 5 years ago

mostly you create your own template. is this yours and why on this location. /oracle/18c/assistants/dbca/templates/template18c.var.dbt is this a standard template. else it is better to remove the template and use the pre defined db

umaha01 commented 5 years ago

You are right, we have customized the template for our internal application needs and the same template configuration working fine when we execute it manually using dbca, but it is failing when we run from puppet. Anyway Thanks, and same oradb::database we are using 3.0.9 version for 12cR1 working fine, but 3.0.18 not working and now we doubt if updated code works for old db versions because this logic is removed from new code, it looks this may be causing the issue....

This section of code is different between 3.0.9 to 3.0.18. if ( $version == '11.2' or $container_database == false ) { $command_pre = "${elevation_prefix}${oracle_home}/bin/dbca -silent -createDatabase -templateName ${templatename} -gdbname ${globaldb_name} -sid ${db_name} -characterSet ${character_set} -responseFile NO_VALUE -sysPassword ${sys_password} -systemPassword ${system_password} -dbsnmpPassword ${db_snmp_password} -asmsnmpPassword ${asm_snmp_password} -storageType ${storage_type} -emConfiguration ${em_configuration} " } elsif ( $version == '12.2') { $command_pre = "${elevation_prefix}${oracle_home}/bin/dbca -silent -createDatabase -templateName ${templatename} -gdbname ${globaldb_name} -sid ${db_name} -characterSet ${character_set} -createAsContainerDatabase ${container_database} -responseFile NO_VALUE -sysPassword ${sys_password} -systemPassword ${system_password} -dbsnmpPassword ${db_snmp_password} -asmsnmpPassword ${asm_snmp_password} -storageType ${storage_type} -datafileDestination ${data_file_destination} -emConfiguration ${em_configuration} " } else { $command_pre = "${elevation_prefix}${oracle_home}/bin/dbca -silent -createDatabase -templateName ${templatename} -gdbname ${globaldb_name} -sid ${db_name} -characterSet ${character_set} -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} " }

biemond commented 5 years ago

that was because of this #197

can you check this https://github.com/biemond/biemond-oradb-vagrant-18.3-CDB-puppet4_3/blob/master/puppet/environments/development/manifests/site.pp together with the right 18.3 template https://github.com/biemond/biemond-oradb/blob/puppet4_3_data/templates/dbtemplate_18.3_vars.dbt.erb

umaha01 commented 5 years ago

Hi, I have reviewed further and i am able to complete dbca manually by passing a responsefile, where is oradb module is pulling -response_file NO_VALUE (which is part of 11g condition). Please review and advise. Not sure, if we can talk together to go-over the issue.. Thanks, Udaya

biemond commented 5 years ago

can you provide me your puppet manifest and db template. lets see if I can make it work.

shammid commented 5 years ago

I faced the same issue. Issue seems to be DBCA in 18.3 doesn't like this parameter in the template. It works if passed on the command line, so could still use NO_VALUE for response file, but this needs to be on the command line then.

'-characterset' 'AL32UTF8' '-nationalCharacterSet' 'AL16UTF16'

umaha01 commented 5 years ago

Same issue with 19c as well, and it fails with the same template error. Please advise if you have plans to fix this, any other suggestions. Thank you in advance.

Is some other workaround for this issue...please advise.