Linux RHEL6 x64 命令行静默安装 Oracle 12c - 2

简介:
软件安装完,还要配置监听,初始化数据库。
这点和PostgreSQL类似。

配置环境变量
vi ~/env_ora.sh
export ORACLE_BASE=/home/digoal/oracle/product
export ORACLE_HOME=$ORACLE_BASE/12.1.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=orcl12c
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export THREADS_FLAG=native

安装监听服务
Net Configuration Assistant

$cp database/response/netca.rsp ~/

$grep -E "^[a-Z]|\[" netca.rsp 
[GENERAL]
RESPONSEFILE_VERSION="12.1"
CREATE_TYPE="CUSTOM"
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}

$ . ~/env_ora.sh

$netca -silent -responsefile /home/digoal/netca.rsp 

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /home/digoal/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control: 
      /home/digoal/oracle/product/12.1.0/db_1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

查看监听是否正常
$lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 23-DEC-2015 14:09:28

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=digoal_host.sqa.zmf)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                23-DEC-2015 13:41:43
Uptime                    0 days 0 hr. 27 min. 45 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/digoal/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File         /home/digoal/oracle/product/diag/tnslsnr/digoal_host/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=digoal_host.sqa.zmf)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl12c" has 1 instance(s).
  Instance "orcl12c", status READY, has 1 handler(s) for this service...
Service "orcl12cXDB" has 1 instance(s).
  Instance "orcl12c", status READY, has 1 handler(s) for this service...
The command completed successfully
配置文件如下
$cat /home/digoal/oracle/product/12.1.0/db_1/network/admin/listener.ora 
# listener.ora Network Configuration File: /home/digoal/oracle/product/12.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = digoal_host.sqa.zmf)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

初始化数据库
Database Configuration Assistant

$ . ~/env_ora.sh

$cp database/response/dbca.rsp ~/

$ vi dbca.rsp

$grep -E "^[a-Z]|\[" dbca.rsp  
[GENERAL]
RESPONSEFILE_VERSION = "12.1.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "orcl12c"
DATABASECONFTYPE  = "SI"
SID = "orcl12c"
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "digoal"
SYSTEMPASSWORD = "digoal"
DATAFILEDESTINATION = /disk1/digoal/oradata
RECOVERYAREADESTINATION= /disk1/digoal/flash_recovery_area
STORAGETYPE=FS
CHARACTERSET = "UTF8"
NATIONALCHARACTERSET= "UTF8"
LISTENERS = "listener1,listener2"
MEMORYPERCENTAGE = "40"
DATABASETYPE = "MULTIPURPOSE"
AUTOMATICMEMORYMANAGEMENT = "TRUE"
TOTALMEMORY = "80000"
# 内存要足够大
[createTemplateFromDB]
SOURCEDB = "myhost:1521:orcl"
SYSDBAUSERNAME = "system"
SYSDBAPASSWORD = "digoal"
TEMPLATENAME = "My Copy TEMPLATE"
[createCloneTemplate]
SOURCEDB = "orcl"
TEMPLATENAME = "My Clone TEMPLATE"
[DELETEDATABASE]
SOURCEDB = "orcl"
[generateScripts]
TEMPLATENAME = "New Database"
GDBNAME = "orcl12.us.oracle.com"
[CONFIGUREDATABASE]
[ADDINSTANCE]
DB_UNIQUE_NAME = "orcl12c.us.oracle.com"
NODENAME=
SYSDBAUSERNAME = "sys"
[DELETEINSTANCE]
DB_UNIQUE_NAME = "orcl12c.us.oracle.com"
INSTANCENAME = "orcl12c"
SYSDBAUSERNAME = "sys"


$dbca -silent -responseFile /home/digoal/dbca.rsp 
Cleaning up failed steps
5% complete
Copying database files
7% complete
9% complete
16% complete
23% complete
30% complete
41% complete
Creating and starting Oracle instance
43% complete
48% complete
53% complete
57% complete
58% complete
59% complete
62% complete
64% complete
Completing Database Creation
68% complete
71% complete
75% complete
85% complete
96% complete
100% complete
Look at the log file "/home/digoal/oracle/product/cfgtoollogs/dbca/orcl12c/orcl12c0.log" for further details.

测试数据库
sqlplus "/ as sysdba"
SQL> select * from dual;

D
-
X
目录
相关文章
|
1月前
|
Oracle Cloud Native 关系型数据库
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
64 10
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
|
1月前
|
监控 Oracle 关系型数据库
Linux平台Oracle开机自启动设置
【11月更文挑战第8天】在 Linux 平台设置 Oracle 开机自启动有多种方法,本文以 CentOS 为例,介绍了两种常见方法:使用 `rc.local` 文件(较简单但不推荐用于生产环境)和使用 `systemd` 服务(推荐)。具体步骤包括编写启动脚本、赋予执行权限、配置 `rc.local` 或创建 `systemd` 服务单元文件,并设置开机自启动。通过 `systemd` 方式可以更好地与系统启动过程集成,更规范和可靠。
117 2
|
1月前
|
Oracle Ubuntu 关系型数据库
Linux平台Oracle开机自启动设置
【11月更文挑战第7天】本文介绍了 Linux 系统中服务管理机制,并详细说明了如何在使用 systemd 和 System V 的系统上设置 Oracle 数据库的开机自启动。包括创建服务单元文件、编辑启动脚本、设置开机自启动和启动服务的具体步骤。最后建议重启系统验证设置是否成功。
|
2月前
|
存储 Oracle 关系型数据库
|
5月前
|
Oracle 关系型数据库 Linux
讲解linux下的Qt如何编译oracle的驱动库libqsqloci.so
通过这一连串的步骤,可以专业且有效地在Linux下为Qt编译Oracle驱动库 `libqsqloci.so`,使得Qt应用能够通过OCI与Oracle数据库进行交互。这些步骤适用于具备一定Linux和Qt经验的开发者,并且能够为需要使用Qt开发数据库应用的专业人士提供指导。
181 1
讲解linux下的Qt如何编译oracle的驱动库libqsqloci.so
|
5月前
|
存储 Oracle 关系型数据库
Oracle 12c支持哪些数据类型?
【7月更文挑战第20天】Oracle 12c支持哪些数据类型?
114 2
|
5月前
|
SQL Oracle 关系型数据库
Oracle 12c有哪些新特性?
【7月更文挑战第20天】Oracle 12c有哪些新特性?
84 2
|
6月前
|
Linux Docker Python
【docker】Mac M1 构建 x64 linux镜像
【docker】Mac M1 构建 x64 linux镜像
132 0
|
7月前
|
Linux
Linux命令行快捷键
Linux命令行快捷键
|
7月前
|
Linux Shell
Linux命令行快捷键和技巧
Linux命令行快捷键和技巧
165 0