centos6.7下安装oracle12C
oracle12c安装、启动、卸载图文教程

Oracle12c安装和配置1.1配置内核参数添加如下行:fs.file-max = 6815744kernel.sem = 250 32000 100 128kernel.shmmni = 4096kernel.shmall = 1073741824kernel.shmmax = 4398046511104kernel.panic_on_oops = 1net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576net.ipv4.conf.all.rp_filter = 2net.ipv4.conf.default.rp_filter = 2fs.aio-max-nr = 1048576net.ipv4.ip_local_port_range = 9000 65500 运行sysctl -p命令更改当前内核参数1.2限制oracle用户资源使用vi /etc/security/limits.conf添加如下行:oracle soft nofile 1024oracle hard nofile 65536 oracle soft nproc 16384 oracle hard nproc 16384 oracle soft stack 10240 oracle hard stack 32768 oracle hard memlock 134217728 oracle soft memlock 1342177281.3安装依赖软件包yum install binutils -yyum install compat-libcap1 -yyum install compat-libstdc++-33 -yyum install compat-libstdc++-33.i686 -y yum install glibc -yyum install glibc.i686 -yyum install glibc-devel -yyum install glibc-devel.i686 -yyum install ksh -yyum install libaio -yyum install libaio.i686 -yyum install libaio-devel -yyum install libaio-devel.i686 -yyum install libX11 -yyum install libX11.i686 -yyum install libXau -yyum install libXau.i686 -yyum install libXi -yyum install libXi.i686 -yyum install libXtst -yyum install libXtst.i686 -yyum install libgcc -yyum install libgcc.i686 -yyum install libstdc++ -yyum install libstdc++.i686 -yyum install libstdc++-devel -yyum install libstdc++-devel.i686 -y yum install libxcb -yyum install libxcb.i686 -yyum install make -yyum install nfs-utils -yyum install net-tools -yyum install smartmontools -yyum install sysstat -yyum install unixODBC -yyum install unixODBC-devel -y1.4创建新组和新用户groupadd -g 54321 oinstallgroupadd -g 54322 dbagroupadd -g 54323 operuseradd -u 54321 -g oinstall -G dba,oper oracle2附加设置2.1为oracle用户设置密码2.2修改设置SELINUXvi /etc/selinux/config## 将`SELINUX`修改为permissiveSELINUX=permissivesetenforce Permissive2.3确保禁用防火墙systemctl stop firewalldsystemctl disable firewalld2.4创建Oracle安装目录mkdir -p /usr/local/products/oracle12cchown -R oracle:oinstall /usr/localchmod -R 775 /usr/local/2.5配置Oracle环境变量并验证切换到新添加的oracle用户名下,在oracle用户下配置环境变量su oraclevi .bash_profileexport TMP=/tmpexport TMPDIR=$TMPexport ORACLE_HOSTNAME=DEV-ORACLE-12C-164export ORACLE_UNQNAME=orclexport ORACLE_BASE=/usr/local/productsexport ORACLE_HOME=$ORACLE_BASE/oracle12cexport ORACLE_SID=orclexport PATH=/usr/sbin:/usr/local/bin:$PATHexport PATH=$ORACLE_HOME/bin:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib使配置立即生效source .bash_profileecho $ORACLE_HOME/usr/local/products/oracle12c3 Oracle安装3.1上传解压将下载的linuxx64_12201_database.zip上传到Linux系统/home/oracle目录下解压unzip linuxx64_12201_database.zip如果没有unzip要先安装yum install zip unzip3.2修改响应文件压缩包解压完成后得到名为database的文件夹,其中包含安装文件。
centos6.7安装oracle

