biemond / biemond-oradb

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

Adding Few DBCA options #163

Open ssubr06 opened 7 years ago

ssubr06 commented 7 years ago

Hi, I would like to have following options exposed in the parameters of this installdb.pp and need to know if I can use the templates in database.pp.. Let me know if this need to be part of templates as I knew that we can use templates for database.pp but not sure for installdb.pp as it uses rsp file..

installdb.pp

oracle.install.db.BACKUPDBA_GROUP=backupdba oracle.install.db.DGDBA_GROUP=dgdba oracle.install.db.KMDBA_GROUP=kmdba

database.pp -redoLogFileSize [-registerWithDirService <true | false> -dirServiceUserName -dirServicePassword -walletPassword ]

biemond commented 7 years ago

Hi,

I see these

#------------------------------------------------------------------------------
# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSBACKUPDBA_GROUP=<%= $group %>

#------------------------------------------------------------------------------
# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSDGDBA_GROUP=<%= $group %>

#------------------------------------------------------------------------------
# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSKMDBA_GROUP=<%= $group %>

#------------------------------------------------------------------------------
# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges.
#------------------------------------------------------------------------------
oracle.install.db.OSRACDBA_GROUP=<%= $group %>

but for database.pp you make your own dbt template or is this a dbca param or do you want to use the rsp template for this

thanks

ssubr06 commented 7 years ago

database.pp, those can be passed as a dbca param and I would like to do that as install group currently passed as param..I can also create an rsp template as well for this purpose.. let me know if you can add them as a parameters.. ?

Also let me know requested installdb.pp parameters also added..so that I can test those options..

ShriramY commented 7 years ago

Ed, When I create a database using the oradb::database template, the database get created but it create all the tablespaces such as "SYSTEM","SYSAUX","TEMP","UNDOTS" and "USERS" on a single mount point. Can you please help, how I will create these tablespaces on a different mount point in Linux. Appreciate your help.

Thanks. Shri.

biemond commented 7 years ago

Hi Shri,

have your template and use 1 of the existing ones as default.

see https://github.com/biemond/biemond-oradb/blob/puppet4_3_data/templates/dbtemplate_12.1_vars.dbt.erb#L65

you can use location02 and add that to the template vars https://github.com/biemond/biemond-oradb/blob/puppet4_3_data/manifests/database.pp#L106

template_variables => { 'location01' => '/oracle/oradata/' , 'location02' => '/oracle/oradata/' }

ShriramY commented 7 years ago

Thanks Ed.

-Shri.

ShriramY commented 7 years ago

Ed,

One more question, I am sorry to bug you again. As I said I am new to puppet. I need little more information and your help since you are the expert. I appreciate all your help in advance.

When I run # puppet agent -t from client or a target server. This will calls site.pp (using biemond/oradb module) from master server. Then it run step by step installation on the client server as provided in the module. So now my question is when it comes to "oradb::database{ 'testDb_Create':", what does puppet do in a backend which file does it check, create and invoke. For example it calls the database.pp and look for "dbtemplate_12.1_vars.dbt.erb" and than create testdb_create.rsp response file. Need this kind of information. So I can customize according to my requirement. I really do appreciate all your help.

Thanks, Shri.

biemond commented 7 years ago

You can take a look at the oradb code sometimes I check facts or check for directories

facts are generated by this https://github.com/biemond/biemond-oradb/blob/puppet4_3_data/lib/facter/oracle_database_homes.rb

I will use oraInst.loc, oratab, oraInventory, opatch etc to get all the data.

ShriramY commented 7 years ago

Thanks Ed for the information.

I am not sure I was clear when I ask this question.

I actually meant the workflow when we run "oradb::database{ 'testDb_Create':" script.

-Shri.

ShriramY commented 7 years ago

Ed,

I am struggling for more than 3 weeks with creating a 12.2.0.1 database using puppet with the below issues. I do appreciate your help in advance.

Here is my oradb:installdb -

oradb::installdb{ '12.2_Linux-x86-64': version => '12.2.0.1', file => 'linuxx64_12201_database', database_type => 'EE', oracle_base => '/oracle', oracle_home => '/oracle/product/12.2/db', bash_profile => true, user => 'oracle', group => 'dba', group_install => 'oinstall', group_oper => 'oper', download_dir => '/data/install', zip_extract => true, puppet_download_mnt_point => '/software', }

My Oracle software binaries is under /software on a master server -

ls -al /software/linuxx64_12201_database.zip

-rwxrwxrwx 1 root root 3453696911 Jun 7 10:10 /software/linuxx64_12201_database.zip

