Oracle 12C静默安装与配置

时间:2022-03-17 01:05:26

Oracle 12C已经发布...下面我将跟大家一起学习静默安装与配置Oracle 12C以及示例用户。

1. 获取Oracle 12C

     http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-linux-download-1959253.html

    从链接地址获取Oracle 12C安装包与示例用户安装包。

2. 静默安装数据库软件

2.1浏览response file参数

[billi@slc03nuj Disk1]$ sed -n '/^[^#]/p' response/db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0
oracle.install.option=
ORACLE_HOSTNAME=
UNIX_GROUP_NAME=
INVENTORY_LOCATION=
SELECTED_LANGUAGES=en
ORACLE_HOME=
ORACLE_BASE=
oracle.install.db.InstallEdition=
oracle.install.db.DBA_GROUP=
oracle.install.db.OPER_GROUP=
oracle.install.db.BACKUPDBA_GROUP=
oracle.install.db.DGDBA_GROUP=
oracle.install.db.KMDBA_GROUP=
oracle.install.db.rac.configurationType=
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.rac.serverpoolName=
oracle.install.db.rac.serverpoolCardinality=
oracle.install.db.config.starterdb.type=
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.ConfigureAsContainerDB=
oracle.install.db.config.PDBName=
oracle.install.db.config.starterdb.characterSet=
oracle.install.db.config.starterdb.memoryOption=
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.password.PDBADMIN=
oracle.install.db.config.starterdb.managementOption=
oracle.install.db.config.starterdb.omsHost=
oracle.install.db.config.starterdb.omsPort=
oracle.install.db.config.starterdb.emAdminUser=
oracle.install.db.config.starterdb.emAdminPassword=
oracle.install.db.config.starterdb.enableRecovery=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=

2.2配置response file参数

[billi@slc03nuj Disk1]$ cat /home/billi/binlearn/db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=slc03nuj
UNIX_GROUP_NAME=dba
INVENTORY_LOCATION=/scratch/billi/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/scratch/billi/app/database/silent/12.1.0.1.0/dbhome
ORACLE_BASE=/scratch/billi/app/database/silent/12.1.0.1.0
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.BACKUPDBA_GROUP=dba
oracle.install.db.DGDBA_GROUP=dba
oracle.install.db.KMDBA_GROUP=dba
oracle.install.db.isRACOneInstall=false
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true
oracle.installer.autoupdates.option=SKIP_UPDATES

2.3静默安装数据库12C

[billi@slc03nuj Disk1]$ ./runInstaller -silent -ignoreSysPrereqs -ignorePrereq -responseFile /home/billi/binlearn/db_install.rsp 
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB. Actual 136617 MB Passed
Checking swap space: must be greater than 150 MB. Actual 1185 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-07-20_11-50-04PM. Please wait ...[billi@slc03nuj Disk1]$ You can find the log of this install session at:
/scratch/billi/app/oraInventory/logs/installActions2013-07-20_11-50-04PM.log
The installation of Oracle Database 12c was successful.
Please check '/scratch/billi/app/oraInventory/logs/silentInstall2013-07-20_11-50-04PM.log' for more details.

As a root user, execute the following script(s):
1. /scratch/billi/app/database/silent/12.1.0.1.0/dbhome/root.sh


Successfully Setup Software.

2.4以root用户运行root.sh

[root@slc03nuj Disk1]# /scratch/billi/app/database/silent/12.1.0.1.0/dbhome/root.sh
Check /scratch/billi/app/database/silent/12.1.0.1.0/dbhome/install/root_slc03nuj_2013-07-21_00-26-05.log for the output of root script

3. 配置Net Listener

3.1 浏览netca response file参数

[billi@slc03nuj Disk1]$ sed -n '/^[^#]/p' response/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"}

3.2 编辑netca response file参数

[billi@slc03nuj Disk1]$ cat /home/billi/binlearn/netca.rsp
[GENERAL]
RESPONSEFILE_VERSION="12.1"
CREATE_TYPE="CUSTOM" // Note, 设置为定制的,否则默认的是LISTENER, 1525
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""custom""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER_ST12C"}
LISTENER_PROTOCOLS={"TCP;1551"}
LISTENER_START=""LISTENER_ST12C""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1551"}

