#environment settings
1. Check the hardware requirements under the server hardware resource Linux system (x86-64):
Physical memory: at least 1GB
Interaction space: When the physical memory is between 1GB and 2GB, the interaction space is 1.5 times the physical memory; when the physical memory is between 2GB and 8GB, the interaction space is 1 times the physical memory; when the physical memory is more than 8GB, the interaction space 0.75 times the physical memory.
Disk Space: Enterprise Edition 4.35GB; Standard Edition 3.22GB; Custom (Maximum): 3.45GB
2. Check the memory:
# grep MemTotal /proc/meminfo
# grep SwapTotal /proc/meminfo
1. Prepare the Oracle installation package for the server
Download address: Oracle official download address
Download the linux x86-64 version, a total of two .zip files. (Oracle's download link, click it will jump to the login interface, you can download it after logging in to the Oracle account, so you can't copy the download link to the command line and use the wget command to download, so the downloaded compressed package will be damaged)
After downloading the compressed package, we use the scp remote transfer command to transfer the file to the server. (This can only be achieved if your local machine is also a linux system, or you can copy the file into a linux virtual machine and use the virtual machine to send it.)
scp -P 8022 /home/oracle_linux_1.zip [email protected]:/home/oracle_linux_1.zip
The specific command is as shown above, -P must be capitalized, and 8022 is the ssh port. The first address indicates the zip file address of your local machine, and the second address indicates the location you want to put on the server. (For details, please check this URL: ssh remote file transfer )
After the file is transferred to the linux server, it is necessary to enter the command line of the linux server through the ssh command to operate. (Be sure to log in with the root user here)
ssh -p 8022 root@ip
Go to the location where you just passed in the .zip file and use the unzip command to unzip the two files
unzip oracle_linux_1.zip
unzip oracle_linux_2.zip
The two compressed packages will be decompressed to the same directory. After decompression, a new directory /database will be generated, and the preparations for the installation package will be completed here.
2. Steps to install Oracle server software
Original post: CentOS 6.5 64-bit silent installation of Oracle11g
2.1 Install the necessary dependencies
Copy the following sentence directly to the command line, including all dependencies
yum -y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make sysstat unixODBC unixODBC-devel
2.2 Add Oracle user information
#Create oinstall and dba groups, add the oracle user to the group, and set the password of the oracle user in the last step.
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
2.3 Modify kernel parameters
##Edit the file /etc/sysctl.conf, using the linux vi editor
vi /etc/sysctl.conf
##Modify the following parameters in the configuration file. If they do not exist, they are added directly. If the default value is larger than the reference value, there is no need to modify it.
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
##Save after editing, execute the following command to make it take effect
sysctl -p
2.4 Modifying User Resource Limits
##1. Modify the /etc/security/limits.conf configuration file
vi /etc/security/limits.conf
##Add the following parameters at the bottom of the configuration file
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
##save and exit
##2. Modify the /etc/pam.d/login configuration file,
vi /etc/pam.d/login
##Add to the configuration file
session required /lib/security/pam_limits.so
session required pam_limits.so
2.5 Create the installation directory
Create the installation directory /usr/local/oracle /usr/local/oraInventory /usr/local/oradata and give the user group permissions.
mkdir -p /usr/local/oracle /usr/local/oraInventory /usr/local/oradata/
chown -R oracle:oinstall /usr/local/oracle /usr/local/oraInventory /usr/local/oradata/
chmod -R 775 /usr/local/oracle /usr/local/oraInventory /usr/local/oradata/
2.6 Create the oraInst.loc file
##Create /etc/oraInst.loc file
vi /etc/oraInst.loc
##Add the following to the file
inventory_loc=/usr/local/oraInventory
inst_group=oinstall
##Save and exit and execute the following command. Set the user group and permissions of the file.
chown oracle:oinstall /etc/oraInst.loc
chmod 664 /etc/oraInst.loc
2.7 Prepare oracle installation answer template file db_install.rsp file
## 1. The file is stored in the decompressed installation package by default, that is, under /home/database/response in this example,
## Copy all the answer files required for the silent installation of oracle to the /usr/local/oracle folder
cp /home/database/response/* /usr/local/oracle/
## 2. Modify the group and permissions of all the answer files required for the installation
chown oracle:oinstall /usr/local/oracle*.rsp
chmod 755 /usr/local/oracle/*.rsp
## 3. Configure the db_install.rsp file
vi /usr/local/oracle/db_install.rsp
## 4. Modify the corresponding parameter configuration in the file as follows:
oracle.install.option=INSTALL_DB_SWONLY //Installation type, only install database software
ORACLE_HOSTNAME=serv2.lin.vm.ncu //Host name (enter hostname query on the command line)
UNIX_GROUP_NAME=oinstall // install group
INVENTORY_LOCATION=/usr/local/oraInventory //INVENTORY directory (** is the default value if not filled in, this example needs to be modified here, depending on the personal creation of the installation directory)
SELECTED_LANGUAGES=en,zh_CN // select language
ORACLE_HOME=/usr/local/oracle/product/11.2.0/db_1 // oracle_home *path Note to modify the installation path /usr/local/oracle according to the directory
ORACLE_BASE=/usr/local/oracle // oracle_base *注意修改
oracle.install.db.InstallEdition=EE // oracle版本
oracle.install.db.isCustomInstall=false //Custom installation, no, use default components
oracle.install.db.DBA_GROUP=dba //dba user group
oracle.install.db.OPER_GROUP=oinstall //oper user group
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE //Database type
oracle.install.db.config.starterdb.globalDBName=orcl //globalDBName
oracle.install.db.config.starterdb.SID=orcl //SID (**Note here is consistent with the SID configured in the environment variable)
oracle.install.db.config.starterdb.memoryLimit=81920 //Automatically manage memory memory (M)
oracle.install.db.config.starterdb.password.ALL=oracle //Set all database users to use the same password
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false //(Manually written false)
DECLINE_SECURITY_UPDATES=true // **Note that this parameter setting must be true
2.8 Setting up the oracle user environment
## Switch from root to the created oracle user
su – oracle
## Modify the user's user configuration file, the file is in the ~ directory, you can execute cd or cd ~
cd
you .bash_profile
## Add and modify the following content in the file
export ORACLE_BASE=/usr/local/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_OWNER=oracle
export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
## After saving and exiting, execute the source command to take effect immediately.
source .bash_profile
2.9 Start the installation under the oracle user
## Excuting an order.
/home/oracle/database/./runInstaller -silent -force -ignorePrereq -responseFile /usr/local/oracle/db_install.rsp
##Parameter Description
/home/database is the decompressed path of the installation package, which is modified according to the location where the installation package is decompressed, which varies from person to person.
runInstaller is the main installation script
-silent silent mode
-force force installation
-ignorePrereq ignore warning to install directly.
-responseFile Read the installation response file.
2.10 Running the script
After executing the installation instructions, you can do nothing in the original window (window 1), reopen a command line window (window 2), and log in to the server as root.
Enter the /usr/local/oracle/product/11.2.0/db_1 directory in window 2, you can see that the installation database has been installed in this directory, and there is a root.sh file in this directory.
At this time, the following prompt appears in the No. 1 window. It will take a certain amount of time to install and compile, please wait patiently.
#-------------------------------------------------------------------
/usr/oracle/oraInventory/orainstRoot.sh (this sentence may not be. I don't know the specific reason, it does not affect the installation, if there is this sentence, also run this orainstRoot.sh script)
/usr/oracle/product/11.2.0/db_1/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and hit"Enter" key to continue
Successfully Setup Software.
#------------------
After the above interface appears, go to window 2 to run the root.sh script
./root.sh
The database installation process ends here, and the following is the configuration.
3. Database configuration and creation
3.1 Create a database
switch here to
Enter the /usr/local/oracle directory and edit dbca.rsp to create a database answer file:
vi dbca.rsp
Modify several parameters. If these parameters are commented, uncomment them ( this file must be modified, otherwise the database cannot be mounted after it is created )
GDBNAME = “orcl”
SID = “orcl”
CHARACTERSET = “ZHS16GBK”
NATIONALCHARACTERSET= “AL16UTF16”
SOURCEDB = “serv2.lin.vm.ncu:1521:orcl”
After saving and exiting, execute the dbca command to create the database:
dbca -silent -responseFile dbca.rsp
The following interface appears
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
…………………………
After the execution reaches 100%, the database creation is completed
3.2 Enable database network monitoring
In the directory just now, there is a netca.rsp file, execute the following command
netca -silent -responseFile netca.rsp
Enable monitoring
lsnrctl start
dbstart $ORACLE_HOME
--postscript--
The detailed installation steps are summed up by Mr. Fu, who is also in the laboratory, according to the installation process. There are detailed solutions for some of the error reporting problems encountered. Thank you Boss Fu~!
After further understanding and comparison, for the DB service on this kind of Linux server, it will be easier to start directly using the docker image, and it will not be so troublesome to install each time.
However, further research is required for the docker container engine. This is the next learning objective.