CentOS上面安装Oracle 11GR2

正常图形化界面安装

  1. 安装X Window
yum groupinstall "X Window System"
yum install unzip.x86_64 vim java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64
  1. 安装依赖软件包
yum install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel glibc-static
  1. 初始化账号
   groupadd oinstall
   groupadd dba
   groupadd oper
   useradd -g oinstall -G dba oracle
  1. 调整/dev/shm,至少为oracle内存的两倍,编辑/etc/fstab,增加如下内容,然后执行mount -o remount /dev/shm重新挂载生效
tmpfs                   /dev/shm                tmpfs   defaults,size=8G       0 0
  1. 可选操作挂载swap文件
blocksize ,每个块大小为1k.count=2048000。则总大小为2G的文件。
#dd if=/dev/zero of=/swapfile bs=1k count=2048000
#mkswap /swapfile
#chmod 600 /swapfile
#swapon /swapfile
修改/etc/fstab使其启动时自动mount,在/etc/fstab中增加如下语句:
/swapfile  swap  swap    defaults 0 0
  1. 创建oracle安装目录
 mkdir -p /u01/app
 chown -R oracle:oinstall /u01
 chmod -R 775 /u01/app
 ```
6. 编辑/etc/sysctl.conf,添加如下内容

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 1048586

然后执行sysctl -p生效
7. 编辑/etc/security/limits.conf,添加如下内容

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

8. 编辑/etc/pam.d/login,增加如下内容:

session required pam_limits.so

9. 编辑/etc/profile,添加如下内容

if [ USER=oracle];thenif[ SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

10. 以下切换到oracle用户执行
11. 编辑/home/oracle/.bashrc文件,增加如下环境变量

export ORACLE_BASE=/oracle/app/oracle
export ORACLE_SID=orcl

12. 解压缩oracle 11g压缩包,两个zip包,执行database下的runInstall脚本,需要开启图形化界面,ssh登录的需要开启x11 forward,并在本地启用x11 server
13. 根据图形界面安装向导安装,安装过程中会报错两次,需要根据提示修改如下文件,然后点击重试即可。

vim /oracle/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk
这一行
ctxhx: (CTXHXOBJ) (LINK_CTXHX) (CTXHXOBJ) (INSO_LINK)
修改为
ctxhx: (CTXHXOBJ)static (LINK_CTXHX) (CTXHXOBJ) (INSO_LINK) /usr/lib64/libc.a

vim /oracle/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk
这一行
(SYSMANBIN)emdctl: (MK_EMAGENT_NMECTL)
修改为
(SYSMANBIN)emdctl: (MK_EMAGENT_NMECTL) -lnnz11


14. 安装完毕,根据提示以root用户执行下面两个脚本

/oracle/app/oraInventory/orainstRoot.sh
/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh

15. 安装完毕,修改/home/oracle/.bashrc,增加如下两个环境变量

export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
export PATH= PATH: ORACLE_HOME/bin

16. 安装完成,本地可以访问,如果要开放远程访问,需要关闭或者配置防火墙,关闭防火墙命令如下:

systemctl stop firewalld.service #停止
systemctl disable firewalld.service #禁用

17. 安装完成,简单操作命令如下:

操作系统用户认证登录方式,以oracle用户执行
sqlplus / as sysdba
通过listener登录方式
sqlplus sys/密码@127.0.0.1/orcl as sysdba
sqlplus格式化列
col column_name format a20

18. 添加开机启动,创建启动脚本,放到/etc/init.d/路径下,命名为oracle
```bash




<div class="se-preview-section-delimiter">div>

#!/bin/sh 




<div class="se-preview-section-delimiter">div>

# chkconfig: 35 80 10 




<div class="se-preview-section-delimiter">div>

# description: Oracle auto start-stop script. 




<div class="se-preview-section-delimiter">div>

# 




<div class="se-preview-section-delimiter">div>

# Set ORACLE_HOME to be equivalent to the $ORACLE_HOME 




<div class="se-preview-section-delimiter">div>

# from which you wish to execute dbstart and dbshut; 




<div class="se-preview-section-delimiter">div>

# 




<div class="se-preview-section-delimiter">div>

# Set ORA_OWNER to the user id of the owner of the 




<div class="se-preview-section-delimiter">div>

# Oracle database in ORACLE_HOME. 

ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORA_OWNER=oracle 

start()
{ 
    # Start the Oracle databases: 
    echo "Starting Oracle Databases ... " 
    echo "-------------------------------------------------" >> /var/log/oracle 
    date +" %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle 
    echo "-------------------------------------------------" >> /var/log/oracle 
    su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" >>/var/log/oracle 
    echo "Done" 
    # Start the Listener: 
    echo "Starting Oracle Listeners ... " 
    echo "-------------------------------------------------" >> /var/log/oracle 
    date +" %T %a %D : Starting Oracle Listeners as part of system up." >> /var/log/oracle 
    echo "-------------------------------------------------" >> /var/log/oracle 
    su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" >>/var/log/oracle 
    echo "Done." 
    # Start the Enterprise Manager: 
    echo "Starting Oracle Enterprise Manager ... " 
    echo "-------------------------------------------------" >> /var/log/oracle 
    date +" %T %a %D : Starting Oracle Enterprise Manager as part of system up." >> /var/log/oracle 
    echo "-------------------------------------------------" >> /var/log/oracle 
    su - $ORA_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole" >>/var/log/oracle 
    echo "Done." 
    echo "-------------------------------------------------" >> /var/log/oracle 
    date +" %T %a %D : Finished." >> /var/log/oracle 
    echo "-------------------------------------------------" >> /var/log/oracle 
    touch /var/lock/subsys/oracle 
}

stop()
{
    # Stop the Oracle Enterprise Manager: 
    echo "Stoping Oracle Enterprise Manager ... " 
    echo "-------------------------------------------------" >> /var/log/oracle 
    date +" %T %a %D : Stoping Oracle Enterprise Manager as part of system down." >> /var/log/oracle 
    echo "-------------------------------------------------" >> /var/log/oracle 
    su - $ORA_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole" >>/var/log/oracle 
    echo "Done." 
    # Stop the Oracle Listener: 
    echo "Stoping Oracle Listeners ... " 
    echo "-------------------------------------------------" >> /var/log/oracle 
    date +" %T %a %D : Stoping Oracle Listener as part of system down." >> /var/log/oracle 
    echo "-------------------------------------------------" >> /var/log/oracle 
    su - $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop" >>/var/log/oracle 
    echo "Done." 
    rm -f /var/lock/subsys/oracle 
    # Stop the Oracle Database: 
    echo "Stoping Oracle Databases ... " 
    echo "-------------------------------------------------" >> /var/log/oracle 
    date +" %T %a %D : Stoping Oracle Databases as part of system down." >> /var/log/oracle 
    echo "-------------------------------------------------" >> /var/log/oracle 
    su - $ORA_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME" >>/var/log/oracle 
    echo "Done." 
    echo "" 
    echo "-------------------------------------------------" >> /var/log/oracle 
    date +" %T %a %D : Finished." >> /var/log/oracle 
    echo "-------------------------------------------------" >> /var/log/oracle 
}

case "$1" in
 start)
        start
        ;;
 stop)
        stop
        ;;
 restart)
         echo $"Restaring oracle"
         $0 stop
         sleep 3
         $0 start
         ;;
 *)
        echo $"Usage: $0 {start|stop|restart|}"
        exit 1
        ;;
esac
exit $RETVAL




<div class="se-preview-section-delimiter">div>
然后执行如下命令:
# chkconfig --add oracle
执行如下命令查看
# chkconfig --list oracle
修改文件/etc/oratab,将最后的'N'修改为'Y',以使dbstarthe dbshut生效。
  1. 重新配置listener,使不依赖于主机名,修改listener配置文件,不依赖于主机。
$ vim /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
首先修改HOST字段为0.0.0.0,然后增加如下配置,增加oracle静态注册到listener
SID_LIST_LISTENER =  
(SID_LIST =  
  (SID_DESC =  
  (GLOBAL_DBNAME = orcl)
  (SID_NAME = orcl)
  )
)
  1. 重新配置em,使不依赖于主机名,具体步骤参见后面的EM配置部分,不依赖于主机名的话需要定义ORACLE_HOSTNAME=localhost

静默安装

  1. package检查
rpm -q \
binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
expat \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
pdksh \
sysstat \
unixODBC \
unixODBC-devel | grep "not installed"
  1. 增加数据库组和用户
