Oracle 11.2.0.4 silently installs software and creates databases

Source: Internet
Author: User
Tags dba reserved sqlplus

In the absence of a graphical interface, the installation of Oracle database software and the creation of a database can only be done using the command line.

This article assumes that the prerequisites for installation are already configured.

I. Silent installation of database software

1. Prepare the parameter file

This parameter file is used to install the software, the configuration of the need to install the version, language, Oracle_home and other information.

The template of this file in the Database/response directory under the DB_INSTALL.RSP, the file of each parameter function reference Http://docs.oracle.com/cd/E11882_01/em.112/e12255/oui3 _response_files.htm#ouicg183

#修改记录如下: oracle.install.option=install_db_swonly #只安装软件UNIX_GROUP_NAME =oinstall #安装的操作系统用户组INVENTORY_LOCATION =/ u01/app/orainventory/#Inventory目录路径SELECTED_LANGUAGES =en #安装语言ORACLE_HOME =/u01/app/oracle/product/11.2.0/db # Oracle Home Path oracle_base=/u01/app/oracle/#Oracle BASE path Oracle.install.db.installedition=ee #数据库版本 EE Enterprise Edition oracle.install.db.dba_group=dba #DBA组所属的操作系统用户组oracle. Install.db.oper_group=oinstall # Oper group belongs to the operating system user group Decline_security_updates=true #必须设置为true, otherwise need to modify additional information # Create inventory directory [[email protected] 11.2.0.4_ database]$ Cd/u01/app/[[email protected] app]$ lsoracle[[email protected] app]$ mkdir orainventory

2. Silent Installation

[[email protected] 11.2.0.4_database]$ ./runinstaller -silent -force - responsefile /opt/soft/11g/11.2.0.4_database/response/install.rsp starting oracle  Universal installer ... checking temp space: must be greater than 120 mb.    actual 34496 mb    passedchecking swap space: must be  greater than 150 mb.   actual 2047 mb     passedpreparing to launch oracle universal installer from /tmp/ ORAINSTALL2016-12-21_05-02-49PM. PLEASE WAIT&NBSP, ..... [[Email protected] 11.2.0.4_database]$ [warning] [ins-13014] target environment  do not meet some optional requirements.   CAUSE: Some  Of the optional prerequisites are not met.&nBsp See logs for details. /tmp/orainstall2016-12-21_05-02-49pm/installactions2016-12-21_ 05-02-49pm.log   action: identify the list of failed prerequisite  checks from the log: /tmp/orainstall2016-12-21_05-02-49pm/installactions2016-12-21_ 05-02-49pm.log. then either from the log file or from  Installation manual find the appropriate configuration to meet the  prerequisites and fix it manually. you can find the log of this install session at: /u01/app/ orainventory/logs/installactions2016-12-21_05-02-49pm.log# log file:/u01/app/orainventory/logs/ installactions2016-12-21_05-02-49pm.log [[email protected] 11.2.0.4_database]$ the  Installation of oracle database 11g was successful. Please check&nbsP; ' /u01/app/orainventory/logs/silentinstall2016-12-21_05-02-49pm.log '  for more details. As a root user, execute the following script (s): 1. /u01/app/ orainventory/orainstroot.sh2. /u01/app/oracle/product/11.2.0/db/root.shsuccessfully setup  Software.

3. Execute script with root

[[Email protected] response]# /u01/app/orainventory/orainstroot.shchanging permissions  of /u01/app/orainventory.adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/orainventory to oinstall. The execution of the script is complete. [[email protected] response]# /u01/app/oracle/product/11.2.0/db/root.shcheck /u01/app/ Oracle/product/11.2.0/db/install/root_rhel6_2016-12-21_17-12-23.log for the output of  root script[[email protected] response]# cat /u01/app/oracle/product/11.2.0/db/ Install/root_rhel6_2016-12-21_17-12-23.logperforming 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   copying  Dbhome to /usr/local/bin ...   copying oraenv to /usr/local/bin  ...   COPYING CORAENV TO /USR/LOCAL/BIN&NBSP, ..... Creating /etc/oratab file ... entries will be added to the /etc/oratab file as needed  bydatabase configuration assistant when a database is createdfinished  Running generic part of root script. Now product-specific root actions will be performed. Finished product-specific root actions. Finished product-specific root actions. #测试sqlplus [[Email protected] 11.2.0.4_database ]$ sqlplus / as sysdbasql*plus: release 11.2.0.4.0 production on  Wed dec 21 17:16:19 2016copyright  (c)  1982, 2013, oracle.  all rights reserved. Connected to an idle instance. Sql>

4. Build the library by hand

Official Document: Http://docs.oracle.com/cd/E11882_01/server.112/e25494/create.htm#CIAEJDBE

4.1 Configuring Environment variables

Export Oracle_base=/u01/app/oracleexport oracle_home= $ORACLE _base/product/11.2.0/dbexport oracle_sid=mydbexport Path= $PATH: $ORACLE _home/bin# Create data file storage directory [[email protected] oracle]$ CD $ORACLE _base[[email protected] oracle]$ mkdir-p Oradata/mydb

4.2 Creating Pfile Manually

#此处只写必要的几个参数, the production should be written according to the actual parameters [[email protected] ~]$ cat mydb.oradb_name=mydbcontrol_files=/u01/app/oracle/oradata/ Mydb/control01.ctl,/u01/app/oracle/oradata/mydb/control02.ctl

4.3 Launching the instance to the Nomount state

[Email protected] ~]$ sqlplus/as sysdbasql*plus:release 11.2.0.4.0 Production on Wed Dec 17:26:31 2016Copyright (c)  1982, Oracle. All rights reserved. Connected to an idle instance. Sql> Startup Nomount Pfile=/home/oracle/mydb.ora;oracle instance started. Total System Global area 217157632 bytesfixed size 2251816 bytesvariable size 159384536 bytesdatabase buffers 50331 648 Bytesredo buffers 5189632 bytes

4.4 Creating SPFile and restarting to Nomount state

Sql> create SPFile from pfile= '/home/oracle/mydb.ora '; File created. sql> shutdown Immediate;ora-01507:database not mountedoracle instance shut down. Sql> Startup Nomount;oracle instance started. Total System Global area 217157632 bytesfixed size 2251816 bytesvariable size 159384536 bytesdatabase buffers 50331 648 Bytesredo buffers 5189632 bytes

4.4 Executing the CREATE DATABASE statement

sql> create database mydb  2     user sys  Identified by oracle  3     user system identified  BY oracle  4     LOGFILE GROUP 1  ('/u01/app/ Oracle/oradata/redo01.log ')  SIZE 100M BLOCKSIZE 512,  5              GROUP 2  ('/u01/app/oracle/oradata/redo02.log ')  SIZE 100M BLOCKSIZE 512,  6              GROUP 3  ('/u01/app/oracle/oradata/redo03.log ')  size 100m  BLOCKSIZE 512  7     MAXLOGFILES 5  8      maxlogmembers 5  9     maxloghistory 1 10      maxdatafiles 100 11     character set zhs16gbk 12      national character set al16utf16 13     extent  MANAGEMENT LOCAL 14     DATAFILE  '/u01/app/oracle/oradata/mydb/ SYSTEM01.DBF '  SIZE 325M REUSE 15     SYSAUX DATAFILE  '/ U01/APP/ORACLE/ORADATA/MYDB/SYSAUX01.DBF '  SIZE 325M REUSE 16      default tablespace users 17        datafile  '/u01/ APP/ORACLE/ORADATA/MYDB/USERS01.DBF '  18        size 500m  reuse autoextend on maxsize unlimited 19     default  temporary tablespace tempts1 20        tempfile   '/u01/app/oracle/oRADATA/MYDB/TEMP01.DBF '  21        SIZE 20M REUSE  22     undo tablespace undotbs 23         DATAFILE  '/u01/app/oracle/oradata/mydb/undotbs01.dbf '  24         SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;Database  Created.

4.5 Execute Create data dictionary script

Conn/as Sysdba@?/rdbms/admin/catalog.sql@?/rdbms/admin/catproc.sql@?/rdbms/admin/utlrp.sqlconn system/oracle@?/ Sqlplus/admin/pupbld.sql

5. Create a listener and start

[[email protected] mydb]$ cd  $ORACLE _home/network/admin[[email protected] admin] $ lssamples  shrept.lst[[email protected] admin]$ vi listener.ora[[email  protected] admin]$ cat listener.ora LISTENER=   (description=      (address_list=       (address= (protocol=tcp) (HOST=RHEL6) (PORT=1521))        (address= (PROTOCOL=IPC) (Key=extproc))) [[Email protected] admin] $ lsnrctl startlsnrctl for linux: version 11.2.0.4.0 - production  on 21-DEC-2016 17:41:13Copyright  (c)  1991, 2013, oracle.  all  rights reserved. Starting /u01/app/oracle/product/11.2.0/db/bin/tnslsnr: please wait ... tnslsnr for linux: version 11.2.0.4.0 - productionsystem parameter  File is /u01/app/oracle/product/11.2.0/db/network/admin/listener.oralog messages written to /u01/app/ oracle/diag/tnslsnr/rhel6/listener/alert/log.xmllistening on:  (description= (ADDRESS= (PROTOCOL=TCP) ( HOST=RHEL6) (port=1521)) listening on:  (description= (address= (PROTOCOL=IPC) (KEY=extproc))) Connecting  to  (description= (address= (protocol=tcp) (HOST=RHEL6) (port=1521)) status of the  LISTENER------------------------alias                      LISTENERVersion                    tnslsnr for linux:  Version 11.2.0.4.0 - ProductionStart Date                 21-DEC-2016 17:41:15Uptime          &nbsP;          0 days 0 hr. 0 min.  2 secTrace Level                offSecurity                   ON: Local OS AuthenticationSNMP                       offlistener  parameter file   /u01/app/oracle/product/11.2.0/db/network/admin/ listener.oralistener log file         /u01/app/oracle/ diag/tnslsnr/rhel6/listener/alert/log.xmllistening endpoints summary...   (DESCRIPTION= ( Address= (PROTOCOL=TCP) (HOST=RHEL6) (port=1521))    (description= (address= (PROTOCOL=IPC) (Key=extproc))) The listener supports no seRvicesthe command completed successfully 

6. Testing

C:\users\victor>sqlplus system/[email protected]/mydbsql*plus:release 12.1.0.1.0 Production on Wednesday December 21 17:51:05 20  16Copyright (c) 1982, Oracle.  All rights reserved. Connect to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit productionwith the partitioning, OLAP, Data Mining and Real application testing optionssql> Select Open_mode from V$database;open_mode----------------- ---READ WRITE


This article is from the "DBA fighting!" blog, so be sure to keep this source http://hbxztc.blog.51cto.com/1587495/1884833

Oracle 11.2.0.4 silently installs software and creates databases

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.