./runInstaller -silent -responseFile /data/database/response/db_install.rsp -ignorePrereq
文章插图
安装成功后,切换root用户执行
#sh /data/oracle/inventory/orainstRoot.sh#sh /data/oracle/product/11.2.0/root.sh
13. 以静默方式配置监听su - oracle
export DISPLAY=ip:0.0 //根据输入实际IP
/data/oracle/product/11.2.0.4.0/bin.NETca -silent -responseFile /data/database/response/netca.rsp
运行成功后会生成配置文件文章插图
[oracle@oracle admin]$ cat listener.ora # listener.ora Network Configuration File: /data/oracle/product/11.2.0.4.0/network/admin/listener.ora# Generated by Oracle configuration tools.LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))(ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))))SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(GLOBAL_DBNAME = orcl)(SID_NAME = orcl)))ADR_BASE_LISTENER = /data/oracle
使用命令查看服务状态lsnrctl statusnetstat -natp
文章插图
文章插图
14. 以静默方式建立新库,同时也建立一个对应的实例 。
[oracle@oracle admin]$ grep -v '^#' /data/database/response/dbca.rsp | more[GENERAL]RESPONSEFILE_VERSION = "11.2.0"OPERATION_TYPE = "createDatabase"[CREATEDATABASE]GDBNAME = "orcl"SID = "orcl"TEMPLATENAME = "General_Purpose.dbc"SYSPASSWORD = "chenzm123"SYSTEMPASSWORD = "chenzm123"SYSMANPASSWORD = "chenzm123"DBSNMPPASSWORD = "chenzm123"DATAFILEDESTINATION =/oradataRECOVERYAREADESTINATION=/data/oracle/fast_recovery_areaCHARACTERSET = "ZHS16GBK"NATIONALCHARACTERSET= "UTF8"[createTemplateFromDB]SOURCEDB = "oracle:1521:orcl"SYSDBAUSERNAME = "system"TEMPLATENAME = "My Copy TEMPLATE"[createCloneTemplate]SOURCEDB = "orcl"TEMPLATENAME = "My Clone TEMPLATE"[DELETEDATABASE]SOURCEDB = "orcl"[generateScripts]TEMPLATENAME = "New Database"GDBNAME = "orcl11.us.oracle.com"[CONFIGUREDATABASE][ADDINSTANCE]DB_UNIQUE_NAME = "orcl11g.us.oracle.com"NODELIST=SYSDBAUSERNAME = "sys"[DELETEINSTANCE]DB_UNIQUE_NAME = "orcl11g.us.oracle.com"INSTANCENAME = "orcl11g"SYSDBAUSERNAME = "sys"
dbca -silent -responseFile /data/database/response/dbca.rsp文章插图
15 . 设置oracle 开机启动
编辑配置文件/data/oracle/product/11.2.0/bin/dbshut
将ORACLE_HOME_LISTNER=$1修改为ORACLE_HOME_LISTNER=$ORACLE_HOME
修改/data/oracle/product/11.2.0/bin/dbstart
将ORACLE_HOME_LISTNER=$1修改为ORACLE_HOME_LISTNER=$ORACLE_HOME
[oracle@oracle dbca]$ cat /data/oracle/product/11.2.0.4.0/bin/dbshut | grep 'ORACLE_HOME_LISTNER='ORACLE_HOME_LISTNER=$ORACLE_HOME[oracle@oracle dbca]$ cat /data/oracle/product/11.2.0.4.0/bin/dbstart | grep 'ORACLE_HOME_LISTNER='ORACLE_HOME_LISTNER=$ORACLE_HOME
修改/etc/oratab文件将
orcl:/data/oracle/product/11.2.0.4.0:N中最后的N改为Y,成为orcl:/data/oracle/product/11.2.04.0:Y
文章插图
dbshut //测试数据库关闭dbstart // 测试数据库启动
16、设置启动脚本 cat /etc/init.d/oracle #!/bin/bash#oracle: Start/Stop Oracle Database 11g R2#chkconfig: 345 90 10#description: The Oracle Database is an Object-Relational Database ManagementSystem.#. /etc/rc.d/init.d/functionsLOCKFILE=/var/lock/subsys/oracleORACLE_HOME=/data/oracle/product/11.2.0.4.0ORACLE_USER=oraclecase "$1" in'start')if [ -f $LOCKFILE ]; thenecho $0 already running.elseecho -n $"StartingOracle Database:"su - $ORACLE_USER -c"$ORACLE_HOME/bin/lsnrctl start"su - $ORACLE_USER -c"$ORACLE_HOME/bin/dbstart $ORACLE_HOME"su - $ORACLE_USER -c"$ORACLE_HOME/bin/emctl start dbconsole"touch $LOCKFILEfi;;'stop')if [ ! -f $LOCKFILE ]; thenecho $0 already stopping.elseecho -n $"StoppingOracle Database:"su - $ORACLE_USER -c"$ORACLE_HOME/bin/lsnrctl stop"su - $ORACLE_USER -c"$ORACLE_HOME/bin/dbshut"su - $ORACLE_USER -c"$ORACLE_HOME/bin/emctl stop dbconsole"rm -f $LOCKFILEfi;;'restart')$0 stopsleep 5$0 start;;'status')if [ -f $LOCKFILE ]; thenecho $0 started.elseecho $0 stopped.fi;;*)echo "Usage: $0[start|stop|status]"exit 1esacexit 0
推荐阅读
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 如何在电脑上安装打印机? 电脑怎么安装打印机
- 地铁除了安装屏蔽门还能怎样阻止跳轨
- pr软件下载 免费中文版 下载与安装详细步骤
- 新电脑怎么样安装系统? 新电脑怎么装系统
- 网卡驱动的安装技巧 网卡驱动怎么安装
- 中兴ZXV10 B860A V1.1破解安装第三方教程
- 华为笔记本linux版 安装win10 系统教程
- 电脑版画个火柴人的下载、安装
- 怎么找到软件安装目录
- 天文望远镜如何安装