偶尔有空上来看看
分类: Oracle
2020-07-17 16:51:59
Oracle software |
LINUX.X64_193000_db_home.zip |
Oracle RU |
p30783543_190000_Linux-x86-64.zip (COMBO OF OJVM RU COMPONENT 19.7.0.0.200414 DB RU 19.7.0.0.200414) |
Oracle OPatch |
p6880880_190000_Linux-x86-64.zip |
compat-libstdc++软件 |
compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm |
OS WATCHER服务包 |
oswatcher-8.3.0-1.el7.noarch.rpm |
RHEL7.4光盘 |
rhel-server-7.7-x86_64-dvd.iso |
cat > /etc/yum.repos.d/yum.repo<
[RHEL77]
name=RHEL77
baseurl=file:///mnt
gpgcheck=0
EOF
yum makecache
yum install -y elfutils* gcc* glibc* libaio* libgcc* libgomp* libstdc* libstdc++-devel* sysstat unixODBC* *libcap* libXp* dstat* compat-* bc unzip smartmontools* mlocate* psmisc* -y
cd /u01/media
rpm -e compat-libstdc++
rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
设置主机名
cat >> /etc/hosts <
XX.XX.1.20 o19c
EOF
cat >> /etc/sysctl.conf <
kernel.shmmax = 137438953472
kernel.shmall = 33554432
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
kernel.panic_on_oops = 1
kernel.randomize_va_space = 0
fs.file-max = 6815744
fs.aio-max-nr = 4194304
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
net.ipv4.ipfrag_high_thresh = 16777216
net.ipv4.ipfrag_low_thresh = 15728640
net.ipv4.ipfrag_time = 60
vm.min_free_kbytes = 524288
vm.swappiness = 0
# vm.nr_hugepages = 43008
EOF
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/sysconfig/selinux
打开用户限制
cat >> /etc/security/limits.conf <
#ORACLE SETTING
* soft memlock unlimited
* hard memlock unlimited
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft stack 10240
EOFsystemctl stop postfix
systemctl stop smartd
systemctl disable firewalld
systemctl disable postfix
systemctl disable smartdsystemctl disable firewalld
cat >> /etc/pam.d/login <
#ORACLE SETTING
session required pam_limits.so
EOFsed -i '/GRUB_CMDLINE_LINUX=/ s/"$/ transparent_hugepage=never"/' /etc/default/grub
grub2-mkconfig > /boot/grub2/grub.cfggroupadd -g 1001 oinstall
groupadd -g 1002 dba
useradd -u 1100 -g oinstall -G dba,oinstall oracle
echo "oracle"|passwd --stdin oracle
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/19.3/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01vi ~/.bash_profile
# Oracle 19c oracle Environment
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3/db_1
export ORACLE_SID=ORCL
export TMP=/tmp
export NLS_LANG=american_america.AL32UTF8
export LIBPATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export LD_LIBRARY_PATH=$LD_LIBARY_PATH:$ORACLE_HOME/jdk/jre/lib:$ORACLE_HOME/network/lib:$ORACLE_HOME/rdbms/lib
export LD_LIBRARY_PATH=$LD_LIBARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export CLASS_PATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:.
umask 022
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
alias sql='sqlplus / as sysdba'
stty erase ^Hcd /u01/media/
unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME/rpm -ivh cvuqdisk-1.0.10-1.rpm
vi db.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oinstall
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.rootconfig.executeRootScript=false
oracle.install.db.rootconfig.configMethod=
oracle.install.db.rootconfig.sudoPath=
oracle.install.db.rootconfig.sudoUserName=
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.ConfigureAsContainerDB=false
oracle.install.db.config.PDBName=
oracle.install.db.config.starterdb.characterSet=
oracle.install.db.config.starterdb.memoryOption=false
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.password.PDBADMIN=
oracle.install.db.config.starterdb.managementOption=DEFAULT
oracle.install.db.config.starterdb.omsHost=
oracle.install.db.config.starterdb.omsPort=0
oracle.install.db.config.starterdb.emAdminUser=
oracle.install.db.config.starterdb.emAdminPassword=
oracle.install.db.config.starterdb.enableRecovery=false
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=./runInstaller -ignorePrereq -silent -force -responseFile /home/oracle/db.rsp
大概10分钟...
用root执行:cd /u01/media
unzip p6880880_*.zip -d $ORACLE_HOME/
$ORACLE_HOME/OPatch/opatch versioncd /u01/media/30783543/30869156
$ORACLE_HOME/OPatch/opatch apply30805684;OJVM RELEASE UPDATE: 19.7.0.0.200414 (30805684)
30869156;Database Release Update : 19.7.0.0.200414 (30869156)
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
dbca -ignorePreReqs -ignorePrereqFailure -silent -createDatabase -responseFile /home/oracle/dbca.rsp
alter system set processes=1000 scope=spfile;
alter system set control_file_record_keep_time=60 scope=spfile sid='*';
alter system set deferred_segment_creation=false scope=spfile sid='*';
alter system set event='43822 trace name context forever,level 1','28401 trace name context forever,level 1','10949 trace name context forever,level 1' scope=spfile sid='*';
alter system set max_dump_file_size='1024M' scope=spfile sid='*';
alter system set open_cursors=500 scope=spfile sid='*';
alter system set parallel_max_servers=32 scope=spfile sid='*';
alter system set recovery_parallelism=10 scope=spfile sid='*';
alter system set result_cache_max_size=0 scope=spfile sid='*';
alter system set session_cached_cursors=100 scope=spfile sid='*';
alter system set large_pool_size=256m scope=spfile;
alter system set db_files=1000 scope=spfile;alter system set "_cleanup_rollback_entries"=10000 scope=spfile sid='*';
alter system set "_datafile_write_errors_crash_instance"=false scope=spfile sid='*';
alter system set "_gc_defer_time"=3 scope=spfile sid='*';
alter system set "_optimizer_use_feedback"=false sid ='*' scope=spfile;
alter system set "_partition_large_extents"=false scope=spfile sid='*';
alter system set "_px_use_large_pool"=true sid ='*' scope=spfile;
alter system set "_sys_logon_delay"=0 sid ='*' scope=spfile;
alter system set "_optimizer_adaptive_cursor_sharing"=false sid='*' scope=spfile;
alter system set "_optimizer_extended_cursor_sharing"=none sid='*' scope=spfile;
alter system set "_optimizer_extended_cursor_sharing_rel"=none sid='*' scope=spfile;alter profile default limit PASSWORD_LIFE_TIME unlimited;
alter profile default limit PASSWORD_LOCK_TIME unlimited;
alter profile default limit PASSWORD_GRACE_TIME unlimited;
alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;
exec dbms_workload_repository.modify_snapshot_settings(interval=>30, retention=>45*24*60);
exec dbms_auto_task_admin.disable(client_name => 'sql tuning advisor',operation => NULL,window_name => NULL);
exec dbms_auto_task_admin.disable(client_name => 'auto space advisor',operation => NULL,window_name => NULL);startup mount
alter database archivelog;
alter database open;
vi /etc/sysconfig/oswatcher
# The directory where oswatcher logs should be kept
DATADIR=/u01/oswatcher
# The interval (in seconds) between runs runs of statistics collections
INTERVAL=10
# The maximum age (in hours) of the various log files
MAXAGE=72
# Extra options, for example, "-z gzip" to compress files
OPTIONS=-z gzipsystemctl start oswatcher
systemctl enable oswatcher