# id oracle (确认oracle用户是否存在)
# /usr/sbin/groupadd oinstall (建立产品清单管理组)
# /usr/sbin/groupadd dba (建立数据库安装组)
# /usr/sbin/groupadd asmadmin (建立ASM管理组)
# /usr/sbin/groupadd asmdba (建立Grid管理组)
# /usr/sbin/useradd -g oinstall -G dba,asmdba oracle -d /home/oracle (oinstall为主要组,确保/home/oracle原不存在)
# id oracle (记住oracle用户的uid和gid)
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba),504(asmdba)
# passwd oracle
  1. 编辑/etc/sysctl.conf调整OS内核参数,kernel.shmmax 为4GB或一半的物理内存, 哪个值更低用哪个,fs.file-max为512*PROGRESS,编辑完成执行sysctl -p生效
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
#kernel.shmmax = 536870912
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 = 1048586
  1. 修改/etc/security/limits.conf, /etc/pam.d/login, /etc/profile这几个文件,参见上面图形化安装对应部分的说明。
  2. 建立必须目录
# more /etc/oratab (确认原来是否存在Oracle主目录)
# more /etc/oraInst.loc (确认原来是否存在Oracle产品清单目录)
# mkdir -p /u01/app/oracle/ (Oracle基础目录, 一般为/mount_point/app/oracle_owner)
# chown -R oracle:oinstall /u01
# chown -R oracle:oinstall /u02
# chown -R oracle:oinstall /u03
# chown -R oracle:oinstall /u04
# chmod -R 775 /u01
# chmod -R 775 /u02
# chmod -R 775 /u03
# chmod -R 775 /u04
  1. 设置oracle用户环境变量
# su - oracle
$ vi ~/.bashrc
umask 022
export ORACLE_HOSTNAME=centos7
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=ORCL
export PATH=.:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/jdk/bin:$PATH
export LC_ALL="en_US"
export LANG="en_US"
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
$ soruce .bashrc
  1. 解压zip安装文件,在解压后oracle软件的response目录里有各种响应文件的模版。
  2. 生成响应文件模板
    1. 方法一,在database目录下$ vi db_swonly.rsp,内容如下:
#--------------------------------------------------------------------

#以下参数不要更改

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
DECLINE_SECURITY_UPDATES=true
#以下参数根据实际情况更改,一般也无需更改
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN,zh_TW
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=true
oracle.install.db.customComponents=oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
#--------------------------------------------------------------------
各参数含义如下:
-silent 表示以静默方式安装,不会有任何提示
-force 允许安装到一个非空目录
-noconfig 表示不运行配置助手netca
-responseFile 表示使用哪个响应文件,必需使用绝对路径
-ignoreDiskWarning 忽略swap警告
-ignoreSysPrereqs 忽略软件包警告
-ignorePrereq 忽略
oracle.install.responseFileVersion 响应文件模板的版本,该参数不要更改
oracle.install.option 安装选项,本例只安装oracle软件,该参数不要更改
DECLINE_SECURITY_UPDATES 是否需要在线安全更新,设置为false,该参数不要更改
ORACLE_HOSTNAME 安装主机名
UNIX_GROUP_NAME oracle用户用于安装软件的组名
INVENTORY_LOCATION oracle产品清单目录
SELECTED_LANGUAGES oracle运行语言环境,一般包括引文和简繁体中文
ORACLE_HOME Oracle安装目录
ORACLE_BASE oracle基础目录
oracle.install.db.InstallEdition 安装版本类型,一般是企业版
oracle.install.db.isCustomInstall 是否定制安装,默认Partitioning,OLAP,RAT都选上了
oracle.install.db.customComponents 定制安装组件列表:除了以上默认的,可加上Label Security和Database Vault
oracle.install.db.DBA_GROUP oracle用户用于授予OSDBA权限的组名
oracle.install.db.OPER_GROUP oracle用户用于授予OSOPER权限的组名
  1. 开始安装,注意db_swonly.rsp需要使用绝对路径
$ ./runInstaller -silent -force -noconfig -ignoreDiskWarning -ignoreSysPrereqs -ignorePrereq -responseFile /home/oracle/database/db_swonly.rsp
  1. 出现下面的输出时表示安装完成
#-------------------------------------------------------------------
...
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
To execute the configuration scripts:
         1. Open a terminal window 
         2. Log in as "root" 
         3. Run the scripts 
         4. Return to this window and hit "Enter" key to continue 

