Oracle 12C Centos7.4桌面版本安裝
1.系統安裝: 安裝Centos7.4 桌面版本,注意,swap分割槽要是記憶體的2倍
2.系統安裝完成後
#安裝工具包
yum install -y vim wget net-tools unzip zip
#安裝依賴
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*i686 compat-libstdc++-33*.devel compat-libstdc++-33 compat-libstdc++-33*.devel gcc gcc-c++ glibc glibc*.i686 glibc-devel glibc-devel*.i686 ksh libaio libaio*.i686 libaio-devel libaio-devel*.devel libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.devel libXi libXi*.i686 libXtst libXtst*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686
#關閉selinux、防火牆
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state
sed -i '/^SELINUX=.*/c SELINUX=disabled' /etc/selinux/config
sed -i 's/^SELINUXTYPE=.*/SELINUXTYPE=disabled/g' /etc/selinux/config
grep --color=auto '^SELINUX' /etc/selinux/config
setenforce 0
# 建立使用者和組
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
echo "123456" | passwd --stdin oracle #oracle使用者的登入密碼,後續登入要用,記著。
#建立目錄
mkdir -p /u01/app/oracle/
chown -R oracle:oinstall /u01/app
chmod -R 775 /u01/app
#修改系統引數
echo '
* soft nofile 655350
* hard nofile 655350
* soft nproc 655350
* hard nproc 655350
* soft stack 6553600
* hard stack 655360
* soft memlock unlimited
* hard memlock unlimited
* soft core unlimited
* hard core unlimited
'>>/etc/security/limits.conf
echo '
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
#表示當keepalive起用的時候,TCP傳送keepalive訊息的頻度。預設是2小時,改為20分鐘。
net.ipv4.ip_local_port_range = 1024 65000
##表示用於向外連線的埠範圍。預設情況下很小:32768到61000,改為1024到65000。
net.ipv4.tcp_max_syn_backlog = 8192
##表示SYN佇列的長度,預設為1024,加大佇列長度為8192,可以容納更多等待連線的網路連線數。
net.ipv4.tcp_max_tw_buckets = 5000
##表示系統同時保持TIME_WAIT套接字的最大數量,如果超過這個數字,TIME_WAIT套接字將立刻被清除並列印警告資訊。
vm.max_map_count=655360
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
net.ipv4.ip_local_port_range = 9000 65500
'>/etc/sysctl.conf
新增系統變數
vi ~oracle/.bash_profile
export PATH
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH:HOME/bin
export EDITOR=/bin/vi
#上傳下載的安裝包
wget -P /u01/app/oracle
cd /orcl/app/oracle
#切換使用者
su oracle
cd /u01/app/oracle
unzip linuxx64_12201_database.zip
export
cd /u01/app/oracle/database
#重啟
reboot
oracle使用者登入系統執行安裝
cd /u01/app/oracle/database
./runInstaller
#出現上圖畫面時,新開一個命令列,切換到root使用者 執行2個指令碼
su root
sh /u01/app/oraInventory/orainstRoot.sh #回車
sh /u01/app/oracle/product/12.2.0/dbhome_1/root.sh #回車
#常用命令 # 增加檔案,擴充套件表空間 ALTER TABLESPACE USERS ADD DATAFILE '/u01/app/oracle/oradata/orcl/users03.dbf' size 200m autoextend on next 100m maxsize unlimited; #建立使用者和表空間,並授權 create tablespace fang datafile '/u01/app/oracle/oradata/fang.dbf' size 200m autoextend on next 100m maxsize unlimited; create user fang identified by 123456 default tablespace fang; grant connect,resource to fang; grant dba to fang; #遠端訪問命令 sqlplus fang/123456@172.16.2.170:1521/orcl sqlplus sys/password@192.168.0.1:1521/orcl as sysdba #修改資料庫自動增長空間 ALTER DATABASE DATAFILE 'c:SmartDB01.ora' AUTOEXTEND ON NEXT 2G 匯入資料 imp fang/123456@172.16.2.170:1521/orcl file=./fang_2020_11_09.dmp log=./imp_fang_new.log full=y ignore=y statistics=none exp fang/123456@172.16.2.170:1521/orcl file=./bj202011211.dmp full=y #檢視錶空間大小 select sum(bytes)/(1024*1024) as free_space,tablespace_name from dba_free_space group by tablespace_name; #查詢表空間剩餘大小 SELECT temp_used.tablespace_name, total - used as "Free", total as "Total", round(nvl(total - used, 0) * 100 / total, 3) "Free percent"FROM (SELECT tablespace_name, SUM(bytes_used) / 1024 / 1024 used FROM GV_$TEMP_SPACE_HEADER GROUP BY tablespace_name) temp_used, (SELECT tablespace_name, SUM(bytes) / 1024 / 1024 total FROM dba_temp_files GROUP BY tablespace_name) temp_total WHERE temp_used.tablespace_name = temp_total.tablespace_name ORDER BY B.TABLESPACE, B.SEGFILE#, B.SEGBLK#, B.BLOCKS; alter database tempfile '/u01/app/oracle/oradata/orcl/temp01.dbf' autoextend on next 500m maxsize unlimited; drop tablespace fang including contents and datafiles cascade constraint;–刪除表空間 #資料庫狀態 lsnrctl status dbca 安裝資料庫 netca 監聽器啟動安裝 netmgrselect * from dual; 檢視資料庫的併發連線數:select count(*) from v$session where status=‘ACTIVE’; 檢視當前資料庫建立的會話情況:select sid,serial#,username,program,machine,status from v$session; 查詢資料庫允許的最大連線數:select value from v$parameter where name = ‘processes’; 或者:show parameter processes; 修改資料庫允許的最大連線數: alter system set processes = 5000 scope = spfile; (需要重啟資料庫才能實現連線數的修改) 一、停止EXP/IMP優化速度 可以直接KILL 程式,但先要KILL 父程式,然後KILL子程式,只KILL子程式,EXP/IMP還會在後臺執行的 樣例:ps -ef |grep imp 查詢到pid,kill -9 pid 、kill -9 ppid,就可以了 一、停止EXP/IMP優化速度 可以直接KILL 程式,但先要KILL 父程式,然後KILL子程式,只KILL子程式,EXP/IMP還會在後臺執行的 樣例:ps -ef |grep imp 查詢到pid,kill -9 pid 、kill -9 ppid,就可以了 ps -ef |grep exp 重啟資料庫: shutdown immediate; startup;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31547066/viewspace-2900252/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 12C安裝Oracle
- oracle 12c release 2 安裝Oracle
- 安裝centOS版本oracleCentOSOracle
- Oracle 12c資料庫安裝Oracle資料庫
- Linux系統oracle 12c VMware Tools 的安裝教程LinuxOracle
- Oracle linux 7.5安裝oracle 12c dg一直提示ORA-01017OracleLinux
- centos7.4原始碼安裝php,swoole,nginx,redis,mariadbCentOS原始碼PHPNginxRedis
- 安裝Cloud Control 12cCloud
- ORACLE---Aix7.1 安裝Oracle11.2.0.4版本資料庫OracleAI資料庫
- Oracle 23ai free 版本地化安裝指南OracleAI
- oracle 12c RAC安裝,例項不能多節點同時啟動Oracle
- 超詳細oracle 11g安裝步驟 win版本Oracle
- oracle安裝配置Oracle
- Oracle RUR 安裝Oracle
- Linux安裝oracleLinuxOracle
- golang oracle 安裝GolangOracle
- Kali Linux 2020.1安裝桌面Linux
- 11. Oracle for Linux安裝和配置—11.3. Oracle安裝和配置—11.3.1. Oracle軟體安裝OracleLinux
- 「Oracle」Oracle 資料庫安裝Oracle資料庫
- [20181005]安裝12C在windows.txtWindows
- oracle 19c 安裝、解除安裝Oracle
- 安裝mysql(版本:8.0.28)MySql
- 靜默方式安裝、升級oracle(一): 安裝oracle軟體Oracle
- 在 Ubuntu 上安裝 Budgie 桌面Ubuntu
- oracleLinux下安裝oracleOracleLinux
- ubuntu下安裝oracleUbuntuOracle
- Oracle 12.2 OJVM安裝OracleJVM
- Docker中安裝OracleDockerOracle
- windows下oracle安裝WindowsOracle
- Oracle靜默安裝Oracle
- Oracle GoldenGate安裝(一)OracleGo
- Oracle GoldenGate安裝(二)OracleGo
- Oracle GoldenGate安裝(三)OracleGo
- Oracle Payment Interface安裝Oracle
- 【RAC】Oracle 12c以及以上版本的diagsnap是什麼? (Doc ID 2469643.1)Oracle
- Oracle 12c Automatic ReoptimizationOracle
- Mysql--所有版本安裝以及完全解除安裝MySql
- Adobe Audition各版本安裝包下載與安裝