安装、建库、登录
free -m
df -h
df -h /tmp
uname -r
oralce安装
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
修改内核参数
配置用户进程和文件数
mkdir /home/U01
mkdir -p /U01/app/oracle
chown -R oracle:oinstall /U01/
chmod -R 755 /U01/
配置环境变量,实例名test
export ORACLE_BASE=/U01/app/oracle
export ORACLE_HOME=ORACLE_HOME/bin:ORACLE_HOME/jdk/bin:$PATH
export LANG="en_US.UTF-8"
export NLS_LANG=american_AMERICA.UTF8
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
CPU\PSU oracle的补丁包... 11.2.0.4
响应文件
创建数据库,删除数据库
dba登录
三种角色:sysdba,sysoper,dba
#######安装
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vi /etc/pam.d/login
session required /lib64/security/pam_limits.so
session required pam_limits.so
vi /etc/sysctl.conf
fs.aio-max-nr=1048576
fs.file-max=6815744
kernel.shmall=2097152
kernel.shmmni=4096
kernel.shmmax = 2147483648
kernel.sem=250 32000 100 64
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=1048586
sysctl -p
vi /etc/redhat-release
redhat-7
vi /etc/profile
if [ SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=PATH:ORACLE_HOME/bin
export LANG="zh_CN.UTF-8"
export NLS_LANG='SIMPLIFIED CHINESE_CHINA.AL32UTF8'
source /etc/profile
groupadd oinstall; groupadd dba
useradd -g oinstall -g dba -m oracle
passwd oracle
mkdir -p /home/oracle/app/oracle/product
mkdir -p /home/oracle/app/oradata
chown -R oracle:oinstall /home/oracle/app
setenforce 0
systemctl stop firewalld.service
yum groupinstall "X Window System" -y
yum install xdpyinfo xorg-x11-server-utils-7.7-14.el7 tigervnc-server vnc -y
yum install -y binutils-2.23.52.0.1-12.el7.x86_64 compat-libcap1-1.10-3.el7.x86_64 gcc-4.8.2-3.el7.x86_64 gcc-c++-4.8.2-3.el7.x86_64 glibc-2.17-36.el7.i686 glibc-2.17-36.el7.x86_64 glibc-devel-2.17-36.el7.i686 glibc-devel-2.17-36.el7.x86_64 ksh libaio-0.3.109-9.el7.i686 libaio-0.3.109-9.el7.x86_64 libaio-devel-0.3.109-9.el7.i686 libaio-devel-0.3.109-9.el7.x86_64 libgcc-4.8.2-3.el7.i686 libgcc-4.8.2-3.el7.x86_64 libstdc++-4.8.2-3.el7.i686 libstdc++-4.8.2-3.el7.x86_64 libstdc++-devel-4.8.2-3.el7.i686 libstdc++-devel-4.8.2-3.el7.x86_64 libXi-1.7.2-1.el7.i686 libXi-1.7.2-1.el7.x86_64 libXtst-1.2.2-1.el7.i686 libXtst-1.2.2-1.el7.x86_64 make-3.82-19.el7.x86_64 sysstat-10.1.5-1.el7.x86_64
通过打包,rpm -Uvh *.rpm --nodeps --force
wget http://vault.centos.org/5.11/os/x86_64/CentOS/pdksh-5.2.14-37.el5_8.1.x86_64.rpm
rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
rpm -ivh http://vault.centos.org/5.11/os/i386/CentOS/compat-libstdc++-33-3.2.3-61.i386.rpm --nodeps --force
rpm -ivh ftp://ftp.icm.edu.pl/vol/rzm3/linux-oracle-repo/EnterpriseLinux/EL4/latest/x86_64/libgcc-3.4.6-3.1.i386.rpm --nodeps --force
rpm -ivh ftp://ftp.pbone.net/mirror/www.whiteboxlinux.org/whitebox/4/en/updates/i386/libstdc++-3.4.6-11.i386.rpm --nodeps --force
rpm -ivh http://vault.centos.org/5.11/os/i386/CentOS/unixODBC-2.2.11-10.el5.i386.rpm --nodeps --force
rpm -ivh http://vault.centos.org/5.11/os/x86_64/CentOS/unixODBC-devel-2.2.11-10.el5.x86_64.rpm --nodeps --force
rpm -ivh http://vault.centos.org/5.11/os/i386/CentOS/glibc-devel-2.5-123.i386.rpm --nodeps --force
startx
在图形界面,用root运行xhost +
su oracle
./runInstall
安装出现ins_ctx.mk错误,则更改文件
ctxhx: (LINK_CTXHX) (INSO_LINK) /usr/lib64/stdc.a
retry
出现ins_emagent.mk.错误
(MK_EMAGENT_NMECTL) -lnnz11
retry
--
用root执行
sh /home/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh
sh /home/oracle/oraInventory/orainstRoot.sh
图形界面上,oracle用户,指令
rpm -ivh http://mirror.centos.org/centos/7/os/x86_64/Packages/ksh-20120801-139.el7.x86_64.rpm --nodeps --force
dbca
创建数据库,中间要输入密码,设置语言UTF8
配置监听
netca
查看状态,
lsnrctl status
lsnrctl start LISTENER
lsnrctl stop LISTENER
服务端配置文件 listener.ora 客户端 tnsnames.ora
1、Linux oracle数据库listener.ora存放路径
cd /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
2、Linux oracle数据库tnsnames.ora存放路径
cd /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
3、ORACLE启动监听器
(1)切换至oracle安装用户(一般为oracle)
su - oracle
(2)启动监听器
lsnrctl start
(3)停止监听器
lsnrctl stop
--
连接
sqlplus /@test as sysdba
sqlplus name/pass@test