Successfully Setup Software.
#-------------------------------------------------------------------
  1. 安装期间查看安装日志信息了解安装进度
$ vim /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
首先修改HOST字段为0.0.0.0,然后增加如下配置,增加oracle静态注册到listener
SID_LIST_LISTENER =  
(SID_LIST =  
  (SID_DESC =  
  (GLOBAL_DBNAME = orcl)
  (SID_NAME = orcl)
  )
)
  1. 重新配置em,使不依赖于主机名,具体步骤参见后面的EM配置部分,不依赖于主机名的话需要定义ORACLE_HOSTNAME=localhost

以下部分为转载。

$ vi $ORACLE_BASE/oraInventory/ContentsXML/inventory.xml
  1. 运行orainstRoot.sh和root.sh,若本机第一次安装oracle软件, 则执行orainstRoot.sh来建立oraInst.loc文件和修改权限:
# /u01/app/oracle/oraInventory/orainstRoot.sh
# more /etc/oraInst.loc
执行$ORACLE_HOME下的root.sh来建立oratab,dbhome,oraenv,coraenv文件, 如果提示则一直回车:
# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
# more /etc/oratab
  1. 静默配置监听,通过response文件运行netca, 生成sqlnet.ora和listener.ora文件, 位于$ORACLE_HOME/network/admin目录下:
# su - oracle
$ $ORACLE_HOME/bin/netca /silent /responsefile $DISTRIB/response/netca.rsp
$ ll $ORACLE_HOME/network/admin/*.ora
$ lsnrctl status
执行完后, 监听就已经启动了, 默认端口是1521, 默认是动态监听, 只要实例启动了就会监听到. 
  1. 静默建库
    1. 生成响应文件模板
$ vi $DISTRIB/db_create.rsp
#--------------------------------------------------------------------
#以下参数不要更改
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
#以下参数必须设置
[CREATEDATABASE]
GDBNAME = "ORCL.LK"
TEMPLATENAME = "General_Purpose.dbc"
#以下参数不设置则使用默认值,建议设置
CHARACTERSET = "ZHS16GBK"
TOTALMEMORY = "1024"
#--------------------------------------------------------------------
2. dbca静默建库, 大概3-4分钟,种子数据库和控制文件位于$ORACLE_HOME/assistants/dbca/templates/下, 即Seed_Database.dfb和Seed_Database.ctl文件, 实际上建库就是基于通过rman恢复种子数据库和控制文件来实现的.
$ $ORACLE_HOME/bin/dbca -silent -responseFile $DISTRIB/db_create.rsp
Enter SYS user password: 
<输入sys用户密码> 
Enter SYSTEM user password: 
<输入system用户密码> 
Copying database files
...
37% complete
Creating and starting Oracle instance
...
62% complete
Completing Database Creation
...
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL/ORCL.log" for further details.

各参数含义如下:
-silent 表示以静默方式安装
-responseFile 表示使用哪个响应文件,必需使用绝对路径
RESPONSEFILE_VERSION 响应文件模板的版本,该参数不要更改
OPERATION_TYPE 安装类型,该参数不要更改
GDBNAME 全局数据库名,点号前面默认是db_name,点号后面默认就是db_domain
TEMPLATENAME 建库模板名,参考各模板定义:$ORACLE_HOME/assistants/dbca/template/*.dbc
CHARACTERSET 字符集,默认是WE8MSWIN1252
TOTALMEMORY 实例内存,默认是服务器物理内存的40%
3. 安装期间查看日志信息了解进度:
$ tail -100f $ORACLE_BASE/cfgtoollogs/dbca/$ORACLE_SID/$ORACLE_SID.log
  1. 建库后实例检查
$ ps -ef | grep ora_ | grep -v grep | wc -l
21
$ ps -ef | grep ora_ | grep -v grep
oracle    1855     1  0 10:07 ?        00:00:00 ora_pmon_ORCL
oracle    1857     1  0 10:07 ?        00:00:00 ora_vktm_ORCL
oracle    1861     1  0 10:07 ?        00:00:00 ora_gen0_ORCL
oracle    1863     1  0 10:07 ?        00:00:00 ora_diag_ORCL
oracle    1865     1  0 10:07 ?        00:00:00 ora_dbrm_ORCL
oracle    1867     1  0 10:07 ?        00:00:00 ora_psp0_ORCL
oracle    1869     1  0 10:07 ?        00:00:00 ora_dia0_ORCL
oracle    1871     1  0 10:07 ?        00:00:00 ora_mman_ORCL
oracle    1873     1  0 10:07 ?        00:00:00 ora_dbw0_ORCL
oracle    1875     1  0 10:07 ?        00:00:00 ora_lgwr_ORCL
oracle    1877     1  0 10:07 ?        00:00:00 ora_ckpt_ORCL
oracle    1879     1  0 10:07 ?        00:00:00 ora_smon_ORCL
oracle    1881     1  0 10:07 ?        00:00:00 ora_reco_ORCL
oracle    1883     1  0 10:07 ?        00:00:00 ora_mmon_ORCL
oracle    1885     1  0 10:07 ?        00:00:00 ora_mmnl_ORCL
oracle    1887     1  0 10:07 ?        00:00:00 ora_d000_ORCL
oracle    1889     1  0 10:07 ?        00:00:00 ora_s000_ORCL
oracle    1969     1  0 10:07 ?        00:00:00 ora_qmnc_ORCL
oracle    1985     1  0 10:07 ?        00:00:00 ora_cjq0_ORCL
oracle    2003     1  0 10:08 ?        00:00:00 ora_q000_ORCL
oracle    2005     1  0 10:08 ?        00:00:00 ora_q001_ORCL
  1. 建库后监听检查
$ lsnrctl status
...
Services Summary...
Service "ORCL.LK" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "ORCLXDB.LK" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
The command completed successfully

实例应该被动态注册到监听程序了. 如果未被动态注册到监听程序, 则可以手工注册:
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 16 11:11:46 2009
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL> alter system register;
  1. 改为归档模式并重启
$ sqlplus / as sysdba
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database flashback on; (如果要启用数据库闪回功能则执行)
SQL> alter database open;
SQL> execute utl_recomp.recomp_serial(); (重新编译所有可能失效对象)
SQL> alter system archive log current; (手工归档测试)
  1. 静默删库
    1. 生成响应文件
$ vi $DISTRIB/db_delete.rsp
#--------------------------------------------------------------------
#以下参数不能更改
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "deleteDatabase"
#以下参数根据实际情况更改
[DELETEDATABASE]
SOURCEDB = "ORCL"
#--------------------------------------------------------------------
2. dbca静默删库,无需手工停库,大概1分钟
$ $ORACLE_HOME/bin/dbca -silent -responseFile $DISTRIB/db_delete.rsp
Connecting to database
...
47% complete
Updating network configuration files
...
52% complete
Deleting instance and datafiles
...
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL.log" for further details.

各参数含义如下:
-silent 表示以静默方式删除
-responseFile 表示使用哪个响应文件,必需使用绝对路径
RESPONSEFILE_VERSION 响应文件模板的版本,该参数不要更改
OPERATION_TYPE 安装类型,该参数不要更改
SOURCEDB  数据库名,不是全局数据库名,即不包含db_domain
3. 删除期间查看日志信息了解进度:
$ tail -100f $ORACLE_BASE/cfgtoollogs/dbca/$ORACLE_SID/$ORACLE_SID.log

EM配置命令

  • 创建一个EM资料库emca -repos create
  • 重建一个EM资料库emca -repos recreate
  • 删除一个EM资料库emca -repos drop
  • 配置数据库的Database Control emca -config dbcontrol db
  • 删除数据库的 Database Control配置emca -deconfig dbcontrol db
  • 重新配置db control的端口,默认端口在1158
emca -reconfig ports
emca -reconfig ports -DBCONTROL_HTTP_PORT 1158
emca -reconfig ports -RMI_PORT 5520
emca -reconfig ports -AGENT_PORT 3938
emca -reconfig ports -JMS_PORT 5540
  • 启动EM console服务emctl start dbconsole
  • 停止EM console服务emctl stop dbconsole
  • 查看EM console服务的状态emctl status dbconsole
  • 配置dbconsole的步骤
emca -repos create
emca -config dbcontrol db
emctl start dbconsole
  • 重新配置dbconsole的步骤
emca -repos drop
emca -repos create
emca -config dbcontrol db
emctl start dbconsole

你可能感兴趣的:(基础知识)