Oracle 數據庫 命令行安裝


Oracle 數據庫 命令行安裝

 1. 准備工作
關閉 防火牆,關閉 SElinux
 2. 安裝相關依賴包
yum -y install binutils compat-libcap1  compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp
 3. 修改 /etc/security/limits.conf,添加如下參數
oracle             soft    nproc   2047
oracle             hard    nproc   16384
oracle             soft    nofile  1024
oracle             hard    nofile  65536
oracle             soft    stack   10240
4. 修改 /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 = 1048576
vm.overcommit_memory = 1
5. 建立 oracle安裝用戶,組和目錄
(1)創建用戶和組
	groupadd oinstall
	groupadd dba
	useradd -g oinstall -G dba oracle
	echo "oracle" | passwd --stdin oracle
(2)創建安裝目錄
	mkdir -p /DataBase/app/oracle
	chown -R oracle:oinstall /DataBase/app/oracle
(3)設置環境變量
	export ORACLE_BASE=/DataBase/app/oracle
	export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
	export ORACLE_SID=umpay
	export PATH=$PATH:$ORACLE_HOME/bin:
	export TNS_ADMIN=$ORACLE_HOME/network/admin
	export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
6.安裝oracle
	(1)切換到oracle 目錄,解壓安裝包
	unzip linux.x64_11gR2_database_1of2.zip
	unzip linux.x64_11gR2_database_2of2.zip
解壓后得到database目錄,其中response目錄里面有三個rsp文件,用來作為靜默安裝時應答文件的模板
[oracle@localhost response]$ ll /tmp/database/response
總用量 76
-rw-rw-r-- 1 oracle oinstall 44969 2月  14 2009 dbca.rsp ##安裝應答
-rw-rw-r-- 1 oracle oinstall 22557 8月  15 2009 db_install.rsp ## 創建數據庫應答
-rwxrwxr-x 1 oracle oinstall  5740 2月  26 2009 netca.rsp ## 建立監聽,本地服務等網絡設置
	(2)修改后的靜默安裝配置文件db_install.rsp
[oracle@localhost etc]$ cat db_install.rsp | grep -v '^#' | grep -v '^$'
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=localhost
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/DataBase/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN,zh_TW
ORACLE_HOME=/DataBase/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/DataBase/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=true
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac: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
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=orcl
oracle.install.db.config.starterdb.SID=umpay
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=512
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=umpayoracle
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.dbcontrol.emailAddress=
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
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=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
7. 開始靜默安裝
./runInstaller -silent -force -responseFile /home/oracle/etc/db_install.rsp
(1)當出現以下信息時
var /DataBase/app/oracle/oraInventory/orainstRoot.sh
var /DataBase/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.
(2)打開新的客戶端使用root身份執行以下腳本
sh /DataBase/app/oracle/oraInventory/orainstRoot.sh
sh /DataBase/app/oracle/product/11.2.0/dbhome_1/root.sh

8. 配置監聽
	(1)運行監聽文件
netca /silent /responsefile /home/oracle/etc/netca.rsp
查看監聽器是否已經在1521端口上開始工作了
[root@localhost etc]# netstat -tlnp | grep 1521
tcp        0      0 10.110.6.191:1521           0.0.0.0:*                   LISTEN      13882/tnslsnr

9. 創建數據庫
/DataBase/app/oracle/product/11.2.0/db_1/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname umpay -sid umpay -sysPassword orcle -systemPassword orcle -responseFile NO_VALUE -datafileDestination /DataBase/app/oracle/oradata/ -redoLogFileSize 50 -recoveryAreaDestination /DataBase/app/oracle/flash_recovery_area -storageType FS -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16 -sampleSchema true -memoryPercentage 30 -totalMemory 200 -databaseType OLTP -emConfiguration NONE
10. 啟動數據庫
進入到Oracle SQL命令行中,執行startup
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 17 17:49:10 2022

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  409194496 bytes
Fixed Size		    2213856 bytes
Variable Size		  348129312 bytes
Database Buffers	   50331648 bytes
Redo Buffers		    8519680 bytes
Database mounted.
Database opened.
SQL> 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM