hostnamectl set-hostname wn-pt-db1
hostnamectl --static
vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 64424509440
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
vi /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
在 /etc/security/limits.conf 文件中添加:
oracle soft nofile 10240
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
yum -y install binutils compat-libstdc++-33 gcc gcc-c++ glibc glibc-common glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat openssh-clients compat-libcap1 xorg-x11-utils xorg-x11-xauth elfutils unixODBC unixODBC-devel libXp elfutils-libelf elfutils-libelf-devel smartmontools
vi /etc/selinux/config
disabled
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
useradd -u 54321 -g oinstall -G dba,oper oracle
mkdir /home/db
mkdir /home/soft
chown -R oracle:oinstall /home/soft
chown -R oracle:oinstall /home/db
chmod -R 775 /home/db
su - oracle
vi .bash_profile
export ORACLE_BASE=/home/db/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export ORACLE_SID=pt_wsap
export LANG=en_US.UTF-8
export NLS_LANG=american_america.ZHS16GBK
export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin:/home/oracle/run
export ORACLE_TERM=xterm
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
export TMOUT=0
cat /etc/oraInst.loc
inventory_loc=/home/db/oraInventory
inst_group=oinstall
./runInstaller -silent -debug -force -noconfig -IgnoreSysPreReqs \
FROM_LOCATION=/home/soft/database/stage/products.xml \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/home/db/oraInventory \
ORACLE_HOME=/home/db/oracle/product/12.2.0/dbhome_1 \
ORACLE_HOME_NAME="Oracle12c" \
ORACLE_BASE=/home/db/oracle \
oracle.install.db.InstallEdition=EE \
oracle.install.db.isCustomInstall=false \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=dba \
oracle.install.db.OSBACKUPDBA_GROUP=dba \
oracle.install.db.OSDGDBA_GROUP=dba \
oracle.install.db.OSKMDBA_GROUP=dba \
oracle.install.db.OSRACDBA_GROUP=dba \
DECLINE_SECURITY_UPDATES=true
实例名只能是字母开头,不超过8位
[FATAL] [DBT-10322] The Instance Name specified contains non alphanumeric characters.
ACTION: Specify a Instance Name that starts with an alphabet and contains only alphanumeric characters.
cd /home/db/oracle/product/12.2.0/dbhome_1/assistants/dbca/templates
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname cisdb -sid cisdb -sysPassword jyc -systemPassword jyc -responseFile NO_VALUE -datafileDestination /home/db/oracle/oradata -redoLogFileSize 200 -recoveryAreaDestination NO_VALUE -storageType FS -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -createAsContainerDatabase false -sampleSchema false -memoryPercentage 60 -databaseType OLTP -emConfiguration NONE
dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname umsdb -sid umsdb -sysPassword jyc -systemPassword jyc -responseFile NO_VALUE -datafileDestination /home/db/oracle/oradata -redoLogFileSize 200 -recoveryAreaDestination NO_VALUE -storageType FS -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -createAsContainerDatabase false -sampleSchema false -memoryPercentage 30 -databaseType OLTP -emConfiguration NONE
netca -silent -responsefile /home/db/oracle/product/12.2.0/dbhome_1/assistants/netca/netca.rsp
alter profile default limit failed_login_attempts unlimited;
alter profile default limit password_life_time unlimited;
alter system set audit_trail=none scope=spfile sid='*';
alter system set recyclebin=off scope=spfile sid='*';
alter system set sga_target=25600M scope=spfile;
alter system set pga_aggregate_target=8192M;
vi $ORACLE_HOME/network/admin/sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
[oracle@wn-jbyl-db ~]$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2019, Oracle Corporation. All rights reserved.
Oracle Home : /home/db/oracle/product/12.2.0/dbhome_1
Central Inventory : /home/db/oraInventory
from : /home/db/oracle/product/12.2.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.17
OUI version : 12.2.0.1.4
Log file location : /home/db/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2019-09-02_14-59-20PM_1.log
LsInventorySession failed: OPatch failed to locate Central Inventory.
Possible causes are:
The Central Inventory is corrupted
The oraInst.loc file specified is not valid.
OPatch failed with error code 73
[oracle@wn-jbyl-db ~]$ more /home/db/oracle/product/12.2.0/dbhome_1/oraInst.loc
#Oracle Installer Location File Location
#Mon Sep 02 14:10:42 CST 2019
inst_group=oinstall
inventory_loc=/home/db/oraInventory
[oracle@wn-jbyl-db ~]$ ls -l /home/db/oraInventory/
total 8
-rw-rw----. 1 oracle oinstall 56 Sep 2 14:10 oraInst.loc
-rwxrwx---. 1 oracle oinstall 1620 Sep 2 14:10 orainstRoot.sh
[oracle@wn-jbyl-db ~]$ ls -l /home
total 0
drwxrwxr-x. 4 oracle oinstall 40 Sep 2 14:10 db
drwx------. 6 oracle oinstall 183 Sep 2 14:59 oracle
drwx------. 14 sjswjw sjswjw 271 Aug 29 18:08 sjswjw
drwxr-xr-x. 3 oracle oinstall 22 Sep 2 13:33 soft
[oracle@wn-jbyl-db ~]$ ls -l /home/db/oraInventory
total 8
-rw-rw----. 1 oracle oinstall 56 Sep 2 14:10 oraInst.loc
-rwxrwx---. 1 oracle oinstall 1620 Sep 2 14:10 orainstRoot.sh
[oracle@wn-jbyl-db ~]$ cd $ORACLE_HOME/oui/bin
[oracle@wn-jbyl-db bin]$ ls
addLangs.sh detachHome.sh filesList.properties lsnodes runConfig.sh runInstaller.sh
attachHome.sh filesList.bat filesList.sh resource runInstaller runSSHSetup.sh
[oracle@wn-jbyl-db bin]$ ./attachHome.sh
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 32063 MB Passed
The inventory pointer is located at /etc/oraInst.loc
'AttachHome' was successful.
[oracle@wn-jbyl-db bin]$ ls -l /etc/oraInst.loc
-rw-r--r--. 1 root root 56 Sep 2 14:58 /etc/oraInst.loc
[oracle@wn-jbyl-db bin]$ more /etc/oraInst.loc
inventory_loc=/home/db/oraInventory
inst_group=oinstall
[oracle@wn-jbyl-db bin]$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2019, Oracle Corporation. All rights reserved.
Oracle Home : /home/db/oracle/product/12.2.0/dbhome_1
Central Inventory : /home/db/oraInventory
from : /home/db/oracle/product/12.2.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.17
OUI version : 12.2.0.1.4
Log file location : /home/db/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2019-09-02_15-03-28PM_1.log
Lsinventory Output file location : /home/db/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2019-09-02_15-03-28PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: wn-jbyl-db
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 12c 12.2.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
[oracle@wn-jbyl-db bin]$
OPatch found the word "error" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
chmod: changing permissions of ?home/db/oracle/product/12.2.0/dbhome_1/bin/extjobO? Operation not permitted
make: [iextjob] Error 1 (ignored)
Patch 29757449 successfully applied.
OPatch Session completed with warnings.
Log file location: /home/db/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2019-09-02_15-05-49PM_1.log
OPatch completed with warnings.
Connect / as sysdba
startup
quit
% ./datapatch -verbose