偶尔有空上来看看
分类: 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