centos6.7 安装oracle数据库1、系统参数配置配置固定IP重启服务:2、修改本机名称# vim /etc/sysconfig/network 打开配置文件,修改hostname3、修改系统标识,(oracle默认不支持centos系统安装),否则oracle将无法识别本系统导致安装失败。
执行# vim /etc/redhat-release 打开文件,注释掉# centos release 6.7(final),添加Red Hat Enterprise Linux 6。
修改red hat成哪个版本需要根据你系统的版本来看。
4、关闭SELinux#vim /etc/selinux/config,修改SELINUX=enforcing的值为disabled5、关闭防火墙# chkconfigiptables off , # service iptables stop6、修改内核参数# vim /etc/sysctl.conf文件,在文件最后加上如下参数fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586注释掉原文件中已经存在的一些参数:执行# sysctl–p 使参数生效7、修改/etc/pam.d/login , # vim /etc/pam.d/login 在文本末尾加上session required /lib64/security/pam_limits.sosession required pam_limits.so8、创建oracle用户、用户组# groupaddoinstall创建用户组oinstall# groupadddba创建用户组dba# useradd -g oinstall -G dba oracle 创建用户oracle,并加入oinstall和dba附属组# passwd oracle 设置用户oracle的登录密码,根据提示输入两次密码9、打开文件# /etc/profile ,修改oracle用户的最大进程数:if [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi退出保存后执行# source /etc/profile使其生效10、配置oracle用户的环境变量,必须切换到新创建的oracle用户下,# su–oracle,再修改.bash_profile配置文件,在文件末尾添加如下配置:export ORACLE_BASE=/home/oracle/appexport ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1export ORACLE_SID=orcl #SID注意和自己即将建立的SID对应export PATH=$PATH:$HOME/bin:$ORACLE_HOME/binexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib11、编辑/etc/security/limits.conf文件,修改操作系统对oracle用户资源的限制,在文件末尾添加oracle softnproc 2047oracle hardnproc 16384oracle softnofile 1024oracle hardnofile 65536oracle hard stack 1024012、操作系统版本及补丁矩阵,需要安装以下RPM软件包(加32bit括号注解的是该软件包32位版本,对应同名未加注解的则是该软件包64位版本。
Centos7Oracle12C超详细安装

