Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
Updated examples in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhollenberger committed Mar 30, 2016
1 parent 7dd86d0 commit 0489120
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Role Name
Ansible Oracle DB Upgrade Role
=========

Upgrade an Oracle database. Role is is divided into 3 sections that should be run in this order:
This role will upgrade an Oracle database. The role is is divided into 3 sections that should be run in this order:

1. pre_upgrade.yml (no downtime if database is in archivelog mode)
1. `pre_upgrade.yml` (no downtime if database is in archivelog mode)
- run 24 hrs before planned database upgrade
- runs pre-upgrade oracle script, performs full (level 0) backup, runs fixup scripts.

2. upgrade.yml (Downtime is required!)
2. `upgrade.yml` (Downtime is required!)
- performs incremental (level 1) backup, enables flashback database and creates guaranteed restore point. Runs manual database upgrade. Takes another full backup after upgrade is complete.

3. upgrade_final.yml (no downtime if database is in archivelog mode)
3. `upgrade_final.yml` (no downtime if database is in archivelog mode)
- run 7 days after upgrade to finalize
- deletes guaranteed restore point before setting database compatibility parameter. Takes full backup (level 0).

Expand Down Expand Up @@ -70,6 +70,19 @@ Example Playbook
### Optional Tags
To skip these optional tags use `--skip-tags` when running the playbook. For example, if you do not want to run RMAN backups before or during the upgrade you would execute these commands:

```
# Pre-Upgrade checks without backups
ansible-playbook 12c_1_pre_upgrade.yml -i <path_to_inventory> --extra-vars="hosts=<hostname>" --skip-tags="pre_upgrade_backup"

# Upgrade database, do not backup database.
ansible-playbook 12c_2_upgrade.yml -i <path_to_inventory> --extra-vars="hosts=<hostname>" --skip-tags="backup"

# Post-Upgrade tasks, do not backup database.
ansible-playbook 12c_3_upgrade_final.yml -i <path_to_inventory> --extra-vars="hosts=<hostname>" --skip-tags="final_upgrade_backup"
```
`pre_upgrade_backup` - Level 0 backup that runs during pre-upgrade checks. If this is skipped do not run subsequent Level 1 backups.
`archivelog` - Run during pre-upgrade playbook. Shuts down database and enables archivelog and flashback database.
Expand Down

1 comment on commit 0489120

@gopi18dba
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi David, I followed the all steps.. however after copying all the scripts in at target host it is unable to run the script saying oracle not available... can you pls suggest . Appreciate your help.

"preupgrd": {
"changed": true,
"cmd": "echo exit | sqlplus / as sysdba @preupgrd.sql",
"delta": "0:00:01.533505",
"end": "2019-11-19 20:04:04.182302",
"failed": false,
"rc": 0,
"start": "2019-11-19 20:04:02.648797",
"stderr": "",
"stderr_lines": [],
"stdout": "\nSQLPlus: Release 12.1.0.2.0 Production on Tue Nov 19 20:04:03 2019\n\nCopyright (c) 1982, 2014, Oracle. All rights reserved.\n\nConnected to an idle instance.\n\nSP2-0310: unable to open file "preupgrd.sql"\nSQL> Disconnected",
"stdout_lines": [
"",
"SQL
Plus: Release 12.1.0.2.0 Production on Tue Nov 19 20:04:03 2019",
"",
"Copyright (c) 1982, 2014, Oracle. All rights reserved.",
"",
"Connected to an idle instance.",
"",
"SP2-0310: unable to open file "preupgrd.sql"",
"SQL> Disconnected"
]

Variables for db-upgrade ansible role

oracle_stage: "{{ oracle_stage_base }}/12c_upgrade/{{ db_name }}" .

oracle_sid: "{{ db_name }}{{ host_num |default('') }}"

Please sign in to comment.