3.3 静默安装NET Listener

[billi@slc03nuj dbhome]$ ./bin/netca -silent -responseFile /home/billi/binlearn/netca.rsp

Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /home/billi/binlearn/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Configuring Listener:LISTENER_ST12C
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/scratch/billi/app/database/silent/12.1.0.1.0/dbhome/bin/lsnrctl start LISTENER_ST12C
Listener Control complete.
Listener started successfully.
Profile configuration complete.
Oracle Net Services configuration successful. The exit code is 0

4. DBCA配置实例

4.1 浏览dbca response file参数

[billi@slc03nuj Disk1]$ sed -n '/^[^#]/p' response/dbca.rsp
[GENERAL]
RESPONSEFILE_VERSION = "12.1.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "orcl12c.us.oracle.com"
SID = "orcl12c"
TEMPLATENAME = "General_Purpose.dbc"
[createTemplateFromDB]
SOURCEDB = "myhost:1521:orcl"
SYSDBAUSERNAME = "system"
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"
NODELIST=
SYSDBAUSERNAME = "sys"
[DELETEINSTANCE]
DB_UNIQUE_NAME = "orcl12c.us.oracle.com"
INSTANCENAME = "orcl12c"
SYSDBAUSERNAME = "sys"
[CREATEPLUGGABLEDATABASE]
SOURCEDB = "orcl"
PDBNAME = "PDB1"
[UNPLUGDATABASE]
SOURCEDB = "orcl"
PDBNAME = "PDB1"
ARCHIVETYPE = "TAR"

4.2 静默dbca新建实例

        上面的参数设置正确,因此直接执行命令创建实例。
[billi@slc03nuj dbhome]$ ./bin/dbca -silent -createDatabase -responseFile /home/billi/binlearn/dbca.rsp -sysPassword welcome1 -systemPassword welcome1
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
33% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/scratch/billi/app/database/silent/12.1.0.1.0/cfgtoollogs/dbca/orcl12c/orcl12c.log" for further details.

5. 检查与实验

5.1 Net Listener检查

[billi@slc03nuj dbhome]$ ps -ef | grep -i st12c
billi 21966 1 0 00:55 ? 00:00:01 /scratch/billi/app/database/silent/12.1.0.1.0/dbhome/bin/tnslsnr LISTENER_ST12C -inherit

[billi@slc03nuj dbhome]$ /scratch/billi/app/database/silent/12.1.0.1.0/dbhome/bin/lsnrctl status LISTENER_ST12C

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 21-JUL-2013 01:40:23

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=slc03nuj.us.oracle.com)(PORT=1551)))
STATUS of the LISTENER
------------------------
Alias LISTENER_ST12C
Version TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date 21-JUL-2013 00:55:14
Uptime 0 days 0 hr. 45 min. 9 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /scratch/billi/app/database/silent/12.1.0.1.0/dbhome/network/admin/listener.ora
Listener Log File /scratch/billi/app/database/silent/12.1.0.1.0/diag/tnslsnr/slc03nuj/listener_st12c/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=slc03nuj.us.oracle.com)(PORT=1551)))
Services Summary...
Service "orcl12c.us.oracle.com" has 1 instance(s).
Instance "orcl12c", status READY, has 1 handler(s) for this service...
Service "orcl12cXDB.us.oracle.com" has 1 instance(s).
Instance "orcl12c", status READY, has 1 handler(s) for this service...
The command completed successfully

5.2 sqlplus连接实例检查


[billi@slc03nuj dbhome]$ $ORACLE_HOME/bin/sqlplus / as sysdba ;

SQL*Plus: Release 12.1.0.1.0 Production on Sun Jul 21 01:37:33 2013

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> col BANNER format a100;
SQL> select * from global_name;GLOBAL_NAME--------------------------------------------------------------------------------ORCL12C.US.ORACLE.COM

到此为止,我们简单的学习如何静态安装Oracle 12C, 一些复杂参数配置敬请参考Oracle文档。 谢谢!~