You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ Pythia is a Role for ansible that helps you to automate the following tasks when
9
9
- Runs SQL Scripts against a specified Oracle Database
10
10
- Upgrade a Oracle DB to a new Version
11
11
- Duplicate a Database with RMAN "duplicate from active database"
12
+
- Datapump Export / Import over NETWORK_LINK
12
13
- Install Oracle Client
13
14
14
15
Thereby several Prerequisites are fullfilled and or checked. E.G.
@@ -68,6 +69,7 @@ Pythia works with tags to combine the actions of installation, configuration, pa
68
69
- client: Specifies, that you want to install an Oracle Client. When tagging `client`, you also may to want to specify the Variable `client_version` when starting the playbook with `client` TAG.
69
70
- duplicate: Specifies, that you want to duplicate a Source Database to a Target Database. Uses RMAN duplicate from active Database. You need to specify the `duplicate_source_host`, `duplicate_target_host`, `duplicate_source_sid` and `duplicate_target_sid` Variable. As HOSTS you need to specify the Target Host.
70
71
- upgrade: Specifies that you want to upgrade a Database to a new Version. You need to specify the Variables `oracle_source_version`, `oracle_target_version`, `oracle_sid` and `upgrade_mode` when starting the Playbook with the `upgrade` TAG.
72
+
- datapump: Specifies, that you want to do an Datapump Export / Import over NETWORK_LINK. You need to specify the `datapump_source_host`, `datapump_target_host`, `datapump_source_sid` and `datapump_target_sid` Variable. As HOSTS you need to specify the Target Host.
71
73
72
74
Example: Install Oracle RDBMS with Version 19c and Enterprise Edition on Host "ansibletest", install the 19.5 RU (Patch ID: 30125133). Build a Database named "ORA19" on top:
73
75
@@ -111,3 +113,10 @@ Also you're able to specify, that the SPFILE of your maybe existing Target Datab
111
113
Example: Upgrade an Oracle Database in Version 18 to Oracle Database in Version 19 on Host "ansibletest":
Example: Do a Datapump Export / Import over NETWORK_LINK. Source Database named EXPSRC to a Database named EXPDST on the host "vmdbsoradatapumptarget". As HOST, the Target Host must be specified:
118
+
Attention!: The Passwords for the Source and Target Database is needed for the datapump process. The Password has to be provided within the vault.yml (using ansible-vault) as vault_datapump_<SOURCESID> and vault_datapump_<TARGETSID>
Pythia is able to do a Datapump Export / Import over a NETWORK_LINK (Database Link). You may either do a FULL Export / Import or an Import of a List of Schemas. Pythia also supports you by remapping the schemas.
6
+
7
+
Be aware, that all restrictions for doing an Export / Import over a Database Link are applying here. More informations can be found [here](https://docs.oracle.com/database/121/SUTIL/GUID-0871E56B-07EB-43B3-91DA-D1F457CF6182.htm#SUTIL919)
8
+
9
+
Be aware, that using the `datapump` TAG assumes, that there is a valid RDBMS in the correct Version already installed on both Systems. If this isn't the case, you need to specify the `rdbms` TAG like described [here](https://github.com/thedatabaseme/pythia/blob/master/docs/02_INSTALL_RDBMS.md)
10
+
11
+
## Working with an Ansible Vault
12
+
13
+
To process a Datapump Export / Import of a database, Pythia will need the Password for a User to execute the actual Export and Import for both Databases. It's recommended, that this user is the System user, but any user with the appropriate permissions will be feasable. The password needs to be provided in a `vault.yml` file, that resides under the `roles/pythia/vars` directory.
You will get asked for a password that will protect the Vault and is needed to edit or view the Vault File in the future.
19
+
In the upcoming editor you can enter informations, that will be stored encrypted in the Vault File. For Pythia Duplicate, you need to specify the SYS Password of the Source Database following the Syntax `vault_datapump_<SID>`. Here is an example:
20
+
21
+
vault_datapump_EXPSRC: supersecretpassword
22
+
23
+
When calling a Playbook that uses Pythia, you can specify the Vault Password either by a Vault Passwordfile using `--vault-password-file` or by entering it during the Playbook call using `--ask-vault-password`.
24
+
25
+
You can find more general informations about the usage of an Ansible Vault [here](https://docs.ansible.com/ansible/latest/user_guide/vault.html).
|HOSTS |In this special usecase, you need to specify the Target Host as HOSTS.|none|
34
+
|datapump_source_host|The source host on which the datapump_source_sid is running. <br>Only needed when starting the playbook with the `datapump` TAG, for doing an Datapump Export / Import a Database.|none|
35
+
|datapump_target_host|The target host on which the datapump_target_sid is running. <br>Only needed when starting the playbook with the `datapump` TAG, for doing an Datapump Export / Import a Database.|none|
36
+
|datapump_source_sid|The source SID of the Database to duplicate. Only needed when <br>starting the playbook with the `datapump` TAG, for duplicating a Database.|none|
37
+
|datapump_target_sid|The target SID of the Database to duplicate to. Only needed when <br>starting the playbook with the `datapump` TAG, for duplicating a Database.|none|
|datapump_full|Should a Full Export / Import be made or schema Import only? If `FALSE`, <br>you need to specify the `datapump_schema_list` Variable|`TRUE`|
45
+
|datapump_schema_list|List of Schemas (divided by , for example `USER1,USER2`). <br>Only relevant when `datapump_full` is `FALSE`. You need to to set `datapump_full` to `FALSE` when you want to export only a certain list of Schemas.|none|
46
+
|datapump_schema_remap|List of Schemas to Remap. For Example `USER1:USERA,USER2:USERB` <br>will remap USER1 to USERA and USER2 to USERB|none|
47
+
|datapump_max_runtime|Number of Seconds of the maximum Datapump runtime.|`14400`|
48
+
|datapump_source_user|User on Source Database which the Database Link uses to connect over Network_link|`System`|
49
+
|datapump_target_user|User on Target Database which impdp uses to connect|`System`|
50
+
|datapump_table_exists_action|Controls the impdp TABLE_EXIST_ACTION. Can either be `APPEND`, `REPLACE`, `SKIP` or `TRUNCATE`|`SKIP`|
51
+
52
+
## Examples
53
+
54
+
Example: Do a Datapump Export / Import over NETWORK_LINK. Source Database named EXPSRC to a Database named EXPDST on the host "vmdbsoradatapumptarget". As HOST, the Target Host must be specified:
55
+
Attention!: The Passwords for the Source and Target Database is needed for the datapump process. The Password has to be provided within the vault.yml (using ansible-vault) as `vault_datapump_<SOURCESID>` and `vault_datapump_<TARGETSID>`
This is only were the fun begins, next let's have a look on how to create a Database using Pythia and how to install Patches on top of your RDBMS and Database.
64
+
65
+
-[Install a RDBMS](https://github.com/thedatabaseme/pythia/blob/master/docs/02_INSTALL_RDBMS.md)
66
+
-[Install Patches and Updates](https://github.com/thedatabaseme/pythia/blob/master/docs/04_INSTALL_PATCH.md)
Copy file name to clipboardExpand all lines: roles/pythia/README.md
+27-15Lines changed: 27 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Pythia is a Role for ansible that helps you to automate the following tasks when
10
10
- Install Patches on top of a new and existing RDBMS and or Database
11
11
- Upgrade a Oracle DB to a new Version
12
12
- Duplicate a Database with RMAN "duplicate from active database"
13
-
-Duplicate a Database with RMAN "duplicate from active database"
13
+
-Datapump Export / Import over NETWORK_LINK
14
14
- Install Oracle Client
15
15
16
16
Thereby several Prerequisites are fullfilled and or checked. E.G.
@@ -72,6 +72,17 @@ main.yml Variables (can be set when calling the playbook, see Examples):
72
72
- current_hugepages (Default 0): Just for initializing the Variable. Must not be modified
73
73
- hugepages (Default 0): Will be calculated during Playbook Runtime. Will be included to the sysctl Configuration when deploying a Database
74
74
- client_install_type (Default Administrator): Choose Which Client Install Type you want to install. Can be Administrator, Runtime, InstantClient or Custom
75
+
- datapump_source_host (Default NULL): The source host on which the datapump_source_sid is running. Only needed when starting the playbook with the "datapump" tag, for doing an Datapump Export / Import a Database.
76
+
- datapump_target_host (Default NULL): The target host on which the datapump_target_sid is running. Only needed when starting the playbook with the "datapump" tag, for doing an Datapump Export / Import a Database.
77
+
- datapump_source_sid (Default NULL): The source SID of the Database to Export. Only needed when starting the playbook with the "datapump" tag, for doing an Datapump Export / Import a Database.
78
+
- datapump_target_sid (Default NULL): The target SID of the Database to Import to. Only needed when starting the playbook with the "datapump" tag, for doing an Datapump Export / Import a Database.
79
+
- datapump_full (Default TRUE): Should a Full Export / Import be made or schema Import only? If FALSE, you need to specify the datapump_schema_list Variable
80
+
- datapump_schema_list (Default NULL): List of Schemas (divided by , for example USER1,USER2). Only relevant when datapump_full is FALSE. You need to to set datapump_full to FALSE when you want to export only a certain list of Schemas.
81
+
- datapump_schema_remap (Default NULL): List of Schemas to Remap. For Example "USER1:USERA,USER2:USERB" will remap USER1 to USERA and USER2 to USERB
82
+
- datapump_max_runtime (Default 14400): Number of Seconds of the maximum Datapump runtime.
83
+
- datapump_source_user (Default system): User on Source Database which the Database Link uses to connect over Network_link
84
+
- datapump_target_user (Default system): User on Target Database which impdp uses to connect
85
+
- datapump_table_exists_action (Default SKIP): Controls the impdp TABLE_EXIST_ACTION. Can either be APPEND, REPLACE, [SKIP] or TRUNCATE
75
86
- duplicate_source_host (Default NULL): The source host on which the duplicate_source_sid is running. Only needed when starting the playbook with the "duplicate" tag, for duplicating a Database.
76
87
- duplicate_target_host (Default NULL): The target host on which the duplicate_target_sid is running. Only needed when starting the playbook with the "duplicate" tag, for duplicating a Database.
77
88
- duplicate_source_sid (Default NULL): The source SID of the Database to duplicate. Only needed when starting the playbook with the "duplicate" tag, for duplicating a Database.
@@ -117,21 +128,22 @@ Dependencies
117
128
------------
118
129
119
130
Tags that can be specified:
120
-
- rdbms: Specifies, that you want a RDBMS installed. When tagging rdbms, you also may want to specify the Variable oracle_version when starting the playbook with "rdbms" tag.
121
-
- db: Specifies, that you want to install a Database on top a new RDBMS (when specifying "rdbms" as a tag alongside with the "db" tag) or an already installed RDBMS on the target system. You may also want to specify the Variable oracle_version when starting the playbook with the "db" tag. You need to specify the oracle_sid Variable when calling the playbook for naming the new Database.
122
-
- patch: Specifies, that you want to install a Patch on top of a new RDBMS (when specifying "rdbms" as a tag alongside with the "patch" tag) or an already installed RDBMS. When specifying the "patch" tag, you need to also specify the "install_patch" Variable when running the playbook. While running under the "patch" tag, the Patch Archive will be uncompressed to the target system. The Patch Files will be deleted after successfully installing the Patch.
123
-
- patchonly: Like "patch" tag but implies, that the Patch Archive already exists on the target system. No cleanup will be done after the Patch Installation.
131
+
- rdbms: Specifies, that you want a RDBMS installed. When tagging `rdbms`, you also may want to specify the Variable `oracle_version` when starting the playbook with `rdbms` tag.
132
+
- db: Specifies, that you want to install a Database on top a new RDBMS (when specifying `rdbms` as a TAG alongside with the `db` TAG) or an already installed RDBMS on the target system. You may also want to specify the Variable `oracle_version` when starting the playbook with the `db` TAG. You need to specify the `oracle_sid` Variable when calling the playbook for naming the new Database.
133
+
- patch: Specifies, that you want to install a Patch on top of a new RDBMS (when specifying `rdbms` as a TAG alongside with the `patch` TAG) or an already installed RDBMS. When specifying the `patch` TAG, you need to also specify the `install_patch` Variable when running the playbook. While running under the `patch` TAG, the Patch Archive will be uncompressed to the target system. The Patch Files will be deleted after successfully installing the Patch.
134
+
- patchonly: Like `patch` tag but implies, that the Patch Archive already exists on the target system. No cleanup will be done after the Patch Installation.
124
135
- cleanup: Forces a cleanup after sucessfull Patch Installation. Also forces that the created backup Files under the RDBMS that are created by OPatch when patching are deleted. Handle with caution if you may want to rollback the Patch.
125
-
- listener: Only creates a listener for the Specified Database with the oracle_sid Variable.
126
-
- sqlscript: Triggers, that SQL Scripts (.sql) under files/default (or specified by local_sql_stage_directory) directory will be executed against the specified oracle_sid. Be aware, the Scripts will be executed without any precheck. Bad SQL can cause immense harm.
127
-
- rpm: Triggers that additional RPMs have to be installed. When specifying "rpm" tag, you need also to specify the "install_rpm" Variable when running the playbook. The RPM will be transfered to the target system. After installing the RPM, the file will be removed.
128
-
- autostart: Controls that the automatic startup of the Database you specified will be implemented. When specifying the autostart tag, you also must specify the oracle_sid Variable when calling the Playbook.
129
-
- hugepage: Triggers, that Hugepages have to be configured. Can only be triggered when also tagging db. Hugepages will be calculated by given sga_max_size (Default 2G)
130
-
- converttohugepage: Converts a non Hugepage configured System to use Hugepages. Disables transparent_hugepages. Needs sga_max_size Variable set to the absolute Size (in GB) of all SGA's on the System
131
-
- prepare: Prepares the Target System for an upcomming Oracle Installation. Can be combined with the hugepage Tag and needs sga_max_size (Default 2G) specified to calculate Shared Memory and Hugepages
132
-
- client: Specifies, that you want to install an Oracle Client. When tagging client, you also may to want to specify the Variable client_version when starting the playbook with "client" tag.
133
-
- duplicate: Specifies, that you want to duplicate a Source Database to a Target Database. Uses RMAN duplicate from active Database. You need to specify the duplicate_source_host, duplicate_target_host, duplicate_source_sid and duplicate_target_sid Variable. As HOSTS you need to specify the Target Host.
134
-
- upgrade: Specifies that you want to upgrade a Database to a new Version. You need to specify the Variables oracle_source_version, oracle_target_version, oracle_sid and upgrade_mode when starting the Playbook with the "upgrade" tag.
136
+
- listener: Only creates a listener for the Specified Database with the `oracle_sid` Variable.
137
+
- sqlscript: Triggers, that SQL Scripts (.sql) under files/default (or specified by `local_sql_stage_directory`) directory will be executed against the specified `oracle_sid`. Be aware, the Scripts will be executed without any precheck. Bad SQL can cause immense harm.
138
+
- rpm: Triggers that additional RPMs have to be installed. When specifying `rpm` TAG, you need also to specify the `install_rpm` Variable when running the playbook. The RPM will be transfered to the target system. After installing the RPM, the file will be removed.
139
+
- autostart: Controls that the automatic startup of the Database you specified will be implemented. When specifying the `autostart` TAG, you also must specify the `oracle_sid` Variable when calling the Playbook.
140
+
- hugepage: Triggers, that Hugepages have to be configured. Can only be triggered when also tagging `db`. Hugepages will be calculated by given `sga_max_size` (Default 2G)
141
+
- converttohugepage: Converts a non Hugepage configured System to use Hugepages. Disables `transparent_hugepages`. Needs `sga_max_size` Variable set to the absolute Size (in GB) of all SGA's on the System
142
+
- prepare: Prepares the Target System for an upcomming Oracle Installation. Can be combined with the `hugepage` TAG and needs `sga_max_size` (Default 2G) specified to calculate Shared Memory and Hugepages
143
+
- client: Specifies, that you want to install an Oracle Client. When tagging `client`, you also may to want to specify the Variable `client_version` when starting the playbook with `client` TAG.
144
+
- duplicate: Specifies, that you want to duplicate a Source Database to a Target Database. Uses RMAN duplicate from active Database. You need to specify the `duplicate_source_host`, `duplicate_target_host`, `duplicate_source_sid` and `duplicate_target_sid` Variable. As HOSTS you need to specify the Target Host.
145
+
- upgrade: Specifies that you want to upgrade a Database to a new Version. You need to specify the Variables `oracle_source_version`, `oracle_target_version`, `oracle_sid` and `upgrade_mode` when starting the Playbook with the `upgrade` TAG.
146
+
- datapump: Specifies, that you want to do an Datapump Export / Import over NETWORK_LINK. You need to specify the `datapump_source_host`, `datapump_target_host`, `datapump_source_sid` and `datapump_target_sid` Variable. As HOSTS you need to specify the Target Host.
0 commit comments