When I run "puppet agent -t" on the target server I am getting the below error message - Look's like the oracle software binaries is not getting remotely copied on the target server under /data/install location. Please help me to resolve the issues.

Error: /Stage[main]/Main/Oradb::Installdb[12.2_Linux-x86-64]/File[/data/install/linuxx64_12201_database.zip]: Could not evaluate: Could not retrieve information from environment production source(s) file:/software/linuxx64_12201_database.zip Notice: /Stage[main]/Main/Oradb::Installdb[12.2_Linux-x86-64]/Exec[extract /data/install/linuxx64_12201_database.zip]: Dependency File[/data/install/linuxx64_12201_database.zip] has failures: true Warning: /Stage[main]/Main/Oradb::Installdb[12.2_Linux-x86-64]/Exec[extract /data/install/linuxx64_12201_database.zip]: Skipping because of failed dependencies

biemond commented 7 years ago

Hi,

you need to create a nfs share with software on all servers or upload them to oradb puppet module files folder on the master and change the puppet_download_mnt_point

but it is better to make a share or copy all binaries to all the servers.

ShriramY commented 7 years ago

Ed,

I tried with having oracle binary on oradb puppet module files folder too. It did not work. maybe I am not having Oracle binaries in the right puppet_download_mnt_point. Here is what I have -

cd /etc/puppetlabs/code/environments/production/modules/oradb

ls -al linux

-rwxrwxrwx 1 e526435a users 3453696911 Jun 7 10:10 linuxx64_12201_database.zip

My Installdb module -


$puppet_download_mnt_point = "oradb/"

oradb::installdb{ '12.2.0.1_Linux-x86-64':
  version                   => '12.2.0.1',
  file                      => 'linuxx64_12201_database',
  database_type             => 'EE',
  oracle_base               => '/oracle',
  oracle_home               => '/oracle/product/12.2/db',
  bash_profile              => true,
  user                      => 'oracle',
  group                     => 'dba',
  group_install             => 'oinstall',
  group_oper                => 'oper',
  download_dir              => '/data/install',
  zip_extract               => true,
  puppet_download_mnt_point => $puppet_download_mnt_point,
}

I am getting this error not copying the binaries on the target -
Error: Failed to apply catalog: Parameter source failed on File[/data/install/linuxx64_12201_database.zip]: Cannot use relative URLs 'oradb//linuxx64_12201_database.zip' at /etc/puppetlabs/code/environments/production/modules/oradb/manifests/installdb.pp:146

Please help.

Thanks,
Shri.
biemond commented 7 years ago

can you check if this works

puppet:///modules/oradb/

ShriramY commented 7 years ago

Sorry no luck. It didn't work.

Here is what I did -

$puppet_download_mnt_point = "puppet:///modules/oradb/"

oradb::installdb{ '12.2.0.1_Linux-x86-64': version => '12.2.0.1', file => 'linuxx64_12201_database', database_type => 'EE', oracle_base => '/oracle', oracle_home => '/oracle/product/12.2/db', bash_profile => true, user => 'oracle', group => 'dba', group_install => 'oinstall', group_oper => 'oper', download_dir => '/data/install', zip_extract => true, puppet_download_mnt_point => $puppet_download_mnt_point, }

Oracle binaries software location - cd /etc/puppetlabs/code/environments/production/modules/oradb ls linu* linuxx64_12201_database.zip

Error - Error: /Stage[main]/Main/Oradb::Installdb[12.2.0.1_Linux-x86-64]/File[/data/install/linuxx64_12201_database.zip]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/oradb//linuxx64_12201_database.zip

biemond commented 7 years ago

Put them under directory files of the oradb modules

ShriramY commented 7 years ago

Thanks Ed, I do appreciate all your help and for your valuable time. It worked this time and passed the installation steps. But now getting different error while running a create database modules -

oradb::database{ 'testDb_Create': oracle_base => '/oracle', oracle_home => '/oracle/product/12.2/db', version => '12.2', user => 'oracle', group => 'dba', template => 'dbtemplate_12.2', download_dir => '/data/install', action => 'create', db_name => 'HONDB', db_domain => 'honeywell.com', db_port => 1521, sys_password => 'Welcome01', system_password => 'Welcome01', data_file_destination => "/oracle/oradata", recovery_area_destination => "/oracle/flash_recovery_area", character_set => "AL32UTF8", nationalcharacter_set => "UTF8", memory_percentage => 40, memory_total => 800, require => Oradb::Listener['start listener'], }

