ansible-oracle icon indicating copy to clipboard operation
ansible-oracle copied to clipboard

How to create 12c db instead of 18c

Open onenessboy opened this issue 7 years ago • 10 comments

Hi

I see lot of changes/improvements with respect to prior versions. I have run the code...It went fine till installation of db and then failed with FAILED! => {"changed": true, "cmd": "/u01/app/oracle/18.3.0.0/db1-base/runInstaller -responseFile /u01/stage/rsp/18300-base_abora.rsp .. I understand by default it will install 18.3.0 But i want to install 12.1.02.. Do I need to pass version also as a parameter to playbook, however I dont see such notes for usage instruction... Can you please help how to install and configure 12.1.02

onenessboy avatar Sep 15 '18 16:09 onenessboy

At least my experience with 12.2 seems to be a bug. Dbca uses crs_stat which was obsolete with 11.2 and has been removed with 18c. I tried a workaround with a crs_stat emulation. But this only worked in interactive mode :(

stelb avatar Sep 15 '18 17:09 stelb

thanks stelb for reply..unfortunately we still use 12c not yet upgraded.. there were lot of changes done in repository (at that time code does not had 18 c version).. huh..figuring our how to make this code to install 12c

onenessboy avatar Sep 15 '18 18:09 onenessboy

for make it run for 12c. Placed 12c binaries into tmp and enabled (uncommented) is_local_copy : true but still below task is not getting executed in play

  • name: install-home-db | Transfer oracle installfiles to server (local) copy: src={{ oracle_sw_source_local }}/{{ item[0].filename }} dest={{ oracle_stage }} mode=775 force=no with_nested: - "{{oracle_sw_image_db}}" - "{{db_homes_installed}}" become: yes become_user: "{{ oracle_user }}" run_once: "{{ configure_cluster}}" when: item[0].version == db_homes_config[item[1].home]['version'] and item[1].state|lower == 'present' and is_sw_source_local and oracle_sw_copy tags: - oradbsw

onenessboy avatar Sep 15 '18 19:09 onenessboy

I had also some trouble with mixed installations with 18.3 and 12.2 on the same host but I hadn't enough time to test it more in detail. Could you post the variable definitions for:

  • db_homes_config
  • db_homes_installed
  • oracle_databases

I had a copy & paste error in a configuration and was wondering about stupid installations. The flexibility of the new configuration style has the small drawback of increased possibility for configuration issues but it allows needed and interesting configurations for the future.

Rendanic avatar Sep 16 '18 18:09 Rendanic

Hi Rendanic,

Actually I did not install 18c at all.. All my idea to just install 12c. I just added inventory to ansible/host, placed binaries in /tmp.

commented unnecessary binaries in /home/cloud-user/ansible-oracle/roles/oraswdb-install/defaults/main.yml (as I needed only 12c)

oracle_sw_image_db: # - { filename: LINUX.X64_180000_db_home.zip, version: 18.3.0.0, creates: 'install/.img.bin' } # - { filename: linuxx64_12201_database.zip, version: 12.2.0.1, creates: 'database/runInstaller' } - { filename: linuxamd64_12102_database_1of2.zip, version: 12.1.0.2, creates: 'database/stage/sizes/oracle.server.Custom.sizes.properties' } - { filename: linuxamd64_12102_database_2of2.zip, version: 12.1.0.2, creates: 'database/install/.oui' } # - { filename: linuxamd64_12c_database_1of2.zip, version: 12.1.0.1, creates: 'database/runInstaller' } # - { filename: linuxamd64_12c_database_2of2.zip, version: 12.1.0.1, creates: 'database/runInstaller' } # - { filename: p13390677_112040_Linux-x86-64_1of7.zip, version: 11.2.0.4, creates: 'database/install/resource/cons_zh_TW.nls' } # - { filename: p13390677_112040_Linux-x86-64_2of7.zip, version: 11.2.0.4, creates: 'database/stage/Components/oracle.db/11.2.0.4.0/1/DataFiles/filegroup18.jar' } # - { filename: p10404530_112030_Linux-x86-64_1of7.zip, version: 11.2.0.3, creates: 'database/readme.html'} # - { filename: p10404530_112030_Linux-x86-64_2of7.zip, version: 11.2.0.3, creates: 'database/stage/Components/oracle.sysman.console.db/11.2.0.3.0/1/DataFiles/filegroup2.jar' }

db_homes_config:

db_homes_config: 18300-base: home: db1-base version: 18.3.0.0 edition: EE 12201-base: home: db1-base version: 12.2.0.1 edition: EE 12201-180717: home: db1-180717 version: 12.2.0.1 edition: EE opatch_minversion: 12.2.0.1.12 opatchauto: - patchid: 28183653 patchversion: 12.2.0.1.180717 state: present subpatches: - 28163133 - 28163190 opatch: []

In below I have mentioned 18c and 12201-180717 as absent (changed it to absent) to make it for only 12c db_homes_installed: - home: 18300-base apply_patches: False state: absent - home: 12201-base apply_patches: False state: present - home: 12201-180717 apply_patches: True state: absent

Oracle_databases oracle_databases: # Dictionary describing the databases to be installed - home: 12201-base # 'Last' directory in ORACLE_HOME path (e.g /u01/app/oracle/12.1.0.2/racdb) # The edition of database-server (EE,SE,SEONE) oracle_db_name: orcl # Database name oracle_db_type: SI # Type of database (RAC,RACONENODE,SI) is_container: False # (true/false) Is the database a container database pdb_prefix: pdb num_pdbs: 1 storage_type: FS # Database storage to be used. ASM or FS. oracle_db_mem_totalmb: 1024 # Amount of RAM to be used for SGA + PGA oracle_database_type: MULTIPURPOSE # MULTIPURPOSE|DATA_WAREHOUSING|OLTP redolog_size: 100M redolog_groups: 3 archivelog: False flashback: False force_logging: False listener_name: LISTENER state: present # present | absent

Any suggestion please.

onenessboy avatar Sep 17 '18 03:09 onenessboy

Hi, @onenessboy, what is the actual problem you're having right now?

  • Files are not being copied from the controlmachine to the target?
  • Database fails to be created?
  • Something else?

And you only want to install 12.1.0.2?

oravirt avatar Sep 17 '18 07:09 oravirt

@oravirt Files are not being copied from the controlmachine to the target? --Yes..its not copying local copy Database fails to be created? -- since above step failed, then did not create any db Something else?

Yes I want to install 12.1.0.2

If you can help me to know steps which I need to install 12.1.0.2 from local copy of software , what are changes I need to to to make it happen

onenessboy avatar Sep 18 '18 09:09 onenessboy

So, the problem is that you want to install 12.1.0.2, but you don't have a config for that, only 18.3 & 12.2 You need this for the home to be installed (you can call the key (12102-base) whatever you want as long as it is the same across the other dictionaries, this is just an example). The <--- ##### markers shows you what needs to be consistent across the dictionaries in terms of ORACLE_HOME

db_homes_config:
  12102-base:        <--- #####
    home: db1-base
    version: 12.1.0.2
    edition: EE

db_homes_installed:
     - home: 12102-base    <--- #####
       apply_patches: False
       state: present

and, then you need to adjust oracle_databases accordingly to use the correct home:

oracle_databases: 
        - home: 12102-base   <--- #####
          oracle_db_name: orcl
          ....

and if you want to have pdbs created this needs to match as well.

oracle_pdbs:
  - home: 12102-base    <--- #####
    pdb_name: orclpdb
    cdb: orcl

These variables need to be set for the files to be copied from the controlmachine to the target.

is_sw_source_local: True
oracle_sw_copy: True

Also, you don't have to comment out things in the oracle_sw_image_db, only the files that are needed will be copied, based on the homes you want to install.

Let me know if this works

oravirt avatar Sep 19 '18 07:09 oravirt

Hi @oravirt (Mikael), Thanks for your help and guidance. I am able to install now.

Below are lesson learnt for me:

  • one should not go by default values , configure what you want :) .. I remember earlier you told clearly when fixing issue no #59 that I should have proper group vars defined for my requirement which I did not follow here, hence the result...
  • Next is remember what you learnt previously, which I did not :) Now coming to point, I have successfully installed 12.1.02 and now I need some help from you. I see you already listed some of sample groupvars file for example aws, vagrant, bla bla bla

