前言:
今天朋友们对“oracle新建sqlnetora”可能比较关心,姐妹们都想要了解一些“oracle新建sqlnetora”的相关资讯。那么小编在网络上收集了一些对于“oracle新建sqlnetora””的相关知识,希望朋友们能喜欢,我们快快来学习一下吧!操作系统安装前的准备修改主机名添加主机名与IP对应记录
安装依赖包
yum -y install gcc gcc-c++ make elfutils-libelf-devel elfutils-libelf-devel-static 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
创建用户和组配置内核参数
vim /etc/sysctl.conffs.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 = 1048576sysctl –p
修改用户限制
vim /etc/security/limits.conforacle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240oracle hard stack 10240
vim /etc/pam.d/login #文件最后添加session required /lib/security/pam_limits.sosession required pam_limits.sovim /etc/profileif [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifisource /etc/profile创建安装目录切换到oracle用户,设置oracle用户的环境变量
su – oraclevim .bash_profileexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0export PATH=$ORACLE_HOME/bin:$PATHexport ORACLE_SID=dbsrv2export LANG=american_america.ZHS16GBKexport LD_LIBRARY_PATH=$ORACLE_HONE/libalias oratrace="cd $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace && ls|grep alert"alias oradata="cd /u01/app/oracle/dbsrv2"alias topc="ps -e -o pcpu,pid,user,tty,args | sort -k 1 -r | head"alias topm="ps -e -o pmem,pid,user,tty,args | sort -k 1 -r | head"source .bash_profile上传oracle安装包,编辑静默安装响应文件
vim /home/oracle/database/response/db_install.rsporacle.install.option=INSTALL_DB_SWONLY #29行,安装类型ORACLE_HOSTNAME=linux-2 #39行,主机名UNIX_GROUP_NAME=oinstall #42行,安装组INVENTORY_LOCATION=/u01/app/oracle/inventory #47行,inventory目录,不填就是默认值SELECTED_LANGUAGES=en,zh_CN #78行,选择语言ORACLE_HOME=/u01/app/oracle/product/11.2.0 #83行,oracle_homeORACLE_BASE=/u01/app/oracle #88行,oracle_baseoracle.install.db.InstallEdition=EE #99行,oracle版本oracle.install.db.isCustomInstall=false #108行,自定义安装,否则使用默认组件oracle.install.db.DBA_GROUP=dba #142行oracle.install.db.OPER_GROUP=dba #147行oracle.install.db.config.starterdb.type=GENERAL_PURPOSE #160行,数据库类型oracle.install.db.config.starterdb.globalDBName=orcl #165行oracle.install.db.config.starterdb.SID=dbsrv2 #170行DECLINE_SECURITY_UPDATES=true根据响应文件安装oracle 11g
./runInstaller -silent -ignorePrereq -ignoreSysPrereqs -responseFile /home/oracle/database/response/db_install.rsp
开始oracle在后台静默安装,安装过程中,如果提示WARNING不必理会,此时安装程序仍在后台进行,如果出现FATAL,则安装程序停止。
出现以上界面,说明安装程序正在后台运行,打开另一个终端查看日志:
tailf /u01/app/oracle/inventory/logs/installActions2018-06-08_03-28-16PM.log
看到如下部分,则表明安装已经完成:
完成安装后,切换到root用户执行两个脚本:
用oracle用户登录配置监听
出现以下情况时,需要配置DISPLAY变量,配置完成后在重新netca
成功运行后,在会/u01/app/oracle/product/11.2.0/network/admin/目录下生成listener.ora和sqlnet.ora两个文件:
查看监听端口:
创建新库,同时建立对应的实例:
[oracle@linux-2 ~]$ vim /home/oracle/database/response/dbca.rsp
修改以下参数:
GDBNAME = "orcl" #78行
SID = "orcl" #149行
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
SYSMANPASSWORD = "oracle"
DBSNMPPASSWORD = "oracle"
DATAFILEDESTINATION =/u01/app/oracle/oradata
RECOVERYAREADESTINATION=/u01/app/oracle/fast_recovery_area
CHARACTERSET = "ZHS16GBK"
TOTALMEMORY = "1638"
进行静默配置:
[oracle@linux-2 ~]$ dbca -silent -responseFile /home/oracle/database/response/dbca.rsp
完成建库后进行实例检查:
查看监听状态:
登录查看实例状态:
启动数据库:
解决方法:
重启启动数据库
标签: #oracle新建sqlnetora