Error - Error: su - oracle -c "/bin/ksh -c \"/oracle/product/12.2/db/bin/dbca -silent -createDatabase -templateName /data/install/dbtemplate_12.2_testDb_Create.dbt -gdbname HONDB.honeywell.com -sid HONDB -characterSet AL32UTF8 -responseFile NO_VALUE -sysPassword Welcome01 -systemPassword Welcome01 -dbsnmpPassword Welcome01 -asmsnmpPassword Welcome01 -storageType FS -emConfiguration NONE -variablesFile /data/install/vars_testDb_Create.txt \"" returned 254 instead of one of [0]

Error: /Stage[main]/Main/Oradb::Database[testDb_Create]/Exec[oracle database testDb_Create]/returns: change from notrun to 0 failed: su - oracle -c "/bin/ksh -c \"/oracle/product/12.2/db/bin/dbca -silent -createDatabase -templateName /data/install/dbtemplate_12.2_testDb_Create.dbt -gdbname HONDB.honeywell.com -sid HONDB -characterSet AL32UTF8 -responseFile NO_VALUE -sysPassword Welcome01 -systemPassword Welcome01 -dbsnmpPassword Welcome01 -asmsnmpPassword Welcome01 -storageType FS -emConfiguration NONE -variablesFile /data/install/vars_testDb_Create.txt \"" returned 254 instead of one of [0]

Looks like it is looking for storageType additional parameter, I got this error while I ran from command prompt -

$ /oracle/product/12.2/db/bin/dbca -silent -createDatabase -templateName /data/install/dbtemplate_12.2_testDb_Create.dbt -gdbname HONDB.honeywell.com -sid HONDB -characterSet AL32UTF8 -responseFile NO_VALUE -sysPassword Welcome01 -systemPassword Welcome01 -dbsnmpPassword Welcome01 -asmsnmpPassword Welcome01 -storageType FS -emConfiguration NONE -variablesFile /data/install/vars_testDb_Create.txt

[INS-04008] Invalid combination of arguments passed from command line. One or more mandatory dependent arguments are not passed for the argument: -storageType

On Wed, Jun 14, 2017 at 12:47 PM, Edwin Biemond notifications@github.com wrote:

Put them under directory files of the oradb modules

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/biemond/biemond-oradb/issues/163#issuecomment-308341790, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab2AANvgdPTEjL2KN7r7PdOvpTtvcIlqks5sD4klgaJpZM4NiyP2 .

-- Thanks, Shriram.

biemond commented 7 years ago

I see -storageType FS but with 12.2 I guess container database should be true. So maybe I need to check this or auto set this to true when version is >= 12.2

This works for me https://github.com/biemond/biemond-oradb-vagrant-12.2-CDB-puppet4_3/blob/master/puppet/environments/development/manifests/site.pp#L149

ShriramY commented 7 years ago

Thanks Ed, It worked this time. Appreciate all your help.

Can you please recommend Oracle database RMAN backup modules. So far I have not found in puppet forge.

Thanks, Shri.

biemond commented 7 years ago

Great

yesterday I fixed your 12.2 container issue and fixed double variables parameters on dbca. I pushed a new version

I don't think there are opensource ones

ShriramY commented 7 years ago

Ed,

Sorry to bug you again. Now I am trying to create using variable template, but getting error. Please verify if I am doing the right thing ...

My oradb:database -

oradb::database{ 'testDb_Create': oracle_base => '/oracle', oracle_home => '/oracle/product/12.2/db', version => '12.2', user => 'oracle', group => 'dba', template => 'dbtemplate_12.2_vars', template_variables => { 'location01' => '/oradata/' , 'location02' => '/oraidx/' } download_dir => '/software', action => 'create', db_name => 'TESTDB', db_domain => 'oracle.com', db_port => 1521, sys_password => 'Welcome01', system_password => 'Welcome01', data_file_destination => "/oracle/oradata", recovery_area_destination => "/oracle/flash_recovery_area", character_set => "AL32UTF8", nationalcharacter_set => "UTF8", memory_percentage => 40, memory_total => 800, require => Oradb::Listener['start listener'], }

Getting a syntax Error - Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not parse for environment production: Syntax error at 'download_dir' at /etc/puppetlabs/code/environments/production/manifests/site.pp:167:3

Not sure what I am doing wrong .. Please help.

biemond commented 7 years ago

template_variables => { 'location01' => '/oradata/' , 'location02' => '/oraidx/' } , <----- add a comma download_dir => '/software',

ShriramY commented 7 years ago

Oops Thanks for pointing out.