How ever in my environment most of the servers are AWS and VMware, so which group_var template suits me out of available example configuration inour play book ?

However I come up with below contents for a new group_var file for me, can you suggest if these holds good


hostgroup: dbserver role_separation: True device_persistence: asmlib

oracle_user: oracle oracle_group: oinstall

is_sw_source_local: True oracle_sw_source_www: install_from_nfs: false oracle_sw_copy: true oracle_sw_unpack: true oracle_stage: /u01/stage oracle_stage_remote: /tmp

configure_ntp: true configure_motd: true configure_interconnect: false configure_ssh: true configure_host_disks: true

install_os_packages: True configure_epel_repo: True configure_public_yum_repo: True disable_selinux: false

db_homes_config: 12102-base:
home: db1-base version: 12.1.0.2 edition: EE

db_homes_installed: - home: 12102-base
apply_patches: False state: present ################ Grid Infrastructure specifics ################ configure_cluster: false oracle_install_version_gi: 12.1.0.2

oracle_asm_init_dg: crs

oracle_databases: # Dictionary describing the databases to be installed - home: 12102-base # 'Last' directory in ORACLE_HOME path (e.g /u01/app/oracle/12.1.0.2/racdb) oracle_version_db: 12.1.0.2 # Oracle versiono oracle_edition: EE # The edition of database-server (EE,SE,SEONE) oracle_db_name: orclcdb # Database name oracle_db_type: SI # Type of database (RAC,RACONENODE,SI) is_container: True # (true/false) Is the database a container database pdb_prefix: orclpdb num_pdbs: 1 storage_type: ASM # Database storage to be used. ASM or FS. oracle_db_mem_totalmb: 1024 # Amount of RAM to be used for SGA oracle_database_type: MULTIPURPOSE # MULTIPURPOSE|DATA_WAREHOUSING|OLTP redolog_size_in_mb: 100 datafile_dest: '+DATA' recoveryfile_dest: '+FRA' state: present The following will create a new database (non-cdb) running from the same home as above (/u01/app/oracle/12.1.0.2/db1) - home: db1 # 'Last' directory in ORACLE_HOME path (e.g /u01/app/oracle/12.2.0.1/db1) oracle_version_db: 12.2.0.1 # Oracle versiono (12.2.0.1,12.1.0.2,12.1.0.1,11.2.0.4,11.2.0.3) oracle_edition: EE # The edition of database-server (EE,SE,SEONE) oracle_db_name: orcl # Database name oracle_db_type: SI # Type of database (RAC,RACONENODE,SI) is_container: false # (true/false) Is the database a container database storage_type: ASM # Database storage to be used. ASM or FS. oracle_db_mem_totalmb: 1024 # Amount of RAM to be used for SGA oracle_database_type: MULTIPURPOSE # MULTIPURPOSE|DATA_WAREHOUSING|OLTP redolog_size_in_mb: 100 datafile_dest: '+DATA' recoveryfile_dest: '+FRA' state: present

and also please let me know if i can configure RMAN backup with our playbook thanks.

onenessboy avatar Sep 21 '18 11:09 onenessboy

I am also hitting with the same problem using latest repo. Need to install 12.1.0.2

Error

fatal: [ansible2]: FAILED! => {"changed": true, "cmd": "/u01/stage/18.3.0.0/database/runInstaller -responseFile /u01/stage/rsp/18300-base_ansible2.rsp -ignorePrereq -ignoreSysPrereqs -silent -waitforcompletion", "delta": "0:00:00.012297", "end": "2019-12-14 14:17:16.879297", "msg": "non-zero return code", "rc": 127, "start": "2019-12-14 14:17:16.867000", "stderr": "/bin/sh: /u01/stage/18.3.0.0/database/runInstaller: No such file or directory", "stderr_lines": ["/bin/sh: /u01/stage/18.3.0.0/database/runInstaller: No such file or directory"], "stdout": "", "stdout_lines": []}

============================= Pls can you advise which file requires ammendments ? and if possible, can you upload the modified file? Regards

singlatk avatar Dec 14 '19 14:12 singlatk