biemond / biemond-oradb

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

datapatch - continuation https://github.com/biemond/puppet/issues/56 #181

Open winningpanthers opened 7 years ago

winningpanthers commented 7 years ago

sorry, thanks. before I close this. Is there a place where I can hardcode this datapatch command to be run right after opatch? any advise how do I work around this issue?

biemond commented 7 years ago

Are you talking about an existing DB or do you need to do it after DB creation. you can use an exec and subscribe to opatch

winningpanthers commented 7 years ago

i installed binaries, applied opatch upgrade, and then 2 opatches and then created DB. and noticed the DB patches were showing up with opatch lsinventory but not on the newly created DB. Not sure if this is working as expected?

biemond commented 7 years ago

strange , you should suspect that opatch also updates the catalog scripts and starter db's. maybe it only works with a dbt template.

winningpanthers commented 7 years ago

that may be it. We are adding this to work around the issue . exec { 'Datapatch':   command  => "${whatever_directory}/datapatch",   refreshonly => true, Oradb::Opatchupgrade {   notify => Exec['Datapatch'], }

dimensionaldba commented 7 years ago

If you are building a 12.1 database in a patched Oracle Home, Oracle doesn't run datapatch after the database build. You have to run it separately. This feature is fixed in 12.2.

biemond commented 7 years ago

interesting, didn't know that. also in case of a dbt template

winningpanthers commented 7 years ago

thanks

dimensionaldba commented 7 years ago

Here is the Oracle Support note 12.1:DBCA(Database Creation) does not execute “datapatch” (Doc ID 2084676.1)

Had to add similar extra run of datapatch after database build for 12.1 with puppet. As mentioned it is fixed in 12.2 build.

dimensionaldba commented 7 years ago

Changes for OEM if you are using it to deploy databases with Cloud Control. Datapatch is not Executed on Databases Created from Cloud Control (Doc ID 2158546.1)

biemond commented 7 years ago

so this command => "${whatever_directory}/datapatch"

will it detect if it is already applied, if not how can I detect it, plus do you need to provide db connect info

winningpanthers commented 7 years ago

is the question around how to make this idempotent?

biemond commented 7 years ago

indeed

winningpanthers commented 7 years ago

onlyif => "echo SELECT patch_id, version, status, bundle_id, bundle_series FROM dba_registry_sqlpatch; | sqlplus / as sysdba | grep

This should work On Wed, Aug 9, 2017 at 3:32 PM, Edwin Biemond wrote: > indeed > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > , > or mute the thread > > . >
biemond commented 7 years ago

ah ok, that is bad. I try to stay away for connecting to the DB, then I need to read dbora , set all the variables , login , check the patch. Already doing something like this for RCU prefix check.

We can do something like that. can you run this as a DBA user? and do you have a working example of what you execute in sqlplus

winningpanthers commented 7 years ago

I think this can be run as a dba user. I have to check.

On Wed, Aug 9, 2017 at 3:41 PM, Edwin Biemond notifications@github.com wrote:

ah ok, that is bad. I try to stay away for connecting to the DB, then I need to read dbora , set all the variables , login , check the patch. Already doing something like this for RCU prefix check.

We can do something like that. can you run this as a DBA user? and do you have a working example of what you execute in sqlplus

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/biemond/biemond-oradb/issues/181#issuecomment-321360402, or mute the thread https://github.com/notifications/unsubscribe-auth/AS0hGG_ElMvwp1yxYp6rXIe4CbT2HN-Hks5sWgtPgaJpZM4Os2OT .