Ed, It worked, but the problem is it created all the tablespaces datafiles not on the location that I have specified. It created all the datafiles under data_file_destination which is => "/oracle/oradata".

$ pwd /oracle/oradata/TESTDB $ ls -al -rw-r----- 1 oracle oinstall 10600448 Jun 16 17:17 control01.ctl -rw-r----- 1 oracle oinstall 10600448 Jun 16 17:17 control02.ctl -rw-r----- 1 oracle oinstall 524288512 Jun 16 17:10 redo0101.log -rw-r----- 1 oracle oinstall 524288512 Jun 16 17:10 redo0102.log -rw-r----- 1 oracle oinstall 524288512 Jun 16 17:17 redo0201.log -rw-r----- 1 oracle oinstall 524288512 Jun 16 17:17 redo0202.log -rw-r----- 1 oracle oinstall 524288512 Jun 16 17:07 redo0301.log -rw-r----- 1 oracle oinstall 524288512 Jun 16 17:07 redo0302.log -rw-r----- 1 oracle oinstall 524288512 Jun 16 17:07 redo0401.log -rw-r----- 1 oracle oinstall 524288512 Jun 16 17:07 redo0402.log -rw-r----- 1 oracle oinstall 576724992 Jun 16 17:17 sysaux01.dbf -rw-r----- 1 oracle oinstall 734011392 Jun 16 17:17 system01.dbf -rw-r----- 1 oracle oinstall 2147491840 Jun 16 17:17 temp01.dbf -rw-r----- 1 oracle oinstall 2147491840 Jun 16 17:17 undotbs01.dbf

Not sure what is going wrong .. :(

ShriramY commented 7 years ago

Ed, One more thing I noticed .. While running with template_variables the database.pp is creating a two times variablefiles in the dbca silent installation command.

Error: /Stage[main]/Main/Oradb::Database[testDb_Create]/Exec[oracle database testDb_Create]/returns: change from notrun to 0 failed: su - oracle -c "/bin/ksh -c \"/oracle/product/12.2/db/bin/dbca -silent -createDatabase -templateName /software/dbtemplate_12.2_vars_testDb_Create.dbt -gdbname HONDB.honeywell.com -sid HONDB -characterSet AL32UTF8 -responseFile NO_VALUE -sysPassword Welcome01 -systemPassword Welcome01 -dbsnmpPassword Welcome01 -asmsnmpPassword Welcome01 -storageType FS -datafileDestination /oracle/oradata -emConfiguration NONE -variablesFile /software/vars_testDb_Create.txt -variablesFile /software/vars_testDb_Create.txt

Which is throwing an error - Repetition of command line argument is not supported: -variablesFile.

Hope this helps ..

biemond commented 7 years ago

this is fixed yesterday, I also noticed. get the latest one

ShriramY commented 7 years ago

Great .. Ed, All looks good only one thing I noticed was with template_variables all the control files get's created under only one location that is location01. Rest all the datafiles are distributed according to the specification that I gave. Not sure why all the control files did not get distributed in spite of specifying to multiple location. Can you please check.

Thanks Again, Shri.

ShriramY commented 7 years ago

Ed, One more thing I found in the init.ora file and spfile that the control_files parameter have missing space. Here is how it looks -

$ ls -al /oracle/admin/TESTDB/pfile
-rw-r----- 1 oracle oinstall 1571 Jun 16 19:47 init.ora.516201720339
$ cat init.ora.516201720339 | grep -i control
control_files=("/oradata//TESTDB/control01.ctl", "/oradata//TESTDB/control02.ctl", "/oradata//TESTDB/control03.ctl")

And similar spfile -
*.control_files='/oradata//TESTDB/control01.ctl','/oradata//TESTDB/control02.ctl','/oradata//TESTDB/control03.ctl'

Thanks, Shri.

biemond commented 7 years ago

what missing space and the datafiles are on the right location. At least the vars are picked up.

ShriramY commented 7 years ago

Ed, I have specified 3 different location to create the control file in template_variable, but it did not take. All the control file was created on /oradata somehow it did not take the other location. Also in the init.ora and spfileSID.ora, the control file path was incorrect with a missing variable in between oradata & SID path like such as /oradata/ /TESTDB/

control_files=("/oradata//TESTDB/control01.ctl", "/oradata//TESTDB/control02.ctl", "/oradata//TESTDB/control03.ctl")

ShriramY commented 7 years ago

Hi Ed, Did you get a chance to look into the control file creation issues.

Thanks, Shri.

biemond commented 7 years ago

I don't see anything in the documentation, so you should create a DB by hand, make a testcase and raise a Oracle support call.