├── 1412EDG ├── change_to_tns_alias.sh ├── generate_perdomainCACERTS-ohs.sh ├── generate_perdomainCACERTS.sh ├── import-domainca-into-kss.sh ├── rsync_copy_and_validate.sh └── rsync_for_WLS.sh ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── SECURITY.md ├── app_dr_common ├── LICENSE.txt ├── README.md ├── THIRD_PARTY_LICENSES.txt ├── dbfs_dr_setup_root.sh ├── fmw_change_to_tns_alias.sh ├── fmw_dec_pwd.sh ├── fmw_enc_pwd.sh ├── fmw_get_connect_string.sh ├── fmw_get_dbrole_wlst.sh └── fmw_get_ds_property.sh ├── apps-unlimited ├── .gitkeep └── PeopleSoft │ └── dr_scripts │ ├── .gitkeep │ ├── Basic_Tasks │ ├── README.md │ ├── get_ps_domain.sh │ ├── startAPP.sh │ ├── startCacheServer.sh │ ├── startPS.sh │ ├── startWS.sh │ ├── stopAPP.sh │ ├── stopCacheServer.sh │ ├── stopPS.sh │ └── stopWS.sh │ ├── LICENSE.txt │ ├── README.md │ ├── Replication │ ├── Example_cron_job_entries.txt │ ├── README.md │ ├── disable_psft_rsync.sh │ ├── enable_psft_rsync.sh │ ├── fs1 │ ├── fs2 │ ├── get_db_session_count.sh │ ├── get_site_role.sh │ ├── psrsync.env │ └── rsync_psft.sh │ └── Wrapper │ ├── README.md │ ├── ps_rpt.env │ ├── set_ps_rpt_node.sh │ ├── startPSFTAPP.sh │ ├── startPSFTWEB.sh │ ├── stopPSFTAPP.sh │ └── stopPSFTWEB.sh ├── dg_setup_scripts ├── 1_prepare_primary_maa_parameters.sh ├── 2_dataguardit_primary.sh ├── 3_dataguardit_standby_root.sh ├── DG_properties.ini ├── LICENSE.txt ├── README.md ├── create_pw_tar_from_asm_root.sh └── dg_setup_scripts.zip ├── dns_and_frontend_utilities ├── README.md ├── scripts_check_frontend_url.zip ├── scripts_check_frontend_url │ ├── LICENSE.txt │ ├── check_sample_url.sh │ └── check_soainfra.sh ├── scripts_update_frontend_DNS.zip └── scripts_update_frontend_DNS │ ├── LICENSE.txt │ ├── README.txt │ ├── virtual_frontend_DNS_entry_to_SITE1.sh │ └── virtual_frontend_DNS_entry_to_SITE2.sh ├── drs_mp_soa ├── .gitignore ├── LICENSE.txt ├── PREPARE_DRS_VENV.md ├── README.md ├── THIRD_PARTY_LICENSES.txt ├── VERSION ├── _internal_python │ └── requirements-drs-plain.txt ├── _internal_scripts │ ├── LICENSE │ ├── check_frontend.sh │ ├── check_soainfra.sh │ ├── db_check_if_rac.sh │ ├── db_select_db_name.sh │ ├── db_select_db_unique_name.sh │ ├── dg_convert_db_to_physical_standby.sh │ ├── dg_convert_db_to_snapshot_standby.sh │ ├── dg_show_configuration_verbose.sh │ ├── dg_switchover_to_standby_db.sh │ ├── fmw_dec_pwd.sh │ ├── fmw_dr_setup_primary.sh │ ├── fmw_dr_setup_standby.sh │ ├── fmw_enc_pwd.sh │ ├── fmw_get_dbrole_wlst.sh │ ├── fmw_get_ds_property.sh │ ├── fmw_primary_check_connectivity_to_stby_admin.sh │ ├── fmw_standby_check_db_connectivity.sh │ ├── fmw_sync_in_primary.sh │ ├── fmw_sync_in_standby.sh │ ├── host_check_ps_process.sh │ ├── host_get_hostname.sh │ ├── host_get_osinfo.sh │ ├── post_setup_drop_tmp_info.sh │ ├── wls_admin_control.py │ ├── wls_check_stack_up.sh │ ├── wls_get_domain_home.sh │ ├── wls_initinfo_get_wl_home.sh │ ├── wls_managed_control.py │ ├── wls_nm_control.py │ └── wls_util.py ├── drs-mp.tar.gz ├── drs_config.py ├── drs_const.py ├── drs_lib.py ├── drs_main.py ├── drs_monitor_log.sh ├── drs_run.sh └── drs_user_config.yaml ├── fmw-wls-with-adb-dr ├── LICENSE ├── README.md ├── fmwadb_config_replica.sh ├── fmwadb_dr_prim.sh ├── fmwadb_dr_stby.sh ├── fmwadb_rest_api_listabds.sh └── fmwadb_switch_db_conn.sh ├── fmw_schemas_exp_imp ├── README.md ├── common_export_import_fmw.sh ├── export_fmw.sh └── import_fmw.sh ├── kubernetes-maa ├── LICENSE.txt ├── README.md ├── apply-artifacts.sh ├── maak8-etcd-backup.sh ├── maak8-etcd-restore.sh ├── maak8-get-all-artifacts.sh ├── maak8-push-all-artifacts.sh ├── maak8DR-apply.env ├── maak8DR-apply.sh ├── maak8s-force-stop-cp.sh ├── maak8s-kube-api-alias.sh ├── maak8s.env └── removeyamlblock.sh ├── maa_wls_lifecycle_scripts ├── Generic │ ├── .gitkeep │ ├── README.md │ ├── domain_properties.env │ ├── py_scripts │ │ ├── .gitkeep │ │ ├── nmkill_servers.py │ │ ├── start_cluster.py │ │ ├── start_servers.py │ │ ├── stop_cluster.py │ │ └── stop_servers.py │ ├── wls_start.sh │ └── wls_stop.sh ├── LICENSE.txt ├── PaaS │ ├── README.md │ ├── nmkill_servers.py │ ├── start_servers.py │ ├── stop_servers.py │ ├── wls_start.sh │ └── wls_stop.sh └── README.md ├── manual_hybrid_dr ├── LICENSE.txt ├── README.md ├── hybrid_dr_rsync_scripts │ ├── README.md │ ├── example_rsync_LOCALCONFIG_to_WLS1.sh │ ├── example_rsync_OHSCONFIG_to_OHS1.sh │ ├── example_rsync_PRODUCTS_to_OHS1.sh │ ├── example_rsync_PRODUCTS_to_WLS1.sh │ ├── example_rsync_SHAREDCONFIG_to_WLS1.sh │ ├── example_rsync_SHAREDRUNTIME_to_WLS1.sh │ ├── example_rsync_orainventory_to_WLS1.sh │ ├── hybrid_dr_rsync_scripts.zip │ └── rsync_copy_and_validate.sh ├── hybrid_dr_terraform │ ├── LICENSE.txt │ ├── README.md │ ├── common │ │ ├── HybridDR_DBSystem │ │ │ ├── 1_get_shapes_and_versions │ │ │ │ ├── main.tf │ │ │ │ ├── terraform.tfvars │ │ │ │ └── variables.tf │ │ │ ├── 2_create_DBSystem │ │ │ │ ├── main.tf │ │ │ │ ├── terraform.tfvars │ │ │ │ └── variables.tf │ │ │ └── README.md │ │ ├── HybridDR_FSSresources │ │ │ ├── README.md │ │ │ ├── main.tf │ │ │ ├── terraform.tfvars │ │ │ └── variables.tf │ │ ├── HybridDR_NetworkResources │ │ │ ├── README.md │ │ │ ├── main.tf │ │ │ ├── terraform.tfvars │ │ │ └── variables.tf │ │ ├── HybridDR_OCILoadBalancer │ │ │ ├── README.md │ │ │ ├── backendsets.tf │ │ │ ├── certificate.tf │ │ │ ├── clusters.yaml │ │ │ ├── clusters_SOA_example.yaml │ │ │ ├── clusters_example.yaml │ │ │ ├── hostnames.tf │ │ │ ├── listeners.tf │ │ │ ├── locals.tf │ │ │ ├── main.tf │ │ │ ├── routing_policies.tf │ │ │ ├── rulesets.tf │ │ │ ├── terraform.tfvars │ │ │ └── variables.tf │ │ └── README.md │ ├── hybrid_dr_terraform.zip │ ├── soa │ │ ├── HybridDR_SOAComputeInstances │ │ │ ├── 1_get_shapes_and_images │ │ │ │ ├── main.tf │ │ │ │ ├── terraform.tfvars │ │ │ │ └── variables.tf │ │ │ ├── 2_create_compute_instances │ │ │ │ ├── main.tf │ │ │ │ ├── terraform.tfvars │ │ │ │ └── variables.tf │ │ │ └── README.md │ │ └── README.md │ └── wls │ │ ├── HybridDR_WLSComputeInstances │ │ ├── README.md │ │ ├── compute.tf │ │ ├── datasources.tf │ │ ├── main.tf │ │ ├── outputs.tf │ │ ├── terraform.tfvars │ │ └── variables.tf │ │ └── README.md └── others │ ├── README.md │ ├── others.zip │ └── update_dbconnect.sh ├── private_dns_views_for_dr ├── LICENSE.txt ├── README.md ├── main.tf ├── private_dns_views_for_dr.zip ├── terraform.tfvars └── variables.tf ├── wls-hydr ├── README.md ├── THIRD_PARTY_LICENSES.txt ├── cleanup.py ├── config │ ├── .gitkeep │ ├── oci.env │ ├── prem.env │ └── replication.properties ├── images │ ├── .gitkeep │ ├── Main_flow_diagram.png │ ├── flow_diagram_create_from_zero.png │ ├── flow_migrate.png │ ├── flow_migration.png │ ├── flow_migration_from_copy.png │ ├── maa-wls-hybrid-dr-tool-highlights.png │ ├── maa-wls-hybrid-dr-tool.png │ ├── maa-wls-hybrid-dr.png │ └── tool-main-modules.png ├── lib │ ├── DataReplication.py │ ├── Discovery.py │ ├── Logger.py │ ├── OciManager.py │ ├── README_FOR_MANUAL_COPY.txt │ ├── Utils.py │ ├── replication.internals │ └── templates │ │ ├── ohs_node_init.sh │ │ └── wls_node_init.sh ├── log │ └── .gitkeep ├── requirements.txt ├── sysconfig.xlsx ├── sysconfig_discovery.xlsx ├── wls_full_setup.py └── wls_hydr.py └── wls_mp_dr ├── Block_Volume_Replica_Method ├── .gitkeep ├── README.md ├── replacement_script_BVmodel.zip └── replacement_script_BVmodel │ ├── LICENSE.txt │ └── replacement_script_BVmodel.sh ├── Drawio_Diagrams ├── DIAGRAM_config_replica.drawio ├── DIAGRAM_fmw_dr_setup_primary.drawio └── DIAGRAM_fmw_dr_setup_standby.drawio ├── LICENSE.txt ├── README.md ├── config_replica.sh ├── fmw_dr_setup_primary.sh ├── fmw_dr_setup_standby.sh ├── fmw_sync_in_primary.sh └── fmw_sync_in_standby.sh /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to this repository 2 | 3 | We welcome your contributions! There are multiple ways to contribute. 4 | 5 | ## Opening issues 6 | 7 | For bugs or enhancement requests, please file a GitHub issue unless it's 8 | security related. When filing a bug remember that the better written the bug is, 9 | the more likely it is to be fixed. If you think you've found a security 10 | vulnerability, do not raise a GitHub issue and follow the instructions in our 11 | [security policy](./SECURITY.md). 12 | 13 | ## Contributing code 14 | 15 | We welcome your code contributions. Before submitting code via a pull request, 16 | you will need to have signed the [Oracle Contributor Agreement][OCA] (OCA) and 17 | your commits need to include the following line using the name and e-mail 18 | address you used to sign the OCA: 19 | 20 | ```text 21 | Signed-off-by: Your Name 22 | ``` 23 | 24 | This can be automatically added to pull requests by committing with `--sign-off` 25 | or `-s`, e.g. 26 | 27 | ```text 28 | git commit --signoff 29 | ``` 30 | 31 | Only pull requests from committers that can be verified as having signed the OCA 32 | can be accepted. 33 | 34 | ## Pull request process 35 | 36 | 1. Ensure there is an issue created to track and discuss the fix or enhancement 37 | you intend to submit. 38 | 1. Fork this repository 39 | 1. Create a branch in your fork to implement the changes. We recommend using 40 | the issue number as part of your branch name, e.g. `1234-fixes` 41 | 1. Ensure that any documentation is updated with the changes that are required 42 | by your change. 43 | 1. Ensure that any samples are updated if the base image has been changed. 44 | 1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly 45 | what your changes are meant to do and provide simple steps on how to validate 46 | your changes. Ensure that you reference the issue you created as well. 47 | 1. We will assign the pull request to 2-3 people for review before it is merged. 48 | 49 | ## Code of conduct 50 | 51 | Follow the [Golden Rule](https://en.wikipedia.org/wiki/Golden_Rule). If you'd 52 | like more specific guidelines, see the [Contributor Covenant Code of Conduct][COC]. 53 | 54 | [OCA]: https://oca.opensource.oracle.com 55 | [COC]: https://www.contributor-covenant.org/version/1/4/code-of-conduct/ 56 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022, 2023 Oracle and/or its affiliates. 2 | 3 | The Universal Permissive License (UPL), Version 1.0 4 | 5 | Subject to the condition set forth below, permission is hereby granted to any 6 | person obtaining a copy of this software, associated documentation and/or data 7 | (collectively the "Software"), free of charge and under any and all copyright 8 | rights in the Software, and any and all patent rights owned or freely 9 | licensable by each licensor hereunder covering either (i) the unmodified 10 | Software as contributed to or provided by such licensor, or (ii) the Larger 11 | Works (as defined below), to deal in both 12 | 13 | (a) the Software, and 14 | (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 15 | one is included with the Software (each a "Larger Work" to which the Software 16 | is contributed by such licensors), 17 | 18 | without restriction, including without limitation the rights to copy, create 19 | derivative works of, display, perform, and distribute the Software and make, 20 | use, sell, offer for sale, import, export, have made, and have sold the 21 | Software and the Larger Work(s), and to sublicense the foregoing rights on 22 | either these or other terms. 23 | 24 | This license is subject to the following condition: 25 | The above copyright notice and either this complete permission notice or at 26 | a minimum a reference to the UPL must be included in all copies or 27 | substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 35 | SOFTWARE. 36 | 37 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting security vulnerabilities 2 | 3 | Oracle values the independent security research community and believes that 4 | responsible disclosure of security vulnerabilities helps us ensure the security 5 | and privacy of all our users. 6 | 7 | Please do NOT raise a GitHub Issue to report a security vulnerability. If you 8 | believe you have found a security vulnerability, please submit a report to 9 | [secalert_us@oracle.com][1] preferably with a proof of concept. Please review 10 | some additional information on [how to report security vulnerabilities to Oracle][2]. 11 | We encourage people who contact Oracle Security to use email encryption using 12 | [our encryption key][3]. 13 | 14 | We ask that you do not use other channels or contact the project maintainers 15 | directly. 16 | 17 | Non-vulnerability related security issues including ideas for new or improved 18 | security features are welcome on GitHub Issues. 19 | 20 | ## Security updates, alerts and bulletins 21 | 22 | Security updates will be released on a regular cadence. Many of our projects 23 | will typically release security fixes in conjunction with the 24 | Oracle Critical Patch Update program. Additional 25 | information, including past advisories, is available on our [security alerts][4] 26 | page. 27 | 28 | ## Security-related information 29 | 30 | We will provide security related information such as a threat model, considerations 31 | for secure use, or any known security issues in our documentation. Please note 32 | that labs and sample code are intended to demonstrate a concept and may not be 33 | sufficiently hardened for production use. 34 | 35 | [1]: mailto:secalert_us@oracle.com 36 | [2]: https://www.oracle.com/corporate/security-practices/assurance/vulnerability/reporting.html 37 | [3]: https://www.oracle.com/security-alerts/encryptionkey.html 38 | [4]: https://www.oracle.com/security-alerts/ 39 | -------------------------------------------------------------------------------- /app_dr_common/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** app_dr_common scripts 3 | ** 4 | ** Copyright (c) 2022 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | -------------------------------------------------------------------------------- /app_dr_common/README.md: -------------------------------------------------------------------------------- 1 | Application DR common scripts 2 | Copyright (c) 2024 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | 6 | Using the Application DR common scripts 7 | ============================================== 8 | These are common scripts referenced by different Disaster Recovery documents. 9 | 10 | 11 | 12 | | Script name | Description | 13 | | ------------- | ------------- | 14 | | [dbfs_dr_setup_root.sh](./dbfs_dr_setup_root.sh) | This script is needed ONLY when DBFS is used as a staging directory for WLS domain configuration. It sets up a DBFS mount point in a hosts: it installs Oracle Database Client, installs fuse, creates DBFS DB schemas, configures wallet and mounts DBFS file system. | 15 | | [fmw_change_to_tns_alias.sh](./fmw_change_to_tns_alias.sh) | This script is used to replace current db connect string in datasources with a TNS alias. | 16 | | [fmw_enc_pwd.sh](./fmw_enc_pwd.sh) | _Referenced by other scripts_. This script encrypts a password using WebLogic encryption. | 17 | | [fmw_dec_pwd.sh](./fmw_dec_pwd.sh) | _Referenced by other scripts_. This script decrypts a password using WebLogic encryption. | 18 | | [fmw_get_connect_string.sh](./fmw_get_connect_string.sh) | _Referenced by other scripts_. This script gets the connect string from a datasource file. | 19 | | [fmw_get_dbrole_wlst.sh](./fmw_get_dbrole_wlst.sh) | _Referenced by other scripts_. This script gets the role of the database using WLST command. | 20 | | [export_fmw.sh](https://github.com/oracle-samples/maa/blob/main/fmw_schemas_exp_imp/export_fmw.sh) |Exports the tablespaces, schemas and roles of an Oracle FMW domain. | 21 | | [import_fmw.sh](https://github.com/oracle-samples/maa/blob/main/fmw_schemas_exp_imp/import_fmw.sh) |Imports the tablespaces, schemas and roles of an Oracle FMW domain. | 22 | -------------------------------------------------------------------------------- /app_dr_common/fmw_dec_pwd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## fmw_enc_pwd.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | export ENC_PASSWORD=$1 10 | echo "domain='${DOMAIN_HOME}'" > /tmp/pret.py 11 | echo "service=weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)" >>/tmp/pret.py 12 | echo "encryption=weblogic.security.internal.encryption.ClearOrEncryptedService(service)" >>/tmp/pret.py 13 | echo "print encryption.decrypt('${ENC_PASSWORD}')" >>/tmp/pret.py 14 | export dec_pwd=$($MIDDLEWARE_HOME/oracle_common/common/bin/wlst.sh /tmp/pret.py | tail -1) 15 | echo "$dec_pwd" 16 | rm /tmp/pret.py 17 | 18 | 19 | -------------------------------------------------------------------------------- /app_dr_common/fmw_enc_pwd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## fmw_enc_pwd.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | ### This script encrypts a password using WLS encryption. 10 | ### Usage: 11 | ### 12 | ### ./fmw_enc_pwd.sh [UNENCRYPTED_PASSWORD] 13 | ### Where: 14 | ### UNENCRYPTED_PASSWORD: 15 | ### This is the uncrypted password that will be encrypted. 16 | 17 | export DEC_PASSWORD=$1 18 | echo "domain='${DOMAIN_HOME}'" > /tmp/pret.py 19 | echo "service=weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)" >>/tmp/pret.py 20 | echo "encryption=weblogic.security.internal.encryption.ClearOrEncryptedService(service)" >>/tmp/pret.py 21 | echo "print encryption.encrypt('${DEC_PASSWORD}')" >>/tmp/pret.py 22 | export enc_pwd=$($MIDDLEWARE_HOME/oracle_common/common/bin/wlst.sh /tmp/pret.py | tail -1) 23 | echo "$enc_pwd" 24 | rm /tmp/pret.py 25 | 26 | -------------------------------------------------------------------------------- /app_dr_common/fmw_get_connect_string.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## fmw_get_connect_string.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | 8 | ## This script returns the connect string that a WLS/SOA/FMW datasource is using 9 | ## 10 | ## Usage: 11 | ## ./fmw_get_connect_string.sh DATASOURCE_FILE 12 | ## 13 | ## Where: 14 | ## DATASOURCE_FILE The WLS jdbc datasource file (complete path) 15 | 16 | ### EXAMPLE: 17 | ### ./fmw_get_connect_string.sh /u01/data/domains/my_domain/config/jdbc/opss-datasource-jdbc.xml 18 | 19 | if [[ $# -eq 1 ]]; then 20 | export DATASOURCE_FILE=$1 21 | else 22 | echo "" 23 | echo "ERROR: Incorrect number of parameters used. Expected 1, got $#" 24 | echo "Usage :" 25 | echo " $0 DATASOURCE_FILE" 26 | echo "Example: " 27 | echo " $0 '/u01/data/domains/my_domain/config/jdbc/opss-datasource-jdbc.xml'" 28 | echo "" 29 | exit 1 30 | fi 31 | 32 | export result=$(grep url ${DATASOURCE_FILE} | awk -F ':@' '{print $2}' |awk -F '' '{print $1}' | awk '{$1=$1};1') 33 | echo $result 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app_dr_common/fmw_get_dbrole_wlst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## fmw_get_dbrole_wlst.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | ## This script can be used to get the role of the database 10 | 11 | ## The script uses com.ziclix.python.sql package and triggers a temporary script execution from wlstr 12 | ## It uses the connect string and values passed as parameter 13 | 14 | ### Usage: 15 | ### ./fmw_get_dbrole_wlst.sh USERNAME PASSWORD JDBC_URL 16 | ### 17 | ### Example: 18 | ### ./fmw_get_dbrole_wlst.sh 'sys' 'mypassword' 'jdbc:oracle:thin:@dbhost-scan.dbsubnet.myvcn.oraclevcn.com:1521/PDB1.dbsubnet.myvcn.oraclevcn.com' 19 | ### 20 | 21 | export username="$1" 22 | export password="$2" 23 | export jdbc_url="$3" 24 | 25 | if [[ ${username} = "sys" || ${username} = "SYS" ]]; then 26 | username="sys as sysdba" 27 | fi 28 | 29 | execute_query(){ 30 | echo "from com.ziclix.python.sql import zxJDBC" > /tmp/get_db_role.py 31 | echo "jdbc_url = \"$jdbc_url\" " >> /tmp/get_db_role.py 32 | echo "username = \"$username\" " >> /tmp/get_db_role.py 33 | echo "password = \"$password\" " >> /tmp/get_db_role.py 34 | echo "driver = \"oracle.jdbc.xa.client.OracleXADataSource\" " >> /tmp/get_db_role.py 35 | echo "conn = zxJDBC.connect(jdbc_url, username, password, driver)" >> /tmp/get_db_role.py 36 | echo "cursor = conn.cursor(1)" >> /tmp/get_db_role.py 37 | echo "cursor.execute(\"select database_role from v\$database\")" >> /tmp/get_db_role.py 38 | echo "print cursor.fetchone()" >> /tmp/get_db_role.py 39 | export result=$($MIDDLEWARE_HOME/oracle_common/common/bin/wlst.sh /tmp/get_db_role.py | tail -1) 40 | echo "${result}" 41 | } 42 | 43 | execute_query 44 | 45 | -------------------------------------------------------------------------------- /app_dr_common/fmw_get_ds_property.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## fmw_get_ds_property.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | 8 | ## This script returns the value of a specific datasource property from a datasource 9 | ## 10 | ## Usage: 11 | ## ./fmw_get_ds_property.sh DATASOURCE_FILE DATASOURCE_PROPERTY 12 | ## 13 | ## Where: 14 | ## DATASOURCE_FILE The WLS jdbc datasource file (complete path) 15 | ## DATASOURCE_PROPERTY The property name in datasource file 16 | 17 | ## EXAMPLE: 18 | ## ./fmw_get_ds_property.sh '/u01/data/domains/my_domain/config/jdbc/opss-datasource-jdbc.xml' oracle.net.tns_admin 19 | 20 | if [[ $# -eq 2 ]]; then 21 | export DATASOURCE_FILE=$1 22 | export DATASOURCE_PROPERTY=$2 23 | else 24 | echo "" 25 | echo "ERROR: Incorrect number of parameters used. Expected 2, got $#" 26 | echo "Usage :" 27 | echo " $0 DATASOURCE_FILE DATASOURCE_PROPERTY" 28 | echo "Example: " 29 | echo " $0 '/u01/data/domains_my_domain/config/jdbc/opss-datasource-jdbc.xml' 'oracle.net.tns_admin'" 30 | echo "" 31 | exit 1 32 | fi 33 | 34 | export property_name_value=$(grep ''$DATASOURCE_PROPERTY'' $DATASOURCE_FILE -A1) 35 | 36 | if [[ "$property_name_value" == *"encrypted-value-encrypted"* ]]; then 37 | export result=$(echo $property_name_value | awk -F'' '{print $2}' | awk -F'' '{print $1}'| awk '{$1=$1};1') 38 | else 39 | export result=$(echo $property_name_value | awk -F'' '{print $2}' | awk -F'' '{print $1}'| awk '{$1=$1};1') 40 | fi 41 | 42 | echo $result 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /apps-unlimited/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/.gitkeep: -------------------------------------------------------------------------------- 1 | File for tracking. Creation of the PeopleSoft and underlying directories and scripts. 2 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Basic_Tasks/README.md: -------------------------------------------------------------------------------- 1 | # Oracle Peoplesoft MAA Basic Task Scripts 2 | 3 | Version 1.0 4 | 5 | Copyright (c) 2024 Oracle and/or its affiliates. 6 | 7 | Released under the Universal Permissive License v1.0 as shown at 8 | . 9 | 10 | 11 | ## Overview 12 | 13 | These are simple scripts to start and stop the application server domain, the process scheduler domains, the PIA webserver domains and the Coherence*Web cache server. These are stand-alone scripts that are run on each PeopleSoft middle tier node. You can specify the domain name as a parameter to these scripts. 14 | 15 | ## Prerequisite 16 | 17 | Ensure that the environment variables required for PeopleSoft application servers and web servers are properly defined. These scripts must run on the appropriate PeopleSoft server. 18 | 19 | 20 | ## Script Description 21 | 22 | The table below provides the script name and its purpose. 23 | 24 | ===================================== 25 | 26 | | Script Name | Description | 27 | | ------ | ------ | 28 | | [startAPP.sh](./startAPP.sh) | Starts the PeopleSoft Application Server domain. | 29 | | [stopAPP.sh](./stopAPP.sh) | Shuts down the PeopleSoft Application Server domain. | 30 | | [startPS.sh](startPS.sh) | Starts the PeopleSoft Process Scheduler domain. | 31 | | [stopPS.sh](./stopPS.sh) | Shuts down the PeopleSoft Process Scheduler domain. | 32 | | [startCacheServer.sh](./startCacheServer.sh) | Starts the Coherence*Web cache server. | 33 | | [stopCacheServer.sh](./stopCacheServer.sh) | Stops the Coherence*Web cache server. | 34 | | [startWS.sh](./startWS.sh) | Starts the PIA web server domain. | 35 | | [stopWS.sh](./stopWS.sh) | Shuts down the PIA web server domain. | 36 | | [get_ps_domain.sh](./get_ps_domain.sh) | Called by the start and stop scripts listed above to determine the PeopleSoft domain for the application server, process scheduler and web servers. 37 | 38 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Basic_Tasks/get_ps_domain.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: get_ps_domain.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: This script is called by several other scripts that will pass in domain directory locatins. 10 | # Returns the PS domain based on the passed in domain directory parameter. 11 | # If the directory locaiotn pointed to by DOMAIN_DIR does not exists, set DOMAIN="" 12 | # if the directory location pointed to by DOMAIN_DIR contains zero or 2 or more domains, set DOMAIN="" 13 | # if the directory location pointed to by DOMAIN_DIR contains only one domain, set DOMAIN to that domain name. 14 | # Return DOMAIN. 15 | # 16 | # Usage: get_ps_domain.sh 17 | # 18 | # Errors: Domain not set if: 19 | # Domain directory location does not exists. Return exit code 1 20 | # More than one domain found. Return exit code 2. 21 | # 22 | ############################################################################ 23 | 24 | DOMAIN_DIR="$1" 25 | RC=0 26 | 27 | 28 | # Check to see if DOMAIN_DIR directory exists. 29 | if [ -d "${DOMAIN_DIR}" ]; then 30 | DOMAIN=$(ls -l "${DOMAIN_DIR}" | grep ^d | grep -v prcs | awk '{print $9}') 31 | n=$(echo "$DOMAIN" | wc -w) 32 | if [ "$n" != 1 ]; then 33 | # There is either no domains or there are more than one domain. 34 | DOMAIN="" 35 | RC=2 36 | fi 37 | else 38 | # Domain directory does not exists. 39 | DOMAIN="" 40 | RC=1 41 | fi 42 | 43 | echo "${DOMAIN}" 44 | # Return exit code. 45 | exit ${RC} 46 | 47 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Basic_Tasks/startAPP.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: startAPP.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Start PeopleSoft application server on one node 10 | # 11 | # Usage: startAPP.sh 12 | # If no parameter, look in $PS_CFG_HOME/appserv for the domain 13 | # 14 | # Errors: Domain not set. Could not determine domain. 15 | # 16 | ############################################################################ 17 | 18 | source ~/psft.env 19 | 20 | DOMAIN="$1" 21 | DOMAIN_DIR="${PS_CFG_HOME}/appserv" 22 | RC=0 23 | 24 | # get the length of the parameter 25 | n=${#DOMAIN} 26 | 27 | # Did they pass in a parameter? it is the domain 28 | if [ "$n" != 0 ]; then 29 | echo "Domain passed in as parameter: ${DOMAIN}" 30 | else 31 | echo "No domain passed in. Look for single App Server domain." 32 | DOMAIN="$("${SCRIPT_DIR}"/get_ps_domain.sh "${DOMAIN_DIR}")" 33 | RC=$? 34 | if [ ${RC} != 0 ]; then 35 | [[ ${RC} = 1 ]] && echo "Domain directory ${DOMAIN_DIR} does not exists." 36 | [[ ${RC} = 2 ]] && echo "Domain directory ${DOMAIN_DIR} contains either no domains or more than one domain." 37 | exit ${RC} 38 | fi 39 | fi 40 | 41 | # Is the domain set? 42 | if [ "${DOMAIN}" = "" ]; then 43 | echo "Domain not set. Stopping run." 44 | exit 1 45 | fi 46 | 47 | HOSTNAME="$(hostname)" 48 | 49 | date 50 | echo "---- Starting Apps Server for domain: $DOMAIN on host: $HOSTNAME ----" 51 | "${PS_HOME}"/appserv/psadmin -c boot -d "${DOMAIN}" 52 | 53 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Basic_Tasks/startCacheServer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: startCacheServer.sh Version 1.0 5 | # 6 | # 7 | # Copyright (c) 2024 Oracle and/or its affiliates 8 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 9 | # 10 | # Description: Start Coherence*Web cache server 11 | # 12 | # Usage: startCacheServer.sh 13 | # We don't have a good way to derive the domain name/build a 14 | # directory location for Coherence*Web log files, so it is 15 | # required. 16 | # 17 | # Errors: Could not determine Coherence domain 18 | # 19 | ############################################################################ 20 | 21 | source ~/psft.env 22 | 23 | DOMAIN="$1" 24 | 25 | # get the length of the parameter 26 | n=${#DOMAIN} 27 | 28 | # Did they pass in a parameter? it is the domain 29 | if [ "$n" != 0 ]; then 30 | echo "Domain passed in as parameter: ${DOMAIN}" 31 | else 32 | echo "No domain passed in. Domain required." 33 | exit 1 34 | fi 35 | 36 | HOSTNAME="$(hostname)" 37 | COHERENCE_HOME="${BASE_DIR}"/pt/bea/coherence 38 | COHERENCE_CONFIG="${PS_CFG_HOME}"/coherence/config 39 | COHERENCE_LOG="${PS_CFG_HOME}"/coherence/log 40 | CWEB_LOG_NAME=pia_"${DOMAIN}"_"${HOSTNAME}" 41 | CWEB_LOG_LEVEL=9 42 | 43 | date 44 | echo "------ Starting Coherence*Web Cache Server for domain: $DOMAIN on host: $HOSTNAME ----" 45 | 46 | echo "" 47 | echo "tangosol.coherence.override=${COHERENCE_CONFIG}/tangosol-coherenceoverride.xml" 48 | echo "Log file can be found at: ${COHERENCE_LOG}/cweb_coherence_server_${CWEB_LOG_NAME}.log" 49 | 50 | java -Xms2g -Xmx2g -Dtangosol.coherence.distributed.localstorage=true -Dtangosol.coherence.session.localstorage=true -Dtangosol.coherence.override="${COHERENCE_CONFIG}"/tangosol-coherence-override.xml -Dtangosol.coherence.cacheconfig=default-session-cache-config.xml -Dtangosol.coherence.log="${COHERENCE_LOG}"/cweb_coherence_server_"${CWEB_LOG_NAME}".log -Dtangosol.coherence.log.level=9 -classpath "${COHERENCE_CONFIG}":"${COHERENCE_HOME}"/lib/coherence.jar:"${COHERENCE_HOME}"/lib/coherence-web.jar com.tangosol.net.DefaultCacheServer -Djava.net.preferIPv6Addresses=false -Djava.net.preferIPv4Stack=true -Dcoherence.log.level="${CWEB_LOG_LEVEL}" & 51 | 52 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Basic_Tasks/startPS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: startPS.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Start the PSFT process scheduler 10 | # 11 | # Usage: startPS.sh 12 | # If no parameter, look in $PS_CFG_HOME/appserv/prcs for the domain 13 | # 14 | # Errors: Domain not set 15 | # More than one domain found. 16 | # 17 | ################################################# 18 | 19 | source ~/psft.env 20 | 21 | DOMAIN="$1" 22 | DOMAIN_DIR="${PS_CFG_HOME}/appserv/prcs" 23 | RC=0 24 | 25 | # get the length of the parameter 26 | n=${#DOMAIN} 27 | 28 | # Did they pass in a parameter? it is the domain 29 | if [ "$n" != 0 ]; then 30 | echo "Domain passed in as parameter: ${DOMAIN}" 31 | else 32 | echo "No domain passed in. Look for single Process Scheduler domain." 33 | DOMAIN="$("${SCRIPT_DIR}"/get_ps_domain.sh "${DOMAIN_DIR}")" 34 | RC=$? 35 | if [ ${RC} != 0 ]; then 36 | [[ ${RC} = 1 ]] && echo "Domain directory ${DOMAIN_DIR} does not exists." 37 | [[ ${RC} = 2 ]] && echo "Domain directory ${DOMAIN_DIR} contains either no domains or more than one domain." 38 | exit ${RC} 39 | fi 40 | fi 41 | 42 | # Is the DOMAIN set? 43 | if [ "${DOMAIN}" = "" ]; then 44 | echo "DOMAIN not set. Stopping run." 45 | exit 1 46 | fi 47 | 48 | HOSTNAME="$(hostname)" 49 | 50 | date 51 | echo "-- Starting Process Scheduler for domain: $DOMAIN on host: $HOSTNAME --" 52 | "${PS_HOME}"/appserv/psadmin -p start -d "${DOMAIN}" 53 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Basic_Tasks/startWS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: startWS.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Start the PeopleSoft PIA / WLS server 10 | # 11 | # Usage: startWS.sh 12 | # 13 | # Errors: 14 | # 15 | ############################################################################ 16 | 17 | # Start the PeopleSoft PIA. 18 | 19 | source ~/psft.env 20 | 21 | DOMAIN="$1" 22 | DOMAIN_DIR="${PS_CFG_HOME}/webserv" 23 | RC=0 24 | 25 | # get the length of the parameter 26 | n=${#DOMAIN} 27 | 28 | # Did they pass in a parameter? it is the domain 29 | if [ "$n" != 0 ]; then 30 | echo "Domain passed in as parameter: ${DOMAIN}" 31 | else 32 | echo "No domain passed in. Look for single WLS Server domain." 33 | DOMAIN="$("${SCRIPT_DIR}"/get_ps_domain.sh "${DOMAIN_DIR}")" 34 | RC=$? 35 | if [ ${RC} != 0 ]; then 36 | [[ ${RC} = 1 ]] && echo "Domain directory ${DOMAIN_DIR} does not exists." 37 | [[ ${RC} = 2 ]] && echo "Domain directory ${DOMAIN_DIR} contains either no domains or more than one domain." 38 | exit ${RC} 39 | fi 40 | fi 41 | 42 | # Is the domain set? 43 | if [ "${DOMAIN}" = "" ]; then 44 | echo "Domain not set. Stopping run." 45 | exit 1 46 | fi 47 | 48 | HOSTNAME="$(hostname)" 49 | 50 | date 51 | echo "------ Starting WLS Server for domain: $DOMAIN on host: $HOSTNAME ----" 52 | "${PS_CFG_HOME}"/webserv/"${DOMAIN}"/bin/startPIA.sh 53 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Basic_Tasks/stopCacheServer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: stopCacheServer.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Stop Coherence*Web cache server 10 | # 11 | # Usage: stopCacheServer.sh 12 | # NOTE: THIS STOPS ALL COHERENCE PROCESSES RUNNING ON THIS SERVER 13 | # 14 | # Errors: None 15 | # 16 | ############################################################################ 17 | 18 | EGREP_STRING="coherence" 19 | PROCESS_COUNT=0 20 | PID_LIST="" 21 | 22 | echo "Stopping Coherence*Web Cache Server..." 23 | PROCESS_COUNT=$(ps -elf | grep psadm2 | grep -E "${EGREP_STRING}" | grep -v grep | wc -l ) 24 | echo "Number of remaining process : ${PROCESS_COUNT}" 25 | 26 | if [ "${PROCESS_COUNT}" -ne 0 ]; then 27 | PID_LIST=$(ps -elf | grep psadm2 | grep -E "${EGREP_STRING}" | grep -v grep | awk '{ print $4 }' ) 28 | echo "Killing processes: " 29 | echo "${PID_LIST}" 30 | # DO NOT place double quotes around ${PID_LIST} as this will remove spaces between pids and cause the kill command to fail. 31 | kill -9 ${PID_LIST} 32 | fi 33 | 34 | 35 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Basic_Tasks/stopPS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: stopPS.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Stop the PSFT process scheduler 10 | # 11 | # Usage: stopPS.sh 12 | # If no parameter, look in $PS_CFG_HOME/appserv/prcs for the domain 13 | # 14 | # Errors: Domain not set 15 | # More than one domain found. 16 | # 17 | ############################################################################ 18 | 19 | source ~/psft.env 20 | 21 | DOMAIN="$1" 22 | DOMAIN_DIR="${PS_CFG_HOME}/appserv/prcs" 23 | RC=0 24 | 25 | # Get the length of the parameter 26 | n=${#DOMAIN} 27 | 28 | # Did they pass in a parameter? it is the domain 29 | if [ "$n" != 0 ]; then 30 | echo "Domain passed in as parameter: ${DOMAIN}" 31 | else 32 | echo "No domain passed in. Look for single Process Scheduler domain." 33 | DOMAIN="$("${SCRIPT_DIR}"/get_ps_domain.sh "${DOMAIN_DIR}")" 34 | RC=$? 35 | if [ ${RC} != 0 ]; then 36 | [[ ${RC} = 1 ]] && echo "Domain directory ${DOMAIN_DIR} does not exists." 37 | [[ ${RC} = 2 ]] && echo "Domain directory ${DOMAIN_DIR} contains either no domains or more than one domain." 38 | exit ${RC} 39 | fi 40 | fi 41 | 42 | # Is the DOMAIN set? 43 | if [ "${DOMAIN}" = "" ]; then 44 | echo "DOMAIN not set. Stopping run." 45 | exit 1 46 | fi 47 | 48 | HOSTNAME="$(hostname)" 49 | 50 | date 51 | echo "-- Stopping Process Scheduler for domain: $DOMAIN on host: $HOSTNAME --" 52 | "${PS_HOME}"/appserv/psadmin -p kill -d "${DOMAIN}" 53 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Basic_Tasks/stopWS.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: stopWS.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Stop the PeopleSoft PIA / WLS server 10 | # 11 | # Usage: stopWS.sh 12 | # 13 | # Errors: No domain passed in, more than one found 14 | # 15 | ############################################################################ 16 | 17 | source ~/psft.env 18 | 19 | DOMAIN="$1" 20 | DOMAIN_DIR="${PS_CFG_HOME}/webserv" 21 | RC=0 22 | 23 | # get the length of the parameter 24 | n=${#DOMAIN} 25 | 26 | # Did they pass in a parameter? it is the domain 27 | if [ "$n" != 0 ]; then 28 | echo "Domain passed in as parameter: ${DOMAIN}" 29 | else 30 | echo "No domain passed in. Look for single WLS Server domain." 31 | DOMAIN="$("${SCRIPT_DIR}"/get_ps_domain.sh "${DOMAIN_DIR}")" 32 | RC=$? 33 | if [ ${RC} != 0 ]; then 34 | [[ ${RC} = 1 ]] && echo "Domain directory ${DOMAIN_DIR} does not exists." 35 | [[ ${RC} = 2 ]] && echo "Domain directory ${DOMAIN_DIR} contains either no domains or more than one domain." 36 | exit ${RC} 37 | fi 38 | fi 39 | 40 | # Is the domain set? 41 | if [ "${DOMAIN}" = "" ]; then 42 | echo "Domain not set. Stopping run." 43 | exit 1 44 | fi 45 | 46 | HOSTNAME="$(hostname)" 47 | 48 | date 49 | echo "------ Stopping WLS Server for domain: $DOMAIN on host: $HOSTNAME ----" 50 | "${PS_CFG_HOME}"/webserv/"${DOMAIN}"/bin/stopPIA.sh 51 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** PeopleSoft MAA Disaster Recovery Scripts 3 | ** 4 | ** Copyright (c) 2023 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Replication/Example_cron_job_entries.txt: -------------------------------------------------------------------------------- 1 | In this project, we are replicating two FSS file systems: 2 | • /u02/app/psft/ps, defined in the file fs1, that contains job logs and the report repository. 3 | • /u01/app/psft/pt, defined in the file fs2, that contains the PeopleSoft PeopleTools software installation. 4 | The file system for fs1 needs to match the contents of the database as closely as possible, thus needs to have a higher frequency of replication. In the below crontab entry, it is set to every 5 minutes (*/5) for the minutes column. 5 | The file system for fs2 is more static and is set up to replicate once a day, at 2:00 AM (0 2). 6 | 7 | */5 * * * * psadm2 /u01/app/psft/pt/custom_admin_scripts/rsync_psft.sh /u01/app/psft/pt/custom_admin_scripts/fs1 8 | 0 2 * * * psadm2 /u01/app/psft/pt/custom_admin_scripts/rsync_psft.sh /u01/app/psft/pt/custom_admin_scripts/fs2 9 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Replication/disable_psft_rsync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: disable_psft_rsync.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Set the file system up to disable rsync. Do this when 10 | # switching the roles of primary and standby sites 11 | # 12 | # Usage: disable_psft_rsync.sh 13 | # Example: disable_psft_rsync.sh //fs1 14 | # 15 | # Errors: No run environment file specified 16 | # Cannot find run environment file 17 | # 18 | ############################################################################ 19 | 20 | if [ $# -eq 0 ] 21 | then 22 | echo "No run env file supplied. Please provide a run env. file." 23 | echo "Usage: disable_psft_rsync.sh " 24 | echo "Example: disable_psft_rsync.sh fs1" 25 | exit 1 26 | fi 27 | 28 | if [ ! -f "$1" ] 29 | then 30 | echo "File $1 does not exist." 31 | exit 1 32 | fi 33 | 34 | source ~/psft.env 35 | source "$SCRIPT_DIR"/psrsync.env 36 | source "$1" 37 | 38 | if [ -f "${SCRIPT_DIR}/.${FS_ALIAS}_rsync_disabled" ] 39 | then 40 | echo "PeopleSoft rsync job for ${FS_ALIAS} already disabled." 41 | else 42 | touch "${SCRIPT_DIR}"/."${FS_ALIAS}"_rsync_disabled 43 | echo "PeopleSoft rsync job for ${FS_ALIAS} disabled." 44 | fi 45 | 46 | exit 0 47 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Replication/enable_psft_rsync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: enable_psft_rsync.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Set the environment up so that the file system will be 10 | # replicated 11 | # 12 | # Usage: enable_psft_rsync.sh 13 | # 14 | # Errors: No run environment file specified 15 | # Cannot find run environment file 16 | # 17 | ############################################################################ 18 | 19 | # Enable the PeopleSoft rsync job. 20 | 21 | if [ $# -eq 0 ] 22 | then 23 | echo "No run env file supplied. Please provide a run env. file." 24 | echo "Usage: enable_psft_rsync.sh " 25 | echo "Example: enable_psft_rsync.sh fs1" 26 | exit 1 27 | fi 28 | 29 | if [ ! -f "$1" ] 30 | then 31 | echo "File $1 does not exist." 32 | exit 1 33 | fi 34 | 35 | source ~/psft.env 36 | source "$SCRIPT_DIR"/psrsync.env 37 | source "$1" 38 | 39 | if [ -f "${SCRIPT_DIR}/.${FS_ALIAS}_rsync_disabled" ] 40 | then 41 | rm -f "${SCRIPT_DIR}"/."${FS_ALIAS}"_rsync_disabled 42 | echo "PeopleSoft rsync job for ${FS_ALIAS} enabled." 43 | else 44 | echo "PeopleSoft rsync job for ${FS_ALIAS} already enabled." 45 | fi 46 | 47 | exit 0 48 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Replication/fs1: -------------------------------------------------------------------------------- 1 | # 2 | # Modify this file according to your environmenty. Please refer to the README for further details. 3 | # 4 | FS_ALIAS= 5 | LOG_FILE_NAME= 6 | SOURCE_RSYNC_DIR= 7 | TARGET_RSYNC_DIR= 8 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Replication/fs2: -------------------------------------------------------------------------------- 1 | # 2 | # Modify this file according to your environmenty. Please refer to the README for further details. 3 | # 4 | FS_ALIAS= 5 | LOG_FILE_NAME= 6 | SOURCE_RSYNC_DIR= 7 | TARGET_RSYNC_DIR= 8 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Replication/get_db_session_count.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: get_db_session_count.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Get the total number of application session connections. The query below counts session connections using database services. 10 | # HR92U033_BATCH is the database service used by the PeopleSoft process (batch) scheduler in our case study environment. 11 | # HR92U033_ONLINE is the database service used by the PeopleSoft application server for online users in our case study environment. 12 | # Edit the query below and change the service names according to your environment. 13 | # 14 | # Parameters: None 15 | # 16 | # Output: Returns only the number of sessions. 17 | # 18 | # Errors: Can return a database error (ORA-XXXXX) if database is unavailable or access failure. 19 | # 20 | # Notes: This script requires oci cli be installed 21 | # 22 | ############################################################################ 23 | 24 | source ~/psft.env 25 | source "$SCRIPT_DIR"/psrsync.env 26 | 27 | SECRET_OCID=$(oci vault secret list -c "$COMPARTMENT_OCID" --raw-output --query "data[?\"secret-name\" == '$SECRET_NAME'].id | [0]") 28 | PSFT_SECRET=$(oci secrets secret-bundle get --raw-output --secret-id "$SECRET_OCID" --query "data.\"secret-bundle-content\".content" | base64 -d ) 29 | 30 | sqlplus -s /nolog < 5 | LOG_DIR=${SCRIPT_DIR}/log 6 | USER= 7 | PS_APP_DOMAIN= 8 | PS_PRC_DOMAIN= 9 | PS_PIA_DOMAIN= 10 | TNS_CONNECT_STRING= 11 | TARGET_HOST= 12 | COMPARTMENT_OCID= 13 | SECRET_NAME="" 14 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Wrapper/ps_rpt.env: -------------------------------------------------------------------------------- 1 | # The following environment variables are used by the set_ps_rpt_node.sh script. 2 | # 3 | # Modify the following environment variables according to your site. 4 | # Set the RPT_URL_HOST to the distribution hostname.network-domain of one of a PIA web servers e.g., myhost.mycompany.com 5 | RPT_URL_HOST= 6 | # Set RPT_URI_PORT to the http or https port of the PIA web server. 7 | RPT_URI_PORT= 8 | # SITE_NAME is the PIA web deployment site typically 'ps'. 9 | SITE_NAME=ps 10 | # PSFT_DOMAIN is set per the product. For HCM, it is HRMS. 11 | PSFT_DOMAIN=HRMS 12 | # Set the PDB_NAME to the name of the Pluggable Database Name in which the PeopleSoft schema is stored. 13 | PDB_NAME= 14 | # Set SCHEMA_NAME to the database schema name within the pluggable database wherre the PeopleSoft schema is stored. 15 | SCHEMA_NAME= 16 | 17 | # Adjust the following two environment variables IF AND ONLY IF required. Otherwise, leve them as they are set. 18 | # If SSL is enabled on the PIA web server, then you will need to change the protocol scheme to https for both URL and RPT_URI. 19 | # NOTE: if SSL termination is at the load balancer, then the protocol should be set to http. 20 | URL="http://${RPT_URL_HOST}:${RPT_URI_PORT}/psreports/${SITE_NAME}" 21 | RPT_URI="http://${RPT_URL_HOST}:${RPT_URI_PORT}/psc/${SITE_NAME}/EMPLOYEE/${PSFT_DOMAIN}/c/CDM_RPT.CDM_RPT.GBL?Page=CDM_RPT_INDEX&Action=U&CDM_ID=" 22 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Wrapper/set_ps_rpt_node.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # File name: set_ps_rpt_node.sh Version 1.0 5 | # 6 | # Copyright (c) 2024 Oracle and/or its affiliates 7 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | # 9 | # Description: Sets the distribution node for the process scheduler. Called by startPSFTAPP.sh. 10 | # This script is site-specific and should be modified according to each site. 11 | # 12 | # NOTE: OCI CLI must be installed for this script to run. 13 | # 14 | # Usage: set_ps_rpt_node.sh 15 | # 16 | # Errors: Can return a database error (ORA-XXXXX) if database is 17 | # unavailable or there is access failure. 18 | # 19 | ############################################################################ 20 | 21 | source ~/psft.env 22 | source "${SCRIPT_DIR}"/psrsync.env 23 | source "${SCRIPT_DIR}"/ps_rpt.env 24 | 25 | 26 | date +"%d-%b-%Y %T" 27 | echo "Running set_ps_rpt_node.sh" 28 | echo "" 29 | 30 | SECRET_OCID=$(oci vault secret list -c "$COMPARTMENT_OCID" --raw-output --query "data[?\"secret-name\" == '$SECRET_NAME'].id | [0]") 31 | PSFT_SECRET=$(oci secrets secret-bundle get --raw-output --secret-id "$SECRET_OCID" --query "data.\"secret-bundle-content\".content" | base64 -d ) 32 | 33 | echo "URL = ${URL}" 34 | echo "RPT_URI = ${RPT_URI}" 35 | 36 | # Update the PS_CDM_DIST_NODE table to set the site specific report 37 | # distribution node. 38 | sqlplus -s /nolog < "${LOG_DIR}"/"${HOSTNAME}"_set_ps_rpt_node_"${DATE_TIME}".log 2>&1 32 | "${SCRIPT_DIR}"/startPS.sh "${PS_PRC_DOMAIN}" > "${LOG_DIR}"/"${HOSTNAME}"_startPS_"${DATE_TIME}".log 2>&1 & 33 | "${SCRIPT_DIR}"/startAPP.sh "${PS_APP_DOMAIN}" > "${LOG_DIR}"/"${HOSTNAME}"_startAPP.sh_"${DATE_TIME}".log 2>&1 & 34 | 35 | # Enable the rsync scripts. 36 | # Uncomment the below lines when you are ready to integrate the replicaton rsync scripts. 37 | # Change the file systems files (fs1, fs2...) per your environment. 38 | 39 | # "${SCRIPT_DIR}"/enable_psft_rsync.sh "${SCRIPT_DIR}"/fs1 40 | # "${SCRIPT_DIR}"/enable_psft_rsync.sh "${SCRIPT_DIR}"/fs2 41 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Wrapper/startPSFTWEB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # 5 | # File name: startPSFTWEB.sh Version 1.0 6 | # 7 | # Copyright (c) 2024 Oracle and/or its affiliates 8 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 9 | # 10 | # Description: Start the Coherence*Web cache server then the PIA web server 11 | # 12 | # Usage: startPSFTWEB.sh 13 | # 14 | # Errors: Any errors from dependent scripts. 15 | # 16 | ############################################################################ 17 | 18 | source ~/psft.env 19 | source "${SCRIPT_DIR}"/psrsync.env 20 | 21 | HOSTNAME="$(hostname)" 22 | DATE_TIME="$(date +"%Y%m%d_%H%M%S")" 23 | 24 | # Start the Coherence*Web cache server first. 25 | "${SCRIPT_DIR}"/startCacheServer.sh "${PS_PIA_DOMAIN}" > "${LOG_DIR}"/"${HOSTNAME}"_startCacheServer_"${DATE_TIME}".log 2>&1 26 | 27 | # Start the PIA web server. 28 | "${SCRIPT_DIR}"/startWS.sh "${PS_PIA_DOMAIN}" > "${LOG_DIR}"/"${HOSTNAME}"_startWS_"${DATE_TIME}".log 2>&1 29 | 30 | # Don't return control until Coherence and the web server have started 31 | wait 32 | -------------------------------------------------------------------------------- /apps-unlimited/PeopleSoft/dr_scripts/Wrapper/stopPSFTWEB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################################ 3 | # 4 | # 5 | # File name: stopPSFTWEB.sh Version 1.0 6 | # 7 | # Copyright (c) 2024 Oracle and/or its affiliates 8 | # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 9 | # 10 | # Description: Stop the PIA web server then the Coherence*Web cache server 11 | # 12 | # Usage: stopPSFTWEB.sh 13 | # 14 | # Errors: Any errors returned by dependent scripts. 15 | # 16 | ############################################################################ 17 | 18 | source ~/psft.env 19 | source "${SCRIPT_DIR}"/psrsync.env 20 | 21 | HOSTNAME="$(hostname)" 22 | DATE_TIME="$(date +"%Y%m%d_%H%M%S")" 23 | 24 | # Stop the PIA web server 25 | "${SCRIPT_DIR}"/stopWS.sh "${PS_PIA_DOMAIN}" > "${LOG_DIR}"/"${HOSTNAME}"_stopWS_"${DATE_TIME}".log 2>&1 26 | 27 | # Stop the Coherence*Web cache server 28 | "${SCRIPT_DIR}"/stopCacheServer.sh "${PS_PIA_DOMAIN}" > "${LOG_DIR}"/"${HOSTNAME}"_stopCacheServer_"${DATE_TIME}".log 2>&1 29 | 30 | 31 | -------------------------------------------------------------------------------- /dg_setup_scripts/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** dg_setup_scripts version 2.0. 3 | ** 4 | ** Copyright (c) 2022 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | -------------------------------------------------------------------------------- /dg_setup_scripts/create_pw_tar_from_asm_root.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## dg_setup_scripts version 2.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | # Load environment specific variables 10 | if [ -f DG_properties.ini ]; then 11 | . DG_properties.ini 12 | else 13 | echo "ERROR: DG_properties.ini not found" 14 | exit 1 15 | fi 16 | 17 | #Check that this is running by oracle root 18 | if [ "$(whoami)" != "root" ]; then 19 | echo "Script must be run as user: root" 20 | exit 1 21 | fi 22 | 23 | # The full path in ASM of the password file 24 | export PWFILE_ASM=$A_FILE_DEST/$A_DBNM/PASSWORD/orapw${DB_NAME} 25 | #export PWFILE_ASM=+DATAC1/CDB11/PASSWORD/pwdcdb11.256.1035458887 26 | 27 | ################################################################################# 28 | echo "" 29 | echo "This script will create a tar containing the primary DB password file" 30 | echo "Checking that the password file exists in ${PWFILE_ASM} ...." 31 | su - ${GRID_OSUSER} -c "$GRID_HOME/bin/asmcmd ls ${PWFILE_ASM}" 32 | result=$? 33 | if [[ $result != "0" ]]; then 34 | echo "" 35 | echo "ERROR: the password file ${PWFILE_ASM} not found" 36 | echo "If your password file has another name, please edit this script and modify the variable PWFILE_ASM with the path" 37 | exit 1 38 | fi 39 | 40 | echo "" 41 | echo "Extracting password file from ASM..." 42 | if [[ -f /tmp/orapw${DB_NAME} ]]; then 43 | rm /tmp/orapw${DB_NAME} 44 | fi 45 | su - ${GRID_OSUSER} -c "$GRID_HOME/bin/asmcmd cp ${PWFILE_ASM} /tmp/orapw${DB_NAME}" 46 | if [[ ! -f /tmp/orapw${DB_NAME} ]]; then 47 | echo "" 48 | echo "Error: could not copy password file from ${PWFILE_ASM}" 49 | echo "If your password file has another name, please edit this script and modify the variable PWFILE_ASM with the correct path" 50 | exit 1 51 | fi 52 | 53 | echo "" 54 | echo "Creating password file tar in ${OUTPUT_PASWORD_TAR} ..." 55 | cd /tmp 56 | tar -czf ${OUTPUT_PASWORD_TAR} orapw${DB_NAME} 57 | chown $ORACLE_OSUSER ${OUTPUT_PASWORD_TAR} 58 | echo "Password file tar created!" 59 | -------------------------------------------------------------------------------- /dg_setup_scripts/dg_setup_scripts.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/dg_setup_scripts/dg_setup_scripts.zip -------------------------------------------------------------------------------- /dns_and_frontend_utilities/README.md: -------------------------------------------------------------------------------- 1 | DNS and Frontend utilities 2 | Copyright (c) 2023 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | # DNS and Frontend utilities 6 | This folder contains scripts and examples for actions related with the frontend name and DNS in Disaster Recovery environments. 7 | Please refer for these papers for additional context: 8 | https://www.oracle.com/a/otn/docs/middleware/maa-wls-mp-dr.pdf 9 | https://www.oracle.com/a/tech/docs/maa-soamp-dr.pdf 10 | 11 | 12 | | Folder | Description | 13 | | ------------- | ------------- | 14 | | [scripts_check_frontend_url/](./scripts_check_frontend_url) | This folder contains example scripts to check the status of the frontend url. 15 | | [scripts_update_frontend_DNS/](./scripts_update_frontend_DNS) | This folder contains example scripts to update the IP of the frontend name DNS record. The scripts are based on OCI Cli, and apply to OCI DNS service. 16 | -------------------------------------------------------------------------------- /dns_and_frontend_utilities/scripts_check_frontend_url.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/dns_and_frontend_utilities/scripts_check_frontend_url.zip -------------------------------------------------------------------------------- /dns_and_frontend_utilities/scripts_check_frontend_url/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** scripts_check_frontend_url 3 | ** 4 | ** Copyright (c) 2022 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | 41 | -------------------------------------------------------------------------------- /dns_and_frontend_utilities/scripts_check_frontend_url/check_sample_url.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## check_sample_url.sh 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | # Script that checks the soa-infra url status 10 | # sucess exit code is returned when the status is 200 OK 11 | # error exit code is returned when status is not 200 OK 12 | 13 | # Customize the following variables 14 | URL="https://mywebapp.mycompany.com/sample-app/" 15 | #USER_PASSWORD=weblogic:Password 16 | 17 | # Fixed variables 18 | OK_STRING="Easy, rapid and agile deployment of any Java application" 19 | 20 | # Wait some time until OCI LBR is updated 21 | sleep 120 22 | # save timestamp of request 23 | TS=`date --rfc-3339=seconds` 24 | 25 | # send request 26 | #HTTP_RESPONSE=$(curl --user $USER_PASSWORD --silent --write-out "HTTPSTATUS:%{http_code}" $URL) 27 | HTTP_RESPONSE=$(curl -k --silent --write-out "HTTPSTATUS:%{http_code}" $URL) 28 | 29 | # extract the body 30 | HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g') 31 | 32 | # extract the status 33 | HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') 34 | 35 | # extract the result 36 | RESULT=$(echo $HTTP_BODY | grep -om1 "$OK_STRING") 37 | 38 | # check http status 39 | if [ $HTTP_STATUS -eq 200 ] 40 | 41 | then 42 | if [[ "$RESULT" == $OK_STRING ]] 43 | then 44 | echo -e "$TS: $HTTP_STATUS $RESULT " 45 | exit 0 46 | else 47 | echo -e "$TS: $HTTP_STATUS $RESULT " 48 | exit 1 49 | fi 50 | else 51 | echo "$TS: Error [HTTP status: $HTTP_STATUS]" 52 | exit 1 53 | fi 54 | 55 | -------------------------------------------------------------------------------- /dns_and_frontend_utilities/scripts_check_frontend_url/check_soainfra.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## check_soainfra.sh 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | # Script that checks the soa-infra url status 10 | # sucess exit code is returned when the status is 200 OK 11 | # error exit code is returned when status is not 200 OK 12 | 13 | # Customize the following variables 14 | URL="https://soadrfrontend.example.com/soa-infra/" 15 | USER_PASSWORD=weblogic:Password 16 | 17 | # Fixed variables 18 | OK_STRING="Welcome to the Oracle SOA Platform on WebLogic" 19 | 20 | # save timestamp of request 21 | TS=`date --rfc-3339=seconds` 22 | 23 | # send request 24 | HTTP_RESPONSE=$(curl -k --user $USER_PASSWORD --silent --write-out "HTTPSTATUS:%{http_code}" $URL) 25 | 26 | # extract the body 27 | HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g') 28 | 29 | # extract the status 30 | HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') 31 | 32 | # extract the result 33 | RESULT=$(echo $HTTP_BODY | grep -om1 "$OK_STRING") 34 | 35 | # check http status 36 | if [ $HTTP_STATUS -eq 200 ] 37 | 38 | then 39 | if [[ "$RESULT" == $OK_STRING ]] 40 | then 41 | echo -e "$TS: $HTTP_STATUS $RESULT " 42 | exit 0 43 | else 44 | echo -e "$TS: $HTTP_STATUS $RESULT " 45 | exit 1 46 | fi 47 | else 48 | echo "$TS: Error [HTTP status: $HTTP_STATUS]" 49 | exit 1 50 | fi 51 | 52 | -------------------------------------------------------------------------------- /dns_and_frontend_utilities/scripts_update_frontend_DNS.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/dns_and_frontend_utilities/scripts_update_frontend_DNS.zip -------------------------------------------------------------------------------- /dns_and_frontend_utilities/scripts_update_frontend_DNS/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** DNS update sample scripts 3 | ** 4 | ** Copyright (c) 2022 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | 41 | -------------------------------------------------------------------------------- /dns_and_frontend_utilities/scripts_update_frontend_DNS/virtual_frontend_DNS_entry_to_SITE1.sh: -------------------------------------------------------------------------------- 1 | ## DNS update sample scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | # OCI client script that updates the frontend dns entry (example "soacsdroci.domainexample.com") to Site1 LBR's public IP (example: 111.111.111.123) 8 | oci dns record rrset update --config-file /home/opc/scripts/.oci_soacsdr/config --force --zone-name-or-id "domainexample.com" --domain "soacsdroci.domainexample.com" --rtype "A" --items '[{"domain":"soacsdroci.domainexample.com","rdata":"111.111.111.123","rtype":"A","ttl":60}]' 9 | -------------------------------------------------------------------------------- /dns_and_frontend_utilities/scripts_update_frontend_DNS/virtual_frontend_DNS_entry_to_SITE2.sh: -------------------------------------------------------------------------------- 1 | ## DNS update sample scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | # OCI client script that updates the frontend dns entry (example "soacsdroci.domainexample.com") to Site2 LBR's public IP (example: 222.222.222.123 8 | oci dns record rrset update --config-file /home/opc/scripts/.oci_soacsdr/config --force --zone-name-or-id "domainexample.com" --domain "soacsdroci.domainexample.com" --rtype "A" --items '[{"domain":"soacsdroci.domainexample.com","rdata":"222.222.222.123","rtype":"A","ttl":60}]' 9 | -------------------------------------------------------------------------------- /drs_mp_soa/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** DRS scripts 3 | ** 4 | ** Copyright (c) 2024 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | -------------------------------------------------------------------------------- /drs_mp_soa/VERSION: -------------------------------------------------------------------------------- 1 | version=mp-v22 2 | 3 | V12 Updates: 4 | - Added DR method option (RSYNC or DBFS) 5 | - Added run option "--do_not_start" 6 | - Fixed a bug by which the DRS was not correctly managing servers' UNKNOWN status 7 | 8 | V13 Updates: 9 | - Added a check in standby to verify that the primary cluster frontend name is resolvable from the standby WLS hosts 10 | 11 | V14 Updates: 12 | - Added post step to clean up DBFS_INFO table 13 | 14 | V15 Updates: 15 | - Added checks to fmw dr scripts to verify that the gathered values are not null 16 | - Added warn in yaml to remind that the private key must be in PEM format 17 | 18 | V16 Updates: 19 | - Removed dependency on adminserver suffix from drs_main.py 20 | - Adapted fmw dr setup scripts to be agnostic to the host naming convention 21 | 22 | V17 Updates: 23 | - Added option "--checks_only" that only run the initial checks but does not perform any setup action. 24 | 25 | V18 Updates: 26 | - Usage of python virtual env. Instructions provided in PREPARE_DRS_VENV.md. 27 | - Added clarification about frontend check uri in drs_user_config.yaml file. 28 | - Added recommendation to provide passwords interactively. In drs_user_config.yaml only for testing environments 29 | - Support for passwords starting with #. 30 | - Fixed bug in managed server names and listen addresses lists creation. 31 | - Log output improvements. 32 | 33 | V19 Updates: 34 | - Scripts updated to use tns_admin folder in the datasources and tns alias in the connect strings 35 | - Added error control in the execution of the fmw dr scripts 36 | - Improved exit message when using "--do_not_start" flag 37 | - Reduced the number of user/password requested as input (because primary and standby have the same user/passwords) 38 | - The modification of the /etc/hosts is now optional 39 | 40 | V20 Updates: 41 | - Modified the function get_PAAS_type. Due to SOAMP oracle soa home change, the check to determine if SOAMP was not longer valid. 42 | 43 | V21 Updates: 44 | - Added a note about internet connectivity to PREPARE_DRS_VENV.md 45 | 46 | V22 Updates: 47 | - Simiplified scripts fmw_dr_setup_primary.sh, fmw_sync_in_primary.sh fmw_sync_in_standby.sh. No need to gather the tns admin folder in most of them. 48 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_python/requirements-drs-plain.txt: -------------------------------------------------------------------------------- 1 | asn1crypto 2 | bcrypt 3 | certifi 4 | cffi 5 | chardet 6 | connection 7 | cryptography 8 | fabric 9 | idna 10 | invoke 11 | paramiko 12 | public 13 | pycparser 14 | PyNaCl 15 | PyYAML 16 | requests 17 | six 18 | urllib3 19 | xmltodict 20 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | ** DRS scripts 3 | ** 4 | ** Copyright (c) 2022 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/check_frontend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | # check_frontend.sh 9 | # Script to check if a name is resolvable, either dns or /etc/host 10 | # Usage: check_frontend.sh 11 | 12 | #Commented this. Instead of getting the name from the config.xml, we get it as input 13 | #frontend=`more $DOMAIN_HOME/config/config.xml | grep frontend-host` 14 | #frontend=`echo $frontend | awk -F '' '{print $2}' |awk -F '' '{print $1}'` 15 | 16 | if [[ $# -ne 1 ]]; then 17 | echo "" 18 | echo "ERROR: Incorrect number of parameters. Expected 1, got $#" 19 | echo "Usage:" 20 | echo " $0 " 21 | echo "Example: " 22 | echo " $0 myfrontend.mycompany.com " 23 | echo "" 24 | exit 1 25 | else 26 | frontend=$1 27 | fi 28 | 29 | echo "Checking if $frontend is resolvable.." 30 | ping -c 1 -W 15 $frontend 31 | result=$? 32 | # The ping output will be 2 in case that the frontend name can't be resolved. 33 | # We catch that case, because that is what causes soa-infra not to start. 34 | # Not need to catch other errors as long as the name is resolved (it maybe not reachable with ping and that is not a problem) 35 | if [[ "$result" = 2 ]]; then 36 | echo "Error: Frontend $frontend Name or service not known. Check the /etc/hosts in standby hosts" 37 | exit 1 38 | else 39 | echo "OK. Frontend $frontend Name is resolvable" 40 | fi 41 | 42 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/check_soainfra.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | # Script that checks the soa-infra url status 9 | # success exit code is returned when the status is 200 OK 10 | # error exit code is returned when status is not 200 OK 11 | 12 | if [[ $# -ne 2 ]]; then 13 | echo 14 | echo "ERROR: Incorrect number of input variables passed to $0" 15 | echo 16 | echo "Usage: ${0} soa_infra_url wls_username:wls_password" 17 | echo "Example: ${0} https://111.222.33.44/soa-infra/ weblogic:welcome1" 18 | echo 19 | exit -1 20 | fi 21 | 22 | # Input parameters 23 | URL=${1} 24 | USER_PASSWORD=${2} 25 | 26 | # Fixed variables 27 | #OK_STRING="Welcome to the Oracle SOA Platform on WebLogic" 28 | OK_STRING= 29 | 30 | # save timestamp of request 31 | TS=$(date --rfc-3339=seconds) 32 | 33 | # send request 34 | HTTP_RESPONSE=$(curl --user ${USER_PASSWORD} --insecure --write-out "HTTPSTATUS:%{http_code}" ${URL}) 35 | 36 | # extract the body 37 | HTTP_BODY=$(echo ${HTTP_RESPONSE} | sed -e 's/HTTPSTATUS\:.*//g') 38 | 39 | # extract the status 40 | HTTP_STATUS=$(echo ${HTTP_RESPONSE} | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') 41 | 42 | # extract the result 43 | RESULT=$(echo ${HTTP_BODY} | grep -om1 "${OK_STRING}") 44 | 45 | # check http status 46 | if [[ ${HTTP_STATUS} -eq 200 ]]; then 47 | echo -e "${TS}: ${HTTP_STATUS} ${RESULT} " 48 | exit 0 49 | #if [[ "$RESULT" == ${OK_STRING} ]]; then 50 | # echo -e "${TS}: ${HTTP_STATUS} ${RESULT} " 51 | # exit 0 52 | #else 53 | # echo -e "${TS}: ${HTTP_STATUS} ${RESULT} " 54 | # exit 1 55 | #fi 56 | else 57 | echo "${TS}: Error [HTTP status: ${HTTP_STATUS}]" 58 | exit 1 59 | fi 60 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/db_check_if_rac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | echo "set feed off 8 | set pages 0 9 | select value from V\$PARAMETER where NAME='cluster_database'; 10 | exit 11 | " | sqlplus -s / as sysdba -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/db_select_db_name.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | echo "set feed off 8 | set pages 0 9 | select value from V\$PARAMETER where NAME='db_name'; 10 | exit 11 | " | sqlplus -s / as sysdba -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/db_select_db_unique_name.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | echo "set feed off 8 | set pages 0 9 | select value from V\$PARAMETER where NAME='db_unique_name'; 10 | exit 11 | " | sqlplus -s / as sysdba -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/dg_convert_db_to_physical_standby.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | # $1 = primary DB SYS password 9 | # $2 = primary DB unique name 10 | # $3 = standby DB unique name 11 | dgmgrl sys/\'${1}\'@${2} "CONVERT DATABASE \"${3}\" TO PHYSICAL STANDBY" 12 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/dg_convert_db_to_snapshot_standby.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | # $1 = primary DB SYS password 9 | # $2 = primary DB unique name 10 | # $3 = standby DB unique name 11 | dgmgrl sys/\'${1}\'@${2} "CONVERT DATABASE \"${3}\" TO SNAPSHOT STANDBY" 12 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/dg_show_configuration_verbose.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## DRS scripts 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | # $1 = local DB SYS password 10 | dgmgrl sys/\'${1}\' "SHOW CONFIGURATION VERBOSE" 11 | 12 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/dg_switchover_to_standby_db.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | # $1 = primary DB SYS password 8 | # $2 = primary DB unique name 9 | # $3 = standby DB unique name 10 | dgmgrl sys/\'${1}\'@${2} "SWITCHOVER TO \"${3}\"" 11 | 12 | 13 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/fmw_dec_pwd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## fmw_enc_pwd.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | export ENC_PASSWORD=$1 10 | echo "domain='${DOMAIN_HOME}'" > /tmp/pret.py 11 | echo "service=weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)" >>/tmp/pret.py 12 | echo "encryption=weblogic.security.internal.encryption.ClearOrEncryptedService(service)" >>/tmp/pret.py 13 | echo "print encryption.decrypt('${ENC_PASSWORD}')" >>/tmp/pret.py 14 | export dec_pwd=$($MIDDLEWARE_HOME/oracle_common/common/bin/wlst.sh /tmp/pret.py | tail -1) 15 | echo "$dec_pwd" 16 | rm /tmp/pret.py 17 | 18 | 19 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/fmw_enc_pwd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## fmw_enc_pwd.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | export DEC_PASSWORD=$1 10 | echo "domain='${DOMAIN_HOME}'" > /tmp/pret.py 11 | echo "service=weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)" >>/tmp/pret.py 12 | echo "encryption=weblogic.security.internal.encryption.ClearOrEncryptedService(service)" >>/tmp/pret.py 13 | echo "print encryption.encrypt('${DEC_PASSWORD}')" >>/tmp/pret.py 14 | export enc_pwd=$($MIDDLEWARE_HOME/oracle_common/common/bin/wlst.sh /tmp/pret.py | tail -1) 15 | echo "$enc_pwd" 16 | rm /tmp/pret.py 17 | 18 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/fmw_get_dbrole_wlst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## fmw_get_dbrole_wlst.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | ## This script can be used to get the role of the database 10 | 11 | ## The script uses com.ziclix.python.sql package and triggers a temporary script execution from wlstr 12 | ## It uses the connect string and values passed as parameter 13 | 14 | ### Usage: 15 | ### ./fmw_get_dbrole_wlst.sh USERNAME PASSWORD JDBC_URL 16 | ### 17 | ### Example: 18 | ### ./fmw_get_dbrole_wlst.sh 'sys' 'mypassword' 'jdbc:oracle:thin:@dbhost-scan.dbsubnet.myvcn.oraclevcn.com:1521/PDB1.dbsubnet.myvcn.oraclevcn.com' 19 | ### 20 | 21 | export username="$1" 22 | export password="$2" 23 | export jdbc_url="$3" 24 | 25 | if [[ ${username} = "sys" || ${username} = "SYS" ]]; then 26 | username="sys as sysdba" 27 | fi 28 | 29 | execute_query(){ 30 | echo "from com.ziclix.python.sql import zxJDBC" > /tmp/get_db_role.py 31 | echo "jdbc_url = \"$jdbc_url\" " >> /tmp/get_db_role.py 32 | echo "username = \"$username\" " >> /tmp/get_db_role.py 33 | echo "password = \"$password\" " >> /tmp/get_db_role.py 34 | echo "driver = \"oracle.jdbc.xa.client.OracleXADataSource\" " >> /tmp/get_db_role.py 35 | echo "conn = zxJDBC.connect(jdbc_url, username, password, driver)" >> /tmp/get_db_role.py 36 | echo "cursor = conn.cursor(1)" >> /tmp/get_db_role.py 37 | echo "cursor.execute(\"select database_role from v\$database\")" >> /tmp/get_db_role.py 38 | echo "print cursor.fetchone()" >> /tmp/get_db_role.py 39 | export result=$($MIDDLEWARE_HOME/oracle_common/common/bin/wlst.sh /tmp/get_db_role.py | tail -1) 40 | echo "${result}" 41 | } 42 | 43 | execute_query 44 | 45 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/fmw_get_ds_property.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## fmw_get_ds_property.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | 8 | ## This script returns the oracle.net.tnsadmin directory that a WLS/SOA/FMW datasource is using if any 9 | ## 10 | ## Usage: 11 | ## ./fmw_get_ds_property.sh DATASOURCE_FILE DATASOURCE_PROPERTY 12 | ## 13 | ## Where: 14 | ## DATASOURCE_FILE The WLS jdbc datasource file (complete path) 15 | ## DATASOURCE_PROPERTY The property name in datasource file 16 | 17 | ## EXAMPLE: 18 | ## ./fmw_get_ds_property.sh '/u01/data/domains/my_domain/config/jdbc/opss-datasource-jdbc.xml' oracle.net.tns_admin 19 | 20 | if [[ $# -eq 2 ]]; then 21 | export DATASOURCE_FILE=$1 22 | export DATASOURCE_PROPERTY=$2 23 | else 24 | echo "" 25 | echo "ERROR: Incorrect number of parameters used. Expected 2, got $#" 26 | echo "Usage :" 27 | echo " $0 DATASOURCE_FILE DATASOURCE_PROPERTY" 28 | echo "Example: " 29 | echo " $0 '/u01/data/domains_my_domain/config/jdbc/opss-datasource-jdbc.xml' 'oracle.net.tns_admin'" 30 | echo "" 31 | exit 1 32 | fi 33 | 34 | export property_name_value=$(grep ''$DATASOURCE_PROPERTY'' $DATASOURCE_FILE -A1) 35 | 36 | if [[ "$property_name_value" == *"encrypted-value-encrypted"* ]]; then 37 | export result=$(echo $property_name_value | awk -F'' '{print $2}' | awk -F'' '{print $1}'| awk '{$1=$1};1') 38 | else 39 | export result=$(echo $property_name_value | awk -F'' '{print $2}' | awk -F'' '{print $1}'| awk '{$1=$1};1') 40 | fi 41 | 42 | echo $result 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/fmw_primary_check_connectivity_to_stby_admin.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | ### 9 | ### This script should be executed on the WLS Admin Server Node in the Primary site 10 | ### 11 | 12 | ##### The following variables need to be passed as parameters to the script in this exact order: 13 | ##### REMOTE_ADMIN_NODE_IP The IP of the remote node 14 | ##### REMOTE_KEYFILE The ssh private keyfile to connect to remote node 15 | 16 | ### 17 | ### Example: 18 | ### fmw_primary_check_connectivity_to_stby_admin.sh '10.2.0.3' '/path/ssh_private_keyfile' 19 | ### 20 | export REMOTE_ADMIN_NODE_IP=$1 21 | export REMOTE_KEYFILE=$2 22 | 23 | echo 24 | echo "******************************** Checking connectivity to Primary DB *******************************" 25 | echo 26 | # Check connectivity to remote Weblogic Administration server node and show its hostname 27 | echo " Checking ssh connectivity to remote Weblogic Administration server node...." 28 | export result=$(ssh -o ConnectTimeout=100 -o StrictHostKeyChecking=no -i $REMOTE_KEYFILE opc@${REMOTE_ADMIN_NODE_IP} "echo 2>&1" && echo "OK" || echo "NOK" ) 29 | if [ $result == "OK" ];then 30 | echo " SUCCESS: Connectivity to ${REMOTE_ADMIN_NODE_IP} is OK" 31 | export REMOTE_ADMIN_HOSTNAME=$(ssh -i $REMOTE_KEYFILE opc@${REMOTE_ADMIN_NODE_IP} 'hostname --fqdn') 32 | echo " REMOTE_ADMIN_HOSTNAME......" ${REMOTE_ADMIN_HOSTNAME} 33 | exit 0 34 | else 35 | echo " ERROR: Failed to connect to ${REMOTE_ADMIN_NODE_IP} from primary WLS Administration node" 36 | exit -1 37 | fi 38 | 39 | 40 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/host_check_ps_process.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | # 9 | # Script checks 'ps' output to find process with the specified name 10 | # Script prints: 11 | # "SUCCESS": if process found 12 | # "FAILURE": if process was not found 13 | # 14 | # Usage: ${0} "search_string" 15 | # where: search_string -- some part of the name of the process name to search in 'ps -ef' output 16 | # 17 | 18 | # Get the last argument (the search string) 19 | for i in $@; do :; done 20 | SEARCH_STRING="$i" 21 | 22 | if [[ ! ${SEARCH_STRING} ]] 23 | then 24 | echo "ERROR: You must provide a search string as argument" 25 | exit 1 26 | fi 27 | 28 | echo 29 | echo "Checking for process matching [${SEARCH_STRING}] in ps output on this host [`hostname`]" 30 | echo 31 | 32 | PROC_COUNT=$(/usr/bin/pgrep -f ${SEARCH_STRING} | wc -l) 33 | 34 | if [[ ${PROC_COUNT} == 3 ]] 35 | then 36 | echo "SUCCESS: Process containing [${SEARCH_STRING}] is running." 37 | else 38 | echo "FAILURE: Could not find process containing string [${SEARCH_STRING}] on this host" 39 | fi 40 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/host_get_hostname.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | FULL_HOSTNAME=$(/bin/hostname -f) 8 | echo "FULL HOSTNAME=${FULL_HOSTNAME}" 9 | # does not always work # IFCONFIG_OUT=$(ifconfig eth0) 10 | # does not always work # IP_ADDR=$(${IFCONFIG_OUT} | awk '/inet addr/ {gsub("addr:", "", $2); print $2}') 11 | IP_ADDR=$(hostname -I | awk '{print $1}') 12 | echo "IP_ADDRESS=${IP_ADDR}" 13 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/host_get_osinfo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | # 9 | # Get the full hostname. 10 | FULL_HOSTNAME=$(/bin/hostname -f) 11 | echo "FULL_HOSTNAME=${FULL_HOSTNAME}" 12 | 13 | # 14 | # Get the IP address (commented out versions don't work reliably) 15 | # does not always work # IFCONFIG_OUT=$(ifconfig eth0) 16 | # does not always work # IP_ADDR=$(${IFCONFIG_OUT} | awk '/inet addr/ {gsub("addr:", "", $2); print $2}') 17 | IP_ADDRESS=$(hostname -I | awk '{print $1}') 18 | echo "IP_ADDRESS=${IP_ADDRESS}" 19 | 20 | # 21 | # Get the OS version 22 | OS_VERSION=$(cat /etc/oracle-release | grep "Oracle Linux Server release" | awk '{print $5}') 23 | echo "OS_VERSION=${OS_VERSION}" 24 | 25 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/post_setup_drop_tmp_info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | # This script runs in stby soa and connect to primary PDB 9 | # to delete a temporary table created during DRS run 10 | # Input parameters are: 11 | # $1 username 12 | # $2 password 13 | # primary db ip 14 | # primary db port 15 | # primary pdb name 16 | SYS_USERNAME=$1 17 | SYS_USER_PASSWORD=$2 18 | A_DB_IP=$3 19 | A_PORT=$4 20 | PDB_SERVICE_PRIMARY=$5 21 | 22 | export DBFS_MOUNT_SCRIPT=${DOMAIN_HOME}/dbfs/dbfsMount.sh 23 | export ORACLE_HOME=$(cat $DBFS_MOUNT_SCRIPT | grep "ORACLE_HOME=" | head -n 1 | awk -F "=" '{print $2}') 24 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH 25 | export PATH=$PATH:$ORACLE_HOME/bin 26 | 27 | echo "Dropping temporary table DBFS_INFO from db ..................................." 28 | echo " 29 | Drop table DBFS_INFO; 30 | exit 31 | " | sqlplus -s $SYS_USERNAME/$SYS_USER_PASSWORD@$A_DB_IP:$A_PORT/$PDB_SERVICE_PRIMARY "as sysdba" > /dev/null 32 | echo "Temporary table DBFS_INFO dropped" 33 | 34 | 35 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/wls_check_stack_up.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | MS_NAME="" 9 | 10 | for i in "$@" 11 | do 12 | case $i in 13 | --managed=*) 14 | MS_NAME="${i#*=}" 15 | shift # past argument=value 16 | ;; 17 | *) 18 | # unknown option 19 | ;; 20 | esac 21 | done 22 | 23 | 24 | if [ ${MS_NAME} eq "" ] 25 | then 26 | echo "ERROR: No managed server name provided" 27 | echo 28 | echo "Usage: $0 --managed soasrv_server_1" 29 | exit -1 30 | 31 | fi 32 | 33 | 34 | RET="NO_ERROR" 35 | 36 | echo 37 | echo "Checking if WLS stack components are running on this host [`hostname`]" 38 | 39 | echo 40 | echo " 1) Checking if Node Manager is running" 41 | NM_PID=$(pgrep -f '\-Dweblogic.nodemanager.JavaHome.*weblogic.NodeManager') 42 | if [ ! -z "${NM_PID}" ] 43 | then 44 | echo " Node Manager is running. PID=${NM_PID}" 45 | else 46 | echo "ERROR: Could not find a Node Manager Server on this host" 47 | RET="ERROR" 48 | fi 49 | 50 | echo " 2) Checking if Admin Server is running" 51 | AS_PID=$(pgrep -f '\-Dweblogic.Name=.*adminserver') 52 | if [ ! -z "${AS_PID}" ] 53 | then 54 | echo " Admin Server is running. PID=${AS_PID}" 55 | else 56 | echo "ERROR: Could not find an Admin Server on this host" 57 | RET="ERROR" 58 | fi 59 | 60 | echo " 3) Checking if Managed Server [${MS_NAME}] is running" 61 | MS_PID=$(pgrep -f '\-Dweblogic.Name=.*${MS_NAME}') 62 | if [ ! -z "${MS_PID}" ] 63 | then 64 | echo " Managed Server is running. PID=${MS_PID}" 65 | else 66 | echo "ERROR: Could not find an Managed Server on this host" 67 | RET="ERROR" 68 | fi 69 | 70 | if [ ${RET} eq "ERROR" ] 71 | exit -1 72 | else 73 | exit 0 74 | 75 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/wls_get_domain_home.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | BASHRC_FILE=/home/oracle/.bashrc 9 | if [ ! -f $BASHRC_FILE ]; then 10 | echo "File [$BASHRC_FILE] not found!" 11 | exit -1 12 | fi 13 | 14 | awk -F= '/DOMAIN_HOME=/ {print $2}' $BASHRC_FILE 15 | -------------------------------------------------------------------------------- /drs_mp_soa/_internal_scripts/wls_initinfo_get_wl_home.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | BASHRC_FILE=/home/oracle/.bashrc 9 | 10 | if [ ! -f $BASHRC_FILE ]; then 11 | echo "File [$BASHRC_FILE] not found!" 12 | exit -1 13 | fi 14 | 15 | DOMAIN_HOME=$(awk -F= '/DOMAIN_HOME=/ {print $2}' $BASHRC_FILE) 16 | TOKENS_FILE="${DOMAIN_HOME}/init-info/tokenValue.properties" 17 | 18 | WL_HOME=$(grep '@WL_HOME=' ${TOKENS_FILE} | awk -F= '{print $2}') 19 | 20 | echo ${WL_HOME} 21 | -------------------------------------------------------------------------------- /drs_mp_soa/drs-mp.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/drs_mp_soa/drs-mp.tar.gz -------------------------------------------------------------------------------- /drs_mp_soa/drs_monitor_log.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | tail -f ${1} | grep --line-buffered -v ' \[DEBUG\]' | grep --line-buffered -v 'paramiko' | egrep --line-buffered -E "(^####|drs_)" 8 | -------------------------------------------------------------------------------- /drs_mp_soa/drs_run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## DRS scripts 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | # Define python path 9 | INTERNAL_PYTHON=./_internal_python/bin/python3 10 | 11 | ${INTERNAL_PYTHON} drs_main.py "$@" 12 | 13 | -------------------------------------------------------------------------------- /fmw-wls-with-adb-dr/LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | ** 3 | ** Copyright (c) 2022 Oracle and/or its affiliates 4 | ** 5 | ** The Universal Permissive License (UPL), Version 1.0 6 | ** 7 | ** Subject to the condition set forth below, permission is hereby granted to any 8 | ** person obtaining a copy of this software, associated documentation and/or data 9 | ** (collectively the "Software"), free of charge and under any and all copyright 10 | ** rights in the Software, and any and all patent rights owned or freely 11 | ** licensable by each licensor hereunder covering either (i) the unmodified 12 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 13 | ** Works (as defined below), to deal in both 14 | ** 15 | ** (a) the Software, and 16 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 17 | ** one is included with the Software (each a "Larger Work" to which the Software 18 | ** is contributed by such licensors), 19 | ** 20 | ** without restriction, including without limitation the rights to copy, create 21 | ** derivative works of, display, perform, and distribute the Software and make, 22 | ** use, sell, offer for sale, import, export, have made, and have sold the 23 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 24 | ** either these or other terms. 25 | ** 26 | ** This license is subject to the following condition: 27 | ** The above copyright notice and either this complete permission notice or at 28 | ** a minimum a reference to the UPL must be included in all copies or 29 | ** substantial portions of the Software. 30 | ** 31 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | ** SOFTWARE. 38 | */ 39 | -------------------------------------------------------------------------------- /fmw-wls-with-adb-dr/README.md: -------------------------------------------------------------------------------- 1 | Oracle FMW-WLS with Autonomous Database Disaster Protection scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | Using the Oracle FMW-WLS with Autonomous Database Disaster Protection scripts 6 | ================================================================================================================= 7 | 8 | This directory contains scripts and utilities to configure and manage FMW DR with ADB. Refer to the Oracle Architecture Center Playbook for details: https://docs.oracle.com/en/solutions/adb-refreshable-clones-dr/index.html 9 | 10 | 11 | IMPORTANT: Read and complete all the pre-requisites and steps per the isntructions in the paper above before using these scripts directly. 12 | These scripts depend on the common scripts of app_dr_common. 13 | 14 | Usage 15 | -------------- 16 | Each script provides automation for different parts of the DR setup and lifecycle of a disaster protection system. 17 | The following table provides a summary of the utilities 18 | 19 | 20 | | Script name | Description | 21 | | ------------- | ------------- | 22 | | [fmwadb_config_replica.sh](./fmwadb_config_replica.sh) | This script is used to replicate configuration between sites. | 23 | | [fmwadb_dr_prim.sh](./fmwadb_dr_prim.sh) | Prepares a primary site for the DR setup. | 24 | | [fmwadb_dr_stby.sh](./fmwadb_dr_stby.sh) | Prepares a secondary site for the DR setup. | 25 | | [fmwadb_rest_api_listabds.sh](./fmwadb_rest_api_listabds.sh) | This script is used to obtain the Autonomous Database role base on the ADB ID and tenancy information. | 26 | | [fmwadb_switch_db_conn.sh](./fmwadb_switch_db_conn.sh) | This script replaces the existing connect information with a new ADB WALLET. | 27 | -------------------------------------------------------------------------------- /fmw_schemas_exp_imp/common_export_import_fmw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## common_export_import_fmw.sh script version 1.0. 4 | ## 5 | ## Copyright (c) 2025 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | ### This script contains common fucntions for Oracle Data Pump export and import scrips for Oracle FMW 9 | 10 | 11 | check_connection () { 12 | schema=$1 13 | tns_alias=$2 14 | while true; do 15 | read -s -p "Provide the schema password for $schema: " pass 16 | if [ "$schema" == "SYS" ]; then 17 | export sys_pass=$pass 18 | echo 19 | oracledate=`sqlplus -s $schema/""${pass}""@${tns_alias} as sysdba <<-EOF 20 | set echo off feedback off timing off pause off heading off verify off 21 | whenever oserror exit failure 22 | whenever sqlerror exit failure 23 | select sysdate from dual; 24 | exit 25 | EOF 26 | ` 27 | sqlerr=$? 28 | else 29 | export schema_pass=$pass 30 | echo 31 | oracledate=`sqlplus -s $schema/""${pass}""@${tns_alias} <<-EOF 32 | set echo off feedback off timing off pause off heading off verify off 33 | whenever oserror exit failure 34 | whenever sqlerror exit failure 35 | select sysdate from dual; 36 | exit 37 | EOF 38 | ` 39 | sqlerr=$? 40 | fi 41 | if [ $sqlerr -ne 0 ]; then 42 | echo "Unable to connect to Oracle with this password for $schema. Try again!" 43 | else 44 | echo "Succesfully connected to DB as $schema." 45 | break 46 | fi 47 | done 48 | echo 49 | } 50 | waiting (){ 51 | 52 | chars="/-\|" 53 | 54 | while :; do 55 | for (( i=0; i<${#chars}; i++ )); do 56 | sleep 0.5 57 | echo -en "This may take some time ${chars:$i:1}" "\r" 58 | done 59 | done 60 | 61 | 62 | } 63 | 64 | -------------------------------------------------------------------------------- /kubernetes-maa/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** k8s MAA scripts 3 | ** 4 | ** Copyright (c) 2023 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | -------------------------------------------------------------------------------- /kubernetes-maa/apply-artifacts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | ## apply-artifact.sh script version 1.0. 5 | ## 6 | ## Copyright (c) 2023 Oracle and/or its affiliates 7 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | ## 9 | 10 | ### This script will "clean-up" and apply a yaml to a K8s cluster checking first if it already exisit 11 | ### The namespaces list is obtained from the directory structure in the TAR 12 | ### Usage: 13 | ### 14 | ### ./apply-artifact.sh [YAML FILE] [LOG FILE] 15 | ### Where: 16 | ### YAML FILE 17 | ### The YAML that will be applied 18 | ### LOG FILE 19 | ### The log file to store result and info 20 | 21 | artifact=$1 22 | oplog=$2 23 | 24 | 25 | echo "Here goes $artifact" >> $oplog 26 | sed -i '/creationTimestamp: /d' $artifact 27 | sed -i '/resourceVersion: /d' $artifact 28 | sed -i '/uid: /d' $artifact 29 | sed -i '/clusterIP: /,+2d' $artifact 30 | sed -i '/nodeName: /d' $artifact 31 | $basedir/removeyamlblock.sh $artifact metadata ownerReferences 32 | #In preparation for avoiding secrets to be copied 33 | #sed -i '/secrets:/,+2d' $artifact 34 | cat $artifact >> $oplog 35 | create_result=$(kubectl create -f $artifact --validate=false 2>&1) 36 | if [[ "$create_result" == *"AlreadyExists"* ]]; then 37 | echo "Artifacts exists. Replacing instead..." >> $oplog 38 | kubectl replace -f $artifact --validate=false 39 | elif [[ "$create_result" == *"Error"* ]]; then 40 | echo "An unknown error ocurred check artifact $artifact ..." >> $oplog 41 | echo "$create_result" >> $oplog 42 | else 43 | echo "Creation of artifact succeeded": >> $oplog 44 | echo "$create_result" >> $oplog 45 | fi 46 | 47 | -------------------------------------------------------------------------------- /kubernetes-maa/maak8DR-apply.env: -------------------------------------------------------------------------------- 1 | #sudo ready user 2 | export user_sec=opc 3 | 4 | #ssh key 5 | export ssh_key_sec=/home/opc/KeyWithoutPassPhraseSOAMAA.ppk 6 | 7 | #Secondary bastion node 8 | export sechost=10.10.0.23 9 | 10 | #List of namespaces that will be excluded from the backup. 11 | ### This is a space-separated list of those namespaces that should be excluded from the backup even when trying to backup ALL custom namespaces. 12 | ### This is to avoid copying control plane related namespaces that will not be applicable on secondary 13 | ### Can be defaulted to kube-system kube-flannel kube-node-lease kube-public in most cases (depends on the app) 14 | export exclude_list="kube-system kube-flannel kube-node-lease kube-public" 15 | 16 | #Root artifacts that will be included. 17 | ### This is the list or artifacts that belong to the root tree (i.e. not part of a precise namespace) but that need to be included also in the snapshot. 18 | ### The framework will look for references in these artifacts to the namespaces being backed up 19 | ### Can be defaulted to crd, clusterrole and clusterrolebinding in most cases (depends on the app) 20 | ### You can add "pv" if you want persistent volume definitions to be replicated also 21 | export nons_artifacts_types="crd clusterrole clusterrolebinding" 22 | 23 | -------------------------------------------------------------------------------- /kubernetes-maa/maak8s-force-stop-cp.sh: -------------------------------------------------------------------------------- 1 | export basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 2 | 3 | echo "*********FORCE STOP OF K8S CONTROL PLANE SERVICES *********" 4 | . $basedir/maak8s.env 5 | 6 | if [[ $# -eq 1 ]]; 7 | then 8 | #LIST OF CONTROL PLANE NODES 9 | export MNODE_LIST=$1 10 | else 11 | echo "" 12 | echo "ERROR: Incorrect number of parameters used: Expected 1, got $#" 13 | echo "" 14 | echo "Usage:" 15 | echo " $0 [LIST OF NODES]" 16 | echo "" 17 | echo "Example: " 18 | echo " $0 'olk8-m1 olk8-m2 olk8-m3'" 19 | exit 1 20 | fi 21 | 22 | for host in ${MNODE_LIST}; do 23 | echo "Stopping control plane in $host..." 24 | ssh -i $ssh_key $user@$host sudo systemctl stop kubelet 25 | export proc_list=$(ssh -i $ssh_key $user@$host "ps -ef | grep 'etcd\|kube-apiserver\|kube-scheduler\|kube-controller-manager'" | grep -v grep |grep -v maak8 | awk '{print $2}') 26 | ssh -i $ssh_key $user@$host sudo kill -9 $proc_list 27 | done 28 | echo "All K8s control plane services stopped!" 29 | 30 | 31 | -------------------------------------------------------------------------------- /kubernetes-maa/maak8s.env: -------------------------------------------------------------------------------- 1 | #bastion node or node that can kubectl to the cluster 2 | export bastion_node=olk8-bastion 3 | #sudo ready user to ssh into bastion node 4 | export user=opc 5 | #ssh key for the ssh 6 | export ssh_key=/home/opc/k8sMAA.ppk 7 | #etcdctl executable's location 8 | export etcdctlhome=/scratch/docker/etcdctl/ 9 | 10 | #etcd advertise port 11 | export advert_port=2379 12 | #etcd init cluster port 13 | export init_port=2380 14 | 15 | #infrastructure pods that will be restarted on restore 16 | export infra_pod_list="proxy controller scheduler" 17 | 18 | -------------------------------------------------------------------------------- /kubernetes-maa/removeyamlblock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | ## removeyamlblock.sh script version 1.0. 5 | ## 6 | ## Copyright (c) 2023 Oracle and/or its affiliates 7 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 8 | ## 9 | 10 | ### This script will "clean-up" a yaml block 11 | ### The namespaces list is obtained from the directory structure in the TAR 12 | ### Usage: 13 | ### 14 | ### ./removeyamlblock.sh [YAML_FILE] [ROOT_ITEM] [SUBITEM_TO_REMOVE] 15 | ### Where: 16 | ### YAML_FILE 17 | ### The YAML file that will be modified 18 | ### ROOT_ITEM 19 | ### The root context where the subitem is located 20 | ### SUBITEM_TO_REMOVE 21 | ### The yaml block under root context that will be removed 22 | 23 | export file=$1 24 | export inrootblock=$2 25 | export indeleteblock=$3 26 | export rootblock="$inrootblock:" 27 | export deleteblock="$indeleteblock:" 28 | 29 | tmpfile=$(mktemp) 30 | cp $file "$tmpfile" 31 | awk -v rb="$rootblock" -v db="$deleteblock" '$1 == rb{t=1} 32 | t==1 && $1 == db{t++; next} 33 | t==2 && /:[[:blank:]]*$/{t=0} 34 | t != 2' $tmpfile >$file 35 | rm $tmpfile 36 | -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/Generic/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/maa_wls_lifecycle_scripts/Generic/.gitkeep -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/Generic/domain_properties.env: -------------------------------------------------------------------------------- 1 | export WLS_DOMAIN_NAME=my_domain_name 2 | 3 | # NOTE: if you are not using EDG folder structure, set ASERVER_HOME and MSERVER_HOME to the same value (DOMAIN_HOME) 4 | export ASERVER_HOME=/u01/oracle/config/domains/my_domain_name 5 | export MSERVER_HOME=/u02/oracle/config/domains/my_domain_name 6 | 7 | export ORACLE_HOME=/u01/oracle/products/fmw_12214 8 | 9 | export WLS_ADMIN_URL=t3://ADMINVHN:7001 10 | export ADMIN_SERVER_NAME=AdminServer 11 | 12 | # Encrypted credentials for weblogic administration user 13 | export WLS_USER_ADMIN_CONFIGFILE="/home/oracle/SCRIPTS_STOP_START/oracle-WebLogicConfig.properties" 14 | export WLS_USER_ADMIN_KEYFILE="/home/oracle/SCRIPTS_STOP_START/oracle-WebLogicKey.properties" 15 | 16 | # Provide the folder where nodemanager stop/start scripts are, depending if it is per host or per domain 17 | export NM_SCRIPTS=/u02/oracle/config/nodemanager # per host nodemanager 18 | #export NM_SCRIPTS=$DOMAIN_HOME/bin #per domain node manager 19 | export NM_TYPE=PLAIN 20 | export NM_PORT=5556 21 | -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/Generic/py_scripts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/maa_wls_lifecycle_scripts/Generic/py_scripts/.gitkeep -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/Generic/py_scripts/nmkill_servers.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) 2024 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | """ 5 | import os 6 | import sys 7 | import socket 8 | from xml.dom import minidom 9 | 10 | domainName = os.getenv('WLS_DOMAIN_NAME') 11 | domainHome = os.getenv('WLS_DOMAIN_HOME') 12 | configPath = domainHome + "/config/config.xml" 13 | 14 | hostName=socket.getfqdn() 15 | nmPort = int(os.getenv('NM_PORT')) 16 | nmtype = os.getenv('NM_TYPE') 17 | 18 | adminURL = os.getenv('WLS_ADMIN_URL') 19 | wlsadminconfigfile=os.getenv('WLS_USER_ADMIN_CONFIGFILE') 20 | wlsadminkeyfile=os.getenv('WLS_USER_ADMIN_KEYFILE') 21 | 22 | serverName=sys.argv[1] 23 | 24 | def getConfigXMLDOM(): 25 | configXMLDoc = minidom.parse(configPath) 26 | return configXMLDoc 27 | 28 | def getNMUsername(): 29 | nmUsernameElem = getConfigXMLDOM().getElementsByTagName('node-manager-username')[0] 30 | return nmUsernameElem.firstChild.nodeValue 31 | 32 | def getEncryptedNMPassword(): 33 | nmPasswordElem = getConfigXMLDOM().getElementsByTagName('node-manager-password-encrypted')[0] 34 | return nmPasswordElem.firstChild.nodeValue 35 | 36 | def getNMPassword(): 37 | encryptionService = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domainHome) 38 | encryption = weblogic.security.internal.encryption.ClearOrEncryptedService(encryptionService) 39 | return encryption.decrypt(getEncryptedNMPassword()) 40 | 41 | 42 | try: 43 | nmUsername = getNMUsername() 44 | nmPassword = getNMPassword() 45 | nmConnect(username=nmUsername,password=nmPassword, domainName=domainName, domainDir=domainHome ,nmType=nmtype, host=hostName, port=nmPort) 46 | nmKill(serverName) 47 | nmDisconnect() 48 | 49 | except Exception, e: 50 | dumpStack() 51 | nmDisconnect() 52 | raise Exception('Failed to stop server') 53 | -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/Generic/py_scripts/start_cluster.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) 2024 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | """ 5 | import os 6 | import sys 7 | import socket 8 | 9 | clusterName = sys.argv[1] 10 | adminURL = os.getenv('WLS_ADMIN_URL') 11 | wlsadminconfigfile = os.getenv('WLS_USER_ADMIN_CONFIGFILE') 12 | wlsadminkeyfile = os.getenv('WLS_USER_ADMIN_KEYFILE') 13 | 14 | try: 15 | connect(userConfigFile=wlsadminconfigfile, userKeyFile=wlsadminkeyfile, url=adminURL) 16 | start(name=clusterName,type='Cluster') 17 | disconnect() 18 | except Exception, e: 19 | dumpStack() 20 | disconnect() 21 | raise Exception('Failed to start weblogic cluster') 22 | 23 | -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/Generic/py_scripts/stop_cluster.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) 2024 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | """ 5 | 6 | import os 7 | import sys 8 | import socket 9 | 10 | clusterName = sys.argv[1] 11 | adminURL = os.getenv('WLS_ADMIN_URL') 12 | wlsadminconfigfile = os.getenv('WLS_USER_ADMIN_CONFIGFILE') 13 | wlsadminkeyfile = os.getenv('WLS_USER_ADMIN_KEYFILE') 14 | 15 | try: 16 | connect(userConfigFile=wlsadminconfigfile, userKeyFile=wlsadminkeyfile, url=adminURL) 17 | shutdown(name=clusterName,entityType='Cluster',timeOut=120) 18 | disconnect() 19 | except Exception, e: 20 | dumpStack() 21 | disconnect() 22 | raise Exception('Failed to stop weblogic cluster') 23 | -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/Generic/py_scripts/stop_servers.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) 2024 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | """ 5 | import os 6 | import sys 7 | import socket 8 | 9 | wlsServer = sys.argv[1] 10 | adminURL = os.getenv('WLS_ADMIN_URL') 11 | wlsadminconfigfile = os.getenv('WLS_USER_ADMIN_CONFIGFILE') 12 | wlsadminkeyfile = os.getenv('WLS_USER_ADMIN_KEYFILE') 13 | 14 | try: 15 | connect(userConfigFile=wlsadminconfigfile, userKeyFile=wlsadminkeyfile, url=adminURL) 16 | shutdown(wlsServer) 17 | disconnect() 18 | except Exception, e: 19 | dumpStack() 20 | disconnect() 21 | raise Exception('Failed to stop weblogic server') 22 | 23 | -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** MAA WLS Lifecycle Scripts 3 | ** 4 | ** Copyright (c) 2024 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | 41 | -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/PaaS/stop_servers.py: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright (c) 2023 Oracle and/or its affiliates. 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | """ 5 | import os 6 | import sys 7 | import socket 8 | from xml.dom import minidom 9 | sys.path.append("/opt/scripts/") 10 | import databag 11 | 12 | adminServerName = databag.getWlsAdminServerName() 13 | managedServerName = databag.getWlsMSServerName()+str(databag.getHostIndex()) 14 | wls_admin_port=databag.getWlsAdminPort() 15 | admin_host_name= databag.getWlsAdminHost() 16 | adminURL = 't3://' + admin_host_name + ':' + str(wls_admin_port) 17 | 18 | serverType=sys.argv[1] 19 | wlsadminconfigfile=sys.argv[2] 20 | wlsadminkeyfile=sys.argv[3] 21 | 22 | 23 | if serverType == "AdminServer": 24 | try: 25 | connect(userConfigFile=wlsadminconfigfile, userKeyFile=wlsadminkeyfile, url=adminURL) 26 | shutdown(adminServerName) 27 | disconnect() 28 | except Exception, e: 29 | dumpStack() 30 | disconnect() 31 | raise Exception('Failed to stop admin server') 32 | 33 | elif serverType == "ManagedServer": 34 | try: 35 | connect(userConfigFile=wlsadminconfigfile, userKeyFile=wlsadminkeyfile, url=adminURL) 36 | shutdown(managedServerName) 37 | disconnect() 38 | except Exception, e: 39 | dumpStack() 40 | disconnect() 41 | raise Exception('Failed to stop managed server') 42 | 43 | -------------------------------------------------------------------------------- /maa_wls_lifecycle_scripts/README.md: -------------------------------------------------------------------------------- 1 | MAA WLS lifecycle scripts 2 | Copyright (c) 2024 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | # MAA WebLogic Lifecycle Scripts 6 | 7 | Scripts to individually **stop and start** WebLogic processes (Administration Server, Managed server and Node Manager). 8 | 9 | ## Scripts 10 | | Script name | Description | 11 | | ------------- | ------------- | 12 | | [PaaS](./PaaS) | Contains scripts to stop/start WebLogic proceses in the SOA Marketplace and WLS for OCI stacks. The scripts simplify their usage using metadata and internal scripts shipped with these PaaS services. | 13 | | [Generic](./Generic) | Contains scripts to stop/start WebLogic proceses in other environments (Enterprise Deployment Guide domains or other custom WebLogic domains). | 14 | -------------------------------------------------------------------------------- /manual_hybrid_dr/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** Hybrid dr scripts 3 | ** 4 | ** Copyright (c) 2023 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | -------------------------------------------------------------------------------- /manual_hybrid_dr/README.md: -------------------------------------------------------------------------------- 1 | hybrid_dr scripts version 1.0. 2 | 3 | Copyright (c) 2022 Oracle and/or its affiliates 4 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | 6 | 7 | Using the Oracle WLS Hybrid Disaster Recovery scripts 8 | ================================================== 9 | 10 | Please refer to the following playbooks for details about the topology and set up automated by these scripts: 11 | https://docs.oracle.com/en/solutions/soa-dr-on-cloud/index.html 12 | https://docs.oracle.com/en/solutions/weblogic-server-dr-on-cloud/index.html 13 | 14 | IMPORTANT: Verify that you have completed all the pre-requisites listed in the appropriate paper above before using these scripts. 15 | 16 | Summary of the scripts 17 | ===================================== 18 | 19 | | Folder | Content | 20 | | ------ | ------ | 21 | | [hybrid_dr_terraform/](./hybrid_dr_terraform) | A set of terraform scripts to create the OCI resources as described in the playbook | 22 | | [hybrid_dr_rsync_scripts/](./hybrid_dr_rsync_scripts) | A set of rsync scripts and examples to copy the file system contents to remote site, as described in the playbook | 23 | | [others/](./others) | Other scripts referenced in the playbook | 24 | 25 | 26 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_rsync_scripts/example_rsync_LOCALCONFIG_to_WLS1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## hybrid_dr scripts version 1.0. 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | ########################################################################### 9 | # CUSTOM VALUES 10 | ########################################################################### 11 | 12 | # Provide the remote node hostname or IP 13 | REMOTE_NODE=hostwls1.example.com 14 | 15 | # Provide the path of the local config folder that containes the MSERVER and NM_HOME folders 16 | LOCAL_CONFIG_FOLDER=/u02/oracle/config 17 | 18 | # Provide custom exclude list. These folders/files will not be included in the rsync copy 19 | #CUSTOM_EXCLUDE_LIST="--exclude dir1/ --exclude dir2/" 20 | CUSTOM_EXCLUDE_LIST="" 21 | 22 | ########################################################################### 23 | # END OF CUSTOM VALUES 24 | ########################################################################### 25 | 26 | 27 | ########################################################################## 28 | # PREPARE VARIABLES AND RUN THE SCRIPT THAT PERFORMS THE COPY 29 | ########################################################################### 30 | ORIGIN_FOLDER=$LOCAL_CONFIG_FOLDER 31 | DEST_FOLDER=$LOCAL_CONFIG_FOLDER 32 | EXCLUDE_LIST_MSERVER="--exclude '*/servers/*/data/nodemanager/*.lck' --exclude '*/servers/*/data/nodemanager/*.pid' --exclude '*/servers/*/data/nodemanager/*.state' --exclude 'servers/*/tmp' " 33 | EXCLUDE_LIST_NM="--exclude 'nodemanager/*.id' --exclude 'nodemanager/*.lck'" 34 | EXCLUDE_LIST="${CUSTOM_EXCLUDE_LIST} ${EXCLUDE_LIST_MSERVER} ${EXCLUDE_LIST_NM}" 35 | 36 | # Run the script 37 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 38 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_rsync_scripts/example_rsync_OHSCONFIG_to_OHS1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## hybrid_dr scripts version 1.0. 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | ########################################################################### 9 | # CUSTOM VALUES 10 | ########################################################################### 11 | 12 | # Provide the remote node hostname or IP 13 | REMOTE_NODE=hydrohs1.webtiersubnet.hydrvcn.oraclevcn.com 14 | 15 | # Provide the path of the local config folder that containes the MSERVER and NM_HOME folders 16 | OHS_CONFIG_FOLDER=/u02/oracle/config/ 17 | 18 | # Provide custom exclude lists (e.g. other domains in the folder that should no be copied) 19 | # Example: CUSTOM_EXCLUDE_LIST="--exclude 'dir1/' --exclude 'dir/'" 20 | CUSTOM_EXCLUDE_LIST="" 21 | 22 | ########################################################################### 23 | # END OF CUSTOM VALUES 24 | ########################################################################### 25 | 26 | 27 | ########################################################################## 28 | # PREPARE VARIABLES AND RUN THE SCRIPT THAT PERFORMS THE COPY 29 | ########################################################################### 30 | ORIGIN_FOLDER=$OHS_CONFIG_FOLDER 31 | DEST_FOLDER=$OHS_CONFIG_FOLDER 32 | EXCLUDE_LIST="${CUSTOM_EXCLUDE_LIST}" 33 | # Run the script 34 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 35 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_rsync_scripts/example_rsync_PRODUCTS_to_OHS1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## hybrid_dr scripts version 1.0. 3 | ## 4 | ## Copyright (c) 2022 Oracle and/or its affiliates 5 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 6 | ## 7 | 8 | ########################################################################### 9 | # CUSTOM VALUES 10 | ########################################################################### 11 | # Provide the remote OHS node hostname or IP 12 | REMOTE_NODE=hydrohs1.webTiersubnet.hydrvcn.oraclevcn.com 13 | 14 | # Provide the path of the OHS products folder 15 | PRODUCTS_FOLDER=/u02/oracle/poducts 16 | 17 | # Provide custom exclude lists if needed. 18 | # Example: CUSTOM_EXCLUDE_LIST="--exclude 'dir1/' --exclude 'dir/'" 19 | CUSTOM_EXCLUDE_LIST="" 20 | 21 | ########################################################################### 22 | # END OF CUSTOM VALUES 23 | ########################################################################### 24 | 25 | ########################################################################### 26 | # PREPARE VARIABLES AND RUN THE SCRIPT THAT PERFORMS THE COPY 27 | ########################################################################### 28 | ORIGIN_FOLDER=${PRODUCTS_FOLDER} 29 | DEST_FOLDER=${PRODUCTS_FOLDER} 30 | EXCLUDE_LIST="${CUSTOM_EXCLUDE_LIST}" 31 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 32 | 33 | 34 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_rsync_scripts/example_rsync_PRODUCTS_to_WLS1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## hybrid_dr scripts version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | ########################################################################### 10 | # CUSTOM VALUES 11 | ########################################################################### 12 | # Provide the remote node hostname or IP 13 | REMOTE_NODE=hostwls1.example.com 14 | 15 | # Provide the path of the products folder 16 | PRODUCTS_FOLDER=/u01/oracle/products 17 | 18 | # Provide custom exclude list. These folders/files will not be included in the rsync copy 19 | #CUSTOM_EXCLUDE_LIST="--exclude 'dir1/' --exclude 'dir/'" 20 | CUSTOM_EXCLUDE_LIST="" 21 | 22 | ########################################################################### 23 | # END OF CUSTOM VALUES 24 | ########################################################################### 25 | 26 | ########################################################################### 27 | # PREPARE VARIABLES AND RUN THE SCRIPT THAT PERFORMS THE COPY 28 | ########################################################################### 29 | ORIGIN_FOLDER=${PRODUCTS_FOLDER} 30 | DEST_FOLDER=${PRODUCTS_FOLDER} 31 | EXCLUDE_LIST="${CUSTOM_EXCLUDE_LIST}" 32 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 33 | 34 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_rsync_scripts/example_rsync_SHAREDCONFIG_to_WLS1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## hybrid_dr scripts version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | ########################################################################### 10 | # CUSTOM VALUES 11 | ########################################################################### 12 | 13 | # Provide the remote node hostname or IP 14 | REMOTE_NODE=hostwls1.example.com 15 | 16 | # Provide the path of the shared config folders to copy 17 | ASERVER_HOME=/u01/oracle/config/domains/mydomain 18 | APPLICATION_HOME=/u01/oracle/config/applications/mydomain 19 | DEPLOY_PLAN_HOME=/u01/oracle/config/dp/mydomain 20 | KEYSTORE_HOME=/u01/oracle/config/keystores 21 | 22 | # NOTE: this script performs the copy of each artifact in separated steps to provide more granularity. 23 | # Alternatively, you could copy the whole /u01/oracle/config in one step. 24 | 25 | ########################################################################### 26 | # END OF CUSTOM VALUES 27 | ########################################################################### 28 | 29 | 30 | # Copy the ASERVER 31 | ################################## 32 | ORIGIN_FOLDER=$ASERVER_HOME 33 | DEST_FOLDER=$ASERVER_HOME 34 | CUSTOM_EXCLUDE_LIST="" 35 | EXCLUDE_LIST="${CUSTOM_EXCLUDE_LIST} --exclude 'servers/*/data/nodemanager/*.lck' --exclude 'servers/*/data/nodemanager/*.pid' --exclude 'servers/*/data/nodemanager/*.state' --exclude 'servers/*/tmp' " 36 | 37 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 38 | 39 | 40 | # Copy the APPLICATION_HOME 41 | #################################### 42 | ORIGIN_FOLDER=${APPLICATION_HOME} 43 | DEST_FOLDER=${APPLICATION_HOME} 44 | EXCLUDE_LIST="" 45 | 46 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 47 | 48 | # Copy the Deploy plan home 49 | ################################## 50 | ORIGIN_FOLDER=${DEPLOY_PLAN_HOME} 51 | DEST_FOLDER=${DEPLOY_PLAN_HOME} 52 | EXCLUDE_LIST="" 53 | 54 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 55 | 56 | 57 | # Copy the keystore home 58 | ################################## 59 | ORIGIN_FOLDER=${KEYSTORE_HOME} 60 | DEST_FOLDER=${KEYSTORE_HOME} 61 | EXCLUDE_LIST="" 62 | 63 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 64 | 65 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_rsync_scripts/example_rsync_SHAREDRUNTIME_to_WLS1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## hybrid_dr scripts version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | ########################################################################### 10 | # CUSTOM VALUES 11 | ########################################################################### 12 | 13 | # Provide the remote node hostname or IP 14 | REMOTE_NODE=hostwls1.example.com 15 | 16 | # Provide the path of the RUNTIME FOLDER 17 | ORACLE_RUNTIME=/u01/oracle/runtime/mydomain 18 | 19 | # Provide custom exclude list. These folders/files will not be included in the rsync copy 20 | # CUSTOM_EXCLUDE_LIST="--exclude dir1/ --exclude dir2/" 21 | CUSTOM_EXCLUDE_LIST="" 22 | 23 | ########################################################################### 24 | # END OF CUSTOM VALUES 25 | ########################################################################### 26 | 27 | 28 | ########################################################################### 29 | # PREPARE VARIABLES AND RUN THE SCRIPT THAT PERFORMS THE COPY 30 | ########################################################################### 31 | ORIGIN_FOLDER=$ORACLE_RUNTIME 32 | DEST_FOLDER=$ORACLE_RUNTIME 33 | EXCLUDE_LIST="${CUSTOM_EXCLUDE_LIST}" 34 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 35 | 36 | 37 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_rsync_scripts/example_rsync_orainventory_to_WLS1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## hybrid_dr scripts version 1.0. 4 | ## 5 | ## Copyright (c) 2022 Oracle and/or its affiliates 6 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 7 | ## 8 | 9 | ########################################################################### 10 | # CUSTOM VALUES 11 | ########################################################################### 12 | 13 | # Provide the remote node hostname or IP 14 | REMOTE_NODE=hostwls1.example.com 15 | 16 | # Provide the path of the ORAINVENTORY FOLDER 17 | ORAINVENTORY_FOLDER=/u01/app/oraInventory 18 | 19 | # Provide custom exclude list. Not needed for this case 20 | CUSTOM_EXCLUDE_LIST="" 21 | 22 | ########################################################################### 23 | # END OF CUSTOM VALUES 24 | ########################################################################### 25 | 26 | ########################################################################### 27 | # PREPARE VARIABLES AND RUN THE SCRIPT THAT PERFORMS THE COPY 28 | ########################################################################### 29 | ORIGIN_FOLDER=$ORAINVENTORY_FOLDER 30 | DEST_FOLDER=$ORAINVENTORY_FOLDER 31 | EXCLUDE_LIST="${CUSTOM_EXCLUDE_LIST}" 32 | ./rsync_copy_and_validate.sh $ORIGIN_FOLDER $DEST_FOLDER $REMOTE_NODE "$EXCLUDE_LIST" 33 | 34 | 35 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_rsync_scripts/hybrid_dr_rsync_scripts.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/manual_hybrid_dr/hybrid_dr_rsync_scripts/hybrid_dr_rsync_scripts.zip -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** WLS Hybrid DR terraform scripts 3 | ** 4 | ** Copyright (c) 2022 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | 41 | 42 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/README.md: -------------------------------------------------------------------------------- 1 | WLS Hybrid DR terraform scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | # Terraform code for WLS Hybrid DR 6 | 7 | This project contains the following code to create resources as described in the playbooks: 8 | https://docs.oracle.com/en/solutions/soa-dr-on-cloud/index.html 9 | https://docs.oracle.com/en/solutions/weblogic-server-dr-on-cloud/index.html 10 | 11 | | Folder | Description | 12 | | ------------- | ------------- | 13 | | [common/](./common) | This folder contains common terraform scripts. 14 | | [wls/](./wls) | This folder contains terraform scripts specific to WLS Hybrid DR. 15 | | [soa/](./soa) | This folder contains terraform scripts specific to SOA Hybrid DR. 16 | 17 | 18 | # Recommended order to use them is: 19 | 1) [common/HybridDR_NetworkResources](./common/HybridDR_NetworkResources), to create the network resources. 20 | 2) [common/HybridDR_DBSystem](./common/HybridDR_DBSystem), to create the DB system. 21 | 3) [common/HybridDR_FSSresources](./common/HybridDR_FSSresources), to create the OCI FS resources. 22 | 4) [wls/HybridDR_WLSComputeInstances](./wls/HybridDR_WLSComputeInstances) or [soa/HybridDR_SOAComputeInstances](./soa/HybridDR_SOAComputeInstances) to create the midtier nodes. 23 | 5) [common/HybridDR_OCILoadBalancer](./common/HybridDR_OCILoadBalancer) to create the OCI Load Balancer (which requires the midtier nodes). 24 | 25 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_DBSystem/1_get_shapes_and_versions/main.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | terraform { 8 | required_providers { 9 | oci = { 10 | source = "oracle/oci" 11 | version = ">= 4.0.0" 12 | } 13 | } 14 | } 15 | 16 | 17 | provider "oci" { 18 | tenancy_ocid = var.tenancy_ocid 19 | user_ocid = var.user_ocid 20 | fingerprint = var.fingerprint 21 | private_key_path = var.private_key_path 22 | region = var.region 23 | } 24 | 25 | 26 | 27 | 28 | data "oci_database_db_system_shapes" "my_db_system_shapes" { 29 | #Required 30 | compartment_id = var.compartment_id 31 | 32 | #Optional 33 | availability_domain = var.availability_domain 34 | } 35 | 36 | output "shapes" { 37 | value = distinct(data.oci_database_db_system_shapes.my_db_system_shapes.db_system_shapes[*].name) 38 | } 39 | 40 | 41 | data "oci_database_db_versions" "my_db_versions" { 42 | #Required 43 | compartment_id = var.compartment_id 44 | 45 | #Optional 46 | #db_system_id = oci_database_db_system.test_db_system.id 47 | #db_system_shape = var.db_version_db_system_shape 48 | #is_database_software_image_supported = var.db_version_is_database_software_image_supported 49 | #is_upgrade_supported = var.db_version_is_upgrade_supported 50 | #storage_management = var.db_version_storage_management 51 | } 52 | 53 | output "versions" { 54 | value = data.oci_database_db_versions.my_db_versions.db_versions 55 | } 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_DBSystem/1_get_shapes_and_versions/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | ## These are sample values. Customize with the values of your environment 8 | 9 | ## OCI Provider details 10 | tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa7dkeohv7ar676767676767xxrokon3f2bxo6z6e2odqxsklgq" 11 | user_ocid = "ocid1.user.oc1..aaaaaaaa77pn6uke4zyxeu7878787878787878787epq6d7jqaubes3fsq4q" 12 | fingerprint = "5c:55:55:55:55:55:55:55:55:55:55:55:55:55:55:55" 13 | private_key_path = "/home/opc/my_keys/oracleidentitycloudservice_user.name-02-28-08-31.pem" 14 | region = "us-ashburn-1" 15 | 16 | # Other 17 | compartment_id = "ocid1.compartment.oc1..aaaaaaaa6zl8989898989898989898983faqfhi6x6qdtd2vathgya" 18 | availability_domain = "efXT:US-ASHBURN-AD-1" 19 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_DBSystem/1_get_shapes_and_versions/variables.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | # Provider required info 8 | variable "tenancy_ocid" {} 9 | variable "user_ocid" {} 10 | variable "fingerprint" {} 11 | variable "private_key_path" {} 12 | variable "region" {} 13 | 14 | # Others 15 | variable "compartment_id" {} 16 | 17 | variable "availability_domain" {} 18 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_DBSystem/2_create_DBSystem/variables.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | # Provider required info 8 | variable "tenancy_ocid" {} 9 | variable "user_ocid" {} 10 | variable "fingerprint" {} 11 | variable "private_key_path" {} 12 | variable "region" {} 13 | 14 | # 15 | variable "compartment_id" {} 16 | variable "availability_domain" {} 17 | variable "dbtier_subnet_id" {} 18 | 19 | # 20 | variable "db_system_display_name" {} 21 | variable "ssh_public_key_path" {} 22 | 23 | # 24 | variable "shape" {} 25 | variable "cpu_core_count" {} 26 | variable "db_version" {} 27 | variable "db_system_license_model" {} 28 | variable "db_system_database_edition" {} 29 | 30 | variable "node_count" {} 31 | 32 | # 33 | variable "db_hostname_prefix" {} 34 | variable "DBName" {} 35 | variable "DB_unique_name_suffix" {} 36 | variable "PDBName" {} 37 | #variable "database_sid_prefix" {} 38 | # 39 | variable "sys_password" {} 40 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_DBSystem/README.md: -------------------------------------------------------------------------------- 1 | WLS Hybrid DR terraform scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | # Terraform code for creating OCI DB system for Hybrid DR 6 | ---------------------------------------------------------------------- 7 | This terraform code is referenced in the section "Configure Oracle Data Guard" of the playbooks: 8 | "Configure a hybrid DR solution for Oracle SOA Suite" https://docs.oracle.com/en/solutions/soa-dr-on-cloud 9 | "Configure a hybrid DR solution for WebLogic" https://docs.oracle.com/en/solutions/weblogic-server-dr-on-cloud 10 | 11 | This terraform code will create: 12 | - A DB System based on the input attributes specified by customer 13 | 14 | Steps to use: 15 | - Terraform code in folder "1_get_shapes_and_versions" can be used to get the list of shapes and versions available. 16 | - Edit terraform.tfvars file. 17 | - Provide the customer values. 18 | - Run "terraform plan" to get the info. 19 | - Choose the shape and version that match to the values used by the on-premises database. 20 | 21 | - Terraform code in folder "2_create_DBSystem" is used to provision the DB System with the values provided. 22 | - Edit terraform.tfvars file. 23 | - Provide the customer values. 24 | - Run "terraform plan" to review the resources that are going to be created. 25 | - Run "terraform apply" to create the resources. 26 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_FSSresources/README.md: -------------------------------------------------------------------------------- 1 | WLS Hybrid DR terraform scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | # Terraform code for creating OCI FS resources for Hybrid DR 6 | --------------------------------------------------------------- 7 | This terraform code is referenced in the section "Prepare the Storage on OCI" of the playbooks: 8 | "Configure a hybrid DR solution for Oracle SOA Suite" https://docs.oracle.com/en/solutions/soa-dr-on-cloud 9 | "Configure a hybrid DR solution for WebLogic" https://docs.oracle.com/en/solutions/weblogic-server-dr-on-cloud 10 | 11 | 12 | This terraform code will create: 13 | - 1 mount target (if only 1 AD is used) or 2 mount targets (if 2 ADs are used). 14 | - 4 File Systems 15 | - 1 file system for the shared config 16 | - 1 file system for the shared runtime 17 | - 1 for products1 (private file system for wls node1) 18 | - 1 for products2 (private file system for wls node2). If there are 2 ADs, this will be created in the second AD. 19 | - 4 exports, one per each file system, in the appropriate AD. 20 | 21 | The names of the file systems and the export paths are configurable in terraform.tfvars file. 22 | 23 | Steps to use: 24 | - Edit terraform.tfvars file. 25 | - Provide the customer values. 26 | - Run "terraform plan" to review the resources that are going to be created. 27 | - Run "terraform apply" to create the resources. 28 | 29 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_FSSresources/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | ## OCI Provider details 8 | tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa7dkeo77777777777777777777okon3f2bxo6z6e2odqxsklgq" 9 | user_ocid = "ocid1.user.oc1..aaaaaaaa77pn6uke444444444444444444445doteepq6d7jqaubes3fsq4q" 10 | fingerprint = "5c:55:55:55:55:55:55:55:55:55:55:55:55:55:55:55a" 11 | private_key_path = "/home/opc/my_keys/oracleidentitycloudservice_user.names-02-28-08-31.pem" 12 | region = "us-ashburn-1" 13 | 14 | # Other 15 | compartment_id = "ocid1.compartment.oc1..aaaaaaaa6zlezuvy333333333333333333yl3faqfhi6x6qdtd2vathgya" 16 | fss_subnet_id = "ocid1.subnet.oc1.iad.aaaaaaaamoieko4dy44444444444444444njfuju5py2ibfa2z6cespsovma" 17 | 18 | # Availability Domain(s) of the WLS midtiers 19 | AD1_name = "efXT:US-ASHBURN-AD-1" 20 | AD2_name = "efXT:US-ASHBURN-AD-2" # Leave this empty if all the midtier hosts are in the same AD 21 | 22 | # Mount target names 23 | mounttarget1_displayname = "WLSDRmountTarget1" 24 | mounttarget2_displayname = "WLSDRmountTarget2" # Leave this empty if all the midtier hosts are in the same AD 25 | 26 | # Filesystem names 27 | sharedconfig_FSSname = "wlsdrconfigFSS" 28 | runtime_FSSname = "wlsdrruntimeFSS" 29 | products1_FSSname = "wlsdrproducts1FSS" 30 | products2_FSSname = "wlsdrproducts2FSS" 31 | 32 | # Export Paths 33 | sharedconfig_exportpath = "/export/wlsdrconfig" 34 | runtime_exportpath = "/export/wlsdrruntime" 35 | products1_exportpath = "/export/wlsdrproducts1" 36 | products2_exportpath = "/export/wlsdrproducts2" 37 | 38 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_FSSresources/variables.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | # Provider required info 8 | variable "tenancy_ocid" {} 9 | variable "user_ocid" {} 10 | variable "fingerprint" {} 11 | variable "private_key_path" {} 12 | variable "region" {} 13 | 14 | # Others 15 | variable "compartment_id" {} 16 | variable "fss_subnet_id" {} 17 | 18 | # Availability domains 19 | variable "AD1_name" {} 20 | variable "AD2_name" {} 21 | 22 | # Mount target names 23 | variable "mounttarget1_displayname" { default = "WLSDRmountTarget1" } 24 | variable "mounttarget2_displayname" {} 25 | 26 | # Filesystem names 27 | variable "sharedconfig_FSSname" { default = "wlsdrconfigFSS" } 28 | variable "runtime_FSSname" { default = "wlsdrruntimeFSS" } 29 | variable "products1_FSSname" { default = "wlsdrproducts1FSS" } 30 | variable "products2_FSSname" { default = "wlsdrproducts2FSS" } 31 | 32 | # Export Paths 33 | variable "sharedconfig_exportpath" { default = "/export/wlsdrconfig" } 34 | variable "runtime_exportpath" { default = "/export/wlsdrruntime" } 35 | variable "products1_exportpath" { default = "/export/wlsdrproducts1" } 36 | variable "products2_exportpath" { default = "/export/wlsdrproducts2" } 37 | 38 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_NetworkResources/README.md: -------------------------------------------------------------------------------- 1 | WLS Hybrid DR terraform scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | # Terraform code for creating network resources for Hybrid DR 6 | ----------------------------------------------------------------- 7 | This terraform code is referenced in the section "Configure the Network" of the playbooks: 8 | "Configure a hybrid DR solution for Oracle SOA Suite" https://docs.oracle.com/en/solutions/soa-dr-on-cloud 9 | "Configure a hybrid DR solution for WebLogic" https://docs.oracle.com/en/solutions/weblogic-server-dr-on-cloud/index.html 10 | 11 | This terraform code will create: 12 | - A NEW VCN in the compartment. 13 | - 4 subnets in the VCN, one per each layer: webtier subnet, midtier subnet, fsstier subnet, dbtier subnet. 14 | - The network security rules to allow traffic between them and with on-prem as described in the Hybrid DR document. 15 | - (Optional) An Internet Gateway to the VCN. 16 | 17 | This terraform code will NOT create: 18 | - This does not create Fast Connect nor Site-to-Site related configuration. 19 | - This does not enable incoming SSH traffic from 0.0.0.0/0 to the subnets. If needed, add the rule manually to the subnet's security list after provisioning. 20 | 21 | 22 | Steps to use: 23 | - Edit terraform.tfvars file. 24 | - Provide the customer values. 25 | - Run "terraform plan" to review the resources that are going to be created. 26 | - Run "terraform apply" to create the resources. 27 | 28 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_NetworkResources/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | ## OCI Provider details 8 | tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa7dkeo77777777777777777777okon3f2bxo6z6e2odqxsklgq" 9 | user_ocid = "ocid1.user.oc1..aaaaaaaa77pn6uke444444444444444444445doteepq6d7jqaubes3fsq4q" 10 | fingerprint = "5c:55:55:55:55:55:55:55:55:55:55:55:55:55:55:55a" 11 | private_key_path = "/home/opc/my_keys/oracleidentitycloudservice_user.names-02-28-08-31.pem" 12 | region = "us-ashburn-1" 13 | compartment_id = "ocid1.compartment.oc1..aaaaaaaa6zlezuvycwpmaiyuunyfqrunkcutyl3faqfhi6x6qdtd2vathgya" 14 | 15 | 16 | ### Network resources 17 | # Names 18 | vcn_name = "HyTestVCN" 19 | webtier_subnet_name = "webtierSubnet" 20 | midtier_subnet_name = "midtierSubnet" 21 | dbtier_subnet_name = "dbtierSubnet" 22 | fsstier_subnet_name = "fsstierSubnet" 23 | 24 | # Public or private 25 | webtier_is_private = "false" 26 | midtier_is_private = "true" 27 | dbtier_is_private = "true" 28 | fsstier_is_private = "true" 29 | 30 | # CIDR ranges 31 | vcn_CIDR = "10.1.112.0/24" 32 | webtier_CIDR = "10.1.112.0/26" 33 | midtier_CIDR = "10.1.112.64/26" 34 | dbtier_CIDR = "10.1.112.128/26" 35 | fsstier_CIDR = "10.1.112.192/26" 36 | onprem_CIDR = "10.100.100.0/24" 37 | 38 | # Set to true if you want to add internet gateway 39 | add_internet_gateway = "true" 40 | 41 | ### Ports for communications 42 | ssh_port = "22" 43 | sqlnet_port = "1521" 44 | ons_port = "6200" 45 | frontend_https_port = "443" 46 | frontend_http_port = "80" 47 | frontend_admin_port = "7001" 48 | frontend_internal_port = "8888" 49 | adminserver_port = "7001" 50 | # Add the listener ports of the WebLogic managed servers. These are the ports that receive the requests from the webtier 51 | wlsservers_ports = ["7010", "8001","8011","8021", "9001" ] 52 | 53 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_NetworkResources/variables.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | variable "tenancy_ocid" {} 8 | variable "user_ocid" {} 9 | variable "fingerprint" {} 10 | variable "private_key_path" {} 11 | variable "region" {} 12 | 13 | variable "compartment_id" {} 14 | 15 | variable "vcn_name" {} 16 | 17 | variable "webtier_subnet_name" {} 18 | variable "midtier_subnet_name" {} 19 | variable "dbtier_subnet_name" {} 20 | variable "fsstier_subnet_name" {} 21 | 22 | variable "webtier_is_private" {} 23 | variable "midtier_is_private" {} 24 | variable "dbtier_is_private" {} 25 | variable "fsstier_is_private" {} 26 | 27 | variable "vcn_CIDR" {} 28 | variable "webtier_CIDR" {} 29 | variable "midtier_CIDR" {} 30 | variable "dbtier_CIDR" {} 31 | variable "fsstier_CIDR" {} 32 | variable "onprem_CIDR" {} 33 | 34 | variable "ssh_port" { default = "22"} 35 | variable "sqlnet_port" { default = "1521"} 36 | variable "ons_port" { default = "6200"} 37 | 38 | variable "add_internet_gateway" { default = "false" } 39 | 40 | variable "frontend_https_port" { default = "443"} 41 | variable "frontend_http_port" { default = "80"} 42 | variable "frontend_admin_port" { default = "7001"} 43 | variable "frontend_internal_port" { default = "8888"} 44 | 45 | variable "adminserver_port" { default = "7001"} 46 | variable "wlsservers_ports" {} 47 | 48 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_OCILoadBalancer/certificate.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | ######################################################################################################## 8 | # Configure SSL certificate in the LBR 9 | ######################################################################################################## 10 | resource "oci_load_balancer_certificate" "hy_https_certificate" { 11 | # This is when the cert has no passphrase 12 | count = var.certificate_passphrase == "" ? 1 : 0 13 | #Required 14 | certificate_name = "hy_https_cert" 15 | load_balancer_id = oci_load_balancer_load_balancer.hydr_LBR.id 16 | 17 | #Optional 18 | ca_certificate = file(var.certificate_ca_certificate_file) 19 | private_key = file(var.certificate_private_key_file) 20 | public_certificate = file(var.certificate_public_certificate_file) 21 | 22 | lifecycle { 23 | create_before_destroy = true 24 | } 25 | } 26 | 27 | resource "oci_load_balancer_certificate" "hy_https_certificate_withpass" { 28 | # This is in case the cert has passwphrase 29 | count = var.certificate_passphrase != "" ? 1 : 0 30 | #Required 31 | certificate_name = "hy_https_cert" 32 | load_balancer_id = oci_load_balancer_load_balancer.hydr_LBR.id 33 | 34 | #Optional 35 | ca_certificate = file(var.certificate_ca_certificate_file) 36 | passphrase = var.certificate_passphrase 37 | private_key = file(var.certificate_private_key_file) 38 | public_certificate = file(var.certificate_public_certificate_file) 39 | 40 | lifecycle { 41 | create_before_destroy = true 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_OCILoadBalancer/clusters.yaml: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | 6 | clusters: 7 | - cluster: 8 | name : "My_Cluster_1" 9 | servers_IPs : 10 | - "111.111.111.1" 11 | - "111.111.111.2" 12 | - "111.111.111.3" 13 | port : "1111" 14 | uris : 15 | - "/app1" 16 | - "/test1" 17 | internal: "no" 18 | 19 | - cluster: 20 | name: "My_Cluster_2" 21 | servers_IPs: 22 | - "222.222.222.1" 23 | - "222.222.222.2" 24 | port: "2222" 25 | uris: 26 | - "/app2" 27 | - "/test2" 28 | internal: "no" 29 | 30 | - cluster: 31 | name: "My_Cluster_3" 32 | servers_IPs: 33 | - "223.223.223.1" 34 | - "223.223.223.2" 35 | port: "3333" 36 | uris: 37 | - "/app3" 38 | - "/test3" 39 | internal: "yes" 40 | 41 | - cluster: 42 | name: "My_Cluster_4" 43 | servers_IPs: 44 | - "224.224.224.1" 45 | - "224.224.224.2" 46 | port: "4444" 47 | uris: 48 | - "/app4" 49 | - "/test4" 50 | - "/another4" 51 | internal: "no" 52 | 53 | #Add more clusters if needed 54 | 55 | 56 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_OCILoadBalancer/clusters_example.yaml: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | 6 | clusters: 7 | - cluster: 8 | name : "My_Cluster_1" 9 | servers_IPs : 10 | - "111.111.111.1" 11 | - "111.111.111.2" 12 | - "111.111.111.3" 13 | port : "1111" 14 | uris : 15 | - "/app1" 16 | - "/test1" 17 | internal: "no" 18 | 19 | - cluster: 20 | name: "My_Cluster_2" 21 | servers_IPs: 22 | - "222.222.222.1" 23 | - "222.222.222.2" 24 | port: "2222" 25 | uris: 26 | - "/app2" 27 | - "/test2" 28 | internal: "no" 29 | 30 | - cluster: 31 | name: "My_Cluster_3" 32 | servers_IPs: 33 | - "223.223.223.1" 34 | - "223.223.223.2" 35 | port: "3333" 36 | uris: 37 | - "/app3" 38 | - "/test3" 39 | internal: "yes" 40 | 41 | - cluster: 42 | name: "My_Cluster_4" 43 | servers_IPs: 44 | - "224.224.224.1" 45 | - "224.224.224.2" 46 | port: "4444" 47 | uris: 48 | - "/app4" 49 | - "/test4" 50 | - "/another4" 51 | internal: "no" 52 | 53 | #Add more clusters if needed 54 | 55 | 56 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_OCILoadBalancer/hostnames.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | ######################################################################################################## 8 | # Configure the hostnames 9 | ######################################################################################################## 10 | 11 | resource "oci_load_balancer_hostname" "adminconsole_frontend" { 12 | #Required 13 | hostname = var.adminconsole_frontend 14 | load_balancer_id = oci_load_balancer_load_balancer.hydr_LBR.id 15 | name = "adminconsole_frontend" 16 | } 17 | 18 | resource "oci_load_balancer_hostname" "https_frontend" { 19 | #Required 20 | hostname = var.https_frontend 21 | load_balancer_id = oci_load_balancer_load_balancer.hydr_LBR.id 22 | name = "https_frontend" 23 | } 24 | 25 | resource "oci_load_balancer_hostname" "http_frontend" { 26 | #Required 27 | hostname = var.http_frontend 28 | load_balancer_id = oci_load_balancer_load_balancer.hydr_LBR.id 29 | name = "http_frontend" 30 | } 31 | 32 | resource "oci_load_balancer_hostname" "internal_frontend" { 33 | count = var.internal_frontend != "" ? 1 : 0 34 | #Required 35 | hostname = var.internal_frontend 36 | load_balancer_id = oci_load_balancer_load_balancer.hydr_LBR.id 37 | name = "internal_frontend" 38 | } 39 | 40 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_OCILoadBalancer/main.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | terraform { 8 | required_providers { 9 | oci = { 10 | source = "oracle/oci" 11 | version = ">= 4.0.0" 12 | } 13 | } 14 | } 15 | 16 | 17 | provider "oci" { 18 | tenancy_ocid = var.tenancy_ocid 19 | user_ocid = var.user_ocid 20 | fingerprint = var.fingerprint 21 | private_key_path = var.private_key_path 22 | region = var.region 23 | } 24 | 25 | 26 | 27 | ######################################################################################################## 28 | # Create the Load Balancer 29 | ######################################################################################################## 30 | resource "oci_load_balancer_load_balancer" "hydr_LBR" { 31 | #Required 32 | compartment_id = var.compartment_id 33 | display_name = var.LBR_display_name 34 | shape = var.LBR_shape 35 | subnet_ids = [var.webtier_subnet_id] 36 | ip_mode = "IPV4" 37 | is_private = var.LBR_is_private 38 | 39 | #Optional 40 | #defined_tags = {"Operations.CostCenter"= "42"} 41 | #freeform_tags = {"Department"= "Finance"} 42 | #network_security_group_ids = var.load_balancer_network_security_group_ids 43 | #reserved_ips { 44 | #Optional 45 | #id = var.load_balancer_reserved_ips_id 46 | #} 47 | shape_details { 48 | #Required 49 | maximum_bandwidth_in_mbps = var.LBR_maxbw 50 | minimum_bandwidth_in_mbps = var.LBR_minbw 51 | } 52 | } 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_OCILoadBalancer/rulesets.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | ######################################################################################################## 8 | # Configure Rule sets (headers, redirects) 9 | ######################################################################################################## 10 | resource "oci_load_balancer_rule_set" "HTTP_to_HTTPS_redirect" { 11 | #Required 12 | items { 13 | #Required 14 | action = "REDIRECT" 15 | 16 | conditions { 17 | #Required 18 | attribute_name = "PATH" 19 | attribute_value = "/" 20 | #Optional 21 | operator = "FORCE_LONGEST_PREFIX_MATCH" 22 | } 23 | #Optional 24 | redirect_uri { 25 | #Optional 26 | host = "{host}" 27 | path = "/{path}" 28 | port = var.frontend_https_port 29 | protocol = "HTTPS" 30 | query = "?{query}" 31 | } 32 | response_code = "301" 33 | } 34 | load_balancer_id = oci_load_balancer_load_balancer.hydr_LBR.id 35 | name = "HTTP_to_HTTPS_redirect" 36 | } 37 | 38 | 39 | resource "oci_load_balancer_rule_set" "SSLHeaders" { 40 | #Required 41 | items { 42 | #Required 43 | action = "ADD_HTTP_REQUEST_HEADER" 44 | header = "is_ssl" 45 | value = "ssl" 46 | } 47 | items { 48 | #Required 49 | action = "ADD_HTTP_REQUEST_HEADER" 50 | header = "WL-Proxy-SSL" 51 | value = "true" 52 | } 53 | load_balancer_id = oci_load_balancer_load_balancer.hydr_LBR.id 54 | name = "SSLHeaders" 55 | } 56 | 57 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/HybridDR_OCILoadBalancer/variables.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | variable "tenancy_ocid" {} 8 | variable "user_ocid" {} 9 | variable "fingerprint" {} 10 | variable "private_key_path" {} 11 | variable "region" {} 12 | 13 | variable "compartment_id" {} 14 | 15 | variable "LBR_display_name" {} 16 | variable "webtier_subnet_id" {} 17 | variable "LBR_is_private" {} 18 | 19 | variable "backend_set_policy" { default = "ROUND_ROBIN" } 20 | variable "LBR_shape" { default = "flexible" } 21 | variable "LBR_minbw" { default = "10" } 22 | variable "LBR_maxbw" { default = "100" } 23 | 24 | variable "https_frontend" {} 25 | variable "http_frontend" {} 26 | variable "adminconsole_frontend" {} 27 | variable "internal_frontend" {} 28 | 29 | variable "frontend_https_port" {} 30 | variable "frontend_http_port" {} 31 | variable "frontend_internal_port" {} 32 | variable "frontend_admin_port" {} 33 | 34 | variable "certificate_passphrase" {} 35 | variable "certificate_private_key_file" {} 36 | variable "certificate_public_certificate_file" {} 37 | variable "certificate_ca_certificate_file" {} 38 | 39 | 40 | variable "there_is_OHS" {} 41 | 42 | variable "ohs_nodes_ips" { default = ""} 43 | variable "ohs_httpconsoles_port" { default = ""} 44 | variable "ohs_http_port" { default = ""} 45 | variable "ohs_httpinternal_port" { default = ""} 46 | 47 | 48 | variable "admin_vip" { default = ""} 49 | variable "wls_adminserver_port" { default = "7001"} 50 | variable "clusters_definition_file" { default = "clusters.yaml"} 51 | 52 | 53 | ############################################################ 54 | 55 | 56 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/common/README.md: -------------------------------------------------------------------------------- 1 | WLS Hybrid DR terraform scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | ## HybridDR_NetworkResources 6 | Terraform code to create the VCN, the subnets and the network security rules as described in "Configure the Network" section. 7 | 8 | ## HybridDR_DBSystem 9 | Terraform code to create the DB System for the section "Configure Oracle Data Guard". 10 | 11 | ## HybridDR_FSSresources 12 | Terraform code to create the OCI File System resources (mount targets, file systems, exports) as described in "Prepare the Storage on OCI" section. 13 | 14 | ## HybridDR_OCILoadBalancer 15 | Terraform code to create the OCI Load Balancer and its configuration as described in "Prepare the Web-tier on OCI" section. 16 | 17 | # Usage 18 | In each case, provide your environment values in the terraform.tfvars file. 19 | Then run "terraform plan" and "terraform apply" to create the resources. 20 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/hybrid_dr_terraform.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/manual_hybrid_dr/hybrid_dr_terraform/hybrid_dr_terraform.zip -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/soa/HybridDR_SOAComputeInstances/1_get_shapes_and_images/main.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | terraform { 8 | required_providers { 9 | oci = { 10 | source = "oracle/oci" 11 | version = ">= 4.0.0" 12 | } 13 | } 14 | } 15 | 16 | 17 | provider "oci" { 18 | tenancy_ocid = var.tenancy_ocid 19 | user_ocid = var.user_ocid 20 | fingerprint = var.fingerprint 21 | private_key_path = var.private_key_path 22 | region = var.region 23 | } 24 | 25 | data "oci_core_shapes" "available_shapes" { 26 | #Required 27 | compartment_id = var.compartment_id 28 | 29 | #Optional 30 | #availability_domain = var.shape_availability_domain 31 | #image_id = oci_core_image.test_image.id 32 | } 33 | 34 | output "shapes" { 35 | value = distinct(data.oci_core_shapes.available_shapes.shapes[*].name) 36 | } 37 | 38 | data "oci_core_images" "available_images" { 39 | #Required 40 | compartment_id = var.compartment_id 41 | 42 | #Optional 43 | #display_name = var.image_display_name 44 | operating_system = var.image_os 45 | #operating_system_version = var.image_operating_system_version 46 | #shape = var.image_shape 47 | state = "AVAILABLE" 48 | #sort_by = "DISPLAYNAME" 49 | #sort_order = "ASC" 50 | } 51 | 52 | 53 | 54 | output "images_and_ids" { 55 | value = [ for x in data.oci_core_images.available_images.images : "IMAGE DISPLAY NAME: ${x.display_name} ----> OCID: ${x.id}" ] 56 | } 57 | 58 | 59 | #output "all" { 60 | # value = data.oci_core_images.available_images 61 | #} 62 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/soa/HybridDR_SOAComputeInstances/1_get_shapes_and_images/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | ## These are sample values. Customize with the values of your environment 8 | 9 | ## OCI Provider details 10 | tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa7dkeohv77777777777777xrokon3f2bxo6z6e2odqxsklgq" 11 | user_ocid = "ocid1.user.oc1..aaaaaaaa77pn6uke4z44444444444444nsu5doteepq6d7jqaubes3fsq4q" 12 | fingerprint = "5c:55:55:55:55:55:55:55:55:55:55:55:55:55:55:55" 13 | private_key_path = "/home/opc/my_keys/oracleidentitycloudservice_user.name-02-28-08-31.pem" 14 | region = "us-ashburn-1" 15 | 16 | # Other 17 | compartment_id = "ocid1.compartment.oc1..aaaaaaaa6zle33333333333333333333l3faqfhi6x6qdtd2vathgya" 18 | 19 | # Images Operating System 20 | # Options: "Windows", "Canonical Ubuntu", "CentOS", "Oracle Autonomous Linux", "Oracle Linux", "Oracle Linux Cloud Developer" 21 | image_os = "Oracle Linux" 22 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/soa/HybridDR_SOAComputeInstances/1_get_shapes_and_images/variables.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | # Provider required info 8 | variable "tenancy_ocid" {} 9 | variable "user_ocid" {} 10 | variable "fingerprint" {} 11 | variable "private_key_path" {} 12 | variable "region" {} 13 | 14 | # Others 15 | variable "compartment_id" {} 16 | 17 | variable "image_os" {} 18 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/soa/HybridDR_SOAComputeInstances/2_create_compute_instances/main.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | provider "oci" { 8 | tenancy_ocid = var.tenancy_ocid 9 | user_ocid = var.user_ocid 10 | fingerprint = var.fingerprint 11 | private_key_path = var.private_key_path 12 | region = var.region 13 | } 14 | 15 | 16 | # Create the compute instances 17 | ######################################################################################################## 18 | 19 | resource "oci_core_instance" "midtier_instance" { 20 | count = length(var.midtier_hostnames) 21 | #Required 22 | #This will take alternative values from AD_names list in each iteration 23 | availability_domain = var.AD_names[count.index % length(var.AD_names)] 24 | compartment_id = var.compartment_id 25 | shape = var.shape 26 | 27 | create_vnic_details { 28 | #Optional 29 | #assign_private_dns_record = var.instance_create_vnic_details_assign_private_dns_record 30 | #assign_public_ip = var.instance_create_vnic_details_assign_public_ip 31 | #defined_tags = {"Operations.CostCenter"= "42"} 32 | #display_name = var.midtier_hostnames[count.index] 33 | #freeform_tags = {"Department"= "Finance"} 34 | hostname_label = var.midtier_hostnames[count.index] 35 | subnet_id = var.midtier_subnet_id 36 | } 37 | display_name = var.midtier_hostnames[count.index] 38 | #hostname_label = var.midtier_hostnames[count.index] 39 | source_details { 40 | #Required 41 | source_id = var.image_id 42 | source_type = "image" 43 | } 44 | metadata = { 45 | ssh_authorized_keys = file(var.ssh_public_key_path) 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/soa/HybridDR_SOAComputeInstances/2_create_compute_instances/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | ## These are sample values. Customize with the values of your environment 8 | 9 | ## OCI Provider details 10 | tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa7dkeohv777777777777777xxrokon3f2bxo6z6e2odqxsklgq" 11 | user_ocid = "ocid1.user.oc1..aaaaaaaa77pn6uke4z444444444444444nsu5doteepq6d7jqaubes3fsq4q" 12 | fingerprint = "5c:55:55:55:55:55:55:55:55:55:55:55:55:55:55:55" 13 | private_key_path = "/home/opc/my_keys/oracleidentitycloudservice_user.name-02-28-08-31.pem" 14 | region = "us-ashburn-1" 15 | 16 | # Other 17 | compartment_id = "ocid1.compartment.oc1..aaaaaaaa6zlez1111111111111111113faqfhi6x6qdtd2vathgya" 18 | midtier_subnet_id = "ocid1.subnet.oc1.iad.aaaaaaaavjs3j44444444444444ilgcfvwu36c4mwwerz6s6bkkq" 19 | 20 | # Availability Domain(s) list, where you want the SOA midtiers to be provisioned. You can provide 1 AD or more. 21 | AD_names = [ "efXT:US-ASHBURN-AD-1", "efXT:US-ASHBURN-AD-2"] 22 | #AD_names = [ "efXT:US-ASHBURN-AD-1" ] 23 | 24 | # Shape and images 25 | shape = "VM.Standard2.1" 26 | image_id = "ocid1.image.oc1.iad.aaaaaaaapfdqrbk6n4txcqv5h5da3d5wyfi4h7jweomf4y5wb3tw2mfmn4dq" 27 | 28 | # Compute node names list. You can provide 1 or more. 29 | midtier_hostnames = [ "soanode1", "soanode2"] 30 | 31 | # Public ssh key file path 32 | ssh_public_key_path = "/home/opc/my_keys/my_ssh_key.pub" 33 | 34 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/soa/HybridDR_SOAComputeInstances/2_create_compute_instances/variables.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | # Provider required info 8 | variable "tenancy_ocid" {} 9 | variable "user_ocid" {} 10 | variable "fingerprint" {} 11 | variable "private_key_path" {} 12 | variable "region" {} 13 | 14 | # Others 15 | variable "compartment_id" {} 16 | variable "midtier_subnet_id" {} 17 | 18 | # Availability domains 19 | variable "AD_names" {} 20 | 21 | # Shape and images 22 | variable "shape" {} 23 | variable "image_id" {} 24 | 25 | # Compute node names 26 | variable "midtier_hostnames" {} 27 | 28 | # Publich ssh key 29 | variable "ssh_public_key_path" {} 30 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/soa/HybridDR_SOAComputeInstances/README.md: -------------------------------------------------------------------------------- 1 | WLS Hybrid DR terraform scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | Terraform code for creating midtier compute instances for SOA Hybrid DR 6 | ---------------------------------------------------------------------- 7 | This terraform code is referenced in the section "Provision the Compute Instances for the SOA Mid-tier Nodes" 8 | of the playbook "Configure a hybrid DR solution for Oracle SOA Suite". 9 | Reference: https://docs.oracle.com/en/solutions/soa-dr-on-cloud 10 | 11 | This terraform code will create: 12 | - N compute instances for the midtier nodes 13 | 14 | Steps to use: 15 | - Terraform code in folder "1_get_shapes_and_images" can be used to get the list of images and shapes available. 16 | - Edit terraform.tfvars file. 17 | - Provide the customer values. 18 | - Run "terraform plan" to get the info. 19 | - Choose the OS image ocid and compute shape that are similar to the image and shape used by the on-premises hosts. 20 | 21 | - Terraform code in folder "2_create_compute_instances" is used to provision the midtier compute instances with the values provided. 22 | - Edit terraform.tfvars file. 23 | - Provide the customer values. 24 | - Run "terraform plan" to review the resources that are going to be created. 25 | - Run "terraform apply" to create the resources. 26 | 27 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/soa/README.md: -------------------------------------------------------------------------------- 1 | WLS Hybrid DR terraform scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | ## HybridDR_SOAComputeInstances 6 | Terraform code to create the SOA midtier compute instances. 7 | 8 | # Usage 9 | In each case, provide your environment values in the terraform.tfvars file. 10 | Then run "terraform plan" and "terraform apply" to create the resources. 11 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/wls/HybridDR_WLSComputeInstances/README.md: -------------------------------------------------------------------------------- 1 | WLS Hybrid DR terraform scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | Terraform code to create midtier compute instances for WLS Hybrid DR 6 | ---------------------------------------------------------------------- 7 | This terraform code is referenced in the section "Provision the Compute Instances for the Mid-tier Nodes" of the playbook 8 | "Configure a hybrid DR solution for WebLogic" https://docs.oracle.com/en/solutions/weblogic-server-dr-on-cloud 9 | 10 | This terraform code will create: 11 | - N compute instances for the midtier nodes, using WLS OCI EE/Suite UCM images. The public images are built using OL7.9 and OL8.5 os versions. 12 | 13 | Steps to use: 14 | - Edit terraform.tfvars file. 15 | - Provide the customer values. 16 | - Run "terraform plan" to review the resources that are going to be created. 17 | - Run "terraform apply" to create the resources. 18 | 19 | 20 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/wls/HybridDR_WLSComputeInstances/compute.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | 8 | resource "oci_core_instance" "wlsoci_instance" { 9 | count = length(var.midtier_hostnames) 10 | #This will take alternative values from AD_names list in each iteration 11 | availability_domain = var.AD_names[count.index % length(var.AD_names)] 12 | 13 | compartment_id = var.compartment_id 14 | display_name = var.midtier_hostnames[count.index] 15 | shape = var.shape 16 | 17 | shape_config { 18 | #Optional 19 | ocpus = var.ocpu_count 20 | } 21 | create_vnic_details { 22 | subnet_id = var.subnet_id 23 | display_name = "Primaryvnic" 24 | assign_public_ip = true 25 | assign_private_dns_record = true 26 | hostname_label = var.midtier_hostnames[count.index] 27 | } 28 | 29 | source_details { 30 | source_id = data.oci_core_app_catalog_listing_resource_version.mp_catalog_listing.listing_resource_id 31 | source_type = "image" 32 | } 33 | metadata = { 34 | ssh_authorized_keys = file(var.ssh_public_key_path) 35 | } 36 | timeouts { 37 | create = "60m" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/wls/HybridDR_WLSComputeInstances/main.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | locals { 8 | package_version = var.os_version == "8.5" ? data.oci_marketplace_listing_packages.ol85_listing_package.package_version : data.oci_marketplace_listing.mp_listing.default_package_version 9 | } 10 | 11 | terraform { 12 | required_providers { 13 | oci = { 14 | source = "oracle/oci" 15 | version = ">= 4.0.0" 16 | } 17 | tls = { 18 | version = "~> 2.0" 19 | } 20 | } 21 | } 22 | 23 | provider "oci" { 24 | tenancy_ocid = var.tenancy_ocid 25 | user_ocid = var.user_ocid 26 | fingerprint = var.fingerprint 27 | private_key_path = var.private_key_path 28 | region = var.region 29 | } 30 | 31 | 32 | 33 | resource "oci_core_app_catalog_listing_resource_version_agreement" "mp_image_agreement" { 34 | 35 | listing_id = data.oci_core_app_catalog_listing_resource_version.mp_catalog_listing.listing_id 36 | listing_resource_version = data.oci_core_app_catalog_listing_resource_version.mp_catalog_listing.listing_resource_version 37 | } 38 | 39 | resource "oci_core_app_catalog_subscription" "mp_image_subscription" { 40 | compartment_id = var.compartment_id 41 | eula_link = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement.eula_link 42 | listing_id = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement.listing_id 43 | listing_resource_version = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement.listing_resource_version 44 | oracle_terms_of_use_link = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement.oracle_terms_of_use_link 45 | signature = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement.signature 46 | time_retrieved = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement.time_retrieved 47 | 48 | timeouts { 49 | create = "20m" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/wls/HybridDR_WLSComputeInstances/outputs.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | output "instance_id" { 8 | value = oci_core_instance.wlsoci_instance[*].id 9 | } 10 | 11 | 12 | output "package_version" { 13 | value = local.package_version 14 | } 15 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/wls/HybridDR_WLSComputeInstances/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ### 3 | ### Copyright (c) 2022 Oracle and/or its affiliates 4 | ### Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ### 6 | 7 | ## OCI Provider details 8 | tenancy_ocid = "ocid1.tenancy.oc1................kon3f2bxo6z6e2odqxsklgq" 9 | user_ocid = "ocid1.user.oc1..................eepq6d7jqaubes3fsq4q" 10 | fingerprint = "5c:44:53:.....98:28:e6:ba" 11 | private_key_path = "/home/opc/my_keys/oracleidentitycloudservice_user.name-02-28-08-31.pem" 12 | region = "us-ashburn-1" 13 | 14 | # Compartment and subnet 15 | compartment_id = "ocid1.compartment....................fhi6x6qdtd2vathgya" 16 | subnet_id = "ocid1.subnet.oc1.iad...........................wb5iereqryqfbiafguba" 17 | 18 | # Availability Domain list, where the midtiers compute will be provisioned. You can provide 1 AD or more. 19 | AD_names = ["efXT:US-ASHBURN-AD-1", "efXT:US-ASHBURN-AD-2"] 20 | #AD_names = [ "efXT:US-ASHBURN-AD-1" ] 21 | 22 | # Shape and images 23 | shape = "VM.Standard2.1" 24 | 25 | # The WebLogic edition (EE, Suite) for UCM images 26 | edition = "Suite" 27 | 28 | # The os version(7.9 or 8.5) for the images 29 | os_version = "8.5" 30 | 31 | # Compute node names list. You can provide 1 or more. 32 | midtier_hostnames = ["hywlsnode1", "hywlsnode2"] 33 | 34 | # Public ssh key file path 35 | ssh_public_key_path = "/home/opc/TERRAFORM_TESTS/my_keys/my_ssh_key.pub" 36 | 37 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/wls/HybridDR_WLSComputeInstances/variables.tf: -------------------------------------------------------------------------------- 1 | ## WLS Hybrid DR terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | variable "tenancy_ocid" { 8 | type = string 9 | } 10 | 11 | variable "user_ocid" { 12 | type = string 13 | } 14 | 15 | variable "fingerprint" { 16 | type = string 17 | } 18 | 19 | variable "private_key_path" { 20 | type = string 21 | } 22 | 23 | variable "region" { 24 | type = string 25 | } 26 | 27 | variable "compartment_id" { 28 | type = string 29 | } 30 | 31 | variable "hostname" { 32 | type = string 33 | default = "wlsoci-instance" 34 | } 35 | 36 | variable "shape" { 37 | type = string 38 | default = "VM.Standard.E3.Flex" 39 | } 40 | 41 | variable "subnet_id" { 42 | type = string 43 | } 44 | 45 | variable "ocpu_count" { 46 | type = number 47 | default = 1 48 | } 49 | 50 | variable "edition" { 51 | type = string 52 | description = "Name of the marketplace image listings" 53 | } 54 | 55 | variable "wls_image_names" { 56 | type = map(any) 57 | default = { 58 | "EE" = "Oracle WebLogic Server Enterprise Edition UCM Image" 59 | "Suite" = "Oracle WebLogic Suite UCM Image" 60 | } 61 | description = "Name of the marketplace image listings" 62 | } 63 | 64 | variable "build_version" { 65 | type = string 66 | default = "" 67 | description = "Marketplace image build version" 68 | } 69 | 70 | variable "os_version" { 71 | type = string 72 | default = "7.9" 73 | description = "Weblogic OCI os version [7.9, 8.5]" 74 | } 75 | 76 | 77 | variable "AD_names" { 78 | type = list(any) 79 | description = "List of the Availability Domains where the instances are created" 80 | } 81 | 82 | 83 | variable "midtier_hostnames" { 84 | type = list(any) 85 | description = "List of the display names for the compute instances" 86 | } 87 | 88 | variable "ssh_public_key_path" { 89 | type = string 90 | default = "" 91 | description = "Path to the ssh public key file" 92 | } 93 | -------------------------------------------------------------------------------- /manual_hybrid_dr/hybrid_dr_terraform/wls/README.md: -------------------------------------------------------------------------------- 1 | WLS Hybrid DR terraform scripts 2 | Copyright (c) 2022 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | ## HybridDR_WLSComputeInstances 6 | Terraform code to create the WLS midtier compute instances. 7 | 8 | # Usage 9 | In each case, provide your environment values in the terraform.tfvars file. 10 | Then run "terraform plan" and "terraform apply" to create the resources. 11 | -------------------------------------------------------------------------------- /manual_hybrid_dr/others/README.md: -------------------------------------------------------------------------------- 1 | hybrid_dr scripts version 1.0. 2 | 3 | Copyright (c) 2022 Oracle and/or its affiliates 4 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | 6 | Other scripts for WLS Hybrid DR 7 | =================================== 8 | Additional util and example scripts to use as described in the playbooks: 9 | https://docs.oracle.com/en/solutions/soa-dr-on-cloud/index.html 10 | https://docs.oracle.com/en/solutions/weblogic-server-dr-on-cloud/index.html 11 | 12 | ### update_dbconnect.sh 13 | This script can be used to automatically replace the database connect string in the datasources and jps files (see the point 14 | "1. Prepare the datasources in primary" in the Hybrid DR documents for more details). 15 | Usage: 16 | - Edit the script and provide the values for ORIGINAL_STRING and NEW_STRING. 17 | - Run the script in the admin server host (it makes the replacement in the ASERVER_HOME). 18 | - A complete WLS domain restart is needed for the changes to take effect: 19 | - stop managed servers and Admin server. 20 | - start the Admin server first, and once in running, start the managed servers. 21 | 22 | -------------------------------------------------------------------------------- /manual_hybrid_dr/others/others.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/manual_hybrid_dr/others/others.zip -------------------------------------------------------------------------------- /private_dns_views_for_dr/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** Terraform scripts for creating DNS private views for Disaster Recovery 3 | ** 4 | ** Copyright (c) 2022 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | -------------------------------------------------------------------------------- /private_dns_views_for_dr/private_dns_views_for_dr.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/private_dns_views_for_dr/private_dns_views_for_dr.zip -------------------------------------------------------------------------------- /private_dns_views_for_dr/terraform.tfvars: -------------------------------------------------------------------------------- 1 | ## private_dns_views_for_dr terraform scripts 2 | ### 3 | ### Copyright (c) 2022 Oracle and/or its affiliates 4 | ### Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ### 6 | 7 | ## OCI Provider details 8 | tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa7dkeohjhfyhsi888888888883f2bxo6z6e2odqxsklgq" 9 | user_ocid = "ocid1.user.oc1..aaaaaaaa77pn6uke4zyxeu7777777777777eepq6d7jqaubes3fsq4q" 10 | fingerprint = "5c:44:53:23:4J:a6:20:77:33:9c:9f:ae:98:28:e6:ba" 11 | private_key_path = "/home/opc/my_keys/oracleidentitycloudservice_user.name-02-28-08-31.pem" 12 | primary_region = "uk-london-1" 13 | secondary_region = "eu-frankfurt-1" 14 | 15 | # Flags 16 | configure_in_primary = "true" 17 | configure_in_secondary = "true" 18 | 19 | # Compartments 20 | primary_compartment_id = "ocid1.compartment.oc1..aaaaaaaaigp2uohnf76yogdrew5id656565656xdxkufjtefw53je5fz6eia" 21 | secondary_compartment_id = "ocid1.compartment.oc1..aaaaaaaaigp2uohnf76yogdre787787878787878xkufjtefw53je5fz6eia" 22 | 23 | # VCNs 24 | primary_vcn_id = "ocid1.vcn.oc1.uk-london-1.amaaaaaaj4y3nwqaehecgek67g2l787878787878787t6vwr6xy23676a" 25 | secondary_vcn_id = "ocid1.vcn.oc1.eu-frankfurt-1.amaaaaaaj4y3nwqadefr454545454545isxmqzksnoixkihm45gmq" 26 | 27 | # Primary domain, hosts fqdns and IPs. Order must be consistent 28 | # If the WLS servers listen in virtual hostnames instead of in the physical hostnames, provide the virtual names here. 29 | # Otherwise, provide the physical hostnames. 30 | primary_domain="primsubnet.primvcn.oraclevcn.com" 31 | primary_nodes_fqdns=["mynode1.primsubnet.primvcn.oraclevcn.com","mynode2.primsubnet.primvcn.oraclevcn.com"] 32 | primary_nodes_IPs=["111.111.111.111","111.111.111.112"] 33 | 34 | 35 | # Secondary domain, hosts fqdns and IPs. Order must be consistent 36 | secondary_domain="secsubnet.secvcn.oraclevcn.com" 37 | secondary_nodes_fqdns=["mynode1.secsubnet.secvcn.oraclevcn.com","mynode2.secsubnet.secvcn.oraclevcn.com"] 38 | secondary_nodes_IPs=["222.222.222.221","222.222.222.222"] 39 | 40 | # Predefined values 41 | primary_private_view_name = "TESTS_Private_View_for_DR_in_Primary" 42 | secondary_private_view_name = "TESTS_Private_View_for_DR_in_Secondary" 43 | 44 | -------------------------------------------------------------------------------- /private_dns_views_for_dr/variables.tf: -------------------------------------------------------------------------------- 1 | ## private_dns_views_for_dr terraform scripts 2 | ## 3 | ## Copyright (c) 2022 Oracle and/or its affiliates 4 | ## Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 5 | ## 6 | 7 | # Provider required info 8 | variable "tenancy_ocid" {} 9 | variable "user_ocid" {} 10 | variable "fingerprint" {} 11 | variable "private_key_path" {} 12 | variable "primary_region" { default = ""} 13 | variable "secondary_region" { default = ""} 14 | 15 | # Flags 16 | variable "configure_in_primary" { default = "true"} 17 | variable "configure_in_secondary" { default = "true"} 18 | 19 | # Compartments 20 | variable primary_compartment_id { default =""} 21 | variable secondary_compartment_id { default =""} 22 | 23 | # VCNs 24 | variable primary_vcn_id { default = ""} 25 | variable secondary_vcn_id { default =""} 26 | 27 | # Primary domain, host fqdn and IPS 28 | variable primary_domain { default =""} 29 | variable primary_nodes_fqdns { default = ""} 30 | variable primary_nodes_IPs { default = ""} 31 | 32 | # Secondary domain, host fqdns and IPs 33 | variable secondary_domain { default = ""} 34 | variable secondary_nodes_fqdns { default = ""} 35 | variable secondary_nodes_IPs { default = ""} 36 | 37 | # Predefined values 38 | variable primary_private_view_name { default = "Private_View_for_DR_in_Primary"} 39 | variable secondary_private_view_name { default = "Private_View_for_DR_in_Secondary"} 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /wls-hydr/THIRD_PARTY_LICENSES.txt: -------------------------------------------------------------------------------- 1 | Package Version 2 | ------------ ------- 3 | paramiko 2.12.0 4 | License text included with the library: 5 | 6 | # Copyright (C) 2003-2011 Robey Pointer 7 | # 8 | # This file is part of paramiko. 9 | # 10 | # Paramiko is free software; you can redistribute it and/or modify it under the 11 | # terms of the GNU Lesser General Public License as published by the Free 12 | # Software Foundation; either version 2.1 of the License, or (at your option) 13 | # any later version. 14 | # 15 | # Paramiko is distributed in the hope that it will be useful, but WITHOUT ANY 16 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 17 | # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 18 | # details. 19 | # 20 | # You should have received a copy of the GNU Lesser General Public License 21 | # along with Paramiko; if not, write to the Free Software Foundation, Inc., 22 | # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 23 | -------------------------------------------------------------------------------- /wls-hydr/config/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/config/.gitkeep -------------------------------------------------------------------------------- /wls-hydr/config/oci.env: -------------------------------------------------------------------------------- 1 | [OCI_ENV] 2 | ############################################################ 3 | # OHS Operating System user and group - CLEAR VALUES (blank) IF OHS IS NOT USED 4 | # ohs_osuser: the OS user that owns the OHS installation 5 | # ohs_osgroup: the primary OS group of the ohs_osuser 6 | ############################################################ 7 | ohs_osuser = oracle 8 | ohs_osgroup = oinstall 9 | 10 | ############################################################ 11 | # WLS Operating System user and group 12 | # wls_osuser: the OS user that owns the WLS installation 13 | # wls_osgroup: the primary OS group of the wls_osuser 14 | ############################################################ 15 | wls_osuser = oracle 16 | wls_osgroup = oinstall 17 | 18 | ############################################################ 19 | # OCI OHS nodes - CLEAR VALUES (blank) IF OHS IS NOT USED 20 | # ohs_ssh_key: the SSH private key to connect with 21 | # ohs_osuser to the OCI OHS nodes 22 | # ohs_nodes: a list of the IPs of the OCI OHS nodes. ENTER ONE IP PER LINE 23 | ############################################################ 24 | ohs_ssh_key = /path/to/oci/ohs/key 25 | ohs_nodes = 10.0.0.1 26 | 10.0.0.2 27 | 28 | ############################################################ 29 | # OCI WLS nodes 30 | # wls_ssh_key: the SSH private key to connect with 31 | # wls_osuser to the OCI WLS nodes 32 | # wls_nodes: a list of the IPs of the OCI WLS nodes. ENTER ONE IP PER LINE 33 | ############################################################ 34 | wls_ssh_key = /path/to/oci/wls/key 35 | wls_nodes = 10.0.0.1 36 | 10.0.0.2 37 | -------------------------------------------------------------------------------- /wls-hydr/config/prem.env: -------------------------------------------------------------------------------- 1 | [PREM_ENV] 2 | ############################################################ 3 | # OHS Operating System user and group - CLEAR VALUES IF OHS IS NOT USED 4 | # ohs_osuser: the OS user that owns the OHS installation 5 | # ohs_osgroup: the primary OS group of the ohs_osuser 6 | ############################################################ 7 | ohs_osuser = oracle 8 | ohs_osgroup = oinstall 9 | 10 | ############################################################ 11 | # WLS Operating System user and group 12 | # wls_osuser: the OS user that owns the WLS installation 13 | # wls_osgroup: the primary OS group of the wls_osuser 14 | ############################################################ 15 | wls_osuser = oracle 16 | wls_osgroup = oinstall 17 | 18 | ############################################################ 19 | # Primary OHS nodes - CLEAR VALUES IF OHS IS NOT USED 20 | # ohs_ssh_key: the SSH private key to connect with 21 | # ohs_osuser to the primary OHS nodes 22 | # ohs_nodes: a list of the IPs of the primary OHS nodes. ENTER ONE IP PER LINE 23 | ############################################################ 24 | ohs_ssh_key = /path/to/prim/ohs/key 25 | ohs_nodes = 10.0.0.1 26 | 10.0.0.2 27 | 28 | ############################################################ 29 | # Primary WLS nodes 30 | # wls_ssh_key: the SSH private key to connect with 31 | # wls_osuser to the primary WLS nodes 32 | # wls_nodes: a list of the IPs of the primary WLS nodes. ENTER ONE IP PER LINE 33 | # The first one MUST be the WLS Administrator Server host 34 | ############################################################ 35 | wls_ssh_key = /path/to/prim/wls/key 36 | wls_nodes = 10.0.0.1 37 | 10.0.0.2 38 | -------------------------------------------------------------------------------- /wls-hydr/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/.gitkeep -------------------------------------------------------------------------------- /wls-hydr/images/Main_flow_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/Main_flow_diagram.png -------------------------------------------------------------------------------- /wls-hydr/images/flow_diagram_create_from_zero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/flow_diagram_create_from_zero.png -------------------------------------------------------------------------------- /wls-hydr/images/flow_migrate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/flow_migrate.png -------------------------------------------------------------------------------- /wls-hydr/images/flow_migration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/flow_migration.png -------------------------------------------------------------------------------- /wls-hydr/images/flow_migration_from_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/flow_migration_from_copy.png -------------------------------------------------------------------------------- /wls-hydr/images/maa-wls-hybrid-dr-tool-highlights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/maa-wls-hybrid-dr-tool-highlights.png -------------------------------------------------------------------------------- /wls-hydr/images/maa-wls-hybrid-dr-tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/maa-wls-hybrid-dr-tool.png -------------------------------------------------------------------------------- /wls-hydr/images/maa-wls-hybrid-dr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/maa-wls-hybrid-dr.png -------------------------------------------------------------------------------- /wls-hydr/images/tool-main-modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/images/tool-main-modules.png -------------------------------------------------------------------------------- /wls-hydr/lib/replication.internals: -------------------------------------------------------------------------------- 1 | [DIRECTORIES] 2 | # staging directory structure 3 | 4 | STAGE_OHS_PRODUCTS = %(STAGE_GOLD_COPY_BASE)s/webtier/ohs_products_home 5 | STAGE_OHS_PRODUCTS1 = %(STAGE_OHS_PRODUCTS)s/ohs_products_home1 6 | STAGE_OHS_PRODUCTS2 = %(STAGE_OHS_PRODUCTS)s/ohs_products_home2 7 | STAGE_OHS_JDK_DIR = %(STAGE_GOLD_COPY_BASE)s/webtier/ohs_jdk_dir 8 | STAGE_OHS_PRIVATE_CONFIG_DIR = %(STAGE_GOLD_COPY_BASE)s/webtier/ohs_private_config 9 | STAGE_WLS_PRODUCTS = %(STAGE_GOLD_COPY_BASE)s/midtier/wls_products_home 10 | STAGE_WLS_PRODUCTS1 = %(STAGE_WLS_PRODUCTS)s/wls_products_home1 11 | STAGE_WLS_PRODUCTS2 = %(STAGE_WLS_PRODUCTS)s/wls_products_home2 12 | STAGE_WLS_JDK_DIR = %(STAGE_GOLD_COPY_BASE)s/midtier/wls_jdk_dir 13 | STAGE_WLS_SHARED_CONFIG_DIR = %(STAGE_GOLD_COPY_BASE)s/midtier/wls_shared_config 14 | STAGE_WLS_PRIVATE_CONFIG_DIR = %(STAGE_GOLD_COPY_BASE)s/midtier/wls_private_config 15 | STAGE_WLS_VAR = %(STAGE_GOLD_COPY_BASE)s/midtier/var 16 | STAGE_WLS_SHARED_ADDITIONAL = %(STAGE_WLS_SHARED_CONFIG_DIR)s/additional_dirs 17 | 18 | [OPTIONS] 19 | # rsync options to use 20 | exclude_ohs_private_config = .snapshot 21 | exclude_ohs_products = .snapshot 22 | exclude_wls_private_config = .snapshot 23 | servers/*/data/nodemanager/*.lck 24 | servers/*/data/nodemanager/*.pid 25 | servers/*/data/nodemanager/*.state 26 | servers/*/tmp 27 | servers/*/adr 28 | nodemanager/*.id 29 | nodemanager/*.lck 30 | tnsnames.ora 31 | 32 | 33 | exclude_wls_shared_config = .snapshot 34 | servers/*/data/nodemanager/*.lck 35 | servers/*/data/nodemanager/*.pid 36 | servers/*/data/nodemanager/*.state 37 | servers/*/tmp 38 | servers/*/adr 39 | nodemanager/*.id 40 | nodemanager/*.lck 41 | tnsnames.ora 42 | 43 | exclude_wls_products = .snapshot -------------------------------------------------------------------------------- /wls-hydr/log/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/log/.gitkeep -------------------------------------------------------------------------------- /wls-hydr/requirements.txt: -------------------------------------------------------------------------------- 1 | oci>=2.150.0 2 | paramiko>=3.5.1 3 | requests>=2.20.0 4 | -------------------------------------------------------------------------------- /wls-hydr/sysconfig.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/sysconfig.xlsx -------------------------------------------------------------------------------- /wls-hydr/sysconfig_discovery.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls-hydr/sysconfig_discovery.xlsx -------------------------------------------------------------------------------- /wls_mp_dr/Block_Volume_Replica_Method/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls_mp_dr/Block_Volume_Replica_Method/.gitkeep -------------------------------------------------------------------------------- /wls_mp_dr/Block_Volume_Replica_Method/README.md: -------------------------------------------------------------------------------- 1 | Oracle WebLogic for OCI Disaster Protection scripts 2 | Copyright (c) 2024 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | 6 | Scripts for Block Volume Replica Disaster Recovery Model 7 | ========================================================== 8 | 9 | Please refer to the appendix "DISASTER RECOVERY BASED ON BLOCK VOLUME CROSS-REGION REPLICATION" in the following papers: 10 | https://www.oracle.com/a/otn/docs/middleware/maa-wls-mp-dr.pdf 11 | https://www.oracle.com/a/tech/docs/maa-soamp-dr.pdf 12 | 13 | | Folder | Description | 14 | | ------------- | ------------- | 15 | | [replacement_script_BVmodel/](./replacement_script_BVmodel) | This folder contains an script to perform the replacement of the database connection string in the WebLogic configuration files, used in the Block Volume replication DR model. 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /wls_mp_dr/Block_Volume_Replica_Method/replacement_script_BVmodel.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/maa/8307bb689694da83a64198626422db1108010fa1/wls_mp_dr/Block_Volume_Replica_Method/replacement_script_BVmodel.zip -------------------------------------------------------------------------------- /wls_mp_dr/Block_Volume_Replica_Method/replacement_script_BVmodel/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** replacement_script_BVmodel.sh 3 | ** 4 | ** Copyright (c) 2022 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | 41 | -------------------------------------------------------------------------------- /wls_mp_dr/LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | ** PaaS DR scripts 3 | ** 4 | ** Copyright (c) 2024 Oracle and/or its affiliates 5 | ** 6 | ** The Universal Permissive License (UPL), Version 1.0 7 | ** 8 | ** Subject to the condition set forth below, permission is hereby granted to any 9 | ** person obtaining a copy of this software, associated documentation and/or data 10 | ** (collectively the "Software"), free of charge and under any and all copyright 11 | ** rights in the Software, and any and all patent rights owned or freely 12 | ** licensable by each licensor hereunder covering either (i) the unmodified 13 | ** Software as contributed to or provided by such licensor, or (ii) the Larger 14 | ** Works (as defined below), to deal in both 15 | ** 16 | ** (a) the Software, and 17 | ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if 18 | ** one is included with the Software (each a "Larger Work" to which the Software 19 | ** is contributed by such licensors), 20 | ** 21 | ** without restriction, including without limitation the rights to copy, create 22 | ** derivative works of, display, perform, and distribute the Software and make, 23 | ** use, sell, offer for sale, import, export, have made, and have sold the 24 | ** Software and the Larger Work(s), and to sublicense the foregoing rights on 25 | ** either these or other terms. 26 | ** 27 | ** This license is subject to the following condition: 28 | ** The above copyright notice and either this complete permission notice or at 29 | ** a minimum a reference to the UPL must be included in all copies or 30 | ** substantial portions of the Software. 31 | ** 32 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 38 | ** SOFTWARE. 39 | */ 40 | -------------------------------------------------------------------------------- /wls_mp_dr/README.md: -------------------------------------------------------------------------------- 1 | Oracle WebLogic for OCI Disaster Protection scripts 2 | Copyright (c) 2024 Oracle and/or its affiliates 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ 4 | 5 | 6 | Using the Oracle WebLogic for OCI Disaster Protection scripts 7 | ============================================== 8 | 9 | Please refer to the following document for details about the topology and set up automated by these scripts: 10 | https://www.oracle.com/a/otn/docs/middleware/maa-wls-mp-dr.pdf 11 | 12 | IMPORTANT: Verify that you have completed all the pre-requisites listed in paper above before using this scripts. 13 | These scripts depend on the common scripts of app_dr_common. 14 | 15 | 16 | Usage 17 | -------------- 18 | Each script provides automation for different parts of the DR setup and lifecycle of a disaster protection system. 19 | The following table provides a summary of the utilities 20 | 21 | 22 | | Script name | Description | 23 | | ------------- | ------------- | 24 | | [fmw_dr_setup_primary.sh](./fmw_dr_setup_primary.sh) | This script prepares the WLS for OCI primary system for Disaster Protection .| 25 | | [fmw_dr_setup_standby.sh](./fmw_dr_setup_standby.sh) | This script prepares the WLS for OCI secondary system for Disaster Protection. | 26 | | [config_replica.sh](./config_replica.sh) | This script is used to replicate WLS domain configuration from primary to standby. It runs in primary and secondary. | 27 | | [fmw_sync_in_primary.sh](./fmw_sync_in_primary.sh) | _Referenced by other scripts_. This script copies the WebLogic domain contents from the domain folder to the staging folder. Used by **config_replica.sh** when the system is PRIMARY role. | 28 | | [fmw_sync_in_standby.sh](./fmw_sync_in_standby.sh) | _Referenced by other scripts_. This script copies the WebLogic domain contents from the staging folder to the domain folder. Used by **config_replica.sh** when the system is STANDBY role. | 29 | | [Block_Volume_Replica_Method/](./Block_Volume_Replica_Method/) | This folder contains scripts specific to the Block Volume Cross-region replica DR model. | 30 | --------------------------------------------------------------------------------