Coder Social home page Coder Social logo

Comments (27)

oravirt avatar oravirt commented on June 27, 2024 2

What I guess I could do is:

  • have a variable that just contains the list of extra repos that should be enabled, and have a | default (omit) to exclude it if nothing is defined.

That way, it is up to the user to keep track of the repo-names.

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

Hi,
I don't think this is something I can do anything about, unfortunately. This is a yum error, and all I do is use yum to install the packages. This looks like yum is unable to talk to some of the repository endpoints, so maybe it is just a temporary problem?

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

huh...better I will rebuild the vm and do the process again.. thanks buddy

from ansible-oracle.

Rendanic avatar Rendanic commented on June 27, 2024

Disable the rhel-7-server-beta-debug-rpms and try again. The repo is not needed for ansible-oracle.

rhel-7-server-beta-debug-rpms: [Errno 256] No more mirrors to try.

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

@Rendanic is correct in that the repo is not needed. However, I enable all repos (enablerepo=*) to be able to install compat- packages in RHEL. Technically, enabling all repos is not needed, but repos could have different names for different systems so I'd rather do this, then trying to keep track of x number of different names.

from ansible-oracle.

Rendanic avatar Rendanic commented on June 27, 2024

The problem is in /etc/yum.repos.d/public-yum-ol7.repo
Oracle is adding a lot of repos in that file and the enabling of every repo will lead to unexpected problems, because RPMs could be used from development or beta-channels.

I am not sure, if enablerepo=* is working in RHEL7. You need to use the subscription-manager to add repositories to RHEL7. I didn't test it but I think that enablerepo=* will not solve the problem.

What about a detection of the OS and enabling the repo for each different vendor? I prefer the way to enable the needed repositories outside of ansible-oracle or enable them when the namen is known.

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

I have obviously tested enablerepo=* in both OL/RHEL 6/7 so I know it works, and I agree it is far from ideal.

But, in terms of doing it another way (keeping track of reponames per platforms or just dealing with it outside of ansible-oracle) I would rather just deal with it outside of ansible-oracle instead of having to keep track of a bunch of repo names (which will be different) for a variety of platforms/versions.