Centos7Oracle12C超详细安装[1] 先决环境Install Desktop Environment, refer to here.[2] Install required packages.[root@dlp ~]# yum -y install binutils compat-libcap1 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc.i686 ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++l7.i686 libstdc++-devel libstdc++-devel.i686 compat-libstdc++-33 compat-libstdc++-33.i686 libXi libXi.i686 libXtst libXtst.i686 make sysstat[3] Edit Kernel parameters.[root@dlp ~]# MEMTOTAL=$(free -b | sed -n '2p' | awk '{print $2}')[root@dlp ~]# SHMMAX=$(expr $MEMTOTAL / 2)[root@dlp ~]# SHMMNI=4096[root@dlp ~]# PAGESIZE=$(getconf PAGE_SIZE) [root@dlp ~]# cat >> /etc/sysctl.conf << EOFfs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmmax = $SHMMAXkernel.shmall = `expr \( $SHMMAX / $PAGESIZE \) \* \( $SHMMNI / 16 \)`kernel.shmmni = $SHMMNIkernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576EOF [root@dlp ~]# sysctl -pfs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmmax = 6274715648 kernel.shmall = 392169728 kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.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[4] Create user and groups for Oracle Database service.[root@dlp ~]# i=54321; for group in oinstall dba backupdba oper dgdba kmdba; dogroupadd -g $i $group; i=`expr $i + 1` done [root@dlp~]#useradd-u1200-goinstall-Gdba,oper,backupdba,dgdba,kmdba -d /home/oracle oracle[root@dlp ~]# passwd oracle Changing password for user oracle. New password: Retype new password:passwd: all authentication tokens updated successfully. [root@dlp ~]# mkdir -p /u01/app/oracle [root@dlp ~]# chown -R oracle:oinstall /u01/app [root@dlp ~]# chmod -R 775 /u01[root@dlp ~]# vi /etc/pam.d/login # near line 14: add1 2 session required pam_selinux.so open session required pam_namespace.so1 s ession required pam_limits.so1 2 3 session optional pam_keyinit.so force revoke session include system-auth -session optional pam_ck_connector.so[root@dlp ~]# vi /etc/security/limits.conf # add to the end1 2 3 4 5 6 oracle softnproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oraclehardstack 32768[5]图形化安装Oracle 12C Login with the user "oracle" and set environment variables.dlp login: oracle Password:[oracle@dlp ~]$ vi ~/.bash_profile # add to the end umask 022export ORACLE_BASE=/u01/app/oracle # create a temporary directory for installation[oracle@dlp ~]$ mkdir tmp[1]Login and work with oracle admin user which you create in pre-requirements settings.[2] Download Oracle Databse 12c for Linux and upload on your server. ?/technology/software/products/database/index.html [3] After uploading Oracle files, move to a tmp directory and run an Installer like follows.[oracle@dlp ~]$ cd tmp [oracle@dlp tmp]$ unzip linuxamd64_12102_database_1of2.zip [oracle@dlptmp]$unziplinuxamd64_12102_database_2of2.zip[oracle@dlp tmp]$ ./database/runInstaller[4] Oracle Installer starts like follows. First, Set your email address and password for receiving some infomation from Oracle likesecurity issues and so on.[5] On this example, Select "Install database software only".[6] On this example, Select "Single Instance Database ***".[7] Select your language.[8] Select which edition you install.[9]Specify the base directory and files for Oracle. On this example, keep default and proceed to next.[10]Specify the installed directory. On this example, keep default and proceed to next.[11]Specify the priviledged group. On this example, keep default and proceed to next.[12] Pre-requirements are checked. If some settings are not configuredfor recomendations, notification is displayed likefollows.Confirm them again.[13]The summary is shown for configuration. Click "Install" if it's OK all.[14] Installation starts.[15]Following screen is shown, then open a terminal and execute follwong commands with the root user.[root@dlp ~]# /u01/app/oraInventory/orainstRoot.sh1 2 Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group.3 4 5 6 7Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete. [root@dlp ~]# [root@dlp~]#/u01/app/oracle/product/12.1.0/dbhome_1/root.sh12345Performing root user operation. The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/12.1.0/dbhome_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: # Enter12 3 4 5 6 7 8 9 10Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... Creating /etc/oratab file...Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script.Now product-specific root actions will be performed.[16] Installation completed. Click "Close" button.[17] Set Environment variables for Oracle user.[oracle@dlp ~]$ vi ~/.bash_profile # add to the end exportORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1exportPATH=$PATH:$ORACLE_HOME/bin[oracle@dlp~]$ source ~/.bash_profile[oracle@dlp ~]$ rm -rf tmp创建监听Create Oracle Net Listener that is the network service onOracle.[1]Login with the oracle admin user and input a command "netca" like follows.[oracle@dlp ~]$ netca[2] Check a box "Listener Configuration" and go next.[3] Go next.[4] Set Listner's name. Input any one you like.[5] This example goes next with keeping default "TCP".[6] Set a port. This example goes next with keeping default.[7]If you'd like to create more Listeners, Answer "Yes". This example selects "No".[8] Configuration completed.[9]After creating Listener, tnslsnr listens on the port you configured like follows.[oracle@dlp ~]$ ss -napt123456789StateRecv-QSend-QLocalAddress:Port Peer Address:Port LISTEN 0 128 *:22 *:* LISTEN 0 128 127.0.0.1:631 *:* LISTEN 0 100 127.0.0.1:25 *:* ESTAB 0 52 10.0.0.30:22 10.0.0.5:50113 LISTEN 0 128 :::1521 :::* users:(("tnslsnr",3988,9)) LISTEN 0 128 :::22 :::* LISTEN 0 128 ::1:631 :::*LISTEN 0 100 ::1:25 :::* [oracle@dlp ~]$ tnsping localhost 12TNS Ping Utility for Linux: Version 12.1.0.2.0 - Productionon 04-JUL-2015 01:03:0734567891 0 Copyright (c) 1997, 2014, Oracle. All rights reserved. Used parameter files:Used HOSTNAME adapter to resolve the alias Attempting to contact(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADD RESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))OK (0 msec)创建数据库 Create a Database.[1] Login with the oracle admin user and input acommand "dbca" like follows.[oracle@dlp ~]$ dbc[2] Select "Create Database" and go next.[3] On this example, select "Advanced Mode" and go next.[4] This example selects "General Purpose ***" and go next.[5]Set Grobal Database name and SID like follows. Input any one you like.[6] This example goes next with keeping default.[7] Set passwords. Please set a password for a user for security.[8] Configure Listener. On this example, keep default and go next.[9]Configure Storage settings. On this example, keep default and go next.[10]Configure sample schema and scripts. If you'd like to add them, Set them.[11] Configure memory settings. After setting, go to next tab.[12] Specify max processes.[13] Set Character setting.[14] Select a connection mode. If your server does not have many clients, Select Dedicated server mode. If your server has manyclients, Select Shared server mode.[15] Go next.[16] Configuration completed. Click "Finish" button to finish.[17] Database creation starts.[18] After completing to create a database, Click "Close" to finish.[19] Add Database SID to the environment variables.[oracle@dlp ~]$ vi /etc/oratab # change like followsdlp:/u01/app/oracle/product/12.1.0/dbhome_1: Y [oracle@dlp ~]$ vi ~/.bash_profile # add to the endexport ORACLE_SID=dlpTo access to the Enterprise Manager, it's possible to manage Database on Web GUI.[1] After creating database, database service is running and it'spossible to access to Enterprise Manager, too. Access to the URL which was displayed when database creation finished, then Login form is shown and it's possible to login with a database user.[2] Just logined. It's possible to manage Database on here.Create Systemd file for Oracle Database services.[1] Login as root user and create Systemd files.[root@dlp ~]# vi /etc/sysconfig/dlp.oracledb # create new : define environment variablesORACLE_BASE=/u01/app/oracleORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1ORACLE_SID=dlp # configure listener service[root@dlp~]#vi/usr/lib/systemd/system/*******************#thisis an example, modify for free12 3 4 5 6 7 8 9 10 11 12 13[Unit]Description=oracle net listener After=network.target [Service] Type=forkingEnvironmentFile=/etc/sysconfig/dlp.oracledbExecStart=/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start ExecStop=/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl stop User=oracle [Install] WantedBy=multi-user.target # configure database service[root@dlp~]#vi/usr/lib/systemd/system/********************#this is an example, modify for free1 2 3 4 5 6 7 8 9 10 11 12 13 [Unit]Description=oracle net listenerAfter=network.target lsnrctl.service [Service] Type=forkingEnvironmentFile=/etc/sysconfig/dlp.oracledbExecStart=/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbstart /u01/app/oracle/product/12.1.0/dbhome_1ExecStop=/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbshut /u01/app/oracle/product/12.1.0/dbhome_1 User=oracle [Install] WantedBy=multi-user.target[root@dlp ~]# systemctl daemon-reload[root@dlp ~]# systemctl enable dlp@lsnrctl dlp@oracledb。
oracle12c安装教程linux

oracle12c安装教程linux一、安装环境准备1、操作系统:Oracle 12c 支持的操作系统:(1)Linux x86-64 (Red Hat Enterprise Linux 5、6、7、Oracle Linux 5、6、7、Suse Linux Enterprise Server 11 SP2)(2)Solaris x86-64 (Solaris 11.2)(3)AIX 7.12、硬件环境:(1)CPU:双核或更多(2)内存:2GB以上(3)硬盘:至少有4GB的空闲空间二、安装步骤1、下载安装文件从官网下载Oracle 12c的安装文件,本文以linux x86-64为例,安装文件名为linuxx64_12201_database.zip。
2、解压安装文件将下载的安装文件解压到指定的安装目录,本文以/opt/oracle/product/12.2/dbhome_1为例,解压后的文件如下:[oracle@localhost ~]$ ls -l /opt/oracle/product/12.2/dbhome_1total 20drwxr-xr-x 4 oracle oinstall 4096 Apr 24 17:43 cdrom-rwxr-xr-x 1 oracle oinstall 1219 Apr 24 17:43 .ouidrwxr-xr-x 2 oracle oinstall 4096 Apr 24 17:43 installdrwxr-xr-x 2 oracle oinstall 4096 Apr 24 17:43 response-rwxr-xr-x 1 oracle oinstall 735 Apr 24 17:43 runInstaller3、添加用户为了安装Oracle 12c,需要添加一个用户,本文以oracle为例:[oracle@localhost ~]$ groupadd oinstall[oracle@localhost ~]$ groupadd dba[oracle@localhost ~]$ useradd -g oinstall -G dba oracle[oracle@localhost ~]$ passwd oracle4、设置环境变量为了方便使用,需要设置环境变量,本文以oracle为例:[oracle@localhost ~]$ vi .bash_profile# Oracle Settingsexport ORACLE_HOME=/opt/oracle/product/12.2/dbhome_1 export ORACLE_SID=orclexport ORACLE_BASE=/opt/oracleexport ORACLE_TERM=xtermexport PATH=$ORACLE_HOME/bin:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib exportCLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms /jlib5、安装Oracle 12c使用root用户登录,进入安装目录,执行安装程序:[oracle@localhost ~]$ su - root[root@localhost ~]。
linux安装Oracle 12C

