├── LICENSE.txt ├── OTNLicense.txt ├── README.md ├── SECURITY.md ├── apacheLicense.txt ├── images └── packerbuild.png ├── packerConfig.json ├── put_files_here └── README.md ├── start.sh └── upload ├── 1updateLinux.sh ├── 1updateLinux_inner.sh ├── 2afterFirstReboot.sh ├── 2afterFirstReboot_inner.sh ├── 3_1installDbtoolClientTools.sh ├── 3_1installDbtoolClientTools_inner.sh ├── 3_2installDatabase.sh ├── 3_2installDatabase_inner.sh ├── 3_3passwordDoNotExpire.sh ├── 3_3passwordDoNotExpire_inner.sh ├── 3_4enableGeoRaster.sh ├── 3_4enableGeoRaster_inner.sh ├── 3_5unzipLabDemos.sh ├── 3_5unzipLabDemos_inner.sh ├── 3_6apexInstall.sh ├── 3_6apexInstall_inner.sh ├── 3_7ORDSInstall.sh ├── 3_7ORDSInstall_inner.sh ├── 3_8setupDemos.sh ├── 3_8setupDemos_inner.sh ├── 3topLevel.sh ├── 3topLevel_inner.sh ├── 9090init ├── 9090start ├── 9090stop ├── Click here to Start.desktop ├── SQL Developer.desktop ├── buildTime32kVarchar2.sh ├── buildTimeCallDBCA.sh ├── buildTimeCheckVersion.sh ├── buildTimeCompressHelper.sh ├── buildTimeConfig.cfg ├── buildTimeConfigureHRREST.sh ├── buildTimeCreateLD_LIBRARY_PATHShellWrappers.sh ├── buildTimeDBCA.rsp ├── buildTimeEnd.sh ├── buildTimeEndOfAllScripts.sh ├── buildTimeFatReleaseCOPYFORFAT.sh ├── buildTimeMoveUserFilesInTmp.sh ├── buildTimeReportSkippingFile.sh ├── buildTimeResizeIcon.sh ├── buildTimeRestEnableHR.sql ├── buildTimeRootU01Chown.sh ├── buildTimeSetupRestClient.sh ├── buildTimeSoftwareInstall.rsp ├── buildTimeStillInstalling ├── createnewpdb ├── createnewpdbminhr ├── custom_postSetupDemos.sh ├── hr_code.sql ├── hr_comnt.sql ├── hr_cre.sql ├── hr_idx.sql ├── hr_popul.sql ├── livesql_create_av_schema.sql ├── loadCoffeeShopApplication.sh ├── loadstorm ├── postdbinstallandpatch.sh ├── runTimeClickHere.png ├── runTimeConfigureHR.sh ├── runTimeEnforceMinScreenSize.sh ├── runTimeKickOffOrds.sh ├── runTimeLabStylesheet.css ├── runTimeOracleOnReboot.sh ├── runTimeParametersForORDS.properties ├── runTimeSQLCLIcon.png ├── runTimeSQLDeveloperConnections.xml ├── runTimeSQLDeveloperIcon.png ├── runTimeStagesText.txt ├── runTimeStartScript.sh ├── runTimeTidyLabWebFiles.sh ├── runtime9090ORDS.properties ├── sqldev.png ├── uninstall9090ORDS.properties └── uploaddemos /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, 2023 Oracle and/or its affiliates. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /OTNLicense.txt: -------------------------------------------------------------------------------- 1 | WARNING: THIS VIRTUAL MACHINE IMAGE CONTAINS ORACLE PROPRIETARY SOFTWARE THAT IS LICENSED TO THE INDIVIDUAL THAT ORIGINALLY OBTAINED IT FROM ORACLE. IT MAY NOT BE TRANSFERRED OR DISTRIBUTED TO OTHER INDIVIDUALS, EVEN IF THOSE INDIVIDUALS ARE EMPLOYED BY THE SAME ENTITY. IF YOU DID NOT OBTAIN THIS IMAGE FROM AN ORACLE WEBSITE OR FROM AN AUTHORIZED ORACLE EMPLOYEE OR CONTRACTOR, YOU MAY NOT USE IT; VISIT WWW.ORACLE.COM/OTN TO DOWNLOAD A COPY YOU MAY USE. 2 | 3 | IF YOU RECEIVED THIS VIRTUAL MACHINE IMAGE DIRECTLY FROM ORACLE THEN BY CONTINUING TO INSTALL THE VIRTUAL MACHINE IMAGE YOU AGREE TO THE LICENSE TERMS AT http://www.oracle.com/technetwork/licenses/vm-license-2130072.html -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Oracle Developer Day VM Builder 2 | =============================== 3 | 4 | Welcome to the packer build for the Oracle Developer Day vm. 5 | This will build a Oracle Linux server and install a 18.3 Oracle database on the machine. Follow the download instructions to download the software to install and follow the build instructions to build the machine. You will need around 30gb of space free to store the downloads and run the build. 6 | 7 | There are several directories which are used in the build 8 | 9 | 1. put_files_here - place ALL downloaded software here 10 | 2. output - The resultant VirtualBox OVA will be placed here 11 | 3. upload - This directory has all the install scripts for the downloaded software. 12 | 13 | Mandatory Downloads 14 | ------------------- 15 | **These two downloads are mandatory**. If they are not here, the build will not start. 16 | 17 | * OracleLinux-R7-U3-Server-x86_64-dvd.iso (needs to be this exactly md5 checked) 18 | * LINUX.X64_180000_db_home.zip (183 has been verified - silent install may be incompatible with later versions) 19 | 20 | Optional Downloads 21 | -------------- 22 | If these files are available in the **put_files_here** directory, the build will try and install them. 23 | 24 | * jdk-8u\*-linux-x64.tar.gz - **Oracle JDK** 25 | * sqldeveloper-\*-no-jre.zip - **Oracle SQL Developer** 26 | * datamodeler-\*-no-jre.zip **Oracle SQLDeveloper Data Modeler** 27 | * sqlcl-\*.zip - **Oracle SQLcl** 28 | * apex\_\*.zip - **Oracle Application Express** 29 | * ords\*.zip - **Oracle REST Data Services** 30 | 31 | Oracle Internal Files 32 | --------------------- 33 | These files may not be available publicly 34 | 35 | * demos.zip - **Oracle Hands on Labs demos** 36 | * reset_xmldbjson ** Reset XMLdb demos** 37 | * master.zip - **Oracle Sample Schema** 38 | * mozillablob.zip - **firefox .mozilla for (json viewer) plugins and or bookmarks** 39 | * storm.zip - **exp dump of non sensative material. For geo location optional demo.** 40 | 41 | Build Instructions 42 | ------------------ 43 | 44 | >**bash start.sh "http://and_proxy_as_first_arg_if_wanted" export** 45 | 46 | NOTE Proxy value will be in the logs from bash set -x stored in ~oracle/log 47 | If you are inside a VPN, the proxy settings allow the VM to contact yum 48 | update servers. optional export to export the ova. 49 | 50 | ![packer build](images/packerbuild.png) 51 | 52 | Build Structure 53 | -------------------- 54 | 55 | 1. 1updateLinux.sh PROGRESS: 1/4 1updateLinux.sh - first script run - from plain iso. Set up second drive. Yum Updates. Reboot 56 | 2. 2afterFirstReboot.sh PROGRESS: 2/4 2afterFirstReboot.sh - after first reboot - before any oracle database software installed. install virtual box guest additions. 57 | 3. 3topLevel.sh PROGRESS: 3/4 3topLevel.sh - main kick off script e.g. yum and call subscripts 58 | 4. 3_1installDbtoolClientTools.sh PROGRESS: 3_1/4 3_1installDbtoolClientTools.sh - install dbtools client tools 59 | 5. 3_2installDatabase.sh PROGRESS: 3_2/4 3_2installDatabase.sh - install the database with silent install 60 | 6. 3_3passwordDoNotExpire.sh PROGRESS: 3_3/4 3_3passwordDoNotExpire.sh - Database post install updates - e.g. passwords do not expire. 61 | 7. 3_4enableGeoRaster.sh PROGRESS: 3_4/4 3_4enableGeoRaster.sh - post database install and patches (if required) 62 | 8. 3_5unzipLabDemos.sh PROGRESS: 3_5/4 3_5unzipLabDemos.sh - demos (labs) 63 | 9. 3_6apexInstall.sh PROGRESS: 3_6/4 3_6apexInstall.sh - apex install 64 | 10. 3_7ORDSInstall.sh PROGRESS: 3_7/4 3_7ORDSInstall.sh - ords install 65 | 11. 3_8setupDemos.sh PROGRESS: 3_8/4 3_8setupDemos.sh - set up demos and run reset scripts 66 | 12. PROGRESS: END OF SCRIPT: 4/4 for tracing information see local file log.zip 67 | 68 | Timings: 69 | 70 | Minimum (Oracle Linux + Oracle Database) 71 | Total time 60 mins (accounted for time + 7 mins rounding error / ignore <2 minute). 72 | 73 | boot,8 74 | yum update,14 75 | reboot ,3 76 | run database software install (not database build),3 77 | dbca (database build),7 78 | password and 32kvarchar2,6 79 | shrink (fill disk with 0 for easy compression),3 80 | 1 x 3 minute reboot + shutdown + minor <1 minute stuff,10 81 | 82 | Maximum (Including all optional extras APEX/ORDS/((internal) demos) 83 | Total time 113.5 mins (Accounted for time + 10.5 mins rounding error / ignore <2 minute). 84 | boot,9 85 | yum update,14 86 | reboot,3 87 | run database software install (not database build),4 88 | dbca (database build),8 89 | password and 32kvarchar ,18 90 | apex install ,16 91 | ords install ,4 92 | set up demos and run demo reset,18 93 | shrink (fill disk with 0 for easy compression),2 94 | 1 x 3 minute reboot + shutdown + minor <1 minute stuff - this is too long,9 95 | 96 | Removing the shrink.sh if not exporting - fills disk with 0 for easy compression. 97 | Run shrink.sh over ssh if subsequently exporting to ova (brings ova file down 60% in size to under 8Gb) 98 | 99 | ## Contributing 100 | 101 | This project is not accepting external contributions at this time. For bugs or enhancement requests, please file a GitHub issue unless it’s security related. When filing a bug remember that the better written the bug is, the more likely it is to be fixed. If you think you’ve found a security vulnerability, do not raise a GitHub issue and follow the instructions in our [security policy](./SECURITY.md). 102 | 103 | ## Security 104 | 105 | Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process 106 | 107 | ## License 108 | 109 | Copyright (c) 2017, 2023 Oracle and/or its affiliates. 110 | -------------------------------------------------------------------------------- /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][3] 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 | -------------------------------------------------------------------------------- /apacheLicense.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /images/packerbuild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/db-appdev-vm/043bb7f9e2b89ed4c965ffebb4585503953ccf66/images/packerbuild.png -------------------------------------------------------------------------------- /packerConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "variables": { 3 | "iso_downloaded": null, 4 | "oracle_database_downloaded": null, 5 | "proxy": "", 6 | "skip_export": "true" 7 | }, 8 | "provisioners": [ 9 | { 10 | "type": "file", 11 | "source": "upload", 12 | "destination": "/tmp" 13 | }, 14 | { 15 | "type": "file", 16 | "source": "put_files_here", 17 | "destination": "/tmp" 18 | }, 19 | { 20 | "type": "shell", 21 | "inline": ["echo 'oracle' | sudo -S -E bash -c 'mv /tmp/upload /tmp/1 && chmod -R 777 /tmp/1 && chown -R oracle /tmp/1 && /tmp/1/1updateLinux.sh {{user `proxy`}} && /sbin/shutdown -r +1'"] 22 | }, 23 | { 24 | "pause_before": "200s", 25 | "type": "shell", 26 | "inline": ["echo not necessaryQQQ /home/oracle/bin/nuketimestamps>/dev/null && echo 'oracle'|sudo -S -E bash -c '/tmp/1/2afterFirstReboot.sh 2>&1 | tee /root/log$$ && /tmp/1/3topLevel.sh && /sbin/shutdown -r +1'" 27 | ] 28 | }, 29 | { 30 | "pause_before": "200s", 31 | "type": "file", 32 | "source": "log.zip", 33 | "destination": "log.zip", 34 | "direction": "download" 35 | }, 36 | { 37 | "type": "shell", 38 | "inline": ["rm log.zip" 39 | ] 40 | } 41 | ], 42 | "builders": [ 43 | { 44 | "type": "virtualbox-iso", 45 | "ssh_skip_nat_mapping": true, 46 | "ssh_host": "127.0.0.1", 47 | "ssh_port": 2222, 48 | "disk_size": "30000", 49 | "guest_os_type": "Oracle_64", 50 | "hard_drive_interface": "sata", 51 | "boot_command": [ 52 | "", 53 | " text noverifyssl ", 54 | "ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/buildTimeConfig.cfg" 55 | ], 56 | "vboxmanage": [ 57 | [ "modifyvm", "{{.Name}}", "--memory", "4096" ], 58 | [ "modifyvm", "{{.Name}}", "--cpus", "2" ], 59 | [ "createhd", "--filename", "Oracle DB Developer VM__2.vdi", "--size", "30000"], 60 | [ "storageattach", "{{.Name}}", "--storagectl", "SATA Controller", "--port", "1", "--device", "0" ,"--type", "hdd", "--medium", "Oracle DB Developer VM__2.vdi"], 61 | [ "modifyvm", "{{.Name}}", "--clipboard", "bidirectional"], 62 | [ "modifyvm", "{{.Name}}", "--draganddrop", "bidirectional"], 63 | [ "modifyvm", "{{.Name}}", "--paravirtprovider", "kvm"], 64 | [ "modifyvm", "{{.Name}}", "--natpf1", "net8,tcp,,1521,,1521"], 65 | [ "modifyvm", "{{.Name}}", "--natpf1", "ssh,tcp,,2222,,22"], 66 | [ "modifyvm", "{{.Name}}", "--natpf1", "apex8080,tcp,,8080,,8080"], 67 | [ "modifyvm", "{{.Name}}", "--natpf1", "apex8081,tcp,,8081,,8081"], 68 | [ "modifyvm", "{{.Name}}", "--natpf1", "ords9090,tcp,,9090,,9090"], 69 | [ "modifyvm", "{{.Name}}", "--audio", "none"], 70 | [ "modifyvm", "{{.Name}}", "--vram", "128"] 71 | ], 72 | "vboxmanage_post": [ 73 | [ "modifyvm", "{{.Name}}", "--memory", "2048" ], 74 | [ "modifyvm", "{{.Name}}", "--cpus", "1" ], 75 | [ "storageattach", "{{.Name}}", "--storagectl", "IDE Controller", "--port", "1", "--device", "0", "--type", "dvddrive", "--medium", "emptydrive"] 76 | ], 77 | "guest_additions_mode": "upload", 78 | "iso_url": "OracleLinux-R7-U3-Server-x86_64-dvd.iso", 79 | "iso_checksum_type": "md5", 80 | "iso_checksum": "e44eff40f3a16ffa008285e5c52e1199", 81 | "format": "ova", 82 | "boot_wait": "10s", 83 | "ssh_username": "oracle", 84 | "ssh_password": "oracle", 85 | "ssh_wait_timeout": "2400s", 86 | "output_directory": "output", 87 | "shutdown_command": "echo 'oracle' | sudo -S shutdown -P now", 88 | "post_shutdown_delay": "30s", 89 | "keep_registered": "{{user `skip_export`}}", 90 | "skip_export": "{{user `skip_export`}}", 91 | "shutdown_timeout": "10m", 92 | "vm_name": "Oracle DB Developer VM", 93 | "http_directory":"upload", 94 | "export_opts": ["--vsys", "0","--eulafile","license.txt", "--product", "Oracle RDBMS 18.3, Application Express 18.1,REST Data Services 18.2,SQL Developer 18.2", "--producturl", "http://otn.oracle.com", "--vendor", "Oracle", "--vendorurl", "http://www.oracle.com", "--version", "July_2017"] 95 | } 96 | ] 97 | } 98 | -------------------------------------------------------------------------------- /put_files_here/README.md: -------------------------------------------------------------------------------- 1 | **Put files required in build here** 2 | 3 | Required Files 4 | -------------- 5 | * OracleLinux-R7-U3-Server-x86_64-dvd.iso (needs to be this exactly md5 checked) 6 | * linux\*122*_database.zip (12201 has been verified - silent install may be incompatible with later versions) 7 | 8 | Optional Downloads 9 | -------------- 10 | If these files are available in the **put_files_here** directory, the build will try and install them. 11 | 12 | * demos.zip - **Oracle Hands on Labs demos** 13 | * jdk-8u\*-linux-x64.tar.gz - **Oracle JDK** 14 | * sqldeveloper-\*-no-jre.zip - **Oracle SQL Developer** 15 | * sqlcl-\*-no-jre.zip - **Oracle SQLcl** 16 | * apex_5\*.zip - **Oracle Application Express** 17 | * ords\*.zip - **Oracle REST Data Services** 18 | * datamodeler-\*-no-jre.zip **Oracle SQLDeveloper Data Modeler** 19 | * mozillablob.zip - **firefox .mozilla for (json viewer) plugins and or bookmarks** 20 | * storm.zip - **exp dump of non sensative material. For geo location optional demo.** 21 | * reset_xmldbjson 22 | * master.zip - **Oracle Sample Schema** 23 | 24 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | 20 | 21 | ################################################################################# 22 | # 23 | # File: start.sh 24 | # 25 | # Description: Start script to check initial files required for starting the 26 | # packer build. At a minimum, the Linux iso and the database zip 27 | # are required before the packer build will start. Everything else 28 | # is optional. 29 | # if needed pass proxy in, 30 | # if needed use the string 'export' to produce an .ova file 31 | # (proxy or export in any order) 32 | ################################################################################# 33 | 34 | # 35 | # Cleanup old builds and remove previous output if it exists. 36 | # 37 | function cleanup { 38 | rm -rf *.vdi 39 | rm -rf output_last 40 | mv output output_last 41 | } 42 | 43 | # 44 | # Check that at aminimum, the Linux iso, and the main database install zip 45 | # are present otherwise, there is no point in continuing 46 | # 47 | function check_required_files { 48 | export varsaccepted= 49 | if test -f OracleLinux-R7-U3-Server-x86_64-dvd.iso 50 | then 51 | export varsaccepted=" -var iso_downloaded=y " 52 | else 53 | if test -f put_files_here/OracleLinux-R7-U3-Server-x86_64-dvd.iso 54 | then 55 | export varsaccepted=" -var iso_downloaded=y " 56 | mv put_files_here/OracleLinux-R7-U3-Server-x86_64-dvd.iso . 57 | touch put_files_here/OracleLinux-R7-U3-Server-x86_64-dvd.iso 58 | fi 59 | fi 60 | if test -f put_files_here/LINUX.X64_*_db_home.zip 61 | then 62 | export varsaccepted=" $varsaccepted -var oracle_database_downloaded=y " 63 | fi 64 | if test "m$2" = "mexport" 65 | then 66 | export varsaccepted=" $varsaccepted -var proxy=$1 -var skip_export=false " 67 | elif test "m$1" = "mexport" 68 | then 69 | export varsaccepted=" $varsaccepted -var proxy=$2 -var skip_export=false " 70 | else 71 | export varsaccepted=" $varsaccepted -var proxy=$1 " 72 | fi 73 | } 74 | # 75 | # start the packer build with a proxy if it is set. 76 | # 77 | function start_packer_build { 78 | packer build $varsaccepted packerConfig.json 79 | } 80 | 81 | #Lets go. 82 | cleanup 83 | check_required_files $1 $2 84 | start_packer_build 85 | -------------------------------------------------------------------------------- /upload/1updateLinux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 1updateLinux.sh 22 | # 23 | # Description: Start script to check initial files required for starting the 24 | # packer build. At a minimum, the Linux iso and the database zip 25 | # are required before the packer build will start. Everything else 26 | # is optional. 27 | # if needed pass proxy in as $1 28 | ################################################################################# 29 | 30 | function bootstrap_logging { 31 | # 32 | # Copying files to home which decorate logs, ie starting and ending phases. 33 | # buildTimeReportSkippingFile.sh is used when some install zips are not available and buildTimeEndOfAllScripts.sh 34 | # is the final end which will cleanup 35 | # 36 | cp /tmp/1/runTimeStartScript.sh /tmp/1/buildTimeEnd.sh /tmp/1/runTimeStagesText.txt /tmp/1/buildTimeEndOfAllScripts.sh /tmp/1/buildTimeReportSkippingFile.sh ~oracle 37 | touch ~oracle/debug_output.txt 38 | chmod 777 ~oracle/runTimeStartScript.sh ~oracle/buildTimeEnd.sh ~oracle/runTimeStagesText.txt ~oracle/debug_output.txt ~oracle/buildTimeReportSkippingFile.sh ~oracle/buildTimeEndOfAllScripts.sh 39 | chown oracle ~oracle/runTimeStartScript.sh ~oracle/buildTimeEnd.sh ~oracle/runTimeStagesText.txt ~oracle/debug_output.txt ~oracle/buildTimeReportSkippingFile.sh ~oracle/buildTimeEndOfAllScripts.sh 40 | 41 | mkdir ~oracle/log 42 | chmod 777 ~oracle/log 43 | chown oracle ~oracle/log 44 | } 45 | 46 | # 47 | # Update linux with YUM 48 | # 49 | function update_linux { 50 | (/tmp/1/1updateLinux_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 51 | } 52 | 53 | bootstrap_logging 54 | update_linux "$@" 55 | -------------------------------------------------------------------------------- /upload/1updateLinux_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 1updateLinux_inner.sh 22 | # 23 | # Description: yum update, create disks, create users 24 | # 25 | ################################################################################# 26 | 27 | 28 | function setup_proxy { 29 | #set -x 30 | #proxy now passed in as optional variable not by setup.sh 31 | echo 'export BUILD_WEB_PROXY='$1|sed 's/["“]//g'>>/tmp/1/BUILD_CONFIG.sh 32 | cat /tmp/1/BUILD_CONFIG.sh 33 | . /tmp/1/BUILD_CONFIG.sh 34 | echo $BUILD_WEB_PROXY 35 | if test "m$BUILD_WEB_PROXY" != "m" 36 | then 37 | printf '2i\nproxy='$BUILD_WEB_PROXY'\n.\nw\nq' | ed /etc/yum.conf 38 | fi 39 | } 40 | function yum_update { 41 | #turn off packagekit - sometimes conflicts with yum - not available yet but mask seems to work 42 | /bin/systemctl stop packagekit.service 43 | /bin/systemctl disable packagekit.service 44 | /bin/systemctl mask packagekit.service 45 | yum -y update 46 | yum -y grouplist 47 | yum -y groups list 48 | yum -y groups install "Server with GUI" 49 | yum -y install expect 50 | yum -y install gcc 51 | yum -y install kernel-uek-devel 52 | yum -y install kernel-headers 53 | yum -y install oracle-database-preinstall-18c 54 | #oracle-rdbms-server-12cR2-preinstall 55 | usermod -a -g oinstall -G dba,wheel oracle 56 | #need to remove the yum proxy 57 | echo '#!/usr/bin/expect 58 | spawn fdisk /dev/sdb 59 | 60 | expect -regexp {m for help.: } { send "n\r" } 61 | expect -regexp {default p.: } {send "\r"} 62 | expect -regexp {default \d+.: } {send "\r"} 63 | expect -regexp {default \d+.. } {send "\r"} 64 | expect -regexp {default \d+.. } {send "\r"} 65 | expect -regexp {m for help.: } { send "p\r" } 66 | expect -regexp {m for help.: } { send "w\r" } 67 | expect -regexp {something the WiLl Never Happen} {send "jingle bella\r"} 68 | interact' > /tmp/xp.sh 69 | chmod 755 /tmp/xp.sh 70 | #following line will $?=1 as never happen not matched 71 | /tmp/xp.sh 72 | } 73 | 74 | function make_disks { 75 | mkfs.xfs -f /dev/sdb1 76 | mkdir /u01 77 | chmod 777 /u01 78 | mount -t xfs /dev/sdb1 /u01 79 | chmod 755 /u01 80 | chown oracle /u01 81 | ed -s /etc/fstab <>~/Desktop/.hidden; echo style.css>>~/Desktop/.hidden'" 107 | su - oracle -c "bash -c 'echo yes >> ~/.config/gnome-initial-setup-done'" 108 | if test -f /tmp/1/demo.zip 109 | then 110 | su - oracle -c "echo '[Desktop Entry] 111 | Version=1.0 112 | Type=Application 113 | Terminal=false 114 | Icon[en_US]=/home/oracle/runTimeClickHere.png 115 | Name[en_US]=Click here to Start Labs 116 | Exec=/usr/bin/firefox /home/oracle/Desktop/ODDHandsOnLabs.html \n 117 | Name=Start Here 118 | Icon=/home/oracle/runTimeClickHere.png 119 | ' > /home/oracle/Desktop/'Click here to Start.desktop'" 120 | else 121 | su - oracle -c "echo '[Desktop Entry] 122 | Version=1.0 123 | Type=Application 124 | Terminal=false 125 | Icon[en_US]=/home/oracle/runTimeClickHere.png 126 | Name[en_US]=Click here to Start Browser 127 | Exec=/usr/bin/firefox \n 128 | Name=Start Here 129 | Icon=/home/oracle/runTimeClickHere.png 130 | ' > /home/oracle/Desktop/'Click here to Start.desktop'" 131 | fi 132 | su - oracle -c "chmod 755 ~/Desktop/'Click here to Start.desktop'" 133 | su - oracle -c "cp /tmp/1/runTimeClickHere.png ~oracle" 134 | } 135 | function setup_resolution { 136 | #copy setsize before /tmp/1 is removed. 137 | #set size now has some retry functionalityZZ 138 | cp /tmp/1/buildTimeResizeIcon.sh ~oracle/runTimeEnforceMinScreenSize.sh 139 | chmod 755 ~oracle/runTimeEnforceMinScreenSize.sh 140 | chown oracle ~oracle/runTimeEnforceMinScreenSize.sh 141 | echo '#!/bin/bash 142 | mkdir -p ~/.config/autostart 143 | echo "[Desktop Entry] 144 | Name=800x600 145 | GenericName=800x600 146 | Comment=00x600 147 | Exec=/home/oracle/runTimeEnforceMinScreenSize.sh 148 | Terminal=false 149 | Type=Application 150 | X-GNOME-Autostart-enabled=true"> ~/.config/autostart/800x600.desktop 151 | chmod 755 ~/.config/autostart/800x600.desktop 152 | '> /tmp/asoracle 153 | chmod 755 /tmp/asoracle 154 | su - oracle -c '/bin/bash -xc /tmp/asoracle' 155 | cp /etc/gdm/custom.conf ~oracle/custom.conf.x 156 | cat ~oracle/custom.conf.x | sed 's/.daemon./[daemon]\ 157 | InitialSetupEnable=false\ 158 | TimedLoginEnable=true\ 159 | TimedLogin=oracle\ 160 | TimedLoginDelay=2/g' > /etc/gdm/custom.conf 161 | } 162 | 163 | # 164 | #Main engine start 165 | # 166 | set -x 167 | export SHSTART=`date +%s` 168 | echo PROGRESS: Call Tree: 1updateLinux.sh 169 | echo PROGRESS: 1/4 1updateLinux.sh "$@" - first script run - from plain iso. Set up second drive. Started: `date +%k:%M:%S` 170 | 171 | #setup variables for installing software 172 | /tmp/1/buildTimeMoveUserFilesInTmp.sh 173 | 174 | rm -rf /tmp/put_files_here 175 | 176 | setup_proxy "$@" 177 | yum_update 178 | make_disks 179 | setup_desktop 180 | setup_resolution 181 | 182 | export SHNOW=`date +%s` 183 | export SHDUR=`expr $SHNOW - $SHSTART` 184 | echo PROGRESS: Ending 1updateLinux.sh Ended: `date +%k:%M:%S` Duration: `printf '\ 185 | %02dh:%02dm:%02ds\n' $(($SHDUR/3600)) $(($SHDUR%3600/60)) $(($SHDUR%60))` 186 | exit 0 187 | -------------------------------------------------------------------------------- /upload/2afterFirstReboot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 2afterFirstReboot.sh 22 | # 23 | # Description: yum update, create disks, create users 24 | # 25 | ################################################################################# 26 | 27 | . ~oracle/runTimeStartScript.sh 28 | #echo PROGRESS got here $0 29 | (/tmp/1/2afterFirstReboot_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | 31 | # >> ~oracle/thestdoutlog 2>&1 32 | . ~oracle/buildTimeEnd.sh 33 | -------------------------------------------------------------------------------- /upload/2afterFirstReboot_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 2afterFirstReboot_inner.sh 22 | # 23 | # Description: Install Guest additions and cleanup VM desktop 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | #need a reboot after yum update - new kernel 30 | #set -x 31 | #mkdir /mnt 32 | cd /home/oracle 33 | mount -o loop VBoxGuestAdditions.iso /mnt 34 | cd /mnt 35 | ./VBoxLinuxAdditions.run 36 | sleep 2 37 | rm ~oracle/.config/autostart/800x600.desktop 38 | cp ~oracle/custom.conf.x /etc/gdm/custom.conf 39 | rm ~oracle/runTimeEnforceMinScreenSize.sh ~oracle/runTimeEnforceMinScreenSize.sh.redoicon 40 | adduser user 41 | #remove proxy from yum file if set 42 | . /tmp/1/BUILD_CONFIG.sh 43 | if test "m$BUILD_WEB_PROXY" != "m" 44 | then 45 | printf "2d\nw\nq"|ed /etc/yum.conf 46 | fi 47 | #fix for intermittant java/sqldeveloper cursor copy issue supposedly fixed in latest (openjdk?) java152 48 | #cat /etc/default/grub| sed 's/^\(GRUB_CMDLINE_LINUX="[^"]*\)/\1 nomodeset/g' > /tmp/xx 49 | #cp /tmp/xx /etc/default/grub 50 | #grub2-mkconfig -o /boot/grub2/grub.cfg 51 | . ~oracle/buildTimeEnd.sh 52 | exit 0 53 | -------------------------------------------------------------------------------- /upload/3_1installDbtoolClientTools.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_1installDbtoolClientTools.sh 22 | # 23 | # Description: install dbtool client tools 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | (/tmp/1/3_1installDbtoolClientTools_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | . ~oracle/buildTimeEnd.sh 31 | -------------------------------------------------------------------------------- /upload/3_1installDbtoolClientTools_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_1installDbtoolClientTools_inner.sh 22 | # 23 | # Description: 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | dbus-launch gsettings set org.gnome.nautilus.icon-view default-zoom-level small 30 | mkdir -p /home/oracle/java 31 | mkdir -p /home/oracle/Desktop/images 32 | if test -f /tmp/1/jdk8x64.tar.gz 33 | then 34 | mv /tmp/1/jdk8x64.tar.gz /home/oracle/java 35 | touch /tmp/1/jdk8x64.tar.gz 36 | #touch for if test... 37 | cd /home/oracle/java 38 | gzip -d jdk*.tar.gz 39 | tar -xf jdk*.tar 40 | #rm jdk-8u45-linux-x64.tar.gz jdk-8u45-linux-x64.tar 41 | rm jdk*.tar 42 | cd - 43 | else 44 | ~oracle/buildTimeReportSkippingFile.sh jdk8x64tar.gz 45 | fi 46 | 47 | if test -f /tmp/1/sqldev.zip 48 | then 49 | mv /tmp/1/sqldev.zip /home/oracle/ 50 | touch /tmp/1/sqldev.zip 51 | #touch for if test 52 | cd /home/oracle 53 | unzip sqldev.zip 54 | chmod 755 sqldeveloper/sqldeveloper.sh 55 | rm sqldev.zip 56 | mkdir sqldeveloper/ords/logs 57 | cd - 58 | else 59 | ~oracle/buildTimeReportSkippingFile.sh sqldev.zip 60 | fi 61 | 62 | if test -f /tmp/1/sqlcl.zip 63 | then 64 | mv /tmp/1/sqlcl.zip /home/oracle 65 | touch /tmp/1/sqlcl.zip 66 | #touch for if test ... 67 | cd /home/oracle 68 | unzip sqlcl.zip 69 | chmod 755 sqlcl/bin/sql 70 | rm sqlcl.zip 71 | cd - 72 | else 73 | ~oracle/buildTimeReportSkippingFile.sh sqlcl.zip 74 | fi 75 | mkdir ~oracle/bin 76 | if test -f /tmp/1/sqldev.zip 77 | then 78 | echo '#!/bin/bash 79 | #should do image or desktop 80 | . ~oracle/.bashrc 81 | . ~oracle/bin/dbenv 82 | cd /home/oracle/sqldeveloper 83 | bash ./sqldeveloper.sh "$@" 84 | '> /home/oracle/bin/sqldeveloper 85 | chmod 755 /home/oracle/bin/sqldeveloper 86 | cp /home/oracle/sqldeveloper/sqldeveloper/bin/sqldeveloper /home/oracle/sqldeveloper/sqldeveloper/bin/sqldeveloper.SAV 87 | cat /home/oracle/sqldeveloper/sqldeveloper/bin/sqldeveloper.SAV |sed 'sZLaunchIDE "$@"Zif test -d ~/.sqldeveloper\nthen\nLaunchIDE "$@"\nelse\nLaunchIDE -connections=/home/oracle/runTimeSQLDeveloperConnections.xml -connections_key=CarryBigStick -nomigrate "$@"\nfiZg' > /home/oracle/sqldeveloper/sqldeveloper/bin/sqldeveloper 88 | chmod 755 /home/oracle/sqldeveloper/sqldeveloper/bin/sqldeveloper 89 | fi 90 | 91 | if test -f /tmp/1/sqlcl.zip 92 | then 93 | echo '#!/bin/bash 94 | export DONOTSETTWO_TASK=true 95 | . ~oracle/.bashrc 96 | . /home/oracle/bin/dbenv 97 | bash /home/oracle/sqlcl/bin/sql "$@" 98 | '> /home/oracle/bin/sql 99 | echo '#!/bin/bash 100 | #set TWO_TASK for UI 101 | . ~oracle/.bashrc 102 | /home/oracle/bin/sql "$@" 103 | '> /home/oracle/bin/sqlui 104 | fi 105 | #temporary until sqlcl icon gets given 106 | cp /tmp/1/runTimeSQLCLIcon.png ~/Desktop/images 107 | chmod 644 ~/Desktop/images/runTimeSQLCLIcon.png 108 | #cp /tmp/1/runTimeClickHere.png ~/Desktop/images 109 | #chmod 644 ~/Desktop/images/runTimeClickHere.png 110 | if test -f /tmp/1/sqlcl.zip 111 | then 112 | chmod 755 /home/oracle/bin/sql 113 | chmod 755 /home/oracle/bin/sqlui 114 | echo '[Desktop Entry] 115 | Name=sqlcl 116 | Comment=sqlcl 117 | Exec=/home/oracle/bin/sqlui 118 | Terminal=true 119 | Icon[en_US]=/home/oracle/Desktop/images/runTimeSQLCLIcon.png 120 | Icon=/home/oracle/Desktop/images/runTimeSQLCLIcon.png 121 | Type=Application 122 | '> /home/oracle/Desktop/sql.desktop 123 | chmod 755 /home/oracle/Desktop/sql.desktop 124 | fi 125 | #cp /tmp/1/"Click here to Start.desktop" /home/oracle/Desktop 126 | #set -x 127 | #actually made further up this script 128 | if test /tmp/1/sqldev.zip 129 | then 130 | cp /tmp/1/"SQL Developer.desktop" /home/oracle/Desktop/ 131 | fi 132 | #cp /tmp/1/readme.txt /home/oracle/Desktop 133 | #probably want to skip next 5 commands in testing - and have them prebuilt into the base. what if they ask for a reboot? - force a reboot at end? 134 | #cd ~ 135 | #wget http://linux.us.oracle.com/uln/uln-internal-setup-3.0.1-2.el6.noarch.rpm 136 | #echo secretSauce342|sudo -S rpm -i uln-internal-setup-3.0.1-2.el6.noarch.rpm 137 | #echo secretSauce342|sudo -S yum update 138 | #busted - speed over efficientcy - ie hard to keep the size low. at least delete the /u01/download files before creating the database. remember to delete yum cash saves about a half a gig.. 139 | export MODNAME=modeler.zip 140 | if test -f /tmp/1/$MODNAME 141 | then 142 | mv /tmp/1/$MODNAME /home/oracle/ 143 | touch /tmp/1/$MODNAME 144 | #for if test.. 145 | cd /home/oracle 146 | unzip $MODNAME 147 | chmod 755 datamodeler/datamodeler.sh 148 | rm $MODNAME 149 | echo "[Desktop Entry] 150 | Encoding=UTF-8 151 | Name=Oracle Data Modeler 152 | Comment=Oracle Data Modeler 153 | Icon=/home/oracle/datamodeler/icon.png 154 | Exec=/home/oracle/bin/datamodeler 155 | Terminal=false 156 | Type=Application 157 | X-Desktop-File-Install-Version=0.21 158 | " > /home/oracle/Desktop/Oracle-datamodeler.desktop 159 | chmod 755 /home/oracle/Desktop/Oracle-datamodeler.desktop 160 | echo '#!/bin/bash 161 | #should do image or desktop 162 | . ~oracle/.bashrc 163 | . /home/oracle/bin/dbenv 164 | cd /home/oracle/datamodeler 165 | bash ./datamodeler.sh "$@"' > /home/oracle/bin/datamodeler 166 | chmod 755 /home/oracle/bin/datamodeler 167 | else 168 | ~oracle/buildTimeReportSkippingFile.sh $MODNAME 169 | fi 170 | cp /tmp/1/runTimeSQLDeveloperConnections.xml ~ 171 | chmod 755 ~/runTimeSQLDeveloperConnections.xml 172 | mkdir ~oracle/bin 173 | echo '#!/bin/bash 174 | #LD_LIBRARY_PATH 175 | #normal .bashrc does not set LD_LIBRARY_PATH even the first time 176 | export ORACLE_BASE=/u01/app/oracle 177 | export ORACLE_HOME=$ORACLE_BASE/product/version/db_1 178 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib 179 | if test "m$DBENV" = "m" 180 | then 181 | export TMP=/tmp 182 | export TMPDIR=$TMP 183 | export ORACLE_UNQNAME=orclcdb 184 | export ORACLE_BASE=/u01/app/oracle 185 | export ORACLE_HOME=$ORACLE_BASE/product/version/db_1 186 | export ORACLE_SID=orclcdb 187 | export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH 188 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib 189 | export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib 190 | export DBENV=true 191 | #export SQL_OR_SQLPLUS='sql -oci' 192 | export SQL_OR_SQLPLUS=sqlplus 193 | fi 194 | '> /home/oracle/bin/dbenv 195 | cp /tmp/1/runTimeSQLCLIcon.png ~/Desktop/images 196 | chmod 644 ~/Desktop/images/runTimeSQLCLIcon.png 197 | echo ' 198 | if test "m$JAVAENV" = "m" 199 | then 200 | export TMZ="GMT" 201 | export JAVA_HOME=`ls -d /home/oracle/java/jdk* 2>/dev/null` 202 | if test "m$JAVA_HOME" = "m" 203 | then 204 | export JAVA_HOME=/u01/app/oracle/product/version/db_1/jdk 205 | fi 206 | export PATH=$JAVA_HOME/bin:/home/oracle/bin:/home/oracle/sqlcl/bin:/home/oracle/sqldeveloper:/home/oracle/datamodeler:$PATH:/home/oracle/sqlcl/bin:/home/oracle/sqldeveloper:/home/oracle/bin 207 | export JAVAENV=true 208 | fi'>>/home/oracle/.bashrc 209 | ed -s /home/oracle/Desktop/'Click here to Start.desktop' <<< $',s/Click here to Start/Click here to Start Labs/g\nw' 210 | echo ' 211 | bash /tmp/1/buildTimeSetupRestClient.sh 212 | export LD_LIBRARY_PATH= 213 | cd ~/Desktop 214 | echo only rest client worked do this again at the end icon size seems almost similar whether trusted or not 215 | dbus-launch gio set "Rest Client.desktop" "metadata::trusted" yes 216 | dbus-launch gio set "SQL Developer.desktop" "metadata::trusted" yes 217 | dbus-launch gio set "Oracle-datamodeler.desktop" "metadata::trusted" yes 218 | dbus-launch gio set "Click here to Start.desktop" "metadata::trusted" yes 219 | dbus-launch gio set "sql.desktop" "metadata::trusted" yes 220 | ' > /tmp/icons.sh 221 | bash /tmp/icons.sh 222 | cp /tmp/1/runTimeSQLDeveloperIcon.png /home/oracle/Desktop/images 223 | cp /tmp/1/runTimeSQLDeveloperIcon.png /home/oracle/Desktop/images 224 | cp /tmp/1/runTimeLabStylesheet.css /home/oracle/Desktop/style.css 225 | mkdir ~/.icons 226 | #errors out unnecessary? cp /home/oracle/runTimeClickHere.png /home/oracle/images/runTimeClickHere.png 227 | #chmod 755 /home/oracle/images/runTimeClickHere.png 228 | 229 | chmod -R 777 /tmp/1/* 230 | chown oracle /tmp/1/* 231 | . ~oracle/buildTimeEnd.sh 232 | -------------------------------------------------------------------------------- /upload/3_2installDatabase.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_2installDatabase.sh 22 | # 23 | # Description: 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | (/tmp/1/3_2installDatabase_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | . ~oracle/buildTimeEnd.sh 31 | -------------------------------------------------------------------------------- /upload/3_2installDatabase_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_1installDbtoolClientTools_inner.sh 22 | # 23 | # Description: 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | mkdir -p /u01/app/oracle/product/version/db_1 30 | mv /tmp/1/LINUX.X64_180000_db_home.zip /u01/app/oracle/product/version/db_1 31 | cd /u01/app/oracle/product/version/db_1 32 | unzip LINUX.X64_180000_db_home.zip 33 | rm LINUX.X64_180000_db_home.zip 34 | echo assumption this results in a directory database 35 | 36 | ./runInstaller -silent -ignorePrereq -waitForCompletion -responseFile /tmp/1/buildTimeSoftwareInstall.rsp 37 | 38 | echo ' 39 | #LD_LIBRARY_PATH 40 | #set up db for su login and gnome terminal use so LD_LIBRARY_PATH pure for gnome and user does not have to . oraenv 41 | #do I still get ui issues "m1" = "m0" ie is it really an issue of these 10 lines ( and install). -a "m1" = "m0" 42 | pstree -s $$ | egrep "\-su-|gnome-terminal" >/dev/null 2>&1 43 | export GNOME_CHECK=$? 44 | if test "m$DBENV" = "m" -a "m$GNOME_CHECK" = "m0" 45 | then 46 | export TMP=/tmp 47 | export TMPDIR=$TMP 48 | export ORACLE_UNQNAME=orclcdb 49 | export ORACLE_BASE=/u01/app/oracle 50 | export ORACLE_HOME=$ORACLE_BASE/product/version/db_1 51 | export ORACLE_SID=orclcdb 52 | #LD_LIBRARY_PATH 53 | export PATH=/home/oracle/bin:/home/oracle/LDLIB:$ORACLE_HOME/bin:/usr/sbin:$PATH 54 | #during install set LD_LIBRARY_PATH otherwise rely on LDLIB wrappers and ~/bin/sql sqlplus and modeller 55 | if test -f /tmp/1/buildTimeStillInstalling 56 | then 57 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib 58 | fi 59 | export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib 60 | export DBENV=true 61 | #export SQL_OR_SQLPLUS='sql -oci' 62 | export SQL_OR_SQLPLUS=sqlplus 63 | fi'>>/home/oracle/.bashrc 64 | 65 | cp /tmp/1/buildTimeCreateLD_LIBRARY_PATHShellWrappers.sh ~oracle/bin/buildTimeCreateLD_LIBRARY_PATHShellWrappers.sh 66 | 67 | chmod 755 ~oracle/bin/buildTimeCreateLD_LIBRARY_PATHShellWrappers.sh 68 | 69 | ~oracle/bin/buildTimeCreateLD_LIBRARY_PATHShellWrappers.sh 70 | 71 | . ~oracle/buildTimeEnd.sh 72 | -------------------------------------------------------------------------------- /upload/3_3passwordDoNotExpire.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_3passwordDoNotExpire.sh 22 | # 23 | # Description: minor helper - e.g. passwords do not expire. 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | (/tmp/1/3_3passwordDoNotExpire_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | . ~oracle/buildTimeEnd.sh 31 | -------------------------------------------------------------------------------- /upload/3_3passwordDoNotExpire_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_3passwordDoNotExpire_inner.sh 22 | # 23 | # Description: minor helper - e.g. passwords do not expire. 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | 30 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib 31 | echo alter pluggable database orcl open';'|$SQL_OR_SQLPLUS / as sysdba 32 | 33 | #password do not expire 34 | $SQL_OR_SQLPLUS / as sysdba <&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | . ~oracle/buildTimeEnd.sh 31 | -------------------------------------------------------------------------------- /upload/3_4enableGeoRaster_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File:3_4enableGeoRaster_inner.sh 22 | # 23 | # Description: post database install and patch e.g.: required for spacial: execute mdsys.enableGeoRaster; 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | #post db install and open - pre non db core software install - no ords/apex... 30 | #assumption - database up, listener up, only cdb and pdb=orcl need to be updated, shutdown startup explicit at end 31 | #assumption - listener does not need to be restarted - if listener needs to be restarted - do it explicitly.lsnrctl stop lsnrctl start 32 | unset TWO_TASK 33 | $SQL_OR_SQLPLUS sys/oracle as sysdba <&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | . ~oracle/buildTimeEnd.sh 31 | -------------------------------------------------------------------------------- /upload/3_5unzipLabDemos_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_5unzipLabDemos_inner.sh 22 | # 23 | # Description: install hands on labs demos 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | cd /home/oracle 30 | if test -f /tmp/1/demos.zip 31 | then 32 | unzip -o /tmp/1/demos.zip 33 | touch /tmp/1/demos.zip 34 | #for test -f /tmp/.. 35 | #change : In 3_5unzipLabDemos.sh (moved to 3_7ORDSInstall.sh as that is done later but before do demos), can you change it to copy the ords_params.propeties file instead of the runTimeParametersForORDS.properties. 36 | #mv ~/ords.war ~/ords_params.properties ~/Desktop/Database_Track/ORDS 37 | #chmod 755 ~/Desktop/Database_Track/ORDS/ords_params.properties 38 | #chmod 755 ~/Desktop/Database_Track/ORDS/ords.war 39 | #echo got privileges wroung fix next zip 40 | #chmod -R 755 Desktop readme.html reset_rest reset_sqldev 3_7ORDSInstall.sh reset_apex reset_soup reset_xmldb pdb_open_says_me.sql reset_JSON reset_soup_apex_only shrink.sh 41 | 42 | #single point of truth sym link demos 3_7ORDSInstall.sh to ~/bin/ords.sh 43 | rm ~/bin/ords.sh 44 | ln -s /home/oracle/ords.sh /home/oracle/bin/ords.sh 45 | chmod 755 /home/oracle/ords.sh /home/oracle/bin/ords.sh 46 | 47 | #mv ords.sh ords.sh.x 48 | #cat ords.sh.x | sed 'sZNAME="OracleZexport JAVAENV=\n. /home/oracle/.bashrc\nNAME="OracleZg'> ords.sh 49 | chmod 755 ords.sh 50 | 51 | bash -x /tmp/1/runTimeTidyLabWebFiles.sh 52 | #do not reset rest on 8080/ords 53 | cp ~/reset_sqldev ~/reset_sqldev.x 54 | cat ~/reset_sqldev.x | sed 'sZsh reset_ords.shZecho Closing ORCL to not delete default ords will exit on prompt if no ords configured in labs; export OLD_TWO_TASK=$TWO_TASK; export TWO_TASK=; ~/bin/ords.sh stop /home/oracle/ords/ords.war; echo "alter pluggable database orcl close;" | sqlplus / as sysdba; export TWO_TASK=$OLD_TWO_TASK; sh reset_ords.sh \& wait; export TWO_TASK=;echo "alter pluggable database orcl open;" | sqlplus / as sysdba; export TWO_TASK=$OLD_TWO_TASK; echo DEBUG Default ORDS restarting; nohup ~/bin/ords.sh start /home/oracle/ords/ords.war >>~/reset_sqldev_restart_basic_ords.log 2>\&1 \& echo DEBUG After Default ORDS restart Zg' > ~/reset_sqldev 55 | 56 | chmod 755 ~/reset_sqldev 57 | else 58 | ~oracle/buildTimeReportSkippingFile.sh "demos.zip - install," 59 | fi 60 | . ~oracle/buildTimeEnd.sh 61 | -------------------------------------------------------------------------------- /upload/3_6apexInstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_6apexInstall.sh 22 | # 23 | # Description: install Oracle APEX if apex zip file available 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | (/tmp/1/3_6apexInstall_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | #>> ~oracle/thestdoutlog 2>&1 31 | . ~oracle/buildTimeEnd.sh 32 | -------------------------------------------------------------------------------- /upload/3_6apexInstall_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_6apexInstall_inner.sh 22 | # 23 | # Description: 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | 30 | if test -f /tmp/1/cwallet.sso 31 | then 32 | mkdir /home/oracle/wallet 33 | cp /tmp/1/cwallet.sso /home/oracle/wallet 34 | chmod -R 755 /home/oracle/wallet 35 | fi 36 | cd $ORACLE_HOME/apex 37 | echo apex not preinstalled anymore 38 | ls -l apxremov_con.sql 39 | 40 | cd /u01/userhome/oracle 41 | if test -f /tmp/1/apex.zip 42 | then 43 | unzip /tmp/1/apex.zip 44 | cd apex 45 | 46 | echo 'shutdown immediate 47 | startup 48 | alter pluggable database all open;'| sqlplus / as sysdba 49 | echo 'spool /tmp/spooltestxxtotierne 50 | alter session set container = orcl; 51 | @apexins.sql SYSAUX SYSAUX TEMP /i/' | $SQL_OR_SQLPLUS / as sysdba 52 | 53 | echo "select 'cdb anonymous at least is global' from dual; 54 | set define '&' 55 | --alter session set container = orcl; 56 | 57 | --EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_040200'); 58 | --EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_PUBLIC_USER'); 59 | --EXEC DBMS_UTILITY.compile_schema(schema => 'FLOWS_FILES'); 60 | --EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_050000'); 61 | --EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_PUBLIC_USER'); 62 | --EXEC DBMS_UTILITY.compile_schema(schema => 'FLOWS_FILES'); 63 | 64 | --anonymous needs to be unlocked?? SELECT username, account_status FROM dba_users; 65 | alter user anonymous identified by oracle container=all; 66 | alter user anonymous account unlock; 67 | --ALTER USER APEX_050000 identified by oracle; 68 | --ALTER USER APEX_PUBLIC_USER identified by oracle; 69 | --ALTER USER FLOWS_FILES identified by oracle; 70 | --ALTER USER APEX_050000 ACCOUNT UNLOCK; 71 | --ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK; 72 | --ALTER USER FLOWS_FILES ACCOUNT UNLOCK; 73 | "|$SQL_OR_SQLPLUS / as sysdba 74 | echo "select 'pdb' from dual; 75 | set define '&' 76 | --alter session set container = orcl; 77 | 78 | EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_040200'); 79 | EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_PUBLIC_USER'); 80 | EXEC DBMS_UTILITY.compile_schema(schema => 'FLOWS_FILES'); 81 | EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_050000'); 82 | EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_PUBLIC_USER'); 83 | EXEC DBMS_UTILITY.compile_schema(schema => 'FLOWS_FILES'); 84 | EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_050100'); 85 | EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_PUBLIC_USER'); 86 | EXEC DBMS_UTILITY.compile_schema(schema => 'FLOWS_FILES'); 87 | column totupapex new_val totupapex 88 | --APEX_180100 check 89 | select username totupapex from all_users where username like 'APEX_0%' or username like 'APEX_1%' or username like 'APEX_2%' order by totupapex asc; 90 | clear column 91 | EXEC DBMS_UTILITY.compile_schema(schema => '&totupapex'); 92 | EXEC DBMS_UTILITY.compile_schema(schema => 'APEX_PUBLIC_USER'); 93 | EXEC DBMS_UTILITY.compile_schema(schema => 'FLOWS_FILES'); 94 | --anonymous needs to be unlocked should be unlocked at pdb level might error?? SELECT username, account_status FROM dba_users; 95 | alter user anonymous identified by oracle; 96 | alter user anonymous account unlock; 97 | ALTER USER APEX_050000 identified by oracle; 98 | ALTER USER APEX_050100 identified by oracle; 99 | ALTER USER &totupapex identified by oracle; 100 | ALTER USER APEX_PUBLIC_USER identified by oracle; 101 | ALTER USER FLOWS_FILES identified by oracle; 102 | ALTER USER APEX_050000 ACCOUNT UNLOCK; 103 | ALTER USER APEX_050100 ACCOUNT UNLOCK; 104 | ALTER USER &totupapex ACCOUNT UNLOCK; 105 | ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK; 106 | ALTER USER FLOWS_FILES ACCOUNT UNLOCK; 107 | "|$SQL_OR_SQLPLUS sys/oracle@localhost:1521/orcl as sysdba 108 | echo "alter session set container = orcl; 109 | @apex_epg_config.sql /u01/userhome/oracle"|$SQL_OR_SQLPLUS / as sysdba 110 | echo leave 8080 for ords 111 | echo "alter session set container = orcl; 112 | @apxconf 113 | exit" > doapxconf.sql 114 | echo '#!/usr/bin/expect 115 | spawn sqlplus / as sysdba @doapxconf 116 | 117 | expect -regexp "Enter the administrator.s username .ADMIN." { send "ADMIN\r" } 118 | expect -regexp "Enter ADMIN.s email .ADMIN." {send "\r"} 119 | expect -regexp "Enter ADMIN.s password .." {send "1Oracle:\r"} 120 | expect -regexp "Enter a port for the XDB HTTP listener " {send "8081\r"} 121 | expect -regexp "something the WiLl Never Happen" {send "jingle bella\r"} 122 | interact' > ~/bin/xp.sh 123 | 124 | chmod 755 ~/bin/xp.sh 125 | ~/bin/xp.sh 126 | rm ~/bin/xp.sh 127 | #echo "ADMIN 128 | # 129 | #1Oracle: 130 | #8081"| sqlplus / as sysdba @doapxconf 131 | #$SQL_OR_SQLPLUS sys/oracle as sysdba @doapxconf ***********???????? 132 | 133 | cp apex_rest_config_cdb.sql apex_rest_config_cdb.sql.SAV 134 | cat apex_rest_config_cdb.sql.SAV|sed 's/--P'"'"'[^'"'"']*'"'"'/--poracle/g'> apex_rest_config_cdb.sql 135 | cp apex_rest_config_nocdb.sql apex_rest_config_nocdb.sql.SAV 136 | cat apex_rest_config_nocdb.sql.SAV|sed 's/^accept PASSWD1.*$/define PASSWD1=oracle/g' |sed 's/^accept PASSWD2.*$/define PASSWD2=oracle/g'> apex_rest_config_nocdb.sql 137 | 138 | echo "alter session set container = orcl; 139 | @apex_rest_config.sql" > doapex_rest_config.sql 140 | echo "exit" | $SQL_OR_SQLPLUS / as sysdba @doapex_rest_config.sql 141 | #better undo -P .SAV change above 142 | cp apex_rest_config_cdb.sql.SAV apex_rest_config_cdb.sql 143 | cp apex_rest_config_nocdb.sql.SAV apex_rest_config_nocdb.sql 144 | #. /tmp/1/apexx2.sh - missing file included rather than recreate file 145 | echo one of these will work depending on apex being included 146 | echo "whenever sqlerror exit 1 147 | alter session set current_schema = APEX_050000; 148 | 149 | PROMPT <<--------------- Setting Instance Settings --------------->> 150 | begin 151 | wwv_flow_security.g_security_group_id := 10; 152 | wwv_flow_security.g_user := 'ADMIN'; 153 | wwv_flow.g_import_in_progress := true; 154 | 155 | for c1 in (select user_id 156 | from wwv_flow_fnd_user 157 | where security_group_id = wwv_flow_security.g_security_group_id 158 | and user_name = wwv_flow_security.g_user 159 | ) loop 160 | APEX_UTIL.edit_user 161 | ( p_user_id => c1.user_id 162 | , p_user_name => wwv_flow_security.g_user 163 | , p_web_password => 'oracle' 164 | , p_new_password => 'oracle' 165 | ,p_change_password_on_first_use => 'N', 166 | p_first_password_use_occurred => 'Y' ); 167 | end loop; 168 | wwv_flow.g_import_in_progress := false; 169 | APEX_INSTANCE_ADMIN.SET_PARAMETER('PASSWORD_HISTORY_DAYS',0); 170 | APEX_INSTANCE_ADMIN.SET_PARAMETER('STRONG_SITE_ADMIN_PASSWORD','N'); 171 | APEX_INSTANCE_ADMIN.SET_PARAMETER('ACCOUNT_LIFETIME_DAYS',36500); 172 | 173 | end; 174 | / 175 | commit; 176 | " | sqlplus sys/oracle@localhost:1521/orcl as sysdba 177 | echo "whenever sqlerror exit 1 178 | alter session set current_schema = APEX_050100; 179 | 180 | PROMPT <<--------------- Setting Instance Settings --------------->> 181 | begin 182 | wwv_flow_security.g_security_group_id := 10; 183 | wwv_flow_security.g_user := 'ADMIN'; 184 | wwv_flow.g_import_in_progress := true; 185 | 186 | for c1 in (select user_id 187 | from wwv_flow_fnd_user 188 | where security_group_id = wwv_flow_security.g_security_group_id 189 | and user_name = wwv_flow_security.g_user 190 | ) loop 191 | APEX_UTIL.edit_user 192 | ( p_user_id => c1.user_id 193 | , p_user_name => wwv_flow_security.g_user 194 | , p_web_password => 'oracle' 195 | , p_new_password => 'oracle' 196 | ,p_change_password_on_first_use => 'N', 197 | p_first_password_use_occurred => 'Y' ); 198 | end loop; 199 | wwv_flow.g_import_in_progress := false; 200 | APEX_INSTANCE_ADMIN.SET_PARAMETER('PASSWORD_HISTORY_DAYS',0); 201 | APEX_INSTANCE_ADMIN.SET_PARAMETER('STRONG_SITE_ADMIN_PASSWORD','N'); 202 | APEX_INSTANCE_ADMIN.SET_PARAMETER('ACCOUNT_LIFETIME_DAYS',36500); 203 | 204 | end; 205 | / 206 | commit; 207 | " | sqlplus sys/oracle@localhost:1521/orcl as sysdba 208 | echo "whenever sqlerror exit 1 209 | column totupapex new_val totupapex 210 | --APEX_180100 check 211 | select username totupapex from all_users where username like 'APEX_0%' or username like 'APEX_1%' or username like 'APEX_2%' order by totupapex asc; 212 | clear column 213 | alter session set current_schema = &totupapex; 214 | 215 | PROMPT <<--------------- Setting Instance Settings --------------->> 216 | begin 217 | wwv_flow_security.g_security_group_id := 10; 218 | wwv_flow_security.g_user := 'ADMIN'; 219 | wwv_flow.g_import_in_progress := true; 220 | 221 | for c1 in (select user_id 222 | from wwv_flow_fnd_user 223 | where security_group_id = wwv_flow_security.g_security_group_id 224 | and user_name = wwv_flow_security.g_user 225 | ) loop 226 | APEX_UTIL.edit_user 227 | ( p_user_id => c1.user_id 228 | , p_user_name => wwv_flow_security.g_user 229 | , p_web_password => 'oracle' 230 | , p_new_password => 'oracle' 231 | ,p_change_password_on_first_use => 'N', 232 | p_first_password_use_occurred => 'Y' ); 233 | end loop; 234 | wwv_flow.g_import_in_progress := false; 235 | APEX_INSTANCE_ADMIN.SET_PARAMETER('PASSWORD_HISTORY_DAYS',0); 236 | APEX_INSTANCE_ADMIN.SET_PARAMETER('STRONG_SITE_ADMIN_PASSWORD','N'); 237 | APEX_INSTANCE_ADMIN.SET_PARAMETER('ACCOUNT_LIFETIME_DAYS',36500); 238 | 239 | end; 240 | / 241 | commit; 242 | " | sqlplus sys/oracle@localhost:1521/orcl as sysdba 243 | echo " 244 | column totupapex new_val totupapex 245 | --APEX_180100 check 246 | select username totupapex from all_users where username like 'APEX_0%' or username like 'APEX_1%' or username like 'APEX_2%' order by totupapex asc; 247 | clear column 248 | BEGIN 249 | DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE( 250 | host => '*', 251 | ace => xs"'$'"ace_type(privilege_list => xs"'$'"name_list('connect'), 252 | principal_name => '&totupapex', 253 | principal_type => xs_acl.ptype_db)); 254 | END; 255 | / 256 | commit; 257 | "| sqlplus sys/oracle@localhost:1521/orcl as sysdba 258 | 259 | else 260 | ~oracle/buildTimeReportSkippingFile.sh apex.zip 261 | 262 | if test -f /tmp/1/ords.zip 263 | then 264 | echo PROGRESS: APEX - may be a prerequisite for this installations ords config file ie APEX_PUBLIC_USER 265 | fi 266 | fi 267 | . ~oracle/buildTimeEnd.sh 268 | -------------------------------------------------------------------------------- /upload/3_7ORDSInstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_7ORDSInstall.sh 22 | # 23 | # Description: ORDS install 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | (/tmp/1/3_7ORDSInstall_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | . ~oracle/buildTimeEnd.sh 31 | -------------------------------------------------------------------------------- /upload/3_7ORDSInstall_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_7ORDSInstall_inner.sh 22 | # 23 | # Description: Install Oracle REST Data Services 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | if test -f /tmp/1/oracle.dbtools.jdbcrest.jar 30 | then 31 | cp /tmp/1/oracle.dbtools.jdbcrest.jar ~/sqlcl/lib 32 | chmod 644 ~/sqlcl/lib/oracle.dbtools.jdbcrest.jar 33 | chown oracle ~/sqlcl/lib/oracle.dbtools.jdbcrest.jar 34 | fi 35 | if test -f /tmp/1/ords.zip 36 | then 37 | if test -d /home/oracle/sqldeveloper/ords 38 | then 39 | if test -f /tmp/1/apex.zip 40 | then 41 | echo 42 | else 43 | echo PROGRESS: If seems like you are trying to install ords without apex. 44 | echo PROGRESS: NOTE ords may have an apex prerequisite in the config files used for this demo. 45 | fi 46 | 47 | echo WARNING REPLACING SQLDEVORDS WITH ORDS EXPLICITLY DOWNLOADED. 48 | cd /home/oracle/sqldeveloper 49 | rm -rf ords 2>/dev/null 50 | mkdir ords 51 | cd ords 52 | unzip /tmp/1/ords.zip 53 | fi 54 | cd /home/oracle 55 | mkdir ords 56 | cd ords 57 | unzip /tmp/1/ords.zip 58 | cp /tmp/1/runTimeParametersForORDS.properties ords_params_vmconfig.properties 59 | cp /tmp/1/runTimeKickOffOrds.sh /home/oracle/bin/ords.sh 60 | chmod 755 /home/oracle/bin/ords.sh 61 | mkdir vmconfig 62 | cp ords.war /home/oracle/ords/params/ords_params.properties ~ 63 | #change : In 3_5unzipLabDemos.sh, can you change it to copy the ords_params.propeties file 64 | #instead of the runTimeParametersForORDS.properties. 65 | mv ~/ords.war ~/ords_params.properties ~/Desktop/Database_Track/ORDS 66 | chmod 755 ~/Desktop/Database_Track/ORDS/ords_params.properties 67 | chmod 755 ~/Desktop/Database_Track/ORDS/ords.war 68 | cp /home/oracle/ords/ords_params_vmconfig.properties /home/oracle/ords/ords_params_vmconfig.properties.x 69 | if test -f /tmp/1/apex.zip 70 | then 71 | cat /home/oracle/ords/ords_params_vmconfig.properties.x | sed 's/rest.services.ords.add=false/rest.services.ords.add=true/g' > /home/oracle/ords/ords_params_vmconfig.properties 72 | else 73 | mkdir /home/oracle/ords/thestatic 74 | echo "grant dba to APEX_PUBLIC_USER identified by oracle;" | sqlplus system/oracle@localhost:1521/ORCL 75 | cat /home/oracle/ords/ords_params_vmconfig.properties.x | sed 's/rest.services.ords.add=false/rest.services.ords.add=true/g'| sed 's/rest.services.apex.add=true/rest.services.apex.add=false/g' | sed 'sZ/home/oracle/apex/imagesZ/home/oracle/ords/thestaticZg' > /home/oracle/ords/ords_params_vmconfig.properties 76 | fi 77 | 78 | 79 | chmod 755 /home/oracle/ords/ords_params_vmconfig.properties 80 | java -jar ords.war configdir /home/oracle/ords/vmconfig 81 | cat /home/oracle/ords/ords_params_vmconfig.properties 82 | echo confirm to prompts sys username and password 83 | 84 | 85 | #expect does not wirk with no tty in this case try plane echo 86 | echo '#!/usr/bin/expect 87 | set timeout 600 88 | spawn java -jar /home/oracle/ords/ords.war install --parameterFile /home/oracle/ords/ords_params_vmconfig.properties simple 89 | 90 | expect -regexp "Enter the database password for SYS AS SYSDBA." {send "oracle\r"} 91 | expect -regexp "Confirm password." {send "oracle\r"} 92 | expect -regexp " if using HTTPS .1.." {send "1\r"} 93 | expect -regexp "something the WiLl Never Happen" {send "jingle bella\r"} 94 | interact' > ~/bin/x.sh 95 | chmod 755 ~/bin/x.sh 96 | ~/bin/x.sh > /tmp/zzz 2>&1 & 97 | echo sleep 160 98 | sleep 260 99 | echo tags to search stdout 1690 160 100 | cat /tmp/zzz 101 | echo /home/oracle/bin/ords.sh stop 102 | mv /home/oracle/ords/vmconfig/ords/defaults.xml /home/oracle/ords/vmconfig/ords/defaults.xml.SAV 103 | cat /home/oracle/ords/vmconfig/ords/defaults.xml.SAV|sed 'sZ1521Z1521\ntrue\nfalseZg'>/home/oracle/ords/vmconfig/ords/defaults.xml 104 | chmod 755 /home/oracle/ords/vmconfig/ords/defaults.xml 105 | /home/oracle/bin/ords.sh stop 106 | rm ~/bin/x.sh /tmp/zzz 107 | cp /tmp/1/runtime9090ORDS.properties ~oracle 108 | cp /tmp/1/uninstall9090ORDS.properties ~oracle 109 | if test -f /tmp/1/demos.zip 110 | then 111 | cp /tmp/1/9090init /tmp/1/9090start /tmp/1/9090stop ~/bin 112 | chmod 755 ~/bin/9090init ~/bin/9090start ~/bin/9090stop 113 | fi 114 | /home/oracle/bin/ords.sh start 115 | cd ~/ords 116 | 117 | echo '#!/usr/bin/expect 118 | exp_internal 1 119 | set timeout 1200 120 | spawn $JAVA_HOME/bin/java -jar ords.war user HRREST "SQL Developer" 121 | expect -regexp "Enter a password for user HRREST." { send "oracle\r" } 122 | expect -regexp "Confirm password for user HRREST." {send "oracle\r"} 123 | expect -regexp "Something that will never happen to force keep searching until process end" {send "neverhappen\r"} 124 | interact'| sed 'sZ$JAVA_HOMEZ'"$JAVA_HOME"'Zg' > ~/bin/xp.sh 125 | chmod 755 ~/bin/xp.sh 126 | ~/bin/xp.sh 127 | rm ~/bin/xp.sh 128 | cd - 129 | /home/oracle/bin/ords.sh stop 130 | else 131 | ~oracle/buildTimeReportSkippingFile.sh ords.zip 132 | fi 133 | . ~oracle/buildTimeEnd.sh 134 | -------------------------------------------------------------------------------- /upload/3_8setupDemos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_8setupDemos.sh 22 | # 23 | # Description: set up demos and run reset scripts 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | (/tmp/1/3_8setupDemos_inner.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | . ~oracle/buildTimeEnd.sh 31 | -------------------------------------------------------------------------------- /upload/3_8setupDemos_inner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_8setupDemos_inner.sh 22 | # 23 | # Description: 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | if test -f /tmp/1/demos.zip 30 | then 31 | #set -x 32 | echo 'cd /home/oracle 33 | zip -r gitmin GitHub/json-in-db/JSON-HOL 34 | zip -r gitmin GitHub/json-in-db/SODA4REST-HOL 35 | zip -r gitmin GitHub/xml-sample-demo/XMLDB-HOL 36 | #xdbpm.jar was missing in a sqlldr. - jpr is available do I jdeveloper build in build 37 | #cp GitHub/xml-sample-demo/XFILES/xdbpm/xdbpm.jar ~/ 38 | #zip -r gitmin GitHub/xml-sample-demo/XFILES/xdbpm/deploy 39 | 40 | rm -rf GitHub 41 | unzip gitmin.zip 42 | #mkdir -p GitHub/xml-sample-demo/XFILES/xdbpm/deploy 43 | #mv ~/xdbpm.jar GitHub/xml-sample-demo/XFILES/xdbpm/deploy 44 | #chmod 777 GitHub/xml-sample-demo/XFILES/xdbpm/deploy/xdbpm.jar 45 | rm gitmin.zip 46 | '>/home/oracle/savegitdirmin.sh 47 | 48 | echo 'if test "m$DONOTSETTWO_TASK" = "m" 49 | then 50 | export TWO_TASK=ORCL 51 | fi' >> ~/.bashrc 52 | export TWO_TASK= 53 | cd 54 | 55 | echo MARK_START 1690 start use git then reset all demos _including apex_. 56 | #wget http://INTERNAL/reset_xmldbjson 57 | cp /tmp/1/reset_xmldbjson . 58 | cat reset_xmldbjson |grep 'sh handsOnLab.sh $DBA' 59 | if test 'm$?' = 'm0' 60 | then 61 | echo 'doInstall() { 62 | rm -rf $GITDIR 63 | mkdir $GITDIR 64 | cd $GITDIR 65 | curl -Lk https://raw.githubusercontent.com/oracle/xml-sample-demo/master/install/installGitHubRepositories.sh -o intallGitHubRepositories.sh 66 | export SYSPWD=$PASSWD 67 | sh intallGitHubRepositories.sh $PDB $DBA $PASSWD $PASSWD $XDBEXT $PASSWD $DEMOUSER $PASSWD $HOSTNAME $HTTPPORT $ORDSHOME 68 | unset SYSPWD 69 | export TWO_TASK=$PDB 70 | export ORACLE_SID=$PDB 71 | cd $GITDIR/json-in-db/JSON-HOL/hol 72 | sh installHandsOnLab.sh $DBA $PASSWD $DEMOUSER $PASSWD $SERVERURL 73 | cd $GITDIR/json-in-db/SODA4REST-HOL/hol 74 | sh installHandsOnLab.sh $DBA $PASSWD $DEMOUSER $PASSWD $SERVERURL 75 | cd $GITDIR/xml-sample-demo/XMLDB-HOL/hol 76 | sh installHandsOnLab.sh $DBA $PASSWD $DEMOUSER $PASSWD $SERVERURL 77 | cd 78 | #rm -rf $GITDIR 79 | rm ~/reset_xmldbjson 80 | } 81 | export TWO_TASK= 82 | PDB=ORCL 83 | PASSWD=oracle 84 | DBA=MYDBA 85 | XFILES=XFILES 86 | XDBEXT=XDBEXT 87 | DEMOUSER=SCOTT 88 | HOSTNAME=localhost 89 | HTTPPORT=8081 90 | ORDSHOME=~/ords 91 | SERVERURL="http://$HOSTNAME:$HTTPPORT" 92 | GITDIR=~/GitHub 93 | logfilename=~/reset_xmldbjson.log 94 | rm $logfilename 95 | doInstall 2>&1 | tee -a $logfilename 96 | ' > reset_xmldbjson 97 | else 98 | #change rm -rf DOLLAR GITDIR reference to #rmORCL 99 | cp ~/reset_xmldbjson ~/reset_xmldbjson.GITDIR 100 | cat ~/reset_xmldbjson.GITDIR| sed '0,/m -rf $GITDIR/! sZrm -rf $GITDIRZbash -x /home/oracle/savegitdirmin.sh Zg' > ~/reset_xmldbjson 101 | rm ~/reset_xmldbjson.GITDIR 102 | #resolve fix typo bogus have to do this in a cleverer place 103 | #cp /home/oracle/GitHub/json-in-db/install/installJSONRepository.sh /home/oracle/GitHub/json-in-db/install/installJSONRepository.sh.4rest 104 | #cat /home/oracle/GitHub/json-in-db/install/installJSONRepository.sh.4rest | sed 'sZSODA4REST=HOL.shZSODA4REST-HOL.shZg' > /home/oracle/GitHub/json-in-db/install/installJSONRepository.sh 105 | #chmod 644 /home/oracle/GitHub/json-in-db/install/installJSONRepository.sh 106 | echo command removed else then requires command 107 | fi 108 | rm -rf rest_xmldb rest_json Desktop/Database_Track/JSON Desktop/Database_Track/XMLDB 109 | . /tmp/1/BUILD_CONFIG.sh 110 | 111 | echo 'alter user hr identified by oracle account unlock;'|sqlplus system/oracle@localhost:1521/orcl 112 | echo 'create or replace trigger EMPLOYEES_EMPLOYEE_ID_TRG 113 | before insert on employees 114 | for each row 115 | begin 116 | if :new.employee_id is null then 117 | select employees_seq.nextval into :new.employee_id from sys.dual; 118 | end if; 119 | end; 120 | /'|sqlplus hr/oracle@localhost:1521/orcl 121 | 122 | #upload demos into ORCL not done in case it interfers with demos 123 | echo ~oracle/bin/uploaddemos 124 | 125 | export NO_PROXY=localhost,127.0.0.0/8,::1 126 | export no_proxy=localhost,127.0.0.0/8,::1 127 | if test "m$BUILD_WEB_PROXY" != "m" 128 | then 129 | #/ at the end was in the base source may not be required. 130 | export http_proxy=$BUILD_WEB_PROXY/ 131 | export HTTPS_PROXY=$BUILD_WEB_PROXY/ 132 | export https_proxy=$BUILD_WEB_PROXY/ 133 | export HTTP_PROXY=$BUILD_WEB_PROXY/ 134 | fi 135 | #one error on cleanup known and expected 136 | export DONOTSETTWO_TASK=true 137 | chmod 755 ./reset_xmldbjson 138 | echo 1690 is proxy set $http_proxy $HTTP_PROXY 139 | ./reset_xmldbjson > reset_xmldbjson.debuglog 2>&1 140 | export DONOTSETTWO_TASK= 141 | export TWO_TASK=ORCL 142 | export http_proxy= 143 | export HTTPS_PROXY= 144 | export https_proxy= 145 | export no_proxy= 146 | export HTTP_PROXY= 147 | #change ORACLE_SID reference to ORCL 148 | 149 | cp /home/oracle/Desktop/Database_Track/JSON/install/setupLab.sh /home/oracle/Desktop/Database_Track/JSON/install/setupLab.sh.SID 150 | cat /home/oracle/Desktop/Database_Track/JSON/install/setupLab.sh.SID | sed 's/$ORACLE_SID/ORCL/g' > /home/oracle/Desktop/Database_Track/JSON/install/setupLab.sh 151 | chmod 644 /home/oracle/Desktop/Database_Track/JSON/install/setupLab.sh 152 | 153 | #resolve HOLDIRECTORY 154 | cp /home/oracle/Desktop/Database_Track/XMLDB/install/setupLab.sh /home/oracle/Desktop/Database_Track/XMLDB/install/setupLab.sh.HOL 155 | cat /home/oracle/Desktop/Database_Track/XMLDB/install/setupLab.sh.HOL | sed 'sZ\%HOLDIRECTORY\%Z/home/oracle/Desktop/Database_Track/XMLDBZg' > /home/oracle/Desktop/Database_Track/XMLDB/install/setupLab.sh 156 | chmod 644 /home/oracle/Desktop/Database_Track/XMLDB/install/setupLab.sh 157 | 158 | #add ORCL TNSNAMES ALIAS 159 | #cp ~/Desktop/Database_Track/JSON/install/setupLab.sh ~/Desktop/Database_Track/JSON/install/setupLab.sh.ORIG 160 | #cat ~/Desktop/Database_Track/JSON/install/setupLab.sh.ORIG | sed 's/@setupLab.sql ${USER} ${USERPWD}$/@setupLab.sql ${USER} ${USERPWD} ORCL/g'> ~/Desktop/Database_Track/JSON/install/setupLab.sh 161 | #only one needs it cannot remember which one 162 | cp reset_xmldb reset_xmldb.SAV 163 | (echo export TWO_TASK=ORCL; cat reset_xmldb.SAV) > reset_xmldb 164 | 165 | cp reset_json reset_json.SAV 166 | (echo export TWO_TASK=ORCL; cat reset_json.SAV) > reset_json 167 | rm reset_xmldb.SAV reset_json.SAV 168 | 169 | for f in rest_sqldev reset_xmldb reset_soup reset_apex reset_json reset_rest reset_soda4rest reset_soup_apex_only 170 | do 171 | if test -f "$f" 172 | then 173 | sed -i '1sZ^Zexport LD_LIBRARY_PATH=/u01/app/oracle/product/version/db_1/lib\ 174 | Zg' $f 175 | printf "\necho 'alter user hr identified by oracle account unlock;'|sqlplus system/oracle@localhost:1521/orcl\necho 'create or replace trigger EMPLOYEES_EMPLOYEE_ID_TRG 176 | before insert on employees 177 | for each row 178 | begin 179 | if :new.employee_id is null then 180 | select employees_seq.nextval into :new.employee_id from sys.dual; 181 | end if; 182 | end; 183 | /'|sqlplus hr/oracle@localhost:1521/orcl\n" >> "$f" 184 | fi 185 | done 186 | 187 | #12.2 no patch required if test "m$BUILD_HAVEPATCH" = "mTRUE" 188 | #then - if here demos included so do all. 189 | for f in reset_xmldb reset_json reset_sqldev reset_soda4rest reset_soup reset_apex; do (bash -x ./$f 2>&1) | tee $f.debuglog ; done 190 | #else 191 | # for f in reset_sqldev reset_soup reset_apex; do bash -x ./$f >$f.debuglog 2>&1 ; done 192 | #fi 193 | 194 | echo MARK_END 1690 end use git then reset all demos _including apex_. 195 | else 196 | ~oracle/buildTimeReportSkippingFile.sh "demos.zip - internal test run," 197 | echo 'if test "m$DONOTSETTWO_TASK" = "m" 198 | then 199 | export TWO_TASK=ORCL 200 | fi' >> ~/.bashrc 201 | echo 'alter user hr identified by oracle account unlock;'|sqlplus system/oracle@localhost:1521/orcl 202 | fi 203 | . ~oracle/buildTimeEnd.sh 204 | -------------------------------------------------------------------------------- /upload/3topLevel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3topLevel.sh 22 | # 23 | # Description: main kick off script i.e. yum and call subscripts 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | (/tmp/1/3topLevel_inner.sh "$@" 2>&1) | tee -a /tmp/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | #slightly dangerous using tee to a directory we are moving to the second disk. so use tmp and move later 31 | mv /tmp/thestdoutlog_`basename $0`_* ~oracle/log 32 | cd ~oracle 33 | zip -r log.zip log >/dev/null 2>&1 34 | chmod 777 log.zip 35 | chown oracle log.zip 36 | rm -rf ~oracle/log 37 | if test "m$1" != "mtrue" 38 | then 39 | su - oracle -c '/bin/bash -xc ./shrink.sh' > /dev/null 2>&1 40 | fi 41 | . ~oracle/buildTimeEnd.sh 42 | . ~oracle/buildTimeEndOfAllScripts.sh 43 | echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX reached end XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 44 | -------------------------------------------------------------------------------- /upload/9090init: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 9090init 22 | # 23 | # Description: Install Oracle REST Data Services on port 9090 24 | # 25 | ################################################################################# 26 | 27 | JETCONFIGDIR="/home/oracle/sqldeveloper/ords/hol-config" 28 | if test -d $JETCONFIGDIR 29 | then 30 | sh /home/oracle/Desktop/Database_Track/ORDS/reset_ords.sh reinstall 31 | else 32 | sh /home/oracle/Desktop/Database_Track/ORDS/reset_ords.sh install 33 | fi 34 | 35 | -------------------------------------------------------------------------------- /upload/9090start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ################################################################################# 19 | 20 | sh /home/oracle/Desktop/Database_Track/ORDS/reset_ords.sh start 21 | -------------------------------------------------------------------------------- /upload/9090stop: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ################################################################################# 19 | sh /home/oracle/Desktop/Database_Track/ORDS/reset_ords.sh stop 20 | -------------------------------------------------------------------------------- /upload/Click here to Start.desktop: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | ###############################################################################\ 17 | ## 18 | # 19 | # File: Click here to Start.desktop 20 | # 21 | # Description: Desktop directory .desktop file for big Click here (for browser (and demo labs html if installed)) 22 | # 23 | ###############################################################################\ 24 | ## 25 | [Desktop Entry] 26 | Version=1.0 27 | Type=Application 28 | Terminal=false 29 | Icon[en_US]=/home/oracle/Desktop/images/runTimeClickHere.png 30 | Name[en_US]=Click here to Start 31 | Exec=/usr/bin/firefox /home/oracle/Desktop/ODDHandsOnLabs.html \n 32 | Name=Start Here 33 | Icon=/home/oracle/Desktop/images/runTimeClickHere.png 34 | 35 | -------------------------------------------------------------------------------- /upload/SQL Developer.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | # 3 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | ###############################################################################\ 18 | ## 19 | # 20 | # File: SQL Developer.desktop 21 | # 22 | # Description: Desktop directory .desktop file SQL Developer if installed) 23 | # 24 | ###############################################################################\ 25 | ## 26 | [Desktop Entry] 27 | Version=1.0 28 | Type=Application 29 | Terminal=false 30 | Icon[en_US]=/home/oracle/Desktop/images/runTimeSQLDeveloperIcon.png 31 | Name[en_US]=SQL Developer 32 | Exec=/home/oracle/bin/sqldeveloper 33 | Name=SQL Developer 34 | Icon=/home/oracle/Desktop/images/runTimeSQLDeveloperIcon.png 35 | -------------------------------------------------------------------------------- /upload/buildTime32kVarchar2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTime32kVarchar2.sh 22 | # 23 | # Description: switch cdb/pdbs to 32kvarchar2 during build 24 | # 25 | ################################################################################# 26 | 27 | 28 | export DONOTSETTWO_TASK=true 29 | export TWO_TASK= 30 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib 31 | echo using /home/oracle/utl32k_cdb_pdbs_output for output dir 32 | 33 | sqlplus sys/oracle as sysdba < ~/bin/xp.sh 54 | 55 | chmod 755 ~/bin/xp.sh 56 | ~/bin/xp.sh 57 | cat /home/oracle/utl32k_cdb_pdbs_output/* 58 | rm ~/bin/xp.sh 59 | 60 | sqlplus sys/oracle as sysdba < ~/bin/xp.sh 80 | 81 | chmod 755 ~/bin/xp.sh 82 | ~/bin/xp.sh 83 | cat /home/oracle/utlrp_cdb_pdbs_output/* 84 | rm ~/bin/xp.sh 85 | rm -rf /home/oracle/utlrp_cdb_pdbs_output /home/oracle/utl32k_cdb_pdbs_output 86 | 87 | 88 | -------------------------------------------------------------------------------- /upload/buildTimeCallDBCA.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeCallDBCA.sh 22 | # 23 | # Description: Create database with DBCA with responsefile 24 | # 25 | ################################################################################# 26 | 27 | 28 | #cd /u01 29 | #rm -rf /u01/stagevb 30 | #bash -lc 'netca -silent -responseFile /tmp/1/netca.rsp' 31 | export ORACLE_HOME=/u01/app/oracle/product/version/db_1 32 | bash -lc 'dbca -silent -createDatabase -responseFile /tmp/1/buildTimeDBCA.rsp; if test "m$?" != "m0" 33 | then 34 | echo error on dbca 35 | tail -100 /u01/app/oracle/cfgtoollogs/dbca/orclcdb/orclcdb.log 36 | fi' 37 | bash -lc 'lsnrctl stop' 38 | #nice to have set up hostname and default database ala XE 39 | mkdir -p $ORACLE_HOME/network/admin 40 | echo 'NAME.DIRECTORY_PATH= {TNSNAMES, EZCONNECT, HOSTNAME}'> $ORACLE_HOME/network/admin/sqlnet.ora 41 | echo 'SID_LIST_LISTENER = 42 | (SID_LIST = 43 | (SID_DESC = 44 | (GLOBAL_DBNAME = orclcdb) 45 | (SID_NAME = orclcdb) 46 | (ORACLE_HOME = /u01/app/oracle/product/version/db_1) 47 | ) 48 | ) 49 | 50 | LISTENER = 51 | (DESCRIPTION_LIST = 52 | (DESCRIPTION = 53 | (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) 54 | (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) 55 | ) 56 | ) 57 | 58 | #HOSTNAME by pluggable not working rstriction or configuration error. 59 | DEFAULT_SERVICE_LISTENER = (orclcdb) 60 | '> $ORACLE_HOME/network/admin/listener.ora 61 | 62 | 63 | 64 | echo 'ORCLCDB=localhost:1521/orclcdb'>> /u01/app/oracle/product/version/db_1/network/admin/tnsnames.ora 65 | echo 'ORCL= 66 | (DESCRIPTION = 67 | (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) 68 | (CONNECT_DATA = 69 | (SERVER = DEDICATED) 70 | (SERVICE_NAME = orcl) 71 | ) 72 | )'>> /u01/app/oracle/product/version/db_1/network/admin/tnsnames.ora 73 | 74 | 75 | bash -lc 'lsnrctl start' 76 | echo 'export TWO_TASK=;echo alter system register ";" |sqlplus sys/oracle as sysdba' > /tmp/12 77 | chmod 755 /tmp/12 78 | bash -lc '/tmp/12' 79 | -------------------------------------------------------------------------------- /upload/buildTimeCheckVersion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeCheckVersion.sh 22 | # 23 | # Description: diagnostic return database version to confirm patching if patching used 24 | # 25 | ################################################################################# 26 | 27 | 28 | echo marker 1690 $1 29 | unset TWO_TASK 30 | sqlplus sys/oracle as sysdba < 0 62 | / 63 | 64 | spool off 65 | 66 | @/tmp/shrink.sql 67 | 68 | EOF 69 | export TWO_TASK=ORCL 70 | sqlplus -s sys/oracle as sysdba < 0 95 | / 96 | 97 | spool off 98 | 99 | @/tmp/shrink.sql 100 | EOF 101 | 102 | export TWO_TASK= 103 | sqlplus -s / as sysdba <>log 2>&1 <<__FDISK_CMD__ 163 | x 164 | h 165 | 64 166 | s 167 | 32 168 | c 169 | 2048 170 | r 171 | n 172 | p 173 | 1 174 | 2048 175 | 1030143 176 | n 177 | p 178 | 2 179 | 1030144 180 | 9418751 181 | n 182 | p 183 | 3 184 | 9418752 185 | 186 | t 187 | 2 188 | 82 189 | w 190 | __FDISK_CMD__ 191 | 192 | %end 193 | 194 | %post --interpreter /bin/sh 195 | 196 | echo -n "Network fixes" 197 | # initscripts don't like this file to be missing. 198 | cat > /etc/sysconfig/network << EOF 199 | NETWORKING=yes 200 | NOZEROCONF=yes 201 | EOF 202 | 203 | # 'eth0' _is_ the predictable device name, since 204 | # we don't want to be tied to specific virtual (!) hardware 205 | rm -f /etc/udev/rules.d/70* 206 | ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules 207 | 208 | # simple eth0 config, again not hard-coded to the build hardware 209 | cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF 210 | DEVICE="eth0" 211 | BOOTPROTO="dhcp" 212 | ONBOOT="yes" 213 | TYPE="Ethernet" 214 | USERCTL="yes" 215 | PEERDNS="yes" 216 | IPV6INIT="no" 217 | PERSISTENT_DHCLIENT="1" 218 | EOF 219 | 220 | # generic localhost names 221 | cat > /etc/hosts << EOF 222 | 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 223 | ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 224 | 225 | EOF 226 | echo . 227 | # make sure firstboot doesn't start 228 | echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot 229 | #add user oracle password oracle in wheel ie sudo 230 | useradd -G wheel oracle 231 | echo "oracle:oracle" | chpasswd 232 | %end 233 | -------------------------------------------------------------------------------- /upload/buildTimeConfigureHRREST.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeConfigureHRREST.sh 22 | # 23 | # Description: REST enable HR schema 24 | # 25 | ################################################################################# 26 | 27 | 28 | export CON=localhost:1521/ORCL 29 | export MYSYSTEMPASSWORD=oracle 30 | export SQLPATH=/home/oracle/ReBuildScriptSQLDev_HR 31 | export NEWUSER=hrrest 32 | export NEWPASSWORD=oracle 33 | echo " 34 | define your_Connect_String=$CON 35 | Rem NAME 36 | Rem HOScreateAccounts.sql - clones Sample Schema objects into hr accounts 37 | Rem 38 | Rem DESCRIPTION 39 | Rem In classrooms, there is sometimes the need to make the Sample 40 | Rem Schemas objects available within a series of individual schemas 41 | Rem This script makes this cloning process easier. 42 | Rem This script frops and creates the HR Human Resources schema 43 | Rem 44 | REM When it runs, DBAs will be prompted for the SYSTEM password and Connect String 45 | REM 46 | Rem COMMENT 47 | REM There are other scripts for creating 26 users for each of OE and HR. 48 | REM Use the other script for creating multiple users. 49 | REM NB: THIS SCRIPT DROPS AND CREATES 1 schema 50 | Rem 51 | Rem Created 15-Feb-2005 jgallus 52 | REM Updated for PM workshop by Sue Harper 2 March 2005 53 | REM Updates include the synonyms between HR and OE and popluting some data. 54 | REM Update Feb2011 to exclude OE. i.e this only rebuilds HR for Developer Days 55 | 56 | SET FEEDBACK 1 57 | SET ECHO OFF 58 | 59 | 60 | Prompt Connecting as SYSTEM to create hr 61 | Prompt Ensure you enter values for the following parameters. 62 | Connect SYSTEM/$MYSYSTEMPASSWORD@&&your_Connect_String 63 | 64 | spool cre_hr.log 65 | 66 | 67 | DROP USER $NEWUSER CASCADE; 68 | 69 | CREATE USER $NEWUSER IDENTIFIED BY oracle 70 | DEFAULT TABLESPACE users 71 | TEMPORARY TABLESPACE temp 72 | QUOTA UNLIMITED ON users; 73 | 74 | GRANT create session 75 | , create table 76 | , create procedure 77 | , create sequence 78 | , create trigger 79 | , create view 80 | , create synonym 81 | , alter session 82 | , create type 83 | , create materialized view 84 | , query rewrite 85 | , create dimension 86 | , create any directory 87 | , alter user 88 | , resumable 89 | , ALTER ANY TABLE -- These 90 | , DROP ANY TABLE -- five are 91 | , LOCK ANY TABLE -- needed 92 | , CREATE ANY TABLE -- to use 93 | , SELECT ANY TABLE -- DBMS_REDEFINITION 94 | TO $NEWUSER; 95 | 96 | GRANT select_catalog_role 97 | , execute_catalog_role 98 | TO $NEWUSER; 99 | 100 | REM connect to user account and invoke the scripts that create schema objects. 101 | REM the location of the demo scrip files in in the \Ora<90><10>\... 102 | 103 | CONNECT $NEWUSER/$NEWPASSWORD@&&your_Connect_String 104 | 105 | Prompt hr_cre 106 | @@hr_cre 107 | 108 | Prompt hr_popul 109 | @@hr_popul 110 | 111 | Prompt hr_idx 112 | @@hr_idx 113 | 114 | Prompt hr_code 115 | @@hr_code 116 | 117 | Prompt hr_comnt 118 | @@hr_comnt 119 | 120 | Prompt What OBJECTS were created? 121 | column object_name format a30 122 | column object_type format a30 123 | 124 | CONNECT $NEWUSER/$NEWPASSWORD@&&your_Connect_String 125 | select object_name, object_type from user_objects order by object_type; 126 | Prompt Are there any INVALID OBJECTS? 127 | select object_name from user_objects where status='INVALID'; 128 | Prompt Are there any INVALID OBJECTS? 129 | select object_name from user_objects where status='INVALID'; 130 | " | sqlplus system/$MYSYSTEMPASSWORD@$CON 131 | sqlplus $NEWUSER/$NEWPASSWORD@$CON @/home/oracle/bin/buildTimeRestEnableHR.sql 132 | -------------------------------------------------------------------------------- /upload/buildTimeCreateLD_LIBRARY_PATHShellWrappers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeCreateLD_LIBRARY_PATHShellWrappers.sh 22 | # 23 | # Description: LD_LIBRARY_PATH workaround so oracle shipped libraries only used when necessary 24 | # 25 | ################################################################################# 26 | 27 | 28 | rm -rf ~/LDLIB/ 29 | . ~/bin/dbenv 30 | cd $ORACLE_HOME/bin 31 | if ! test -d ~/LDLIB/ 32 | then 33 | mkdir ~/LDLIB/ 34 | for f in *; do 35 | if test "$f" != 'oracle' 36 | then 37 | if test "$f" != 'sql' 38 | then 39 | echo '#!/bin/bash 40 | . ~/bin/dbenv 41 | $ORACLE_HOME/bin/'"$f"' "$@"'>~/LDLIB/$f 42 | fi 43 | fi 44 | done 45 | chmod 755 ~/LDLIB/* 46 | rm ~/LDLIB/oraenv 47 | rm ~/LDLIB/coraenv 48 | fi 49 | -------------------------------------------------------------------------------- /upload/buildTimeEnd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeEnd.sh 22 | # 23 | # Description: Centralised end of script Progress reporting script. 24 | # 25 | ################################################################################# 26 | 27 | 28 | echo $0 | grep _inner > /dev/null 2>&1 29 | if test "m$?" = "m0" 30 | then 31 | export SHNOW=`date +%s` 32 | export SHDUR=`expr $SHNOW - $SHSTART` 33 | echo PROGRESS: Ending $VMSCRIPTNAME Ended: `date +%k:%M:%S` Duration: `printf '%02dh:%02dm:%02ds\n' $(($SHDUR/3600)) $(($SHDUR%3600/60)) $(($SHDUR%60))` 34 | fi 35 | #pstree -s $$ | grep '\-pstree'| sed 's/pstree//g' | sed "sZ.*--$TOPNAME-ZZg" 36 | #pstree -s $$ | sed 's/pstree//g' #also to log file 37 | -------------------------------------------------------------------------------- /upload/buildTimeEndOfAllScripts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeEndOfAllScripts.sh 22 | # 23 | # Description: Helper script to print PROGRES:... on end of everything 24 | # 25 | ################################################################################# 26 | 27 | echo PROGRESS: END OF SCRIPT: 4/4 for tracing information see local file log.zip 28 | -------------------------------------------------------------------------------- /upload/buildTimeFatReleaseCOPYFORFAT.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ################################################################################# 19 | 20 | . /home/oracle/.bashrc 21 | newpdbords 22 | 9090init 23 | #on ords 9090 reset we want reinstall not uninstall 24 | touch ~/.ordsreinstall 25 | #note 9090init has a 3 minute wait to ensure ords has started 26 | -------------------------------------------------------------------------------- /upload/buildTimeMoveUserFilesInTmp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeMoveUserFilesInTmp.sh 22 | # 23 | # Description: take version out of name and mv from /tmp/put_files_here to /tmp/1 24 | ################################################################################# 25 | 26 | 27 | echo "export BUILD_STOPAT=ALL 28 | export BUILD_HAVEPATCH=TRUE" > /tmp/1/BUILD_CONFIG.sh 29 | #old style 30 | export USHOME=/tmp/put_files_here 31 | export BUILDHOME=$USHOME 32 | export EURHOME=$USHOME 33 | export DATABASE1URL=$USHOME/LINUX.X64_*_db_home.zip 34 | export DEMOSURL=$BUILDHOME/demos.zip 35 | export JAVAURL=$EURHOME/jdk-8u*-linux-x64.tar.gz 36 | export SQLDEVURL=$BUILDHOME/sqldeveloper-*-no-jre.zip 37 | export SQLCLURL=$EURHOME/sqlcl*.zip 38 | export APEXURL=$EURHOME/apex_*.zip 39 | export ORDSURL=$EURHOME/ords*.zip 40 | export MODELLER=$EURHOME/datamodeler-*-no-jre.zip 41 | export MOZILLABLOB=$EURHOME/mozillablob.zip 42 | export RESTCLIENTUI=$EURHOME/restclient*.jar 43 | export STORM=$USHOME/storm.zip 44 | export RESETXMLDBJSON=$USHOME/reset_xmldbjson 45 | export SAMPLESCHEMAS=$USHOME/master.zip 46 | export JDBCREST=$USHOME/oracle.dbtools.jdbcrest*.jar 47 | export WALLET=$USHOME/cwallet.sso 48 | function download() { 49 | #echo OUTPUT $2 SOURCE $1 50 | mv $1 "$2" 51 | if test "m$?" != "m0" 52 | then 53 | if test "m$1" = "mLINUX.X64_*_db_home.zip" 54 | then 55 | echo PROGRESS: XXXXXXXXXXXXXX mv for essential "$2" failed XXXXXXXXXXXX 56 | else 57 | echo PROGRESS: XXXXXXXXXXXXXX mv for optional "$2" failed XXXXXXXXXXXX 58 | fi 59 | exit 1 60 | fi 61 | } 62 | export -f download 63 | #linuxx64_122_database.zip 64 | printf "$DATABASE1URL\n/tmp/1/LINUX.X64_180000_db_home.zip\n$JAVAURL\n/tmp/1/jdk8x64.tar.gz\n$SQLDEVURL\n/tmp/1/sqldev.zip\n$SQLCLURL\n/tmp/1/sqlcl.zip\n$APEXURL\n/tmp/1/apex.zip\n$ORDSURL\n/tmp/1/ords.zip\n$DEMOSURL\n/tmp/1/demos.zip\n$MOZILLABLOB\n/tmp/1/mozillablob.zip\n$MODELLER\n/tmp/1/modeler.zip\n$RESTCLIENTUI\n/tmp/1/restclient.jar\n$STORM\n/tmp/1/storm.zip\n$RESETXMLDBJSON\n/tmp/1/reset_xmldbjson\n$SAMPLESCHEMAS\n/tmp/1/master.zip\n$WALLET\n/tmp/1/cwallet.sso" | xargs -n2 -P3 bash -c 'download "$0" "$1"' 65 | if test "m$?" != "m0" 66 | then 67 | echo PROGRESS: XXXXXXXXXXXXXX parallel mv failed XXXXXXXXXXXXXX 68 | #exit 1 69 | fi 70 | chmod -R 777 /tmp/1/* 71 | chown oracle /tmp/1/* 72 | -------------------------------------------------------------------------------- /upload/buildTimeReportSkippingFile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeReportSkippingFile.sh 22 | # 23 | # Description: helper script what to say on optional file missing 24 | # 25 | ################################################################################# 26 | 27 | 28 | echo PROGRESS: Optional "$1" not found skipping 29 | -------------------------------------------------------------------------------- /upload/buildTimeResizeIcon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeResizeIcon.sh 22 | # 23 | # Description: after first boot 'in gnome' script - set icon large 24 | # 25 | ################################################################################# 26 | 27 | 28 | #allow for 50 retries 500 for first xrandr and error out on 7 seconds. 29 | #set -x 30 | doseveral() { 31 | export start=`date -u +%s` 32 | #export exe="$1" 33 | export tries=$2 34 | export SOFAR=0; 35 | #echo $exe 36 | while true 37 | do 38 | result=`bash -x ~/repeat.setsize` 39 | if test "m$?" = "m0" 40 | then 41 | echo "RESULT=$result" 42 | break; 43 | else 44 | echo "RESULT=$result" 45 | export SOFAR=`expr $SOFAR + 1` 46 | if test "m$SOFAR" = "m$tries" 47 | then 48 | exit 1 49 | fi 50 | export now=`date -u +%s` 51 | export diff=`expr $now - $start` 52 | if test $diff -gt $3 53 | then 54 | exit 1 55 | fi 56 | #sleep for a fraction of a second otherwise all our retries will be time of failure 57 | sleep 0.05 58 | fi 59 | done 60 | } 61 | #echo 'echo iconsizesetup skupped as no longer on desktop>> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 62 | echo '(gvfs-set-attribute ~/Desktop/"Click here to Start.desktop" metadata::icon-scale "5.58333333333"&&gvfs-set-attribute ~/Desktop/"Click here to Start.desktop" metadata::nautilus-icon-position "20,222" )>> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 63 | #echo '(echo gvfs-set-attribute ~/Desktop/"Click here to Start.desktop" metadata::nautilus-icon-scale "5.58333333333"&&gvfs-set-attribute ~/Desktop/"Click here to Start.desktop" metadata::icon-scale "5.58333333333"&&echo gvfs-set-attribute ~/Desktop/"Click here to Start.desktop" metadata::nautilus-icon-position "20,222" )>> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 64 | doseveral x 50 7 65 | echo xrandr > ~/repeat.setsize 66 | doseveral x 500 7 67 | echo result="$result" >> ~oracle/setsize.log 68 | 69 | export result=`echo "$result" | grep -e " connected [^(]" | sed -e "sX\([A-Z0-9a-z/_-]\+\) connected.*X\1X"` 70 | echo GREPRESULT="$result" >> ~oracle/setsize.log 71 | echo 'xrandr --output '"$result"' --mode 800x600 >> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 72 | doseveral x 50 7 73 | #echo 'echo size set skipped not on desktop >> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 74 | echo '(gvfs-set-attribute ~/Desktop/"Click here to Start.desktop" metadata::icon-scale "5.58333333333"&&gvfs-set-attribute ~/Desktop/"Click here to Start.desktop" metadata::nautilus-icon-position "20,222" )>> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 75 | doseveral x 50 7 76 | 77 | if test -f ~/runTimeEnforceMinScreenSize.sh.redoicon 78 | then 79 | echo icon move already done once 80 | else 81 | cp ~/runTimeEnforceMinScreenSize.sh ~/runTimeEnforceMinScreenSize.sh.redoicon 82 | cat ~/runTimeEnforceMinScreenSize.sh.redoicon | sed 's/gvfs-set-attribute/echo gvfs-set-attribute/g' > ~/runTimeEnforceMinScreenSize.sh 83 | chmod 755 ~/runTimeEnforceMinScreenSize.sh 84 | fi 85 | 86 | -------------------------------------------------------------------------------- /upload/buildTimeRestEnableHR.sql: -------------------------------------------------------------------------------- 1 | 2 | REM 3 | REM Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 4 | REM 5 | REM Licensed under the Apache License, Version 2.0 (the "License"); 6 | REM you may not use this file except in compliance with the License. 7 | REM You may obtain a copy of the License at 8 | REM 9 | REM http://www.apache.org/licenses/LICENSE-2.0 10 | REM 11 | REM Unless required by applicable law or agreed to in writing, software 12 | REM distributed under the License is distributed on an "AS IS" BASIS, 13 | REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | REM See the License for the specific language governing permissions and 15 | REM limitations under the License. 16 | REM 17 | 18 | REM 19 | REM 20 | REM File: buildTimeRestEnableHR.sql 21 | REM 22 | REM Description: rest enable hr schema - and hr schema tables. 23 | REM 24 | REM 25 | 26 | 27 | --http://krisrice.blogspot.com/2015/06/ords-auto-rest-table-feature.html 28 | define TOORDS=ORDS 29 | define THETABLES="'REGIONS','LOCATIONS','DEPARTMENTS','JOBS','EMPLOYEES','JOB_HISTORY','COUNTRIES'" 30 | --connect hr/oracle 31 | BEGIN 32 | &TOORDS..ENABLE_SCHEMA; 33 | commit; 34 | end; 35 | / 36 | 37 | begin 38 | declare 39 | type array_t is table of varchar2(100); 40 | names array_t := array_t(&THETABLES); 41 | begin 42 | FOR i IN names.FIRST .. names.LAST 43 | LOOP 44 | &TOORDS..ENABLE_OBJECT(p_enabled => TRUE, 45 | -- skip schema default to user? p_schema => 'THESCHEMA', 46 | p_object => names(i), 47 | p_object_type => 'TABLE', 48 | p_object_alias => LOWER(names(i)), 49 | p_auto_rest_auth => FALSE); 50 | END LOOP; 51 | end; 52 | 53 | commit; 54 | END; 55 | / 56 | exit 0; 57 | --example address: http://localhost:8080/ords/__THE_SCHEMA__/employees/ 58 | -------------------------------------------------------------------------------- /upload/buildTimeRootU01Chown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeRootU01Chown.sh 22 | # 23 | # Description: small file with minor root chmods 24 | # 25 | ################################################################################# 26 | 27 | 28 | #mkdir /u01 29 | chmod 755 /u01 30 | chown oracle /u01 31 | chgrp dba /u01 32 | echo 127.0.0.1 vbgeneric vbgeneric.localdomain >> /etc/hosts 33 | -------------------------------------------------------------------------------- /upload/buildTimeSetupRestClient.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeSetupRestClient.sh 22 | # 23 | # Description: set up rest client if it is supplied 24 | # 25 | ################################################################################# 26 | 27 | 28 | if test -f /tmp/1/restclient.jar 29 | then 30 | cp /tmp/1/restclient.jar ~/restclient.jar 31 | chmod 755 ~/restclient.jar 32 | echo '#!/bin/bash 33 | . ~/.bashrc 34 | java -jar ~/restclient.jar' > ~/bin/buildTimeSetupRestClient.sh 35 | chmod 755 ~/bin/buildTimeSetupRestClient.sh 36 | #go through @/.bashrc to make sure local/latest/unziped java is used. 37 | echo '#!/usr/bin/env xdg-open 38 | 39 | [Desktop Entry] 40 | Version=1.0 41 | Type=Application 42 | Terminal=false 43 | Icon[en_US]=gnome-panel-launcher 44 | Name[en_US]=Rest Client 45 | Exec=/home/oracle/bin/buildTimeSetupRestClient.sh 46 | Name=Rest Client'> /home/oracle/Desktop/'Rest Client.desktop' 47 | chmod 755 /home/oracle/Desktop/'Rest Client.desktop' 48 | export LD_LIBRARY_PATH= 49 | cd ~/Desktop 50 | dbus-launch gio set "Rest Client.desktop" "metadata::trusted" yes 51 | fi 52 | -------------------------------------------------------------------------------- /upload/buildTimeStillInstalling: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: buildTimeStillInstalling 22 | # 23 | # Description: flag to set LD_LIBRARY_PATH when installing 24 | ################################################################################# 25 | #LD_LIBRARY_PATH 26 | #test for this that you are still installing. -------------------------------------------------------------------------------- /upload/createnewpdb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: createnewpdb 22 | # 23 | # Description: as title - user script so no long descriptive rename 24 | # 25 | ################################################################################# 26 | 27 | 28 | #set -x 29 | # VM SPECIFIC/ testing only/ not for production use 30 | export BASESEED=/u01/app/oracle/oradata/ORCLCDB 31 | export DEFAULTNEWPDBNAME=ORDS 32 | export CONNECT=/ 33 | export TNSNAMESFILE=$ORACLE_HOME/network/admin/tnsnames.ora 34 | export THEPORT=1521 35 | export ADMINUSER=oracle 36 | export ADMINPASSWORD=oracle 37 | export USERSTABLESPACESIZE=50M 38 | #notes for test VM '$1' is the wanted pdb 39 | #note you could use CONNECT=sys/password@SOME_TNS_ENTRY (and update BASESEED) - the text 'as sysdba' is added on CONNECT use (TNSNAMES entry update would be local, and 32k test would fail if pdbseed not already updated) 40 | #plan create pdb/set password do not expire/32kvarchar/pdb open by default/on success put entry in '$ORACLE_HOME/network/admin/tnsnames.ora' approximate cost 4gb disk space or less 41 | #show vdb| grep PDB?? whenever sqlerror exit 1 whenever oserror exit 1 for now 42 | echo "THIS WILL UNSET TWO_TASK AND CONNECT AS sqlplus $CONNECT as sysdba TO YOUR DATABASE and run sql... 43 | pdb being created admin user $ADMINUSER 44 | press y to proceed will cost about 1.1GB disk space and take about 2 minutes [y/n]" 45 | read line 46 | if test "m$line" != "my" 47 | then 48 | echo $line is not y 49 | exit 1 50 | fi 51 | 52 | export PDB=$1 53 | if test "m$PDB" = "m" 54 | then 55 | export PDB=$DEFAULTNEWPDBNAME 56 | fi 57 | #todo check pdb exist ? for now let sql exit on error 58 | if test -f /home/oracle/unzipdemos/master.zip 59 | then 60 | export NOOP=NOOP 61 | else 62 | echo Warning demo schema not being installed as not present at /home/oracle/unzipdemos/master.zip 63 | export EXITEARLY="exit 0" 64 | fi 65 | if test "m$EXITEARLY" = "m" 66 | then 67 | export TWO_TASK= 68 | cd /home/oracle/unzipdemos 69 | if test -d /home/oracle/unzipdemos/db-sample-schemas-master 70 | then 71 | echo samples unzipped 72 | cd db-sample-schemas-master 73 | else 74 | unzip master.zip 75 | cd db-sample-schemas-master 76 | mkdir log 77 | perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat 78 | #ln -s `pwd`/db-sample-schemas-master __SUB__CWD__ 79 | #HR only - OE mkdirs etc on the file system - not multiple pdb friendly 80 | cp /home/oracle/unzipdemos/db-sample-schemas-master/human_resources/hr_main.sql /home/oracle/unzipdemos/db-sample-schemas-master/human_resources/hr_main.sql.noexit 81 | (cat /home/oracle/unzipdemos/db-sample-schemas-master/human_resources/hr_main.sql.noexit ; echo " 82 | exit 0") > /home/oracle/unzipdemos/db-sample-schemas-master/human_resources/hr_main.sql 83 | fi 84 | fi 85 | echo "whenever sqlerror exit 1; 86 | whenever oserror exit 1; 87 | set echo on 88 | set verify on 89 | CREATE PLUGGABLE DATABASE $PDB admin user $ADMINUSER IDENTIFIED BY $ADMINPASSWORD 90 | DEFAULT TABLESPACE USERS 91 | DATAFILE '$BASESEED/$PDB/users01.dbf' SIZE $USERSTABLESPACESIZE AUTOEXTEND ON 92 | FILE_NAME_CONVERT = ('$BASESEED/pdbseed/', '$BASESEED/$PDB/'); 93 | alter pluggable database $PDB open; 94 | alter session set container=$PDB; 95 | --up by default 96 | alter pluggable database $PDB save state; 97 | --no password expire - testing only... remove if this is not required 98 | alter profile DEFAULT limit password_life_time UNLIMITED; 99 | --this will error if 32k not in seed remove if 32k check not needed/add 32k setup (not checked) if 32k needed and pdbseed not updated add (alpha) 32kinstall code below (shuts down starts up) 100 | create table t_almostunique ( x varchar(32767) ); 101 | insert into 102 | t_almostunique values ( rpad('*',32000,'*') ); 103 | select length(x) from t_almostunique; 104 | drop table t_almostunique; 105 | --32kvarchar2 on new pluggable might not even need full cdb stop/start actually this is set in pdbDOLLARseed on VM and cdb on VM - need to confirm 32k works on newly created VM pdb without this code - CONFIRMED 106 | --alter session set container=CDB"'$'"ROOT; 107 | --IGNORE FOR VM START 108 | --shutdown immediate 109 | --startup upgrade 110 | --alter pluggable database $PDB open upgrade; 111 | --alter session set container=$PDB; 112 | --alter system set max_string_size=EXTENDED; 113 | --@?/rdbms/admin/utl32k.sql 114 | --alter session set container=CDB"'$'"ROOT; 115 | --shutdown immediate 116 | --startup 117 | --IGNORE FOR VM END 118 | --create HR 119 | --drops before create 120 | whenever sqlerror continue 121 | --host commant auto exits 122 | whenever oserror continue 123 | $EXITEARLY 124 | @/home/oracle/unzipdemos/db-sample-schemas-master/mksample oracle oracle oracle oracle oracle oracle oracle oracle USERS TEMP /tmp/ localhost:$THEPORT/$PDB 125 | select 'HR schema only installed' from dual; 126 | exit 0 127 | " | sqlplus $CONNECT as sysdba 128 | export THEEXIT=$? 129 | if test $THEEXIT -ne 0 130 | then 131 | echo EXITTED WITH $THEEXIT 132 | else 133 | echo "create or replace trigger EMPLOYEES_EMPLOYEE_ID_TRG 134 | before insert on employees 135 | for each row 136 | begin 137 | if :new.employee_id is null then 138 | select employees_seq.nextval into :new.employee_id from sys.dual; 139 | end if; 140 | end; 141 | / 142 | "| sqlplus hr/oracle@localhost:1521/$PDB 143 | echo adding entry to $TNSNAMESFILE 144 | echo " 145 | $PDB = 146 | (DESCRIPTION = 147 | (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = $THEPORT)) 148 | (CONNECT_DATA = 149 | (SERVER = DEDICATED) 150 | (SERVICE_NAME = $PDB) 151 | ) 152 | ) 153 | " >> $TNSNAMESFILE 154 | fi 155 | exit $THEEXIT 156 | -------------------------------------------------------------------------------- /upload/createnewpdbminhr: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: createnewpdbminhr 22 | # 23 | # Description: create new pdb with small set of files for HR schema. User runable so no long descriptive name. 24 | # 25 | ################################################################################# 26 | 27 | 28 | #set -x 29 | 30 | # VM SPECIFIC/ testing only/ not for production use 31 | export BASESEED=/u01/app/oracle/oradata/ORCLCDB 32 | export DEFAULTNEWPDBNAME=ORDS 33 | export CONNECT=/ 34 | export TNSNAMESFILE=$ORACLE_HOME/network/admin/tnsnames.ora 35 | export THEPORT=1521 36 | export ADMINUSER=oracle 37 | export ADMINPASSWORD=oracle 38 | export USERSTABLESPACESIZE=50M 39 | #notes for test VM '$1' is the wanted pdb 40 | #note you could use CONNECT=sys/password@SOME_TNS_ENTRY (and update BASESEED) - the text 'as sysdba' 41 | #is added on CONNECT use (TNSNAMES entry update would be local, and 32k test would fail if pdbseed 42 | #not already updated) 43 | #plan create pdb/set password do not expire/32kvarchar/pdb open by default/on success put entry 44 | #in '$ORACLE_HOME/network/admin/tnsnames.ora' approximate cost 4gb disk space or less 45 | 46 | echo "THIS WILL UNSET TWO_TASK AND CONNECT AS sqlplus $CONNECT as sysdba TO YOUR DATABASE and run sql... 47 | pdb being created admin user $ADMINUSER 48 | press y to proceed will cost about 1.1GB disk space and take about 2 minutes [y/n]" 49 | 50 | read line 51 | 52 | if test "m$line" != "my" 53 | then 54 | echo $line is not y 55 | exit 1 56 | fi 57 | 58 | export PDB=$1 59 | if test "m$PDB" = "m" 60 | then 61 | export PDB=$DEFAULTNEWPDBNAME 62 | fi 63 | #todo check pdb exist ? for now let sql exit on error 64 | 65 | export TWO_TASK= 66 | 67 | # 68 | # setup PDB create script 69 | # 70 | echo "whenever sqlerror exit 1; 71 | whenever oserror exit 1; 72 | set echo on 73 | set verify on 74 | CREATE PLUGGABLE DATABASE $PDB admin user $ADMINUSER IDENTIFIED BY $ADMINPASSWORD 75 | DEFAULT TABLESPACE USERS 76 | DATAFILE '$BASESEED/$PDB/users01.dbf' SIZE $USERSTABLESPACESIZE AUTOEXTEND ON 77 | FILE_NAME_CONVERT = ('$BASESEED/pdbseed/', '$BASESEED/$PDB/'); 78 | 79 | alter pluggable database $PDB open; 80 | alter session set container=$PDB; 81 | --up by default 82 | alter pluggable database $PDB save state; 83 | 84 | --no password expire - testing only... remove if this is not required 85 | alter profile DEFAULT limit password_life_time UNLIMITED; 86 | 87 | --this will error if 32k not in seed remove if 32k check not needed/add 32k setup (not checked) 88 | --if 32k needed and pdbseed not updated add (alpha) 32kinstall code below (shuts down starts up) 89 | create table t_almostunique ( x varchar(32767) ); 90 | insert into 91 | t_almostunique values ( rpad('*',32000,'*') ); 92 | 93 | select length(x) from t_almostunique; 94 | drop table t_almostunique; 95 | 96 | --32kvarchar2 on new pluggable might not even need full cdb stop/start actually this is set 97 | --in pdbDOLLARseed on VM and cdb on VM - need to confirm 32k works on newly created VM pdb without this code - CONFIRMED 98 | --alter session set container=CDB"'$'"ROOT; 99 | --IGNORE FOR VM START 100 | --shutdown immediate 101 | --startup upgrade 102 | --alter pluggable database $PDB open upgrade; 103 | --alter session set container=$PDB; 104 | --alter system set max_string_size=EXTENDED; 105 | --@?/rdbms/admin/utl32k.sql 106 | --alter session set container=CDB"'$'"ROOT; 107 | --shutdown immediate 108 | --startup 109 | --IGNORE FOR VM END 110 | --create HR 111 | --drops before create 112 | whenever sqlerror continue 113 | --host commant auto exits 114 | whenever oserror continue 115 | 116 | --@/home/oracle/unzipdemos/db-sample-schemas-master/mksample oracle oracle oracle oracle oracle oracle oracle oracle USERS TEMP /tmp/ localhost:$THEPORT/$PDB 117 | select 'HR schema install reinserted' from dual; 118 | exit 0 119 | " | sqlplus $CONNECT as sysdba 120 | 121 | # 122 | # Check the return and see it exited gracefully 123 | # 124 | export THEEXIT=$? 125 | if test $THEEXIT -ne 0 126 | then 127 | echo EXITTED WITH $THEEXIT 128 | else 129 | echo adding entry to $TNSNAMESFILE 130 | echo " 131 | $PDB = 132 | (DESCRIPTION = 133 | (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = $THEPORT)) 134 | (CONNECT_DATA = 135 | (SERVER = DEDICATED) 136 | (SERVICE_NAME = $PDB) 137 | ) 138 | ) 139 | " >> $TNSNAMESFILE 140 | 141 | #for install only configurehr has details hardcoded. 142 | ~/bin/runTimeConfigureHR.sh 143 | fi 144 | exit $THEEXIT 145 | -------------------------------------------------------------------------------- /upload/custom_postSetupDemos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ################################################################################# 19 | 20 | if test -f /tmp/1/loadCoffeeShopApplication.sh 21 | then 22 | su oracle -c "bash -x /tmp/1/loadCoffeeShopApplication.sh" 23 | fi 24 | if test -f /tmp/1/buildTimeFatRelease.sh 25 | then 26 | su - oracle -c "bash -x /tmp/1/buildTimeFatRelease.sh" 27 | fi 28 | -------------------------------------------------------------------------------- /upload/hr_code.sql: -------------------------------------------------------------------------------- 1 | Rem 2 | Rem Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3 | Rem 4 | Rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | Rem you may not use this file except in compliance with the License. 6 | Rem You may obtain a copy of the License at 7 | Rem 8 | Rem http://www.apache.org/licenses/LICENSE-2.0 9 | Rem 10 | Rem Unless required by applicable law or agreed to in writing, software 11 | Rem distributed under the License is distributed on an "AS IS" BASIS, 12 | Rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | Rem See the License for the specific language governing permissions and 14 | Rem limitations under the License. 15 | Rem 16 | Rem Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 17 | Rem 18 | Rem Licensed under the Apache License, Version 2.0 (the "License"); 19 | Rem you may not use this file except in compliance with the License. 20 | Rem You may obtain a copy of the License at 21 | Rem 22 | Rem http://www.apache.org/licenses/LICENSE-2.0 23 | Rem 24 | Rem Unless required by applicable law or agreed to in writing, software 25 | Rem distributed under the License is distributed on an "AS IS" BASIS, 26 | Rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 27 | Rem See the License for the specific language governing permissions and 28 | Rem limitations under the License. 29 | Rem 30 | Rem 31 | Rem NAME 32 | Rem hr_code.sql - Create procedural objects for HR schema 33 | Rem 34 | Rem DESCRIPTION 35 | Rem Create a statement level trigger on EMPLOYEES 36 | Rem to allow DML during business hours. 37 | Rem Create a row level trigger on the EMPLOYEES table, 38 | Rem after UPDATES on the department_id or job_id columns. 39 | Rem Create a stored procedure to insert a row into the 40 | Rem JOB_HISTORY table. Have the above row level trigger 41 | Rem row level trigger call this stored procedure. 42 | Rem 43 | Rem NOTES 44 | Rem 45 | Rem CREATED by Nancy Greenberg - 06/01/00 46 | Rem 47 | Rem MODIFIED (MM/DD/YY) 48 | Rem ahunold 05/11/01 - disable 49 | Rem ahunold 03/03/01 - HR simplification, REGIONS table 50 | Rem ahunold 02/20/01 - Created 51 | Rem 52 | 53 | SET FEEDBACK 1 54 | SET NUMWIDTH 10 55 | SET LINESIZE 80 56 | SET TRIMSPOOL ON 57 | SET TAB OFF 58 | SET PAGESIZE 100 59 | SET ECHO OFF 60 | 61 | REM ************************************************************************** 62 | 63 | REM procedure and statement trigger to allow dmls during business hours: 64 | CREATE OR REPLACE PROCEDURE secure_dml 65 | IS 66 | BEGIN 67 | IF TO_CHAR (SYSDATE, 'HH24:MI') NOT BETWEEN '08:00' AND '18:00' 68 | OR TO_CHAR (SYSDATE, 'DY') IN ('SAT', 'SUN') THEN 69 | RAISE_APPLICATION_ERROR (-20205, 70 | 'You may only make changes during normal office hours'); 71 | END IF; 72 | END secure_dml; 73 | / 74 | 75 | CREATE OR REPLACE TRIGGER secure_employees 76 | BEFORE INSERT OR UPDATE OR DELETE ON employees 77 | BEGIN 78 | secure_dml; 79 | END secure_employees; 80 | / 81 | 82 | ALTER TRIGGER secure_employees DISABLE; 83 | 84 | REM ************************************************************************** 85 | REM procedure to add a row to the JOB_HISTORY table and row trigger 86 | REM to call the procedure when data is updated in the job_id or 87 | REM department_id columns in the EMPLOYEES table: 88 | 89 | CREATE OR REPLACE PROCEDURE add_job_history 90 | ( p_emp_id job_history.employee_id%type 91 | , p_start_date job_history.start_date%type 92 | , p_end_date job_history.end_date%type 93 | , p_job_id job_history.job_id%type 94 | , p_department_id job_history.department_id%type 95 | ) 96 | IS 97 | BEGIN 98 | INSERT INTO job_history (employee_id, start_date, end_date, 99 | job_id, department_id) 100 | VALUES(p_emp_id, p_start_date, p_end_date, p_job_id, p_department_id); 101 | END add_job_history; 102 | / 103 | 104 | CREATE OR REPLACE TRIGGER update_job_history 105 | AFTER UPDATE OF job_id, department_id ON employees 106 | FOR EACH ROW 107 | BEGIN 108 | add_job_history(:old.employee_id, :old.hire_date, sysdate, 109 | :old.job_id, :old.department_id); 110 | END; 111 | / 112 | 113 | COMMIT; 114 | 115 | -------------------------------------------------------------------------------- /upload/hr_comnt.sql: -------------------------------------------------------------------------------- 1 | Rem 2 | Rem Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3 | Rem 4 | Rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | Rem you may not use this file except in compliance with the License. 6 | Rem You may obtain a copy of the License at 7 | Rem 8 | Rem http://www.apache.org/licenses/LICENSE-2.0 9 | Rem 10 | Rem Unless required by applicable law or agreed to in writing, software 11 | Rem distributed under the License is distributed on an "AS IS" BASIS, 12 | Rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | Rem See the License for the specific language governing permissions and 14 | Rem limitations under the License. 15 | Rem 16 | Rem NAME 17 | Rem hr_comnt.sql - Create comments for HR schema 18 | Rem 19 | Rem DESCRIPTION 20 | Rem 21 | Rem 22 | Rem CREATED by Nancy Greenberg, Nagavalli Pataballa - 06/01/00 23 | Rem MODIFIED (MM/DD/YY) 24 | Rem ahunold 02/20/01 - New header 25 | Rem vpatabal 03/02/01 - Added comments for Regions table 26 | Rem - Removed references to currency symbol 27 | Rem and currency name columns of countries 28 | Rem - Removed comments to DN column of 29 | Rem employees and departments. 30 | Rem - Removed references to sequences 31 | 32 | SET FEEDBACK 1 33 | SET NUMWIDTH 10 34 | SET LINESIZE 80 35 | SET TRIMSPOOL ON 36 | SET TAB OFF 37 | SET PAGESIZE 100 38 | SET ECHO OFF 39 | 40 | COMMENT ON TABLE regions 41 | IS 'Regions table that contains region numbers and names. Contains 4 rows; references with the Countries table.'; 42 | 43 | COMMENT ON COLUMN regions.region_id 44 | IS 'Primary key of regions table.'; 45 | 46 | COMMENT ON COLUMN regions.region_name 47 | IS 'Names of regions. Locations are in the countries of these regions.'; 48 | 49 | COMMENT ON TABLE locations 50 | IS 'Locations table that contains specific address of a specific office, 51 | warehouse, and/or production site of a company. Does not store addresses / 52 | locations of customers. Contains 23 rows; references with the 53 | departments and countries tables. '; 54 | 55 | COMMENT ON COLUMN locations.location_id 56 | IS 'Primary key of locations table'; 57 | 58 | COMMENT ON COLUMN locations.street_address 59 | IS 'Street address of an office, warehouse, or production site of a company. 60 | Contains building number and street name'; 61 | 62 | COMMENT ON COLUMN locations.postal_code 63 | IS 'Postal code of the location of an office, warehouse, or production site 64 | of a company. '; 65 | 66 | COMMENT ON COLUMN locations.city 67 | IS 'A not null column that shows city where an office, warehouse, or 68 | production site of a company is located. '; 69 | 70 | COMMENT ON COLUMN locations.state_province 71 | IS 'State or Province where an office, warehouse, or production site of a 72 | company is located.'; 73 | 74 | COMMENT ON COLUMN locations.country_id 75 | IS 'Country where an office, warehouse, or production site of a company is 76 | located. Foreign key to country_id column of the countries table.'; 77 | 78 | 79 | REM ********************************************* 80 | 81 | COMMENT ON TABLE departments 82 | IS 'Departments table that shows details of departments where employees 83 | work. Contains 27 rows; references with locations, employees, and job_history tables.'; 84 | 85 | COMMENT ON COLUMN departments.department_id 86 | IS 'Primary key column of departments table.'; 87 | 88 | COMMENT ON COLUMN departments.department_name 89 | IS 'A not null column that shows name of a department. Administration, 90 | Marketing, Purchasing, Human Resources, Shipping, IT, Executive, Public 91 | Relations, Sales, Finance, and Accounting. '; 92 | 93 | COMMENT ON COLUMN departments.manager_id 94 | IS 'Manager_id of a department. Foreign key to employee_id column of employees table. The manager_id column of the employee table references this column.'; 95 | 96 | COMMENT ON COLUMN departments.location_id 97 | IS 'Location id where a department is located. Foreign key to location_id column of locations table.'; 98 | 99 | 100 | REM ********************************************* 101 | 102 | COMMENT ON TABLE job_history 103 | IS 'Table that stores job history of the employees. If an employee 104 | changes departments within the job or changes jobs within the department, 105 | new rows get inserted into this table with old job information of the 106 | employee. Contains a complex primary key: employee_id+start_date. 107 | Contains 25 rows. References with jobs, employees, and departments tables.'; 108 | 109 | COMMENT ON COLUMN job_history.employee_id 110 | IS 'A not null column in the complex primary key employee_id+start_date. 111 | Foreign key to employee_id column of the employee table'; 112 | 113 | COMMENT ON COLUMN job_history.start_date 114 | IS 'A not null column in the complex primary key employee_id+start_date. 115 | Must be less than the end_date of the job_history table. (enforced by 116 | constraint jhist_date_interval)'; 117 | 118 | COMMENT ON COLUMN job_history.end_date 119 | IS 'Last day of the employee in this job role. A not null column. Must be 120 | greater than the start_date of the job_history table. 121 | (enforced by constraint jhist_date_interval)'; 122 | 123 | COMMENT ON COLUMN job_history.job_id 124 | IS 'Job role in which the employee worked in the past; foreign key to 125 | job_id column in the jobs table. A not null column.'; 126 | 127 | COMMENT ON COLUMN job_history.department_id 128 | IS 'Department id in which the employee worked in the past; foreign key to deparment_id column in the departments table'; 129 | 130 | 131 | REM ********************************************* 132 | 133 | COMMENT ON TABLE countries 134 | IS 'country table. Contains 25 rows. References with locations table.'; 135 | 136 | COMMENT ON COLUMN countries.country_id 137 | IS 'Primary key of countries table.'; 138 | 139 | COMMENT ON COLUMN countries.country_name 140 | IS 'Country name'; 141 | 142 | COMMENT ON COLUMN countries.region_id 143 | IS 'Region ID for the country. Foreign key to region_id column in the departments table.'; 144 | 145 | REM ********************************************* 146 | 147 | COMMENT ON TABLE jobs 148 | IS 'jobs table with job titles and salary ranges. Contains 19 rows. 149 | References with employees and job_history table.'; 150 | 151 | COMMENT ON COLUMN jobs.job_id 152 | IS 'Primary key of jobs table.'; 153 | 154 | COMMENT ON COLUMN jobs.job_title 155 | IS 'A not null column that shows job title, e.g. AD_VP, FI_ACCOUNTANT'; 156 | 157 | COMMENT ON COLUMN jobs.min_salary 158 | IS 'Minimum salary for a job title.'; 159 | 160 | COMMENT ON COLUMN jobs.max_salary 161 | IS 'Maximum salary for a job title'; 162 | 163 | REM ********************************************* 164 | 165 | COMMENT ON TABLE employees 166 | IS 'employees table. Contains 107 rows. References with departments, 167 | jobs, job_history tables. Contains a self reference.'; 168 | 169 | COMMENT ON COLUMN employees.employee_id 170 | IS 'Primary key of employees table.'; 171 | 172 | COMMENT ON COLUMN employees.first_name 173 | IS 'First name of the employee. A not null column.'; 174 | 175 | COMMENT ON COLUMN employees.last_name 176 | IS 'Last name of the employee. A not null column.'; 177 | 178 | COMMENT ON COLUMN employees.email 179 | IS 'Email id of the employee'; 180 | 181 | COMMENT ON COLUMN employees.phone_number 182 | IS 'Phone number of the employee; includes country code and area code'; 183 | 184 | COMMENT ON COLUMN employees.hire_date 185 | IS 'Date when the employee started on this job. A not null column.'; 186 | 187 | COMMENT ON COLUMN employees.job_id 188 | IS 'Current job of the employee; foreign key to job_id column of the 189 | jobs table. A not null column.'; 190 | 191 | COMMENT ON COLUMN employees.salary 192 | IS 'Monthly salary of the employee. Must be greater 193 | than zero (enforced by constraint emp_salary_min)'; 194 | 195 | COMMENT ON COLUMN employees.commission_pct 196 | IS 'Commission percentage of the employee; Only employees in sales 197 | department elgible for commission percentage'; 198 | 199 | COMMENT ON COLUMN employees.manager_id 200 | IS 'Manager id of the employee; has same domain as manager_id in 201 | departments table. Foreign key to employee_id column of employees table. 202 | (useful for reflexive joins and CONNECT BY query)'; 203 | 204 | COMMENT ON COLUMN employees.department_id 205 | IS 'Department id where employee works; foreign key to department_id 206 | column of the departments table'; 207 | 208 | COMMIT; 209 | -------------------------------------------------------------------------------- /upload/hr_cre.sql: -------------------------------------------------------------------------------- 1 | Rem 2 | Rem Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3 | Rem 4 | Rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | Rem you may not use this file except in compliance with the License. 6 | Rem You may obtain a copy of the License at 7 | Rem 8 | Rem http://www.apache.org/licenses/LICENSE-2.0 9 | Rem 10 | Rem Unless required by applicable law or agreed to in writing, software 11 | Rem distributed under the License is distributed on an "AS IS" BASIS, 12 | Rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | Rem See the License for the specific language governing permissions and 14 | Rem limitations under the License. 15 | Rem 16 | Rem NAME 17 | Rem hr_cre.sql - Create data objects for HR schema 18 | Rem 19 | Rem DESCRIPTION 20 | Rem This script creates six tables, associated constraints 21 | Rem and indexes in the human resources (HR) schema. 22 | Rem 23 | Rem NOTES 24 | Rem 25 | Rem CREATED by Nancy Greenberg, Nagavalli Pataballa - 06/01/00 26 | Rem 27 | Rem MODIFIED (MM/DD/YY) 28 | Rem ahunold 09/14/00 - Added emp_details_view 29 | Rem ahunold 02/20/01 - New header 30 | Rem vpatabal 03/02/01 - Added regions table, modified regions 31 | Rem column in countries table to NUMBER. 32 | Rem Added foreign key from countries table 33 | Rem to regions table on region_id. 34 | Rem Removed currency name, currency symbol 35 | Rem columns from the countries table. 36 | Rem Removed dn columns from employees and 37 | Rem departments tables. 38 | Rem Added sequences. 39 | Rem Removed not null constraint from 40 | Rem salary column of the employees table. 41 | 42 | SET FEEDBACK 1 43 | SET NUMWIDTH 10 44 | SET LINESIZE 80 45 | SET TRIMSPOOL ON 46 | SET TAB OFF 47 | SET PAGESIZE 100 48 | SET ECHO OFF 49 | 50 | REM ******************************************************************** 51 | REM Create the REGIONS table to hold region information for locations 52 | REM HR.LOCATIONS table has a foreign key to this table. 53 | 54 | Prompt ****** Creating REGIONS table .... 55 | 56 | CREATE TABLE regions 57 | ( region_id NUMBER 58 | CONSTRAINT region_id_nn NOT NULL 59 | , region_name VARCHAR2(25) 60 | ); 61 | 62 | CREATE UNIQUE INDEX reg_id_pk 63 | ON regions (region_id); 64 | 65 | ALTER TABLE regions 66 | ADD ( CONSTRAINT reg_id_pk 67 | PRIMARY KEY (region_id) 68 | ) ; 69 | 70 | REM ******************************************************************** 71 | REM Create the COUNTRIES table to hold country information for customers 72 | REM and company locations. 73 | REM OE.CUSTOMERS table and HR.LOCATIONS have a foreign key to this table. 74 | 75 | Prompt ****** Creating COUNTRIES table .... 76 | 77 | CREATE TABLE countries 78 | ( country_id CHAR(2) 79 | CONSTRAINT country_id_nn NOT NULL 80 | , country_name VARCHAR2(40) 81 | , region_id NUMBER 82 | , CONSTRAINT country_c_id_pk 83 | PRIMARY KEY (country_id) 84 | ) 85 | ORGANIZATION INDEX; 86 | 87 | ALTER TABLE countries 88 | ADD ( CONSTRAINT countr_reg_fk 89 | FOREIGN KEY (region_id) 90 | REFERENCES regions(region_id) 91 | ) ; 92 | 93 | REM ******************************************************************** 94 | REM Create the LOCATIONS table to hold address information for company departments. 95 | REM HR.DEPARTMENTS has a foreign key to this table. 96 | 97 | Prompt ****** Creating LOCATIONS table .... 98 | 99 | CREATE TABLE locations 100 | ( location_id NUMBER(4) 101 | , street_address VARCHAR2(40) 102 | , postal_code VARCHAR2(12) 103 | , city VARCHAR2(30) 104 | CONSTRAINT loc_city_nn NOT NULL 105 | , state_province VARCHAR2(25) 106 | , country_id CHAR(2) 107 | ) ; 108 | 109 | CREATE UNIQUE INDEX loc_id_pk 110 | ON locations (location_id) ; 111 | 112 | ALTER TABLE locations 113 | ADD ( CONSTRAINT loc_id_pk 114 | PRIMARY KEY (location_id) 115 | , CONSTRAINT loc_c_id_fk 116 | FOREIGN KEY (country_id) 117 | REFERENCES countries(country_id) 118 | ) ; 119 | 120 | Rem Useful for any subsequent addition of rows to locations table 121 | Rem Starts with 3300 122 | 123 | CREATE SEQUENCE locations_seq 124 | START WITH 3300 125 | INCREMENT BY 100 126 | MAXVALUE 9900 127 | NOCACHE 128 | NOCYCLE; 129 | 130 | REM ******************************************************************** 131 | REM Create the DEPARTMENTS table to hold company department information. 132 | REM HR.EMPLOYEES and HR.JOB_HISTORY have a foreign key to this table. 133 | 134 | Prompt ****** Creating DEPARTMENTS table .... 135 | 136 | CREATE TABLE departments 137 | ( department_id NUMBER(4) 138 | , department_name VARCHAR2(30) 139 | CONSTRAINT dept_name_nn NOT NULL 140 | , manager_id NUMBER(6) 141 | , location_id NUMBER(4) 142 | ) ; 143 | 144 | CREATE UNIQUE INDEX dept_id_pk 145 | ON departments (department_id) ; 146 | 147 | ALTER TABLE departments 148 | ADD ( CONSTRAINT dept_id_pk 149 | PRIMARY KEY (department_id) 150 | , CONSTRAINT dept_loc_fk 151 | FOREIGN KEY (location_id) 152 | REFERENCES locations (location_id) 153 | ) ; 154 | 155 | Rem Useful for any subsequent addition of rows to departments table 156 | Rem Starts with 280 157 | 158 | CREATE SEQUENCE departments_seq 159 | START WITH 280 160 | INCREMENT BY 10 161 | MAXVALUE 9990 162 | NOCACHE 163 | NOCYCLE; 164 | 165 | REM ******************************************************************** 166 | REM Create the JOBS table to hold the different names of job roles within the company. 167 | REM HR.EMPLOYEES has a foreign key to this table. 168 | 169 | Prompt ****** Creating JOBS table .... 170 | 171 | CREATE TABLE jobs 172 | ( job_id VARCHAR2(10) 173 | , job_title VARCHAR2(35) 174 | CONSTRAINT job_title_nn NOT NULL 175 | , min_salary NUMBER(6) 176 | , max_salary NUMBER(6) 177 | ) ; 178 | 179 | CREATE UNIQUE INDEX job_id_pk 180 | ON jobs (job_id) ; 181 | 182 | ALTER TABLE jobs 183 | ADD ( CONSTRAINT job_id_pk 184 | PRIMARY KEY(job_id) 185 | ) ; 186 | 187 | REM ******************************************************************** 188 | REM Create the EMPLOYEES table to hold the employee personnel 189 | REM information for the company. 190 | REM HR.EMPLOYEES has a self referencing foreign key to this table. 191 | 192 | Prompt ****** Creating EMPLOYEES table .... 193 | 194 | CREATE TABLE employees 195 | ( employee_id NUMBER(6) 196 | , first_name VARCHAR2(20) 197 | , last_name VARCHAR2(25) 198 | CONSTRAINT emp_last_name_nn NOT NULL 199 | , email VARCHAR2(25) 200 | CONSTRAINT emp_email_nn NOT NULL 201 | , phone_number VARCHAR2(20) 202 | , hire_date DATE 203 | CONSTRAINT emp_hire_date_nn NOT NULL 204 | , job_id VARCHAR2(10) 205 | CONSTRAINT emp_job_nn NOT NULL 206 | , salary NUMBER(8,2) 207 | , commission_pct NUMBER(2,2) 208 | , manager_id NUMBER(6) 209 | , department_id NUMBER(4) 210 | , CONSTRAINT emp_salary_min 211 | CHECK (salary > 0) 212 | , CONSTRAINT emp_email_uk 213 | UNIQUE (email) 214 | ) ; 215 | 216 | CREATE UNIQUE INDEX emp_emp_id_pk 217 | ON employees (employee_id) ; 218 | 219 | 220 | ALTER TABLE employees 221 | ADD ( CONSTRAINT emp_emp_id_pk 222 | PRIMARY KEY (employee_id) 223 | , CONSTRAINT emp_dept_fk 224 | FOREIGN KEY (department_id) 225 | REFERENCES departments 226 | , CONSTRAINT emp_job_fk 227 | FOREIGN KEY (job_id) 228 | REFERENCES jobs (job_id) 229 | , CONSTRAINT emp_manager_fk 230 | FOREIGN KEY (manager_id) 231 | REFERENCES employees 232 | ) ; 233 | 234 | ALTER TABLE departments 235 | ADD ( CONSTRAINT dept_mgr_fk 236 | FOREIGN KEY (manager_id) 237 | REFERENCES employees (employee_id) 238 | ) ; 239 | 240 | 241 | Rem Useful for any subsequent addition of rows to employees table 242 | Rem Starts with 207 243 | 244 | 245 | CREATE SEQUENCE employees_seq 246 | START WITH 207 247 | INCREMENT BY 1 248 | NOCACHE 249 | NOCYCLE; 250 | 251 | REM ******************************************************************** 252 | REM Create the JOB_HISTORY table to hold the history of jobs that 253 | REM employees have held in the past. 254 | REM HR.JOBS, HR_DEPARTMENTS, and HR.EMPLOYEES have a foreign key to this table. 255 | 256 | Prompt ****** Creating JOB_HISTORY table .... 257 | 258 | CREATE TABLE job_history 259 | ( employee_id NUMBER(6) 260 | CONSTRAINT jhist_employee_nn NOT NULL 261 | , start_date DATE 262 | CONSTRAINT jhist_start_date_nn NOT NULL 263 | , end_date DATE 264 | CONSTRAINT jhist_end_date_nn NOT NULL 265 | , job_id VARCHAR2(10) 266 | CONSTRAINT jhist_job_nn NOT NULL 267 | , department_id NUMBER(4) 268 | , CONSTRAINT jhist_date_interval 269 | CHECK (end_date > start_date) 270 | ) ; 271 | 272 | CREATE UNIQUE INDEX jhist_emp_id_st_date_pk 273 | ON job_history (employee_id, start_date) ; 274 | 275 | ALTER TABLE job_history 276 | ADD ( CONSTRAINT jhist_emp_id_st_date_pk 277 | PRIMARY KEY (employee_id, start_date) 278 | , CONSTRAINT jhist_job_fk 279 | FOREIGN KEY (job_id) 280 | REFERENCES jobs 281 | , CONSTRAINT jhist_emp_fk 282 | FOREIGN KEY (employee_id) 283 | REFERENCES employees 284 | , CONSTRAINT jhist_dept_fk 285 | FOREIGN KEY (department_id) 286 | REFERENCES departments 287 | ) ; 288 | 289 | REM ******************************************************************** 290 | REM Create the EMP_DETAILS_VIEW that joins the employees, jobs, 291 | REM departments, jobs, countries, and locations table to provide details 292 | REM about employees. 293 | 294 | Prompt ****** Creating EMP_DETAILS_VIEW view ... 295 | 296 | CREATE OR REPLACE VIEW emp_details_view 297 | (employee_id, 298 | job_id, 299 | manager_id, 300 | department_id, 301 | location_id, 302 | country_id, 303 | first_name, 304 | last_name, 305 | salary, 306 | commission_pct, 307 | department_name, 308 | job_title, 309 | city, 310 | state_province, 311 | country_name, 312 | region_name) 313 | AS SELECT 314 | e.employee_id, 315 | e.job_id, 316 | e.manager_id, 317 | e.department_id, 318 | d.location_id, 319 | l.country_id, 320 | e.first_name, 321 | e.last_name, 322 | e.salary, 323 | e.commission_pct, 324 | d.department_name, 325 | j.job_title, 326 | l.city, 327 | l.state_province, 328 | c.country_name, 329 | r.region_name 330 | FROM 331 | employees e, 332 | departments d, 333 | jobs j, 334 | locations l, 335 | countries c, 336 | regions r 337 | WHERE e.department_id = d.department_id 338 | AND d.location_id = l.location_id 339 | AND l.country_id = c.country_id 340 | AND c.region_id = r.region_id 341 | AND j.job_id = e.job_id 342 | WITH READ ONLY; 343 | 344 | COMMIT; 345 | -------------------------------------------------------------------------------- /upload/hr_idx.sql: -------------------------------------------------------------------------------- 1 | Rem 2 | Rem Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3 | Rem 4 | Rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | Rem you may not use this file except in compliance with the License. 6 | Rem You may obtain a copy of the License at 7 | Rem 8 | Rem http://www.apache.org/licenses/LICENSE-2.0 9 | Rem 10 | Rem Unless required by applicable law or agreed to in writing, software 11 | Rem distributed under the License is distributed on an "AS IS" BASIS, 12 | Rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | Rem See the License for the specific language governing permissions and 14 | Rem limitations under the License. 15 | Rem 16 | Rem NAME 17 | Rem hr_idx.sql - Create indexes for HR schema 18 | Rem 19 | Rem DESCRIPTION 20 | Rem 21 | Rem 22 | Rem NOTES 23 | Rem 24 | Rem 25 | Rem CREATED by Nancy Greenberg - 06/01/00 26 | Rem MODIFIED (MM/DD/YY) 27 | Rem ahunold 02/20/01 - New header 28 | Rem vpatabal 03/02/01 - Removed DROP INDEX statements 29 | 30 | SET FEEDBACK 1 31 | SET NUMWIDTH 10 32 | SET LINESIZE 80 33 | SET TRIMSPOOL ON 34 | SET TAB OFF 35 | SET PAGESIZE 100 36 | SET ECHO OFF 37 | 38 | CREATE INDEX emp_department_ix 39 | ON employees (department_id); 40 | 41 | CREATE INDEX emp_job_ix 42 | ON employees (job_id); 43 | 44 | CREATE INDEX emp_manager_ix 45 | ON employees (manager_id); 46 | 47 | CREATE INDEX emp_name_ix 48 | ON employees (last_name, first_name); 49 | 50 | CREATE INDEX dept_location_ix 51 | ON departments (location_id); 52 | 53 | CREATE INDEX jhist_job_ix 54 | ON job_history (job_id); 55 | 56 | CREATE INDEX jhist_employee_ix 57 | ON job_history (employee_id); 58 | 59 | CREATE INDEX jhist_department_ix 60 | ON job_history (department_id); 61 | 62 | CREATE INDEX loc_city_ix 63 | ON locations (city); 64 | 65 | CREATE INDEX loc_state_province_ix 66 | ON locations (state_province); 67 | 68 | CREATE INDEX loc_country_ix 69 | ON locations (country_id); 70 | 71 | COMMIT; 72 | 73 | -------------------------------------------------------------------------------- /upload/loadCoffeeShopApplication.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ################################################################################# 19 | 20 | echo 'export PATH=/home/oracle/Desktop/Database_Track/coffeeshop:$PATH'>> /home/oracle/.bashrc 21 | . /home/oracle/.bashrc 22 | . /tmp/1/BUILD_CONFIG.sh 23 | export http_proxy=$BUILD_WEB_PROXY 24 | export https_proxy=$BUILD_WEB_PROXY 25 | if test -f /tmp/1/coffeeshopApp.zip 26 | then 27 | echo "mkdir -p /u01/userhome/oracle/sqldeveloper/ords/ords_config/ords/standalone/doc_root 28 | if ! test -L /u01/userhome/oracle/sqldeveloper/ords/ords_config/ords/standalone/doc_root/coffeeshop-map 29 | then 30 | ln -s /home/oracle/Desktop/Database_Track/coffeeshop/coffeeshop-target-web /u01/userhome/oracle/sqldeveloper/ords/ords_config/ords/standalone/doc_root/coffeeshop-map 31 | fi 32 | if ! test -L /u01/userhome/oracle/sqldeveloper/ords/ords_config/ords/standalone/doc_root/coffeeshop-start 33 | then 34 | ln -s /home/oracle/Desktop/Database_Track/coffeeshop/coffeeshop-start-web /u01/userhome/oracle/sqldeveloper/ords/ords_config/ords/standalone/doc_root/coffeeshop-start 35 | fi 36 | mkdir -p /u01/userhome/oracle/sqldeveloper/ords/hol-config/ords/standalone/doc_root 37 | if ! test -L /u01/userhome/oracle/sqldeveloper/ords/hol-config/ords/standalone/doc_root/coffeeshop-map 38 | then 39 | ln -s /home/oracle/Desktop/Database_Track/coffeeshop/coffeeshop-target-web /u01/userhome/oracle/sqldeveloper/ords/hol-config/ords/standalone/doc_root/coffeeshop-map 40 | fi 41 | if ! test -L /u01/userhome/oracle/sqldeveloper/ords/hol-config/ords/standalone/doc_root/coffeeshop-start 42 | then 43 | ln -s /home/oracle/Desktop/Database_Track/coffeeshop/coffeeshop-start-web /u01/userhome/oracle/sqldeveloper/ords/hol-config/ords/standalone/doc_root/coffeeshop-start 44 | fi 45 | " > /home/oracle/bin/coffeeshop_install 46 | echo '#!/bin/bash 47 | rm -rf /home/oracle/Desktop/Database_Track/coffeeshop 48 | (mkdir /home/oracle/Desktop/Database_Track/coffeeshop 49 | cp ~/coffeeshopApp.zip /home/oracle/Desktop/Database_Track/coffeeshop 50 | cd /home/oracle/Desktop/Database_Track/coffeeshop 51 | echo unzipping coffeeshopApp 52 | unzip coffeeshopApp.zip > coffeeshopApp.zip.log$$ 2>&1 53 | rm coffeeshopApp.zip 54 | mv Workshop_Source_Only/* Workshop_Source_Only/.DS_Store . 55 | chmod 755 install.sh 56 | #have a way to do install later $1 = nothing - do install.sh noinstall = dont run install.sh 57 | if test "m$1" = m 58 | then 59 | #drop existing user if it exists 60 | echo "--do not want any coffeeshop user sessions 61 | alter pluggable database ords close immediate; 62 | alter pluggable database ords open; 63 | drop user COFFEESHOP cascade; 64 | exit"|sqlplus SYS/oracle@ORDS as sysdba > ./dropusersqlplusout$$ 2>&1 65 | #bring it back to initial ie _schema loaded if coffeeshop zip in buid state 66 | ./install.sh > install.sh$$ 2>&1 67 | fi) 68 | ' > /home/oracle/bin/coffeeshop_uninstall_install 69 | mv /tmp/1/coffeeshopApp.zip /home/oracle 70 | #Put unzip at the top - wait at end of newpdbords will wait for both import and unzip 71 | mv /home/oracle/bin/newpdbords /home/oracle/bin/newpdbords.x 72 | #put on top - unzip 73 | (echo '#!/bin/bash 74 | (bash /home/oracle/bin/coffeeshop_uninstall_install noinstall 2>&1) & 75 | ' ; cat /home/oracle/bin/newpdbords.x) > /home/oracle/bin/newpdbords 76 | rm /home/oracle/bin/newpdbords.x 77 | #put on bottom wait for unzip 78 | echo 'wait 79 | cd /home/oracle/Desktop/Database_Track/coffeeshop 80 | echo oracle ORDS is available please wait while coffeeshop schema is installed 81 | ./install.sh > install.sh$$ 2>&1 82 | echo End of newpdbords'>>/home/oracle/bin/newpdbords 83 | chmod 755 /home/oracle/bin/newpdbords 84 | fi 85 | export HTTP_PROXY= 86 | export HTTPS_PROXY= 87 | 88 | -------------------------------------------------------------------------------- /upload/loadstorm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd ~/storm 3 | export THEPDB="$1" 4 | if test "m$THEPDB" = "m" 5 | then 6 | export THEPDB=ORDS 7 | fi 8 | sqlplus system/oracle@$THEPDB <> storm_vm_log 2>&1 20 | fi 21 | echo importing storm.dmp 22 | imp storm/oracle@$THEPDB FILE=storm.dmp FULL=Y >> storm_vm_log 2>&1 23 | fi 24 | -------------------------------------------------------------------------------- /upload/postdbinstallandpatch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: 3_4enableGeoRaster.sh 22 | # 23 | # Description: install and patch e.g.: required for spacial: execute mdsys.enableGeoRaster; 24 | # 25 | ################################################################################# 26 | 27 | 28 | . ~oracle/runTimeStartScript.sh 29 | (/tmp/1/3_4enableGeoRaster.sh "$@" 2>&1) | tee -a ~oracle/log/thestdoutlog_`basename $0`_$$ | egrep '^PROGRESS' 30 | #>> ~oracle/thestdoutlog 2>&1 31 | . ~oracle/buildTimeEnd.sh 32 | -------------------------------------------------------------------------------- /upload/runTimeClickHere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/db-appdev-vm/043bb7f9e2b89ed4c965ffebb4585503953ccf66/upload/runTimeClickHere.png -------------------------------------------------------------------------------- /upload/runTimeConfigureHR.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: runTimeConfigureHR.sh 22 | # 23 | # Description: Create sample HR schema in database 24 | # 25 | ################################################################################# 26 | 27 | 28 | export CON=localhost:1521/ORDS 29 | export MYSYSTEMPASSWORD=oracle 30 | export SQLPATH=/home/oracle/ReBuildScriptSQLDev_HR 31 | export NEWUSER=hr 32 | export NEWPASSWORD=oracle 33 | echo " 34 | define your_Connect_String=$CON 35 | Rem NAME 36 | Rem HOScreateAccounts.sql - clones Sample Schema objects into hr accounts 37 | Rem 38 | Rem DESCRIPTION 39 | Rem In classrooms, there is sometimes the need to make the Sample 40 | Rem Schemas objects available within a series of individual schemas 41 | Rem This script makes this cloning process easier. 42 | Rem This script frops and creates the HR Human Resources schema 43 | Rem 44 | REM When it runs, DBAs will be prompted for the SYSTEM password and Connect String 45 | REM 46 | Rem COMMENT 47 | REM There are other scripts for creating 26 users for each of OE and HR. 48 | REM Use the other script for creating multiple users. 49 | REM NB: THIS SCRIPT DROPS AND CREATES 1 schema 50 | Rem 51 | Rem Created 15-Feb-2005 jgallus 52 | REM Updated for PM workshop by Sue Harper 2 March 2005 53 | REM Updates include the synonyms between HR and OE and popluting some data. 54 | REM Update Feb2011 to exclude OE. i.e this only rebuilds HR for Developer Days 55 | 56 | SET FEEDBACK 1 57 | SET ECHO OFF 58 | 59 | 60 | Prompt Connecting as SYSTEM to create hr 61 | Prompt Ensure you enter values for the following parameters. 62 | Connect SYSTEM/$MYSYSTEMPASSWORD@&&your_Connect_String 63 | 64 | spool cre_hr.log 65 | 66 | 67 | DROP USER $NEWUSER CASCADE; 68 | 69 | CREATE USER $NEWUSER IDENTIFIED BY oracle 70 | DEFAULT TABLESPACE users 71 | TEMPORARY TABLESPACE temp 72 | QUOTA UNLIMITED ON users; 73 | 74 | GRANT create session 75 | , create table 76 | , create procedure 77 | , create sequence 78 | , create trigger 79 | , create view 80 | , create synonym 81 | , alter session 82 | , create type 83 | , create materialized view 84 | , query rewrite 85 | , create dimension 86 | , create any directory 87 | , alter user 88 | , resumable 89 | , ALTER ANY TABLE -- These 90 | , DROP ANY TABLE -- five are 91 | , LOCK ANY TABLE -- needed 92 | , CREATE ANY TABLE -- to use 93 | , SELECT ANY TABLE -- DBMS_REDEFINITION 94 | TO $NEWUSER; 95 | 96 | GRANT select_catalog_role 97 | , execute_catalog_role 98 | TO $NEWUSER; 99 | 100 | REM connect to user account and invoke the scripts that create schema objects. 101 | REM the location of the demo scrip files in in the \Ora<90><10>\... 102 | 103 | CONNECT $NEWUSER/$NEWPASSWORD@&&your_Connect_String 104 | 105 | Prompt hr_cre 106 | @@hr_cre 107 | 108 | Prompt hr_popul 109 | @@hr_popul 110 | 111 | Prompt hr_idx 112 | @@hr_idx 113 | 114 | Prompt hr_code 115 | @@hr_code 116 | 117 | Prompt hr_comnt 118 | @@hr_comnt 119 | 120 | Prompt What OBJECTS were created? 121 | column object_name format a30 122 | column object_type format a30 123 | 124 | create or replace trigger EMPLOYEES_EMPLOYEE_ID_TRG 125 | before insert on employees 126 | for each row 127 | begin 128 | if :new.employee_id is null then 129 | select employees_seq.nextval into :new.employee_id from sys.dual; 130 | end if; 131 | end; 132 | / 133 | 134 | 135 | CONNECT $NEWUSER/$NEWPASSWORD@&&your_Connect_String 136 | select object_name, object_type from user_objects order by object_type; 137 | Prompt Are there any INVALID OBJECTS? 138 | select object_name from user_objects where status='INVALID'; 139 | Prompt Are there any INVALID OBJECTS? 140 | select object_name from user_objects where status='INVALID'; 141 | " | sqlplus system/$MYSYSTEMPASSWORD@$CON 142 | #sqlplus $NEWUSER/$NEWPASSWORD@$CON @/home/oracle/bin/buildTimeRestEnableHR.sql 143 | -------------------------------------------------------------------------------- /upload/runTimeEnforceMinScreenSize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: runTimeEnforceMinScreenSize.sh 22 | # 23 | # Description: after subsequent boot 'in gnome' script - set size 800x600 24 | # 25 | ################################################################################# 26 | 27 | 28 | #allow for 50 retries 500 for first xrandr and error out on 7 seconds. 29 | #set -x 30 | doseveral() { 31 | export start=`date -u +%s` 32 | #export exe="$1" 33 | export tries=$2 34 | export SOFAR=0; 35 | #echo $exe 36 | while true 37 | do 38 | result=`bash -x ~/repeat.setsize` 39 | if test "m$?" = "m0" 40 | then 41 | echo "RESULT=$result" 42 | break; 43 | else 44 | echo "RESULT=$result" 45 | export SOFAR=`expr $SOFAR + 1` 46 | if test "m$SOFAR" = "m$tries" 47 | then 48 | exit 1 49 | fi 50 | export now=`date -u +%s` 51 | export diff=`expr $now - $start` 52 | if test $diff -gt $3 53 | then 54 | exit 1 55 | fi 56 | #sleep for a fraction of a second otherwise all our retries will be time of failure 57 | sleep 0.05 58 | fi 59 | done 60 | } 61 | echo 'echo skipped >> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 62 | #echo 'echo gvfs-set-attribute ~/Desktop/"Click here to Start.desktop" metadata::nautilus-icon-position "469,10" >> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 63 | doseveral x 50 7 64 | echo xrandr > ~/repeat.setsize 65 | doseveral x 500 7 66 | echo result="$result" >> ~oracle/setsize.log 67 | export result=`echo "$result" | grep -e " connected [^(]" | sed -e "sX\([A-Z0-9a-z/_-]\+\) connected.*X\1X"` 68 | echo GREPRESULT="$result" >> ~oracle/setsize.log 69 | echo 'xrandr --output '"$result"' --mode 800x600 >> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 70 | doseveral x 50 7 71 | echo 'echo skipped >> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 72 | #echo 'echo gvfs-set-attribute ~/Desktop/"Click here to Start.desktop" metadata::nautilus-icon-position "469,10" >> ~oracle/setsize.log 2>&1' > ~/repeat.setsize 73 | doseveral x 50 7 74 | 75 | if test -f ~/runTimeEnforceMinScreenSize.sh.redoicon 76 | then 77 | echo icon move already done once 78 | else 79 | cp ~/runTimeEnforceMinScreenSize.sh ~/runTimeEnforceMinScreenSize.sh.redoicon 80 | export PARTOF=cuthere 81 | cat ~/runTimeEnforceMinScreenSize.sh.redoicon | sed 's/gvfs-set-attribute/echo gvfs-set-attribute/g'| awk "/awk${PARTOF}/{exit}1"> ~/runTimeEnforceMinScreenSize.sh.alt 82 | chmod 755 ~/runTimeEnforceMinScreenSize.sh.alt 83 | fi 84 | #assumption - script kicksed off and xrandr and gvfs-set-attribute finish before gnome arranges icons for the first time. 85 | echo '#!/bin/bash 86 | if test -f ~/Desktop/readme.txt 87 | then 88 | cat ~/Desktop/readme.txt 89 | if test -f ~/ords/ords.war 90 | then 91 | if test -f ~/sqlcl/lib/jdbcrest.jar 92 | then 93 | echo 'try JDBC REST driver: sql HRREST/oracle@http://localhost:8080/ords/hrrest/' 94 | fi 95 | fi 96 | else 97 | echo No default readme.txt - minium install is Oracle linux 7.3 and Oracle Database 18.3 98 | fi 99 | 100 | cd ~ 101 | bash 102 | exit 0'>~/setsizeStartTerminal.sh 103 | chmod 744 ~/setsizeStartTerminal.sh 104 | #give time for startup 105 | sleep 4 106 | nohup gnome-terminal -e ~/setsizeStartTerminal.sh --geometry=60x20+243+0 & 107 | 108 | #awkcuthere 109 | #request stop 110 | tracker-control -t 111 | sleep 2 112 | 113 | #kill 114 | tracker-control -k 115 | tracker-control -r 116 | cd /etc/xdg/autostart/ 117 | 118 | #cd ~/.config/autostart 119 | #cp -v /etc/xdg/autostart/tracker-* ./ 120 | #echo 'Hidden=true'>> ~/.config/autostart/$FILE; ??? old style??? 121 | 122 | for FILE in `ls tracker*`; do 123 | cat $FILE|sed 'sZX-GNOME-Autostart-enabled=trueZX-GNOME-Autostart-enabled=falseZg' > ~/.config/autostart/$FILE 124 | done 125 | 126 | #some things (nautilis search?) will be affected 127 | rm -rf ~/.cache/tracker ~/.local/share/tracker 128 | 129 | echo reached cache remove >> ~oracle/setsize.log 130 | -------------------------------------------------------------------------------- /upload/runTimeKickOffOrds.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: runTimeKickOffOrds.sh (installed as ~/bin/ords.sh) 22 | # 23 | # Description: kick off ords on customer VM 24 | # 25 | ################################################################################# 26 | 27 | 28 | # 29 | . /etc/rc.d/init.d/functions 30 | export JAVAENV= 31 | . /home/oracle/.bashrc 32 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib 33 | NAME="Oracle REST Data Services" 34 | #JAVA="/u01/oracle/app/oracle/product/12.1.0/dbhome_1/jdk/bin/java" 35 | JAVA=`which java` 36 | APEXWARDEFAULT="/home/oracle/ords/ords.war" 37 | if test "m$2" = "m" 38 | then 39 | if test "m$APEXWAR" = "m" 40 | then 41 | APEXWAR="$APEXWARDEFAULT" 42 | fi 43 | else 44 | APEXWAR="$2" 45 | fi 46 | #want full path to APEXWAR so we kill start stop the right one 47 | echo "$APEXWAR" | egrep '^/' > /dev/null 2>&1 48 | if test "m$?" != m0 49 | then 50 | echo "APEXWAR '$APEXWAR' must start with / to start stop intended ORDS" 51 | echo "APEXWAR - given as second argument - or existing environmental variable," 52 | echo "APEXWAR defaults to: $APEXWARDEFAULT" 53 | exit 1 54 | fi 55 | OPTIONS="-Xmx1024m -Xms256m -jar $APEXWAR" 56 | 57 | LOGFILE=/tmp/ords_listener.log 58 | #start stop 'this' ORDS only picked out by war file. 59 | PID=`ps -ef | grep "$APEXWAR" | grep -v grep |grep java| cut -c9-15` 60 | 61 | start() { 62 | echo -n "Starting $NAME: " 63 | if [ "X" != "${PID}X" ]; then 64 | echo $NAME already running: $PID 65 | exit 2; 66 | else 67 | nohup $JAVA $OPTIONS 2>&1 > $LOGFILE & 68 | RETVAL=$! 69 | echo Started PID: $RETVAL 70 | echo 71 | fi 72 | 73 | } 74 | 75 | status() { 76 | echo -n "Status $NAME: " 77 | if [[ "X" != "${PID}X" ]]; then 78 | echo $NAME already running: $PID 79 | ps -ef | grep $PID 80 | else 81 | echo $NAME not running 82 | fi 83 | } 84 | 85 | stop() { 86 | if [[ "X" != "${PID}X" ]]; then 87 | echo -n "Shutting down $NAME " 88 | echo 89 | echo "$PID" | wc -l | egrep '^1$' > /dev/null 2>&1 90 | if test "m$?" = m0 91 | then 92 | kill $PID 93 | rm -f $PIDFILE 94 | else 95 | echo skipping kill "'"$PID"'" more than one line 96 | fi 97 | else 98 | echo $NAME not running 99 | fi 100 | return 0 101 | } 102 | 103 | log() { 104 | tail -f $LOGFILE 105 | } 106 | 107 | case "$1" in 108 | start) 109 | start 110 | ;; 111 | stop) 112 | stop 113 | ;; 114 | status) 115 | status 116 | ;; 117 | restart) 118 | stop 119 | start 120 | ;; 121 | log) 122 | log 123 | ;; 124 | *) 125 | echo "Usage: {start|stop|status|restart|log} [APEXWAR]" 126 | exit 1 127 | ;; 128 | esac 129 | exit $? 130 | -------------------------------------------------------------------------------- /upload/runTimeLabStylesheet.css: -------------------------------------------------------------------------------- 1 | body{max-width:960px;min-width:640px;margin:auto;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}a{color:#2C7ABF;text-decoration:none}a:hover{text-decoration:underline}.home h1,.home h2,.home h3{text-align:center;font-weight:200;line-height:1;padding:0;margin:0}.home h1{font-size:32px;font-weight:200;color:#FF0000;margin:128px 0 0 0}.home h2{font-size:64px;font-weight:200;color:#B0B0B0;line-height:1.25}.home h3{font-size:32px;margin:96px 0 64px 0;color:#303030}ul.home-list{display:block;list-style:none;margin:0;padding:0;overflow:hidden}.home-list li{display:block;height: 120px;padding:12px;width:33%;padding:0;margin:0;float:left;text-align:center;margin-bottom:24px}.home-list li a{display:block;text-decoration:none}.home-list .icon{width:64px;height:64px;display:block;margin:8px auto}.home-list .icon img{display:block}.home-list .label{display:block;font-size:14px;color:#303030;width:60%;margin:0 auto;line-height:1.4}.learn-more{clear:both;padding:48px 0;text-align:center}.learn-more h2{font-size:24px;margin:0;color:#303030;font-weight:200;line-height:1.25}.learn-more p{font-size:14px;color:#707070}.home .learn-more{margin-top:48px;border-top:1px solid #F0F0F0}.header{display:block;padding:64px 0 0 0;margin:0 24px;text-align:center}.body-header{margin:0 24px;overflow:hidden}.header .icon{// float:left;margin:0 auto;width:64px;height:64px}.header-content{overflow:hidden}.header-product{font-size:14px;color:#606060;line-height:20px;margin-top:8px}.header-title{line-height:64px;font-size:32px;color:#303030;margin:0;padding:0;font-weight:300}.body-content{padding:0 24px;overflow:hidden}.intro{font-size:20px;line-height:32px;color:#303030;font-weight:300;margin:48px 0 48px 0;padding:24px 0;border-bottom:1px solid #F0F0F0;border-top:1px solid #F0F0F0}.content-block{border-bottom:1px solid #F0F0F0;padding-bottom:24px;margin-bottom:48px;overflow:hidden}.content-block h2{font-size:20px;line-height:32px;font-weight:normal;color:#303030;margin:0}.content-block p{font-size:14px;line-height:20px;color:#707070;margin:0}.content-block ul{margin:24px;padding:0;list-style:none}.content-block li{line-height:20px;position:relative;margin:4px 0;padding:2px 0;padding-left:24px;font-size:14px}.content-block li:before{content:'';background-image:url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22200%22%20height%3D%22200%22%20viewBox%3D%220%200%20200%20200%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M71.875%2033.075c-2.438-2.438-6.4-2.438-8.837%200s-2.438%206.4%200%208.837L121.112%20100l-58.075%2058.075c-2.438%202.438-2.438%206.4%200%208.837%201.225%201.226%202.825%201.838%204.413%201.838%201.587%200%203.2-.612%204.425-1.825L138.8%20100%2071.875%2033.075z%22%2F%3E%3C%2Fsvg%3E');background-color:#D0D0D0;border-radius:100%;width:16px;height:16px;margin:4px 0;background-position:50%;background-size:12px;background-repeat:no-repeat;position:absolute;top:0;left:0} -------------------------------------------------------------------------------- /upload/runTimeOracleOnReboot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: runTimeOracleOnReboot.sh renamed as oracle in final VM 22 | # 23 | # Description: init.d file to startup oracle and ords on reboot. 24 | # 25 | ################################################################################# 26 | 27 | 28 | # 29 | # chkconfig: 2345 99 99 30 | 31 | # 32 | export ORACLE_BASE=/u01/app/oracle 33 | export ORACLE_HOME=$ORACLE_BASE/product/version/db_1 34 | export ORACLE_HOME_LISTENER=$ORACLE_HOME 35 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib 36 | #export JAVA_HOME=$ORACLE_HOME/jdk 37 | export PATH=$PATH:$ORACLE_HOME/bin:$JAVA_HOME/bin 38 | export ORACLE_SID=orclcdb 39 | #export ORACLE_TRACE=Y 40 | 41 | export PATH=$JAVA_HOME/bin:$ORACLE_HOME/bin:$PATH 42 | 43 | # Source function library. 44 | . /etc/rc.d/init.d/functions 45 | 46 | # See how we were called. 47 | case "$1" in 48 | start) 49 | echo "1" > /proc/sys/net/ipv4/ip_forward 50 | 51 | # Route 80 -> 8888 for XDB 52 | iptables -t nat -A PREROUTING -m tcp -p tcp --dport 80 -j REDIRECT --to-port 8888 53 | iptables -t nat -A PREROUTING -m tcp -p tcp --dport 21 -j REDIRECT --to-port 2121 54 | 55 | su oracle -c "$ORACLE_HOME/bin/lsnrctl start" 56 | su oracle -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" 57 | su oracle -c "echo alter pluggable database all open';'|$ORACLE_HOME/bin/sqlplus / as sysdba" 58 | if test -f /home/oracle/bin/ords.sh 59 | then 60 | su oracle -c "/home/oracle/bin/ords.sh start /home/oracle/ords/ords.war" 61 | nohup su - oracle -c "/home/oracle/bin/9090start >> /tmp/9090startlog 2>&1" & 62 | fi 63 | ;; 64 | stop) 65 | if test -f /home/oracle/bin/ords.sh 66 | then 67 | su oracle -c "/home/oracle/bin/ords.sh stop /home/oracle/ords/ords.war" 68 | nohup su - oracle -c "/home/oracle/bin/9090stop >> /tmp/9090stoplog 2>&1" & 69 | fi 70 | su oracle -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" 71 | su oracle -c "$ORACLE_HOME/bin/lsnrctl stop" 72 | ;; 73 | restart|reload) 74 | if test -f /home/oracle/bin/ords.sh 75 | then 76 | su oracle -c "/home/oracle/bin/ords.sh stop /home/oracle/ords/ords.war" 77 | nohup su - oracle -c "/home/oracle/bin/9090stop >> /tmp/9090stoplog 2>&1" & 78 | fi 79 | su oracle -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" 80 | su oracle -c "$ORACLE_HOME/bin/lsnrctl stop" 81 | su oracle -c "$ORACLE_HOME/bin/lsnrctl start" 82 | su oracle -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" 83 | su oracle -c "echo alter pluggable database all open';'|$ORACLE_HOME/bin/sqlplus / as sysdba" 84 | if test -f /home/oracle/bin/ords.sh 85 | then 86 | su oracle -c "/home/oracle/bin/ords.sh start /home/oracle/ords/ords.war" 87 | nohup su - oracle -c "/home/oracle/bin/9090start >> /tmp/9090startlog 2>&1" & 88 | fi 89 | ;; 90 | status) 91 | $ORACLE_HOME/bin/lsnrctl status 92 | ;; 93 | *) 94 | echo $"Usage: $0 {start|stop|restart|reload}" 95 | exit 1 96 | esac 97 | 98 | exit 0 99 | -------------------------------------------------------------------------------- /upload/runTimeParametersForORDS.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | ################################################################################# 17 | # 18 | # File: runTimeParametersForORDS.properties 19 | # 20 | # Description: parameters for ORDS 21 | # 22 | ################################################################################# 23 | db.hostname=localhost 24 | db.password=oracle 25 | db.port=1521 26 | db.servicename=orcl 27 | db.username=APEX_PUBLIC_USER 28 | plsql.gateway.add=true 29 | rest.services.apex.add=true 30 | rest.services.ords.add=false 31 | schema.tablespace.default=SYSAUX 32 | schema.tablespace.temp=TEMP 33 | standalone.http.port=8080 34 | standalone.mode=true 35 | standalone.static.images=/u01/userhome/oracle/apex/images 36 | user.apex.listener.password=oracle 37 | user.apex.restpublic.password=oracle 38 | user.public.password=oracle 39 | user.tablespace.default=USERS 40 | user.tablespace.temp=TEMP 41 | 42 | 43 | -------------------------------------------------------------------------------- /upload/runTimeSQLCLIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/db-appdev-vm/043bb7f9e2b89ed4c965ffebb4585503953ccf66/upload/runTimeSQLCLIcon.png -------------------------------------------------------------------------------- /upload/runTimeSQLDeveloperConnections.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | true 11 | 12 | 13 | BASIC 14 | 15 | 16 | Oracle 17 | 18 | 19 | orcl 20 | 21 | 22 | Key 23 | 24 | 25 | jdbc:oracle:thin:@localhost:1521/orcl 26 | 27 | 28 | thin 29 | 30 | 31 | TRUE 32 | 33 | 34 | YL3chQZqPwI= 35 | 36 | 37 | localhost 38 | 39 | 40 | oracle.jdbc.OracleDriver 41 | 42 | 43 | 1521 44 | 45 | 46 | oraJDBC 47 | 48 | 49 | false 50 | 51 | 52 | system 53 | 54 | 55 | false 56 | 57 | 58 | system 59 | 60 | 61 | IjBrK3qvlukDfogeU09NsQ== 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /upload/runTimeSQLDeveloperIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/db-appdev-vm/043bb7f9e2b89ed4c965ffebb4585503953ccf66/upload/runTimeSQLDeveloperIcon.png -------------------------------------------------------------------------------- /upload/runTimeStagesText.txt: -------------------------------------------------------------------------------- 1 | 1updateLinux.sh PROGRESS: 1/4 1updateLinux.sh - first script run - from plain iso. Set up second drive. DONT ECHOED BY HAND IN 1updateLinux.sh 2 | 2afterFirstReboot.sh PROGRESS: 2/4 2afterFirstReboot.sh - after first reboot - before any oracle database software installed. (install virtual box guest additions). 3 | 3topLevel.sh PROGRESS: 3/4 3topLevel.sh - main kick off script i.e. yum and call subscripts 4 | 3_1installDbtoolClientTools.sh PROGRESS: 3_1/4 3_1installDbtoolClientTools.sh - install dbtool client tools 5 | 3_2installDatabase.sh PROGRESS: 3_2/4 3_2installDatabase.sh - install the database 6 | 3_3passwordDoNotExpire.sh PROGRESS: 3_3/4 3_3passwordDoNotExpire.sh - minor helper - e.g. passwords do not expire. 7 | 3_4enableGeoRaster.sh PROGRESS: 3_4/4 3_4enableGeoRaster.sh - post database install and patch 8 | 3_5unzipLabDemos.sh PROGRESS: 3_5/4 3_5unzipLabDemos.sh - demos (labs) 9 | 3_6apexInstall.sh PROGRESS: 3_6/4 3_6apexInstall.sh - apex install 10 | 3_7ORDSInstall.sh PROGRESS: 3_7/4 3_7ORDSInstall.sh - ords install 11 | 3_8setupDemos.sh PROGRESS: 3_8/4 3_8setupDemos.sh - set up demos and run reset scripts 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /upload/runTimeStartScript.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: runTimeStartScipt.sh 22 | # 23 | # Description: Helper script to be called to give standardised startup output in larger scripts. 24 | # 25 | ################################################################################# 26 | 27 | 28 | #echo PROGRESS $0 29 | #something messes up maybe nested this exec 127>> ~oracle/debug_output_`basename $0`_$$.txt 30 | #export BASH_XTRACEFD="127" 31 | #set -x 32 | export SHSTART=`date +%s` 33 | export VMSCRIPTNAME=`echo $0|sed 'sZ^.*/\([^/]*\)$Z\1Zg'|sed 'sZstart_.*Z1updateLinux.shZg'` 34 | export NOINNER=`echo $VMSCRIPTNAME|sed 'sZ_innerZZg'` 35 | echo $0 | grep _inner > /dev/null 2>&1 36 | if test "m$?" = "m0" 37 | then 38 | set -x 39 | export VMSCRIPTNAME=$NOINNER 40 | 41 | if test "m$TOPNAME" = "m" 42 | then 43 | export TOPNAME=$VMSCRIPTNAME 44 | export STACK=$TOPNAME 45 | else 46 | export STACK=$STACK'->'$VMSCRIPTNAME 47 | fi 48 | 49 | echo 'PROGRESS: Call Tree:' "$STACK" 50 | #pstree -l -s $$ | grep "$TOPNAME"| sed 's/pstree//g' | sed "sZ^.*${TOPNAME}Z${TOPNAME}Zg"| sed 's/grep.*$//g' | sed 's/sed.*$//g' | sed 's/---[^-]*inner.sh//g'| sed 's/^/PROGRESS Call Tree: /g' 51 | egrep '^'"$VMSCRIPTNAME " ~oracle/runTimeStagesText.txt| sed 's/$/ Started: '`date +%k:%M:%S|sed 'sZ ZZg'`'/g'| sed 's/^'"$VMSCRIPTNAME"' //g'| grep $VMSCRIPTNAME 52 | if test $? -ne 0 53 | then 54 | echo WARNING: $VMSCRIPTNAME not found 55 | fi 56 | fi 57 | -------------------------------------------------------------------------------- /upload/runTimeTidyLabWebFiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: runTimeTidyLabWebFiles.sh 22 | # 23 | # Description: minor update to labs web files 24 | # 25 | ################################################################################# 26 | 27 | 28 | cd ~/Desktop 29 | cp ODDHandsOnLabs.html ODDHandsOnLabs.html.x 30 | chmod 755 ODDHandsOnLabs.html ODDHandsOnLabs.html.x 31 | cat ODDHandsOnLabs.html.x | sed 'sZhref="style.css"Zhref="images/style.css"Zg'|sed 'sZsrc="lab.js"Zsrc="images/lab.js"Zg' > ODDHandsOnLabs.html 32 | rm ODDHandsOnLabs.html.x 33 | chmod 755 ODDHandsOnLabs.html 34 | chmod 755 lab.js labs.json style.css 35 | cp lab.js labs.json style.css images 36 | cd images 37 | cp lab.js lab.js.x 38 | chmod 755 lab.js.x 39 | cat lab.js.x | sed "sZ'labs.json'Z'images/labs.json'Zg" > lab.js 40 | rm lab.js.x 41 | chmod 755 lab.js labs.json style.css 42 | cd ~/Desktop 43 | chmod 755 lab.js labs.json style.css 44 | rm lab.js labs.json style.css 45 | -------------------------------------------------------------------------------- /upload/runtime9090ORDS.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | # File name: runtime9090ORDS.properties renamed to 17 | # /u01/userhome/oracle/sqldeveloper/ords/warmstart/ords_params_vmconfig.properties by init script 18 | db.hostname=localhost 19 | db.port=1521 20 | db.servicename=ords 21 | migrate.apex.rest=false 22 | ords.admin.password=@0595EF68A01A67A71E419780298842432F 23 | ords.admin.username=ords_admin 24 | ords.sqldev.password=@05B40F336C99F8FDB603EF06C3EF1C4E85 25 | ords.sqldev.username=ords_dev 26 | plsql.gateway.add=false 27 | rest.services.apex.add=false 28 | rest.services.ords.add=true 29 | schema.tablespace.default=SYSAUX 30 | schema.tablespace.temp=TEMP 31 | security.verifySSL=false 32 | standalone.http.port=9090 33 | standalone.mode=true 34 | standalone.use.https=false 35 | standalone.skip.static.resources value=true 36 | user.public.password=oracle 37 | user.tablespace.default=USERS 38 | user.tablespace.temp=TEMP 39 | config.status=REQUIRES_CONFIG 40 | @05A5E9B2C0CA9664E0FE0516F7ED473A2B5EF4EA6E4C4B0C21=@058985F627D4AE7309DD81F379A683FC62 41 | @05F752B18312E9F5AC0964F573203DE0E531F60EE9BA261C52=@056E34BA50503B2D4A739AE1BC6BF10F81 42 | file.creator=sqldev 43 | installer=install 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /upload/sqldev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oracle-samples/db-appdev-vm/043bb7f9e2b89ed4c965ffebb4585503953ccf66/upload/sqldev.png -------------------------------------------------------------------------------- /upload/uninstall9090ORDS.properties: -------------------------------------------------------------------------------- 1 | @05A5E9B2C0CA9664E0FE0516F7ED473A2B5EF4EA6E4C4B0C21=@058985F627D4AE7309DD81F379A683FC62 2 | @05F752B18312E9F5AC0964F573203DE0E531F60EE9BA261C52=@056E34BA50503B2D4A739AE1BC6BF10F81 3 | db.hostname=localhost 4 | db.port=1521 5 | db.servicename=ords 6 | file.creator=sqldev 7 | installer=uninstall 8 | 9 | -------------------------------------------------------------------------------- /upload/uploaddemos: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ################################################################################# 20 | # 21 | # File: uploaddemos 22 | # 23 | # Description: upload demos into pdb from master.zip (if supplied) end user visible so not given hard to type rename. 24 | # 25 | ################################################################################# 26 | 27 | 28 | #set -x 29 | # VM SPECIFIC/ testing only/ not for production use 30 | export TWO_TASK= 31 | export BASESEED=/u01/app/oracle/oradata/ORCLCDB 32 | export DEFAULTNEWPDBNAME=ORCL 33 | export CONNECT=/ 34 | export TNSNAMESFILE=$ORACLE_HOME/network/admin/tnsnames.ora 35 | export THEPORT=1521 36 | export ADMINUSER=oracle 37 | export ADMINPASSWORD=oracle 38 | export USERSTABLESPACESIZE=50M 39 | if test -f /u01/userhome/oracle/unzipdemos/master.zip 40 | then 41 | export NOOP=NOOP 42 | else 43 | echo ERROR Sample schemas not available in /u01/userhome/oracle/unzipdemos/master.zip 44 | exit 1 45 | fi 46 | #notes for test VM '$1' is the wanted pdb 47 | #note you could use CONNECT=sys/password@SOME_TNS_ENTRY (and update BASESEED) - the text 'as sysdba' is added on CONNECT use (TNSNAMES entry update would be local, and 32k test would fail if pdbseed not already updated) 48 | #plan create pdb/set password do not expire/32kvarchar/pdb open by default/on success put entry in '$ORACLE_HOME/network/admin/tnsnames.ora' approximate cost 4gb disk space or less 49 | #show vdb| grep PDB?? whenever sqlerror exit 1 whenever oserror exit 1 for now 50 | export PDB=$1 51 | if test "m$PDB" = "m" 52 | then 53 | export PDB=$DEFAULTNEWPDBNAME 54 | fi 55 | #todo check pdb exist ? for now let sql exit on error 56 | 57 | cd /u01/userhome/oracle/unzipdemos 58 | rm -rf /home/oracle/unzipdemos/db-sample-schemas-master 59 | if test -d /home/oracle/unzipdemos/db-sample-schemas-master 60 | then 61 | echo samples unzipped 62 | cd db-sample-schemas-master 63 | else 64 | unzip master.zip 65 | cd db-sample-schemas-master 66 | mkdir log 67 | perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat 68 | fi 69 | echo "alter pluggable database $PDB open; 70 | alter session set container=$PDB; 71 | @/u01/userhome/oracle/unzipdemos/db-sample-schemas-master/mksample oracle oracle oracle oracle oracle oracle oracle oracle USERS TEMP /tmp/ localhost:$THEPORT/$PDB 72 | exit 0 73 | " | sqlplus $CONNECT as sysdba 74 | export THEEXIT=$? 75 | cd /home/oracle 76 | rm -rf /home/oracle/unzipdemos/db-sample-schemas-master 77 | if test $THEEXIT -ne 0 78 | then 79 | echo EXITTED WITH $THEEXIT 80 | else 81 | echo granting dba to av schema - should restrict privileges to what privileges are required. 82 | echo "drop user av cascade; 83 | grant dba to av identified by oracle; 84 | connect av/oracle@localhost:$THEPORT/$PDB 85 | @/home/oracle/bin/livesql_create_av_schema.sql 86 | exit;"|sqlplus system/oracle@localhost:$THEPORT/$PDB 87 | echo "create or replace trigger EMPLOYEES_EMPLOYEE_ID_TRG 88 | before insert on employees 89 | for each row 90 | begin 91 | if :new.employee_id is null then 92 | select employees_seq.nextval into :new.employee_id from sys.dual; 93 | end if; 94 | end; 95 | / 96 | "| sqlplus hr/oracle@localhost:$THEPORT/$PDB 97 | fi 98 | exit $THEEXIT 99 | --------------------------------------------------------------------------------