ITPub博客

首页 > 数据库 > Oracle > 使用静默方式安装11g数据库

使用静默方式安装11g数据库

原创 Oracle 作者:super_sky 时间:2013-12-10 10:00:22 0 删除 编辑
环境:
LINUX 6.3 
oracle11g 11.2.0.3

现象:
在安装数据库时,无法启动数据库安装的图形界面,一直报could not execute auto check for display colors using command /usr/bin/xdpyinfo,导致无法启动oracle的安装界面。

采用静默方式安装数据库

1)修改rsp文件,下面是我修改的rsp文件内容
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=r11g
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/oraInventory
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba

oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.config.starterdb.password.ALL=oracle

2)安装数据库软件
执行命令

[oracle@r11g database]$ ./runInstaller -silent -responseFile /opt/setup/database/init.rsp 
说明:
-responseFile 参数必须是绝对路径
执行过程中,这个页面不要动,也不要关闭。可以在新的页面进行日志监控

tail -100f /u01/app/oracle/oraInventory/logs/installActions2013-11-08_11-37-44PM.log

脚本执行完后,有如下提示
[oracle@r11g ~]$ The installation of Oracle Database 11g was successful.

Please check '/u01/app/oracle/oraInventory/logs/silentInstall2013-11-08_11-37-44PM.log' for more details.

 

As a root user, execute the following script(s):

        1. /u01/app/oracle/oraInventory/orainstRoot.sh

        2. /u01/app/oracle/product/11.2.0/db_1/root.sh

 Successfully Setup Software.

3)执行相关脚本

[root@r11g ~]# /u01/app/oracle/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oracle/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

 Changing groupname of /u01/app/oracle/oraInventory to oinstall.

The execution of the script is complete.

[root@r11g ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh

Check /u01/app/oracle/product/11.2.0/db_1/install/root_r11g_2013-11-08_23-47-49.log for the output of root script

检查root.sh脚本执行情况

[root@r11g ~]# more  /u01/app/oracle/product/11.2.0/db_1/install/root_r11g_2013-11-08_23-47-49.log

 Performing root user operation for Oracle 11g

 The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/db_1

 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.

Finished product-specific root actions.

4)软件安装后测试

[oracle@r11g ~]$ sqlplus "/as sysdba"

 SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 8 23:49:57 2013

 Copyright (c) 1982, 2011, Oracle.  All rights reserved.

 Connected to an idle instance.

 SQL>  


5)编辑初始化参数文件

db_name='db'

db_block_size=8192

memory_target=1G

memory_max_target=1G

processes = 150

control_files = ('/u01/app/oracle/oradata/control/control01.ctl', '/u01/app/oracle/oradata/control/control02.ctl')

job_queue_processes=10

open_cursors=300

fast_start_mttr_target=500

undo_tablespace='UNDOTBS1'

undo_management=AUTO

remote_login_passwordfile='EXCLUSIVE'

audit_file_dest='/u01/app/oracle/admin/db/adump'

audit_trail ='db'

db_domain=''

db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'

db_recovery_file_dest_size=2G

diagnostic_dest='/u01/app/oracle'

dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'

compatible ='11.2.0'


6)创建相关目录

mkdir -p /u01/app/oracle/oradata/control

mkdir -p /u01/app/oracle/admin/db/adump

mkdir -p /u01/app/oracle/flash_recovery_area

 

在建库脚本中的路径,也需要提前创建。


7)执行建库脚本

CREATE DATABASE db

   USER SYS IDENTIFIED BY oracle

   USER SYSTEM IDENTIFIED BY oracle

   LOGFILE GROUP 1 ('/u01/app/oracle/oradata/redolog/redo01a.log','/u01/app/oracle/oradata/redolog/redo01b.log') SIZE 100M,

           GROUP 2 ('/u01/app/oracle/oradata/redolog/redo02a.log','/u01/app/oracle/oradata/redolog/redo02b.log') SIZE 100M,

           GROUP 3 ('/u01/app/oracle/oradata/redolog/redo03a.log','/u01/app/oracle/oradata/redolog/redo03b.log') SIZE 100M

   MAXLOGFILES 5

   MAXLOGMEMBERS 5

   MAXLOGHISTORY 1

   MAXDATAFILES 200

   CHARACTER SET ZHS16GBK

   NATIONAL CHARACTER SET AL16UTF16

   EXTENT MANAGEMENT LOCAL

   DATAFILE '/u01/app/oracle/oradata/db/system01.dbf' SIZE 500M

   SYSAUX DATAFILE '/u01/app/oracle/oradata/db/sysaux01.dbf' SIZE 500M

   DEFAULT TABLESPACE users

      DATAFILE '/u01/app/oracle/oradata/db/users01.dbf'

      SIZE 500M AUTOEXTEND off

   DEFAULT TEMPORARY TABLESPACE tempts1

      TEMPFILE '/u01/app/oracle/oradata/db/temp01.dbf'

      SIZE 20M

   UNDO TABLESPACE UNDOTBS1

      DATAFILE '/u01/app/oracle/oradata/db/undotbs01.dbf'

      SIZE 200M AUTOEXTEND off;


8)运行脚本创建数据字典视图

使用sys用户执行下面脚本

 @?/rdbms/admin/catalog.sql

@?/rdbms/admin/catproc.sql

 使用system用户执行下面脚本

@?/sqlplus/admin/pupbld.sql


至此,数据库安装完成


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11590946/viewspace-1062866/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-01-11

  • 博文量
    77
  • 访问量
    764085