系统配置准备及安装1.创建Oracle用户和用户组及修改密码groupadd dbagroupadd oinstalluseradd -g oinstall -G dba oraclepasswd oracleid oracle2.创建安装目录mkdir -p /tempchown -R oracle:oinstall /temp待安装oracle时用mkdir -p /u01/app/oraclechown -R oracle:oinstall /u01/app/oraclechmod -R 775 /u01/app/oraclemkdir -p /u01/app/oraInventorychown -R oracle:oinstall /u01/app/oraInventorychmod -R 775 /u01/app/oraInventory3.把RPM和oracle包拷入到temp文件夹下4.安装RPM包:按此顺序安装;rpm -ivh为安装rpm文件命令,后面的是包名。
rpm -ivh zlib-1.2.3-27.el6.x86_64.rpmrpm -ivh zlib-devel-1.2.3-27.el6.x86_64.rpmrpm -ivh binutils-2.20.51.0.2-5.28.el6.x86_64.rpmrpm -ivh binutils-devel-2.20.51.0.2-5.28.el6.x86_64.rpmrpm -ivh compat-libcap1-1.10-1.x86_64.rpmrpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpmrpm -ivh elfutils-libelf-0.152-1.el6.x86_64.rpmrpm -ivh elfutils-libelf-devel-0.152-1.el6.x86_64.rpmrpm -ivh glibc-2.12-1.47.el6.x86_64.rpmrpm -ivh glibc-common-2.12-1.47.el6.x86_64.rpmrpm -ivh ksh-20100621-12.el6.x86_64.rpmrpm -ivh libaio-0.3.107-10.el6.x86_64.rpmrpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpmrpm -ivh libgcc-4.4.5-6.el6.x86_64.rpmrpm -ivh libgomp-4.4.6-3.el6.x86_64.rpmrpm -ivh libgxim-0.3.3-3.1.el6.x86_64.rpmrpm -ivh libmpcdec-1.2.6-6.1.el6.x86_64.rpmrpm -ivh libstdc++-4.4.6-3.el6.x86_64.rpmrpm -ivh libstdc++-devel-4.4.6-3.el6.x86_64.rpmrpm -ivh make-3.81-19.el6.x86_64.rpmrpm -ivh sysstat-9.0.4-18.el6.x86_64.rpmrpm -ivh unixODBC-2.2.14-11.el6.x86_64.rpmrpm -ivh unixODBC-devel-2.2.14-11.el6.x86_64.rpm rpm -ivh kernel-headers-2.6.32-220.el6.x86_64.rpm rpm -ivh glibc-headers-2.12-1.47.el6.x86_64.rpmrpm -ivh glibc-devel-2.12-1.47.el6.x86_64.rpmrpm -ivh ppl-0.10.2-11.el6.x86_64.rpmrpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpmrpm -ivh mpfr-2.4.1-6.el6.x86_64.rpmrpm -ivh cpp-4.4.6-3.el6.x86_64.rpmrpm -ivh gcc-4.4.6-3.el6.x86_64.rpmrpm -ivh gcc-c++-4.4.6-3.el6.x86_64.rpm5.设置用户限制改内核参考vi /etc/sysctl.conf,添加如下内容fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586参数生效命令: /sbin/sysctl -p4:修改用户限制:vi /etc/security/limits.conf 添加如下信息oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle soft stack 10240oracle hard stack 102406.解压安装镜像文件切换到oracle用户:su - oracle解压oracle文件:unzip是解压命令解压之后到解压文件夹下找到runInstaller运行 ./runIstaller 到界面安装7.界面安装密码设置:随自己,如果不符合oracle的密码要求下一步时提示点击Yes就可以了运行这两个sh文件,运行后点击OK完成安装8.配置环境变量编辑修改主目录下vi .bash_profileexport ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 export ORACLE_SID=orclexport PATH=$ORACLE_HOME/bin:$PATH使配置生效source .bash_profile修改如下:重启防火墙等服务,/etc/init.d/iptables restart10.修改配置文件(为了方便外部plsql访问数据库)把两个文件里边的host =localhost 改为host = ip地址*启动监听:lsnrctl start 查看监听:lsnrctl status 停止监听:lsnrctl stop 12.完成进入登录界面修改orcle配置文件CBD容器:orcl,PDB容器:pdborclPDBORCL =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.157)(PORT = 1521)) (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = PDBORCL)))ORCL =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.157)(PORT = 1521)) (CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ORCL)))。
Linux环境下安装Oracle12c