So, we either keep it as it as (with enablerepo=*, or we do it outside of ansible-oracle.
It is probably safer to just do it external so I could just add an info debug that the repo needs to be enabled for RHEL7

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

Should be fixed by 5e1cf4e

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

thank you very much...I will test and let you know... Thanks for your patience

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

Hi

Now...I have retried with entire new clone from our git on new VM..

same error got compat lib 33 errs not found...( i am not bothered about this one now). I have manually fixed it by enabling optional rpm......( i am not sure why this problem is keep repeating)

once i surpass subsequent steps..it failed at below level

TASK [oraswdb-install : debug] ***********************************************************************************************************************
ok: [1.2.3.202] => (item=None) => {}

TASK [oraswdb-install : Run root script after installation] ******************************************************************************************
changed: [1.2.3.202] => (item=[{u'oracle_db_type': u'SI', u'home': u'db1', u'oracle_edition': u'EE', u'oracle_db_name': u'orcl', u'oracle_version_db': u'12.1.0.2'}, {'_ansible_parsed': True, 'stderr_lines': [u'grep: /u01/app/oraInventory/ContentsXML/inventory.xml: No such file or directory'], u'cmd': u'grep "/u01/app/oracle/12.1.0.2/db1" "/u01/app/oraInventory/ContentsXML/inventory.xml" |wc -l', u'end': u'2018-04-23 18:34:11.785999', '_ansible_no_log': False, u'stdout': u'0', '_ansible_item_result': True, u'changed': True, 'item': {u'oracle_db_type': u'SI', u'home': u'db1', u'oracle_edition': u'EE', u'oracle_db_name': u'orcl', u'oracle_version_db': u'12.1.0.2'}, u'delta': u'0:00:00.069259', u'stderr': u'grep: /u01/app/oraInventory/ContentsXML/inventory.xml: No such file or directory', u'rc': 0, u'invocation': {u'module_args': {u'warn': True, u'executable': None, u'_uses_shell': True, u'_raw_params': u'grep "/u01/app/oracle/12.1.0.2/db1" "/u01/app/oraInventory/ContentsXML/inventory.xml" |wc -l', u'removes': None, u'creates': None, u'chdir': None, u'stdin': None}}, 'stdout_lines': [u'0'], u'start': u'2018-04-23 18:34:11.716740', '_ansible_ignore_errors': None, 'failed': False}])

TASK [oraswdb-install : Generate glogin.sql] *********************************************************************************************************
failed: [1.2.3.202] (item={u'oracle_db_type': u'SI', u'home': u'db1', u'oracle_edition': u'EE', u'oracle_db_name': u'orcl', u'oracle_version_db': u'12.1.0.2'}) => {"changed": false, "item": {"home": "db1", "oracle_db_name": "orcl", "oracle_db_type": "SI", "oracle_edition": "EE", "oracle_version_db": "12.1.0.2"}, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'is_container'"}
to retry, use: --limit @/home/kalki/ansible-oracle/ansible-oracle/single-instance-db-on-fs.retry

PLAY RECAP *******************************************************************************************************************************************
1.2.3.202 : ok=49 changed=13 unreachable=0 failed=1

real 51m50.732s
user 14m50.965s
sys 4m13.446s
[root@localhost ansible-oracle]#

so now,

from steps I see instllation done ? is that correct
"AnsibleUndefinedVariable: 'dict object' has no attribute 'is_container'" ? I dont understand this error ?

now do i need to rerun entire run playbook again ? because i see instllation is successful...after that it failed at above step ?

Can you please help

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

Hi,

The is_container parameter is used to define if the database should be a Container Database (CDB) or not.

I'd like to see your config (playbook + corresponding group_vars) to be able to fully debug this, but:

To fix the 'TASK [oraswdb-install : Generate glogin.sql] ', you should just do this:
in your config file (group_vars/ under oracle_databases, add the following:

  oracle_databases:
    - home: db1
      oracle_version_db: 12.1.0.2
      oracle_edition: EE
      oracle_db_name: orcl
      oracle_db_type: SI
      is_container: False <-- Add this line

Your oracle_databases configuration may be different, but adding that line should help. I'll also update the default configuration.

Re: the compat- error, you have to add this to you configuration (you were running on AWS, correct?):
extrarepos_enabled: "rhui-REGION-rhel-server-extras,rhui-REGION-rhel-server-optional"

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

thanks much for your reply...
I did not change thing in git except in etc/ansible/host added [orafs] and my local ip in it

OMG i got it... that is_container line is not is not there in that main.yml under roles/oraswdb-install /defaults/mail.yml... Is this the file you are talking about or Host file ?
what is the location for this "in your config file (group_vars/ under oracle_databases"

now if restart entire playbook, then shall it impact existing installation or it will cleanup everything and redo it from beginning
can you please confirm....

Re: the compat- error, you have to add this to you configuration (you were running on AWS, correct?):
extrarepos_enabled: "rhui-REGION-rhel-server-extras,rhui-REGION-rhel-server-optional"

so what i understand is... ansible and this step should be manually should be taken care before implementing this play book...

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

ok...so are you talking about this file ?
directory :/home/kalki/ansible-oracle/group_vars
file : vbox-si-fs is this correct.?

currently iam trying this solution on my laptop with VM on it...
In that file I do see below content...is that you are asking to change
once i change, should i run entire playbook again ? (does it impact already installed oracle home )?

oracle_databases: # Dictionary describing the databases to be installed
- 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: orclcdb # Database name
oracle_db_passwd: Oracle123 # Passwords (sys/system/dbsnm etc)
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: FS # 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: /u02
recoveryfile_dest: /u02
listener_name: LISTENER # This home will have a listener configured
listener_port: 1521
state: present

sorry...troubling you with more questions...I determined to make it work on my machine...please help

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

Ok, so a little ansible basics (you may already know all of this and if so, apologies)

Every role have a bunch of default variables, and they are placed in:
role_name/defaults/main.yml, e.g oraswdb-install/defaults/main.yml.

So if you just clone the repo, add an entry (e.g myconfig in the inventory-file

(e.g /etc/ansible/hosts)
[myconfig]
my.host.com

and run the playbook against that group, it will use the default variables for each role in the playbook.

However, since the defaults probably doesn't look anything like 'your' system, it is possible to override the defaults with 'your' specific config. To do this, you create a file in group_vars called the same as the name you put in the inventory file:

i.e
group_vars/myconfig and in this file you add all the variables that you want to be different from the defaults (for all roles you're using)

So when I was asking for 'your' config, that's what I was getting at. Anything that is placed in group_vars will override a default variable.

Since you didn't have a matching config in group_vars, you were just using the defaults and in this case you ran into a bug where I hadn't added the is_container variable to the oracle_databases structure in oraswdb-install/default/main.yml. I will fix this though.

And re: you question whether it will change an existing installation: it will not. It will continue past the error though and run through the other roles.
If the playbook realises there is an existing ORACLE_HOME in the place where you wanted it installed it will just skip that step.

Also, I have other repo's (https://github.com/oravirt/vagrant-vbox-si-fs, https://github.com/oravirt/vagrant-vbox-si-asm, https://github.com/oravirt/vagrant-vbox-rac) which come with pre-built vagrant configs which have a matching group_vars configuration in ansible-oracle

And re this:
"Re: the compat- error, you have to add this to you configuration (you were running on AWS, correct?):
extrarepos_enabled: "rhui-REGION-rhel-server-extras,rhui-REGION-rhel-server-optional"

so what i understand is... ansible and this step should be manually should be taken care before implementing this play book..."

You would put
extrarepos_enabled: "rhui-REGION-rhel-server-extras,rhui-REGION-rhel-server-optional"
in group_vars/myconfig, and then Ansible would enable those 2 repos for the duration of the task. By default, Ansible will just use whatever repositories are already enabled.

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

Ok, so a little ansible basics (you may already know all of this and if so, apologies)
I never mind, no apologies required...I am a beginner in ansible stuff..happy to learn from mistakes

Thank you very much for detailed explanation.....I will give a re-try as per suggestion shall keep you posted.

Thanks you so much for patience and help :)

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

Hi here the update..
as of now I wanted to go with defaults for a successful installation(Though i will do a research on having my own group_vars --for more customized installation)

As you suggested to fix 'TASK [oraswdb-install : Generate glogin.sql] ', added is_container variable as false to the oracle_databases structure in oraswdb-install/default/main.yml

Now reran playbook...that issue is resolved...

now it stops below error at Task create Listener

ASK [oradb-create : listener | Create responsefile for listener configuration] **********************************************************************
changed: [1.2.3.202] => (item={u'oracle_init_params': u'', u'is_container': False, u'oracle_db_type': u'SI', u'service_name': u'orcl_serv', u'num_pdbs': 1, u'pdb_prefix': u'pdb', u'oracle_db_name': u'orcl', u'listener_name': u'LISTENER', u'redolog_size_in_mb': 100, u'state': u'present', u'oracle_edition': u'EE', u'oracle_db_mem_totalmb': 1024, u'oracle_version_db': u'12.2.0.1', u'oracle_database_type': u'MULTIPURPOSE', u'oracle_db_passwd': u'Oracle123', u'home': u'db1', u'storage_type': u'FS'})

TASK [oradb-create : listener | Create listener] *****************************************************************************************************
failed: [1.2.3.202] (item={u'oracle_init_params': u'', u'is_container': False, u'oracle_db_type': u'SI', u'service_name': u'orcl_serv', u'num_pdbs': 1, u'pdb_prefix': u'pdb', u'oracle_db_name': u'orcl', u'listener_name': u'LISTENER', u'redolog_size_in_mb': 100, u'state': u'present', u'oracle_edition': u'EE', u'oracle_db_mem_totalmb': 1024, u'oracle_version_db': u'12.2.0.1', u'oracle_database_type': u'MULTIPURPOSE', u'oracle_db_passwd': u'Oracle123', u'home': u'db1', u'storage_type': u'FS'}) => {"changed": true, "cmd": "/u01/app/oracle/12.2.0.1/db1/bin/netca -responseFile /u01/stage/rsp/netca_db1_LISTENER.rsp -silent", "delta": "0:00:00.015732", "end": "2018-04-24 13:09:52.291992", "item": {"home": "db1", "is_container": false, "listener_name": "LISTENER", "num_pdbs": 1, "oracle_database_type": "MULTIPURPOSE", "oracle_db_mem_totalmb": 1024, "oracle_db_name": "orcl", "oracle_db_passwd": "Oracle123", "oracle_db_type": "SI", "oracle_edition": "EE", "oracle_init_params": "", "oracle_version_db": "12.2.0.1", "pdb_prefix": "pdb", "redolog_size_in_mb": 100, "service_name": "orcl_serv", "state": "present", "storage_type": "FS"}, "msg": "non-zero return code", "rc": 127, "start": "2018-04-24 13:09:52.276260", "stderr": "/bin/sh: /u01/app/oracle/12.2.0.1/db1/bin/netca: No such file or directory", "stderr_lines": ["/bin/sh: /u01/app/oracle/12.2.0.1/db1/bin/netca: No such file or directory"], "stdout": "", "stdout_lines": []}
to retry, use: --limit @/home/kalki/ansible-oracle/ansible-oracle/single-instance-db-on-fs.retry

PLAY RECAP *******************************************************************************************************************************************
1.2.3.202 : ok=52 changed=11 unreachable=0 failed=1

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

Hi,

Sorry about the late reply, but:

It looks like the database server installation has not finished properly, since the binaries does not seem to be there.
I would start over and run the playbook again from the start

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

Hi

No worries.....yeah...ok I will cleanup everything again and do that... i have copied linuxamd64_12201 two zip files in /tmp.....

anyhow let me re do from scratch

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

Did you get this to work?

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

My apologies, was on long vacation.. had comeback... Let me try this...I did not forge this though (i still believe this is my best mate repository for Oracle stuff)

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

Hi...atlast have some good news..much relieved ... now play book ran successfully and installed db successfully with just default values.

now when i try to log into sqlplus..its sqlcommand not found ... actually i switeched to oracle user and issuing sql plus there... any suggestions.

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

Great!
No environment is set by default, but there are .profile_dbname files created for each db and home Just source the file (source .profile_xxxx) and you’re set

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

hello teacher (i love to call you like that..I am just learning new things),

some progress again..googled a bit.. .bash_profile did not have oracle home and sid ( i thought that ansible playbook will set that as well :) ... so... updated it. now connected to oracle...actually searched for password...::) then finally got under main.yml of defaults folder of oradbcreate role :)

One job done... I need to try creating 3 db at same time. I know some option are there in playbook it self..shall try it.
So if I want to clear everything what i have done is that oradb-delete is only which i need to include in single-instance-db-on-fs.yml?

Now need playbook for OEM as well...please do share..( i remember you said that you had one, but you need to refactor that one)... but does it do basic configuration of OEM ?

Thanks buddy for all your patience help

from ansible-oracle.

oravirt avatar oravirt commented on June 27, 2024

Hi,
Yeah, like I said in my previous reply - I don't set any environment variables in .bash_profile. and the reason for that is: You may have more than one DB/ORACLE_HOME, and then you still have to change the environment variables for the 'other' DB's.
That's why there is a .profile_dbname for each DB which sets up the environment for 'that' DB.
ls -latr .profile_*

re the 3 DB's at once, just do this (add entries to the oracle_databases list)

oracle_databases:
       - oracle_db_name: yourname1
         home: db1
         oracle_edition: EE
         oracle_db_type: SI
         is_container: False/True
         storage_type: FS
         oracle_db_mem_totalmb: 1024
         oracle_database_type: MULTIPURPOSE
         redolog_size_in_mb: 100
         state: present

       - oracle_db_name: yourname2
         home: db1
         oracle_edition: EE
         oracle_db_type: SI
         is_container: False/True
         storage_type: FS
         oracle_db_mem_totalmb: 1024
         oracle_database_type: MULTIPURPOSE
         redolog_size_in_mb: 100
         state: present
         
       - oracle_db_name: yourname3
         home: db1
         oracle_edition: EE
         oracle_db_type: SI
         is_container: False/True
         storage_type: FS
         oracle_db_mem_totalmb: 1024
         oracle_database_type: MULTIPURPOSE
         redolog_size_in_mb: 100
         state: present

Re: Removing a DB, first of all do a git pull in the ansible-oracle directory to get the latest changes, then just change the state: present to state: absent to remove the DB and then run the manage-db.yml playbook to add/remove databases. The old roles (oradb-create & oradb-delete) are deprecated and will be removed

The oem-role just does the installation of OEM, it doesn't configure anything 'inside' of OEM.
I'll add it once I've had time to go through and update/re-factor it

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

Sure ..Thanks again for inputs (for 3 db and cleanup)... i need to do a pull for latest one..

Meanwhile can you please share basic version on playbook for OEM which just does the install .. (I shall wait for those configurations though)

Thank you buddy

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

Hi, can you please let me know the basic version of installing OEM

from ansible-oracle.

onenessboy avatar onenessboy commented on June 27, 2024

can you please add rman backup process also if you find time..thank you

from ansible-oracle.

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.