This is the 30th day of my participation in the August Text Challenge.More challenges in August
🌲 preface
MacOS players check it out!! This article focuses on how to play Parallels Desktop.
After learning how to build an Oracle database using Vagrant in conjunction with VirtualBox, I have been using the Parallels Desktop VIRTUAL machine and Vagrant is Pd enabled, so I researched and played around with it. By the way, I share 😄~
❤️ You can visit my Vagrant Box site to download using the Oracle database Gar❤️ヾ (◍ ° ∇ ° ◍) ノ ゙~
Luciferliu/oracle11g: app.vagrantup.com/luciferliu/…
🪐 Vagrant can be used at:
- Vagrant’s Chinese document column
- A one-line command installation for Linux, an ultra-detailed how-to guide to Vagrant
🌏 Oracle one-click installation script for details:
- Oracle one-click setup script column
- After writing over 4000 lines of Shell scripts, I was able to install Oracle RAC with one click!!
Software to be installed in advance:
- Vagrant: www.vagrantup.com/downloads
- Parallels Desktop: www.parallels.cn/products/de…
Start as soon as you install it
❄️ 1. Environment preparation ❄️
Download Vagrant Box
⭐ ️ access Vagrant official download site Box: app.vagrantup.com/generic/box…
Download Centos7 for Parallels with Box: Rename the file after downloading to make it easier to distinguish:
2. Install Paralles
Since Vagrant uses the VirtualBox virtual machine as the carrier by default, you need to download and install the Paralles plug-in.
vagrant plugin install vagrant-parallels
Copy the code
Here is relatively simple, a single command can be successfully installed.
Vagrant adds box
Add the box you just downloaded to Vagrant:
vagrant box add /Volumes/Lucifer/vagrant/centos79-oracle11g-parallels/centos79-parallels --name oracle11pd
Copy the code
As shown above, box has been successfully added.
4. Configure Vagrantfile
Emm configuration, I will not go into details, the following is a brief introduction:
cd /Volumes/DBA/vagrant/oracle11pd
cat <<EOF>Vagrantfile Vagrant.configure("2") do |config| config.vm.box = "oracle11pd" config.vm.provision :shell, path: "/Volumes/DBA/vagrant/oracle11pd/scripts/ora_preinstall.sh" config.vm.synced_folder "/Volumes/Lucifer/vagrant/centos79-oracle11g-vb", "/vagrant" config.vm.network :forwarded_port, guest: 1521, host: 1521 config.vm.network :forwarded_port, guest: 22, host: 22 config.vm.network "public_network", ip: "192.168.1.120" config. The vm. The provider "parallels do | PRL | PRL. Name =" orcl11g "PRL. Memory = 4196 PRL. Cpus = 2 end end EOF
Copy the code
Here are a few parameters in the configuration file:
- config.vm.box = “oracle11pd”
Specify the box logical name added above for installing Linux
- config.vm.provision :shell, path: “/Volumes/DBA/vagrant/oracle11pd/scripts/ora_preinstall.sh”
The configuration is used to automatically execute shell scripts after the Linux system is installed
- config.vm.synced_folder “/Volumes/Lucifer/vagrant/centos79-oracle11g-vb”, “/vagrant”
Map a local directory to a Linux host directory
- config.vm.network :forwarded_port, guest: 1521, host: 1521
Map Linux host port 1521 to local port 1521
- config.vm.network :forwarded_port, guest: 22, host: 22
Map Linux host port 22 to local port 22
- Config.vm.net work “public_network”, IP: “192.168.1.120”
Set the network of the host to 192.168.1.120. You are advised to bridge the network to the local host for Internet access
- config.vm.provider “parallels” do |prl|
Configure the virtual machine program as Parallels
- vb.name = “orcl11g”
Configuring host Names
- vb.memory = 4196
Configuring host Memory
- vb.cpus = 2
Configuring host cpus
5. Prepare installation media
inVagrantfile specifies the directory to which the mapping is mountedTo createsoft
Folder, and upload the required installation media: Here’s what the following files do:
- CentOS – 7.9 – x86_64 – Everything – 2009. Iso
Centos ISO file, used to install the local YUM source
- OracleShellInstall.sh
Oracle one-click installation script, available for download at Github, continue to update 🔥, welcome 👏🏻 Star
- p13390677_112040_Linux-x86-64_1of7.zip
- p13390677_112040_Linux-x86-64_2of7.zip
Oracle 11GR2 Database installation package
- p31537677_112040_Linux-x86-64.zip
Oracle 11GR2 Database PSU patch package
- p6880880_112000_Linux-x86-64.zip
Oracle OPatch patch pack
- Rlwrap – 0.42. Tar. Gz
Context switch software, optional installation, not required
Here the installation medium is ready, put here on the line 😄 ~
6. Write Shell scripts defined in Vagrantfile
To automatically install the Oracle database after Linux is successfully installed, prepare shell scripts for invoking the Oracle database after Linux is installed.
mkdir -p /Volumes/DBA/vagrant/oracle11pd/scripts
cd /Volumes/DBA/vagrant/oracle11pd/scripts
cat <<EOF>ora_preinstall.sh #change root password echo oracle | passwd --stdin root #change sshd_config sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config systemctl reload sshd.service #mkdir software dir mkdir /soft #cp software to softdir cp /vagrant/soft/* /soft #mount iso to mnt dir mount -o loop /soft/*iso /mnt #chmod shell script chmod +x /soft/OracleShellInstall.sh #install oracle database cd /soft ./OracleShellInstall.sh -i 192.168.1.120 -opa 31537677 - InstallMode single -DBV 11g EOF
Copy the code
Here’s a little explanation of the steps in the script:
- A. Change the password of user root
- B. Configure the SSH service to allow password connection
- C. Linux Create a soft directory on the host to store the installation media
- D. Copy the installation media under the mapping directory /vagrant/soft to /soft
- E. Mount the iso image file of centos7.9
- F. Grant the Oracle one-click installation script execution permission
- G. Go to the /soft directory and install the Oracle database according to the one-click installation parameters
❤️ Vagrant launches a one-click install of Oracle ❤️
1, 😏 is very simple, a short line command
vagrant up --provider=parallels
Copy the code
The Oracle database has been installed after a period of time. The database can be connected and used normally Can see database created successfully 🎉, PSU patch also installed successfully ✌🏻.
The box for installing Oracle database in this article will be packaged and uploaded to Vagrant’s official site for your convenience:
Download method:luciferliu/oracle11g
There should be more versions of Box in the future, including RAC database, Dataguard, DNS server, OpenFiler server, MySQL, etc.
Write in the last
While this approach is not suitable for production installations using 😒, it is extremely convenient for personal test practices using 😄. If you don’t know how to use vagrant Up, you can download my box directly and use it 🎉~
❤️ Finally, I wish you all have a good time. If you have any questions or technical exchanges, you can follow me and chat with me privately ~ ❤️
This is the end of sharing ~
If you think the article is helpful to you, please like it, favorites it, pay attention to it, comment on it, and support it four times with one button. Your support is the biggest motivation for my creation.