Linux环境下安装Oracle数据库(不使用12c的新特性-CDB和PDB)一、安装Oracle所必需的包1、root用户安装以下RPM软件包yum -y install gcc gcc-c++ make binutils compat-libstdc++-33 glibc glbic-devel libaio libaio-devellibgcc libstdc++ libstdc++-devel unixODBC-devel sysstat ksh unzip二、内核参数配置1、root用户登录,修改/etc/sysctl.conf文件,在此文件中添加以下参数:fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576注:命令生效/sbin/sysctl -p三、创建安装数据库所需要的用户(组)1、添加oracle用户帐号跟用户组oinstall、dba,并定义为oracle 用户的主次组,root用户操作。
groupadd oinstallgroupadd dbauseradd -g oinstall -G dba oraclepasswd oracle #给oracle用户设置密码oracle20190107 #密码四、添加oracle用户的限制参数1、将以下内容添加到vim /etc/security/limits.conforacle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle hard stack 102402、将如下内容添加到 /etc/pam.d/login中session required /lib/security/pam_limits.sosession required pam_limits.so3、将如下内容添加到 /etc/profile中if [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi五、创建安装所需要的安装目录1、创建oracle安装目录(root用户下操作):mkdir -p /u01/appchown -R oracle:oinstall /u01/appchmod -R 775 /u01/app其中u01为oracle安装目录2、使用root用户创建安装时使用的临时文件夹sudo mkdir /u01/tmpsudo chmod a+wr /u01/tmp六、设置oracle的环境变量1、设置oracle用户的环境变量,是oracle用户的.bash_profile 文件的内容cdmore .bash_profile加入以下内容:TMP=/u01/tmpTMPDIR=/u01/tmpexport TMP TMPDIR#added by aa for oracle文件中加这一段:export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export ORACLE_SID=aexport PATH=$ORACLE_HOME/bin:$PATHexport PATH=$PATH:$ORACLE_HOME/bin:/usr/local/bin export ORACLE_TERM=xtermexport TNS_ADMIN=$ORACLE_HOME/network/adminexportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/bin:$ORACLE_ HOME/oracm/lib:$ORACLE_HOME/libexportCLASSPATH=$CLASSPATH:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOM E/jlib:$ORACLE_HOME/network/libexport LANG=american_america.ZHS16GBKexport NLS_LANG=american_america.ZHS16GBK#命令生效source .bash_profile七、安装1、解压安装包unzip linuxx64_12201_database.zip2、安装的过程中执行脚本(root用户下执行)/u01/app/oracle/orainstRoot.sh/u01/app/oracle/product/11.2.0/dbhome_1/root.sh注:执行完这两个脚本之后再继续3、安装完成之后启动数据库sqlplus / as sysdbastartup八、安装之后1、创建表空间create tablespace A_DATA datafile'/u01/app/oracle/oradata/a/a_data01.dbf' size 1G;2、创建用户--创建用户,不同的环境,可以设置不同的账户和密码,要指定命名空间create user A identified by 123456 default tablespace A_DATA;--授权grant connect, resource to A;。
Oracle12CR2RAC安装过程记录
Oracle12CR2RAC安装过程记录Oracle 12CR2 RAC安装过程记录环境: 服务器(vbox虚拟机) 操作系统: CentOS 7.2 内存: 8G 本地磁盘: 50G IP规划 主机 IP priv-ip vip rac1 10.19.100.5192.168.220.510.19.100.15 rac2 10.19.100.6192.168.220.610.19.100.16 scan-IP 10.19.100.19 其中“IP”和“priv-ip”各占⽤⼀个⽹卡或者bind⽹卡,“vip”和“scan-IP”为rac节点启动后配置的虚拟IP和scanIP。
共享存储规划 本演⽰不做冗余,采⽤最低配置。
12CR2 voting disk⾄少需要40G有效空余空间。
Data disk预留60G有效磁盘空间。
⼀、安装前准备⼯作此步骤需要在两台服务器上都执⾏关闭selinux、防⽕墙等操作不赘述。
创建⽤户# groupadd -g 501 oinstall# groupadd -g 502 dba# groupadd -g 504 asmadmin# groupadd -g 506 asmdba# groupadd -g 507 asmoper# useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper grid# useradd -u 502 -g oinstall -G dba,asmdba oracle# passwd oracle# passwd grid ⽂件⽬录准备# mkdir -p /u01/app/oraInventory# mkdir -p /u01/app/grid# mkdir -p /u01/app/12.2.0/grid# mkdir -p /u01/app/oracle/product/12.2.0/db_1# chown -R grid:oinstall /u01/app/oraInventory# chown -R grid:oinstall /u01/app/grid# chown -R grid:oinstall /u01/app/12.2.0/grid# chown -R oracle:oinstall /u01/app/oracle# chown -R oracle:oinstall /u01/app/oracle/product/12.2.0/db_1# chmod -R 775 /u01 检查依赖包# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \compat-libstdc++-33 \elfutils-libelf \elfutils-libelf-devel \gcc \gcc-c++ \glibc \glibc-common \glibc-devel \glibc-headers \ksh \libaio \libaio-devel \libgcc \libstdc++ \libstdc++-devel \libXext \libXtst \libX11 \libXau \libxcb \libXi \make \sysstat \compat-libcap1 \unixODBC \unixODBC-devel根据输出结果补全缺失的依赖包。
Linux下安装Oracle12C详解
Linux下安装Oracle12C详解Linux下安装Oracle12C详解本例操作系统版本:CentOS 7.8、数据库版本:Oracle 12c(12.201)安装步骤如下分解:主机信息hostname: ol7-122.localdomainhosts: 10.0.0.10 ol7-122.localdomain ol7-1221.关闭防⽕墙,禁⽌防⽕墙开机⾃启# 关闭防⽕墙systemctl stop firewalld.service# 禁⽌防⽕墙开机启动systemctl disable firewalld.service# 查看防⽕墙状态systemctl status firewalld.service2.关闭selinux# 编辑⽂件vi /etc/selinux/config# 修改内容SELINUX=disabled3.yum安装必要安装包使⽤ yum 批量安装依赖包,若执⾏⼀遍失败则继续执⾏第⼆遍(多次执⾏不会出现其他问题)yum install binutils -yyum install compat-libcap1 -yyum install compat-libstdc++-33 -yyum install compat-libstdc++-33.i686 -yyum install glibc -yyum install glibc.i686 -yyum install glibc-devel -yyum install glibc-devel.i686 -yyum install ksh -yyum install libaio -yyum install libaio.i686 -yyum install libaio-devel -yyum install libaio-devel.i686 -yyum install libX11 -yyum install libX11.i686 -yyum install libXau -yyum install libXau.i686 -yyum install libXi -yyum install libXi.i686 -yyum install libXtst -yyum install libXtst.i686 -yyum install libgcc -yyum install libgcc.i686 -yyum install libstdc++ -yyum install libstdc++.i686 -yyum install libstdc++-devel -yyum install libstdc++-devel.i686 -yyum install libxcb -yyum install libxcb.i686 -yyum install make -yyum install nfs-utils -yyum install net-tools -yyum install smartmontools -yyum install sysstat -yyum install unixODBC -yyum install unixODBC-devel -y检查是否安装成功(31个安装包)rpm -q binutils compat-libcap1 compat-libstdc++-33gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel4.创建 swap详见⽂章:5.创建 oracle 分区(可选)如果你操作系统原有分区都合适,这步可以忽略# 查看硬盘及分区信息(启动Disk开头的就是硬盘,Device开头的就是分区)fdisk -l# 创建分区(/dev/sdb 是硬盘,是你需要创建分区的硬盘,创建分区后会⽣成 /dev/sdb1,如果本来有sdb1,则会出现sdb2)fdisk /dev/sdb# 格式化新创建的分区mkfs.xfs /dev/sdb1# 将分区添加到 /etc/fstab ⽂件中,使之开机⾃动挂载(编辑保存 fstab ⽂件后不会⽴即⽣效)vim /etc/fstab/dev/sdb1 /u01 xfs defaults 006.创建 oracle data ⽬录(同第5步可选)# 创建⽬录mkdir /u01# 重新加载⽂件 /etc/fstab 所有内容。
Linux7安装单节点Oracle 12c数据库详细配置操作
Linux7安装单节点Oracle 12c数据库详细配置操作1前言一般企业级的服务器都是采用Linux或者Unix,因为相对Windows系统来说,Linux和Unix 服务器稳定性比较好、可以多用户操作系统、bug较Windows少、调控性高、可以根据实际应用做出相应的调整、排错性强,而且Linux是免费的而Windows收费。
另外,对于企业来说,更希望程序执行的效率更高些,虽然这两个系统的人工成本高,但是更有可能兼顾程序的效率,所以一般生产用的服务器都是Linux和Unix。
2 Linux下Oracle 12c数据库的安装Linux 6(x86-64)系统对应的Oracle 12c数据库可以通过以下网址进行下载:/technetwork/database/enterprise-edition/downloads/databas e12c-linux-download-1959253.html,安装包分为2个文件,下载完后,需要将2个文件解压到同一目录下,路径名称中,最好不要出现中文,也不要出现空格等不规则字符;安装的参考文档以及数据库相关的学习文档下载网址是/technetwork/database/enterprise-edition/documentation/ind ex.html。
2.1 安装前准备工作2.1.1 操作系统软硬件检查1. 内存要求1) 最小值为1 GB of RAM,建议值为2 GB of RAM or more;2) 查询命令:# grep MemTotal /proc/meminfo本测试系统环境为Linux 6.4(x86-64),内存有1.8G多,满足Oracle 12c的内存安装要求。
2. 交换空间要求1) 查询命令:# grep SwapTotal /proc/meminfo2) 通过命令:# free查看内存和交换空间的使用情况。
由上面本机内存1.8G可知,只要交换空间在1.8*1.5以上就可以,查询可知本机的交换空间接近4G,满足要求。
部署Oracle12c企业版数据库(安装及使用)
部署Oracle12c企业版数据库(安装及使⽤)在计算机信息安全领域中,数据库系统⽆疑有着举⾜轻重的地位。
⽐如:SQL Server、MySQL、DB2、Oracle等,都是⽐较知名的数据库管理软件,由于Oracle数据库的安全性,所以在⼀些⽐较重要的场合被普遍使⽤,⽐如:电信、银⾏、政府部门等。
本次博⽂以Oracle 12c数据库的64位企业版为例,学习如何在Centos 操作系统中的安装和基本配置,包括安装的准备等。
博⽂⼤纲:⼀、安装Oracle 12c⼆、创建Oracle 12c数据库三、Oracle 12c数据库的启动与关闭四、将Oracle数据库设置为开机⾃启动⼀、安装Oracle 12c1.安装CentOS 7操作系统的注意事项由于本次安装Oracle 12c软件是在CentOS 7系统上实现的,那么⾸次安装CentOS 7操作系统有⼏点要求:防⽕墙的配置选项设置为禁⽤;SELinux设置为禁⽤;默认安装设置为软件开发;内核选择3.10.0-862.el7.x86_64及以上版本;2.前置条件的准备Oracle数据库是⼀个相对庞⼤的应⽤软件,对服务器的系统类型、内存和交换分区、硬盘空阿⾦、内核参数、软件环境、⽤户环境等都有相应的要求。
只要满⾜了这些必备的条件,才能确保Oracle 12c 安装成功并稳定运⾏。
(1)系统及配置要求Oracle 12c明确⽀持的Linux操作系统包括Oracle Linux 7、Oracle Linux 6、Oracle Linux 5、Red Hat Enterprise Linux 7、Red Hat Enterprise Linux 6、Red Hat Enterprise Linux 5等,因为Red Hat Enterprise 和CentOS属于同步并⾏的操作系统,所以Oracle 12 c同样⽀持CentOS 7、CentOS 6、CentOS 5操作系统。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
CENTOS 6.7 INSTALL ORACLE 12C 1安装依赖包
cd /media/CentOS_6.7_Final/Packages
rpm --import /etc/pki/rpm-gpg/RPM*
rpm -ivh compat-libcap1-1.10-1.x86_64.rpm --force --nodeps
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
rpm -ivh libstdc++-devel-4.4.7-16.el6.x86_64.rpm
rpm -ivh gcc-4.4.7-16.el6.x86_64.rpm --force --nodeps
rpm -ivh gcc-c++-4.4.7-16.el6.x86_64.rpm --force --nodeps
rpm -ivh ksh-20120801-28.el6.x86_64.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
2卸载openjdk
查看:
rpm -qa | grep java
卸载:
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6.x86_64
rpm -e --nodeps java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64
3安装jdk 1.8
rpm -i jdk-8u77-linux-x64.rpm
4安装数据库12C准备
4.1创建ORACLE用户
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
mkdir -p /data/app/oracle
mkdir -p /data/oradata
chown -R oracle:oinstall /data/app/oracle /data/oradata chmod -R 775 /data/app/oracle /data/oradata
4.2配置内核参数
vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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
sysctl -p
4.3修改系统限制
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 /lib/security/pam_limits.so session required pam_limits.so
vi /etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
4.4切换到oracle用户下,配置环境变量su - oracle
vi .bash_profile
export ORACLE_BASE=/data/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/
export ORACLE_SID=ORCL
export PATH=$PATH:$ORACLE_HOME/bin
export LD_BIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
5配置X-start
6解压安装文件
unzip linuxamd64_12102_database_* 7开始安装ORACLE12C
7.1安装数据库软件
运行X-start,切换到安装目录
cd /home/oracle/database
./runInstaller
7.1.1安装数据库软件
7.1.4版本
7.1.5安装位置直接读取环境变量的
7.1.6选择组
第二个数据库操作员默认是空的,应该是没有建这个组。
7.1.7条件检查
可以再安装前先检查一次,然后把不满足的地方补上,比如说依赖包
7.1.8执行root脚本
sh /data/app/oraInventory/orainstRoot.sh sh /data/app/oraInventory/orainstRoot.sh
7.1.9oracle12c数据库软件安装完成
7.2使用dbca创建数据库
7.2.1在X-start命令窗口输入dbca
7.2.2选择创建数据库
7.2.3选择高级模式
7.2.4数据库模板
7.2.5数据库标识
此部分全局数据库名SID 表示的是创建的CDB容器—容器数据库,这是必须要的
下面可以选择是否创建PDB—插接式数据库,12C的特性。
这里我们一起创建一个PDB。
7.2.6配置EM 选择不配置
7.2.7管理员密码
7.2.8监听
待会单独创建
7.2.9存储位置
7.2.10数据库选项默认
7.2.11初始化参数根据需要可选择---注意字符集
7.2.12创建选项
7.2.13选决条件检查
7.2.14生成概要文件
7.2.15开始安装
7.2.16安装完成
7.3创建监听
netca
一直点击下一步就ok了,使用默认设置。