In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. system version
Operating system: CentOS Linux release 7.3.1611 (Core)
II. Oracle software version
Oracle version: linux.x64_11gR2
Linux.x64_11gR2_database_1of2.zip
Linux.x64_11gR2_database_2of2.zip
Third, create users and groups
A) create users and groups
Groupadd oinstall
Groupadd dba
Useradd-g oinstall-G dba oracle
Passwd oracle
B) create a database installation directory
Mkdir-p / opt/oracle # # $ORACLE_BASE
Mkdir-p / opt/oracle/product/112010/db_1 # # $ORACLE_HOME
Mkdir / opt/oracle/oradata # # Storage database directory
Mkdir / opt/oracle/inventory
Mkdir / opt/oracle/flash_recovery_area
Chown-R oracle:oinstall / opt/oracle
Chmod-R 775 / opt/oracle
C) add oracle users to the sudo group
Vi / etc/sudoers
After entering the above command, open the sudoers file for editing and find the
Root ALL= (ALL) ALL
This line, and add the following command at the bottom:
Oracle ALL= (ALL) ALL
Fourth, modify system parameters and environmental variables
1. Close selinux
Vi / etc/selinux/config
Modify: SELINUX=disabled
2. Turn off the firewall
Systemctl stop firewalld.service # stop service | firewall
Systemctl disable firewalld.service # prevents firewall from booting
3. Modify / etc/hosts file
Vi / etc/hosts
10.143.200.188 DATAFS
4. Modify kernel parameters
Vi / etc/sysctl.conf
Modify the following
Kernel.shmall = 2097152
Kernel.shmmax = 1073741824
Add the following
Fs.aio-max-nr = 1048576
Fs.file-max = 6815744
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 = 1048576
# sysctl-p
5. Modify the user limit file
# vi / etc/security/limits.conf
Add the following at the end of the line
Oracle soft nproc 2047
Oracle hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Oracle soft stack 10240
6. Association settings
Vi / etc/pam.d/login
Add the following at the end of the line:
Session required / lib64/security/pam_limits.so
Session required pam_limits.so
7. Modify / etc/profile
# vi / etc/profile
Add the following:
If [$USER = "oracle"]; then
If [$SHELL = "/ bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Fi
Source / etc/profile
8. Oralce users modify user environment variables
# vi / home/oracle/.bash_profile
Add the following at the bottom
# For Oracle
Export ORACLE_BASE=/opt/oracle
Export ORACLE_HOME=/opt/oracle/product/112010/db_1
Export ORACLE_SID=orcl
Export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
Export LC_ALL= "en_US"
Export LANG= "en_US"
Export NLS_LANG= "AMERICAN_AMERICA.ZHS16GBK"
Export NLS_DATE_FORMAT= "YYYY-MM-DD HH24:MI:SS"
If [$USER = "oracle"]; then
If [$SHELL = "/ bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Umask 022
Fi
Source / home/oracle/.bash_profile
View command: # env
Install the dependency package
There are many dependent packages to install, it is better that the server can access the external network, which is much easier. If you really can't access the external network, you can only download the corresponding rpm package and install it.
Yum-y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh ksh libaio.i686 glibc.i686 compat-libstdc++-33.i686 libaio-devel.i686 libgcc.i686 libstdc++.i686 unixODBC.i686 unixODBC-devel.i686
Rpm package installation: # rpm-ivh *-- force-- nodeps
VI. Officially start the installation of the database
1. Install the package decompression command (using oracle user decompression)
$unzip linux.x64_11gR2_database_1of2.zip
$unzip linux.x64_11gR2_database_2of2.zip
Modify the user to which the directory belongs
Chown-R oracle:oinstall database
After the decompression is completed, the database directory will be generated. In the decompressed file, there are db_install.rsp, dbca.rsp and netca.rsp answer files under database/response, which are database installation files, database instance establishment and monitoring configuration installation files respectively. These three files will be used in the following steps.
2. Edit the database installation file db_install.rsp
Vi db_install.rsp
20 oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
29 oracle.install.option=INSTALL_DB_SWONLY # installation type
37 ORACLE_HOSTNAME=DATAFS # Host name
42 UNIX_GROUP_NAME=oinstall # installation group
47 INVENTORY_LOCATION=/opt/oracle/inventory # INVENTORY directory
78 SELECTED_LANGUAGES=en,zh_CN # Select language
83 ORACLE_HOME=/opt/oracle/product/112010/db_1 # oracle_home
88 ORACLE_BASE=/opt/oracle # oracle_base
99 oracle.install.db.InstallEdition=EE # # oracle version
108 oracle.install.db.isCustomInstall=true
142 oracle.install.db.DBA_GROUP=dba # dba user Group
147oracle.install.db.OPER_GROUP=dba # oper user Group
160 oracle.install.db.config.starterdb.type=GENERAL_PURPOSE # database type
165 oracle.install.db.config.starterdb.globalDBName=orcl # globalDBName
170 oracle.install.db.config.starterdb.SID=orcl # SID
200 oracle.install.db.config.starterdb.memoryLimit=800 # minimum memory for automatically managed memory (M)
233 oracle.install.db.config.starterdb.password.ALL=oracle # set all database users to use the same password
385 DECLINE_SECURITY_UPDATES=true # set security updates
3. Install the database software (using oracle users)
# su-oracle
Go to the database directory just now
. / runInstaller-silent-responseFile / ghca/database/response/db_install.rsp-ignorePrereq
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 13773 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2047 MB Passed
Preparing to launch Oracle Universal Installer from / tmp/OraInstall2018-09-20 09-16-02PM. Please wait...
The next step is to wait (it's a little long, don't worry!). If it's fast, it takes about 10 minutes, and it may take about 30 minutes to slow down, depending on the server configuration.
During installation, if you prompt [WARNING] to ignore it, the installer is still in the background, and if [FATAL] appears, the installer has stopped.
The log for this installation session can be found in the following location.
If the installation fails, the message will be printed.
[FATAL] [INS-32076] English cannot be removed from the selected languages list.
CAUSE: An attempt was made to remove English from the selected languages list.
ACTION: Select English as one of the selected product languages.
A log of this session is currently saved as: / tmp/OraInstall2018-09-20 09-16-02PM/installActions2018-09-20 09-16-02PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.
View log log information:
Cat / tmp/OraInstall2018-09-20 09-16-02PM/installActions2018-09-20 09-16-02PM.log. Oracle
Normal installation log information:
[oracle@DATAFS database] $[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
You can find the log of this install session at:
/ opt/oracle/inventory/logs/installActions2018-09-20 09-47-28PM.log
Tail-f / opt/oracle/inventory/logs/installActions2018-09-20 09-47-28PM.log
The log of successful installation is as follows:
The following configuration scripts need to be executed as the "root" user.
#! / bin/sh
# Root scripts to run
/ opt/oracle/inventory/orainstRoot.sh
/ opt/oracle/product/112010/db_1/root.sh
To execute the configuration scripts:
Open a terminal windowLog in as "root" Run the scriptsReturn to this window and hit "Enter" key to continue
4. After installation, execute the script as required
Open a new terminal, log in as root, and execute the script:
# / opt/oracle/inventory/orainstRoot.sh
# / opt/oracle/product/112010/db_1/root.sh
[root@DATAFS db_1] # / opt/oracle/inventory/orainstRoot.sh
Changing permissions of / opt/oracle/inventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of / opt/oracle/inventory to oinstall.
The execution of the script is complete.
[root@DATAFS db_1] # / opt/oracle/product/112010/db_1/root.sh
Check / opt/oracle/product/112010/db_1/install/root_DATAFS_2018-09-20, 22-36-50.log for the output of root script
When finished, return to the original terminal and press the enter key and wait for the program to be installed.
VII. Listener configuration
Execute the command: netca / silent / responseFile / ghca/database/response/netca.rsp #-absolute path must be written here
[oracle@DATAFS response] $netca / silent / responseFile / ghca/database/response/netca.rsp
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = / ghca/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/ opt/oracle/product/112010/db_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Profile configuration complete.
Oracle Net Services configuration successful. The exit code is 0
Check to see if the port is occupied:
[root@DATAFS ~] # ss-tnl | grep 1521
LISTEN 0 128:: 1521: *
[root@DATAFS ~] #
View the monitoring status:
[oracle@DATAFS response] $lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0-Production on 21-SEP-2018 12:22:08
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=DATAFS) (PORT=1521)
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0-Production
Start Date 21-SEP-2018 12:20:29
Uptime 0 days 0 hr. 1 min. 41 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File / opt/oracle/product/112010/db_1/network/admin/listener.ora
Listener Log File / opt/oracle/diag/tnslsnr/DATAFS/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=DATAFS) (PORT=1521))
The listener supports no services
The command completed successfully
8. Install database instance
1 modify important parameters in / ghca/database/response/dbca.rsp response file
The following parameters are set during this installation: (note that the following parameters depend on the situation, do not copy, the original documents are described)
RESPONSEFILE_VERSION = "11.2.0" # cannot be changed
OPERATION_TYPE = "createDatabase"
GDBNAME = "orcl" # name of the database
SID = "ORCL" # # the corresponding instance name
TEMPLATENAME = "General_Purpose.dbc" # # template file for building the library
SYSPASSWORD = "oracle" # # SYS administrator password
SYSTEMPASSWORD = "oracle" # # SYSTEM administrator password
SYSMANPASSWORD= "oracle"
DBSNMPPASSWORD= "oracle"
DATAFILEDESTINATION = / opt/oracle/oradata # # data file storage directory
RECOVERYAREADESTINATION=/opt/oracle/flash_recovery_area # # restore the data storage directory
CHARACTERSET = "ZHS16GBK" # # character set, important! Generally speaking, it cannot be changed after the library is built, so make sure it is clear before building the library.
TOTALMEMORY = "1638" # 1638MB, physical memory 2Gbps 80%.
2. Start installing the database instance
Dbca-silent-responseFile / ghca/database/response/response/dbca.rsp
[oracle@DATAFS response] $dbca-silent-responseFile / ghca/database/response/dbca.rsp
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/ opt/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.
To this database instance installation is complete.
IX. Monitoring configuration error report
When configuring snooping, there is no absolute path to the corresponding file in netca.rsp
[oracle@DATAFS response] $netca / silent / responseFile netca.rsp
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" =. / netca.rsp
Oracle Net Configuration Assistant could not find the Response File at the given location.
Oracle Net Services configuration failed. The exit code is 1
10. Database start and stop
Log in to the database sqlplus / as sysdba
Start: SQL > startup
Stop: SQL > shutdown immediate
Create tablespaces, users, permissions, etc.
1. Administrator users create tablespaces to save data
Create tablespace IDR_TS datafile'/ opt/oracle/oradata/orcl/IDR_TS01.dbf' size 1024m
2. Create user data to manipulate users
Create user operator identified by "123456"
Default tablespace operator
Temporary tablespace TEMP
Profile DEFAULT
Quota unlimited on IDR_TS
The following permissions are optional and empower users according to their own needs
Grant connect to operator
Grant dba to operator
Grant javasyspriv to operator
-- Grant/Revoke system privileges
Grant create any sequence to operator
Grant create any table to operator
Grant create any view to operator
Grant unlimited tablespace to operator
-- Grant/Revoke role privileges
Grant connect to operator
Grant dba to operator
Grant exp_full_database to operator
Grant imp_full_database to operator
Grant javasyspriv to operator
Grant resource to operator
-- Grant/Revoke system privileges
Grant create any sequence to operator
Grant alter any table to operator
Grant alter any trigger to operator
Grant alter session to operator
Grant alter system to operator
Grant alter tablespace to operator
Grant alter user to operator
Grant analyze any to operator
Grant create any procedure to operator
Grant create any synonym to operator
Grant create any table to operator
Grant create any trigger to operator
Grant create cluster to operator
Grant create database link to operator
Grant create procedure to operator
Grant create public synonym to operator
Grant create role to operator
Grant create sequence to operator
Grant create session to operator
Grant create synonym to operator
Grant create table to operator
Grant create any view to operator
Grant delete any table to operator
Grant drop any index to operator
Grant drop any synonym to operator
Grant drop any table to operator
Grant drop any trigger to operator
Grant drop public synonym to operator
Grant execute any procedure to operator
Grant insert any table to operator
Grant lock any table to operator
Grant select any table to operator
Grant unlimited tablespace to operator
Grant update any table to operator
At this point, you can use operator login for data manipulation. The complete installation of the database is over.
>
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.