Oracle安装(12c-Redhat6.5)

Redhat6.5系统准备

/

10G

SWAP

4G

/boot

200M

/HOME

4G

/usr

8G

/var

4G

/u01

 

一:Linux挂载:VMware tools for Linux安装

# mkdir /mnt/cdrom

# mount /dev/cdrom /mnt/cdrom/

# cp VMwareTools-9.0.0-782409.tar.gz /opt/

# tar -zxvpf VMwareTools-9.0.0-782409.tar.gz

#  cd vmware-tools-distrib

# ./vmware-install.pl

#  /etc/init.d/vmware-tools status  #查看是否有在執行

二、设置ip地址:Linux网络配置:设置IP地址、网关DNS、主机名

/etc/sysconfig/network-scripts/ifcfg-ethN 文件

/etc/hosts文件

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=static

IPADDR=192.168.0.66

NETMASK=255.255.255.0

GATEWAY=192.168.0.65

配置OK后使用service network restart重启网络服务

三、设置防火墙

设置 vim /etc/selinux/config

SELINUX=disabled

关闭防火墙

chkconfig ip6tables off

chkconfig iptables off

service iptables stop

service ip6tables stop

查看防火墻狀態:service iptables status

啟動防火墻:service iptables start

禁用防火墻:service iptables stop

四、建立oracle账户和群组

建立dba群组:groupadd dba

创建oracle用户并授权到dba群组:useradd -g dba oracle

设定oracle用户密码:passwd oracle

五、创建oracle工作目录

Oracle基础目录:mkdir -p /u01/app/oracle

Oracle软件存放目录:mkdir -p /u01/app/oracle/product

Oracle库存目录:mkdir -p /u01/app/oraInventory

Oracle数据库文件目录:mkdir -p /u01/app/oracle/oradata

六、授权Oracle工作目录

chown -R oracle.dba /u01

七、Yum源配置,安装Packages

挂载Redhat5.8ISO文件

mount /dev/cdrom /mnt/cdrom

注:虚拟机-〉setting->cd/dvd-〉device status-.connected前面的勾打上

备份Yum的配置文件

1. #cd /etc/yum.repos.d/

2. #cp rhel-debuginfo.repo rhel-debuginfo.repo.bak

配置文件进行编辑

vi rhel-debuginfo.repo

[rhel-debuginfo]

name=Red Hat Enterprise Linux $releasever – $basearch – Debug

baseurl=file:///mnt/cdrom/Server

enabled=1

gpgcheck=1

gpgkey=file:///mnt//cdrom/pki/rpm-gpg/RPM-GRG-KEY-redhat-release

vim rhel-source.repo

[oel6]

name=oel6

baseurl=file:///mnt/cdrom

enabled=1

gpgcheck=0

验证可以安装的组件

#yum grouplist

安装组件

#yum groupinstall “KDE (K Desktop Environment)”

# yum -y install glibc-devel-2.5*

Packages:Red Hat Enterprise Linux 4.0:

binutils-2.15.92.0.2-10.EL4

compat-db-4.1.25-9

control-center-2.8.0-12

gcc-3.4.3-9.EL4

gcc-c++-3.4.3-9.EL4

glibc-2.3.4-2

glibc-common-2.3.4-2

gnome-libs-1.4.1.2.90-44.1

libstdc++-3.4.3-9.EL4

libstdc++-devel-3.4.3-9.EL4

make-3.80-5

pdksh-5.2.14-30

sysstat-5.0.5-1

xscreensaver-4.18-5.rhel4.2

八、Configuring Kernel Parameters

kernel parameter settings

/etc/sysctl.conf

/sbin/sysctl -p /etc/sysctl.conf

kernel.shmmni = 4096

kernel.sem = 250 32000 100 142

fs.aio-max-nr = 1048576

fs.file-max = 6815744

net.ipv4.ip_local_port_range = 9000 65000

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default =262144

net.core.wmem_max = 1048576

Setting Shell Limits

for the oracle User

1、Add the following lines to the /etc/security/limits.conf file:

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile 1024

oracle              hard    nofile 65536

2、Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:

session    required     pam_limits.so

3、Depending on the oracle user's default shell, make the following changes to the default shell start-up file:

For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the /etc/profile.local file on SUSE systems):

if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi

For the C shell (csh or tcsh), add the following lines to the /etc/csh.login file (or the file on SUSE systems)/etc/csh.login.local:

if ( $USER == "oracle" ) then

limit maxproc 16384

limit descriptors 65536

endif

Configuring the oracle User's Environment

/home/oracle/.bash_profile

Source /home/oracle/.bash_profile

#Enter commands similar to the following to set the TEMP and TMPDIR environment variables:

TMP=/tmp; export TMP

TMPDIR=$TMP;

export TMPDIR

#Enter commands similar to the following to set the ORACLE_BASE and ORACLE_SID environment variables:

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

.0/dbhome_1;

export ORACLE_HOME

ORACLE_SID=ora01;

export ORACLE_SID

ORACLE_UNQNAME=ora01;

export ORACLE_UNQNAME

PATH=/usr/sbin:$PATH;

export PATH

PATH=$ORACLE_HOME/bin:$PATH;

export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64;

export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

TNS_ADMIN=$ORACLE_HOME/network/admin

NLS_LANG=AMERICAN_AMERICA.AL32UTF8;

export NLS_LANG

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

九、解压缩安装文档:Linux压缩解压缩(unzip,tar)

 

十、安装ORACLE软件

以root账户权限运行

/u01/app/oraInventory/orainstRoot.sh

/u01/app/oracle/product/12.2.0/dbhome_1/root.sh

十一、安装数据

十二:安装LISTENER

Oracle 监听器启动与关闭

启动:lsnrctl start

关闭:lsnrctl stop

使用srvctl 命令

Oracle环境变量、监听listener.ora、tnsnames.ora、sqlnet.ora配置

/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora配置

在这个目录下有个listener.ora文件,内容如下:

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = ora01))

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.111)(PORT = 1521))

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

)

)

ADR_BASE_LISTENER = /u01/app/oracle

十三:连接oracle

PLSQL Developer在未安装Oracle Client情况下连接Oracle

若遇到如上错误,下载instantclient_12.2

/u01/app/oracle/product/11.2.0.4.0/dbhome_1/network/admin/tnsnames.ora配置

安装完Oracle Client以后,发现相应目录中没有tnsnames.ora文件,其实只要手动建立一个就可以了。

在 oracle安装位置product11.2.0client_1networkadmin 目录下,建立一个tnsnames.ora,内容如下

ora01=

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(host = 192.168.0.111)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SID=ora01)

)

)

D:\PLSQL\instantclient_11_2\tnsnames.ora

sqlplus常用命令

在sqlplus中调用本机操作系统命令,只需要在相关命令前加上HOST指令即可。

设置每行显示的记录长度

SET LINESIZE 300;

设置每页显示的记录长度

SET PAGESIZE 30;

调用本机记事本程序

使用ed命令

用户连接数据库

CONN 用户名/密码 [AS SYSDBA]

取得当前用户的全部数据对象

SELECT * FROM tab

查看表结构

DESC 表名称

使用本机的操作系统命令

HOST 命令

查看当前连接用户

SHOW USER命令

查看现在的容器名称

show con_name;

CON_NAME

------------------------------

CDB$ROOT

改变容器为PDB

ALTER SESSION SET CONTAINER=ora01pdb01

ALTER DATABASE ora01pdb01 OPEN;

ALTER PLUGGABLEDATABASE ORA01PDB01 OPEN;

查看用户

SELECT username FROM dba_users WHERE username='SCOOT' OR username='SH';

最新文章

  1. SageCRM 页面加载完后,用下拉框联动修改放大镜字段的取值范围
  2. AJAX进行数据交互的过程
  3. iOS 微信分享
  4. SQL Server SQL分页查询
  5. Python脚本控制的WebDriver 常用操作 <十一> 操作测试对象
  6. 《梦断代码》读书笔记第0篇——“软件时间”、“死定了”、“Agenda之魂“
  7. Android 非Activity类引用getResources()方法问题的解决方法
  8. PHP开发调优clockwork工具
  9. Linux服务器集群系统(二)--转
  10. discuz!X2.5技术文档
  11. vs2015
  12. QT unit test code coverage
  13. 2014多校3 Wow! Such Sequence!段树
  14. ZOJ 2794 Just Pour the Water 【矩阵快速幂】
  15. Python import hook
  16. linux 查找指定进程并kill
  17. 最接近原点的K个点
  18. Cesium学习1:如何在本机的Apache tomcat9.0.8服务器中打开cesium的index.html页面
  19. Intent 跳转Activity
  20. linux学习:【第1篇】初识Linux及安装

热门文章

  1. CYQ学习主要摘要3
  2. [转]James Bach:测试人员的角色
  3. jQuery瀑布流插件 Masonry
  4. excel 笔记
  5. cocos2d-x中CCEditbox导出到lua
  6. 框架Iframe的退出,IE 火狐都没问题 到360就不跳转页面 刷新一遍才跳转到登录页
  7. java 基础数据结构
  8. python的post请求抓取数据
  9. 扩展KMP - HDU 4333 Revolving Digits
  10. grafana里prometheus查询语法