CentOS6.332位静默安装Oracle11gr2详细教程 一、安装依赖包 binutils 2.17.50.0.6 compat-libstdc++-33 3.2.3 elfutils-libelf 0.125 elfutils-libelf-devel 0.125 elfutils-libelf-devel-static 0.125 gcc 4.1.2 gcc-c++ 4.1.2 glibc 2.5-24 glibc-common 2
CentOS 6.3 32位静默安装Oracle 11g r2详细教程
一、安装依赖包
binutils2.17.50.0.6
compat-libstdc++-33 3.2.3
elfutils-libelf0.125
elfutils-libelf-devel0.125
elfutils-libelf-devel-static0.125
gcc4.1.2
gcc-c++4.1.2
glibc2.5-24
glibc-common2.5
glibc-devel2.5
glibc-headers2.5
kernel-headers2.6.18
ksh20060214
libaio0.3.106
libaio-devel0.3.106
libgcc4.1.2
libgomp4.1.2
libstdc++4.1.2
libstdc++-devel4.1.2
make3.81
sysstat7.0.2
unixODBC2.2.11
unixODBC-devel2.2.11
yum install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel
二、修改内核参数
1、修改/etc/sysctl.conf文件
(1)、以root身份登录
(2)、编辑文件 #vim /etc/sysctl.conf,修改以下参数,如果没有可以自己添加,如果默认值比参考值大,则不需要修改。
kernel.shmall = 2097152 //表示系统一次可以使用的共享内存总量(以页为单位)。缺省值就是2097152,通常不需要修改
kernel.shmmax = 2147483648 //定义了共享内存段的最大尺寸(以字节为单位)。缺省为32M,对于oracle来说,该缺省值太低了,通常将其设置为2G=2147483648/1024/1024/1024
kernel.shmmni = 4096 //用于设置系统范围内共享内存段的最大数量。该参数的默认值是 4096 。通常不需要更改
kernel.sem = 250 32000 100 128 //表示设置的信号量
fs.file-max = 65536 //表示文件句柄的最大数量。文件句柄表示在Linux系统中可以打开的文件数量。其实是由"fs.file-max = 512 * PROCESSES"得到的,我们指定PROCESSES的值为128,即为"fs.file-max =512 *128"。
fs.aio-max-nr = 1048576 //同时可以拥有的的异步IO请求数目。
net.ipv4.ip_local_port_range = 1024 65000 //应用程序可使用的Ipv4端口范围。
net.core.rmem_default = 262144 //默认的接收窗口大小
net.core.rmem_max = 4194304 //接收窗口的最大大小
net.core.wmem_default = 262144 //默认的发送窗口大小
net.core.wmem_max = 1048586 //发送窗口的最大大小
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
(3)、运行#sysctl -p ,即可马上生效。
(4)、运行 #sysctl -p 命令报错
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
解决方法,执行如下命令:
#modprobe bridge
#lsmod|grep bridge
2、为oracle用户设置Shell限制
(1)、编辑文件 #vim /etc/security/limits.conf ,添加如下行:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
(2)、编辑文件 #vim /etc/pam.d/login ,添加如下行:
session required pam_limits.so
(3)、查看/etc/selinux/config 文件,确保SELINUX 为disabled状态
SELINUX=disabled
查看SELinux状态:getenforce
关闭SELinux:
1、临时关闭(不用重启机器):
setenforce 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
3、编辑/etc/profile,添加如下配置:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
4、编辑 /etc/csh.login ,添加如下配置:
if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
endif
3、注:内核参数并非必须修改,可以根据自己实际情况而定。
三、创建用户和组及安装目录
1、创建Oracle用户与组
在这里只讨论单主机环境,不考虑RAC环境的配置。
执行以下指令以新增oracle安装时所需要的使用者与群组。
(1) 建立群组oinstall
# groupadd oinstall
(2) 建立群组dba
# groupadd oradba
(3) 新增使用者oracle并将其加入oinstall和dba群组
# useradd -g oinstall -G oradba oracle
(4) 测试oracle账号是否建立完成
# id oracle
(5) 建立oracle的新密码
# passwd oracle
(6)将oracle使用者加入到sudo群组中
# vim /etc/sudoers
找到
root ALL=(ALL) ALL
这行,并且在底下再加入
oracle ALL=(ALL) ALL
输入wq!或者x!(由于这是一份只读文档所以需要再加上!)并且按下Enter
2、创建oracle安装时的目标目录
(1) 以root身份登录
(2) 创建Oracle系统目录:# mkdir -p /app/oracle
(3) 创建Oracle服务器主目录:# mkdir /app/oracle/11g
(4) 将该目录的所有者设置为oracle:# chown -R oracle:oinstall /app/oracle
(5) 编辑 /etc/profile,在后面追加以下内容
export ORACLE_BASE=/app/oracle
export ORACLE_HOME=/app/oracle/11g
export ORACLE_SID=ora11g
export PATH=$PATH:$ORACLE_HOME/bin
运行# source /etc/profile 使其立即生效
(6) 注: 安装Oracle的目标目录可以任意指定, 但是安装和运行Oracle的用户必须有完全修改该目录的权限
四、编辑安装需要的应答文件
(1) 以root身份登录
(2) 静默模式(Silent)安装必须指定一个应答文件db_install.rsp来完成安装过程所须的各类参数。
(3) 编辑db_install.rsp,修改以下这些项目的值。
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=localhost
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/app/oracle/11g
ORACLE_BASE=/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=oradba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=oracle11g
oracle.install.db.config.starterdb.SID=ora11g
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.password.ALL=manager
DECLINE_SECURITY_UPDATES=true
其它项目用默认值即可,也可以根据自己的须要进行修改
(4) 注:如果Oracle从光盘安装,必须先将应答文件复制到硬盘上,才能修改
五、开始安装
(1) 用oracle用户登录,然后在Oracle安装目录里执行
$ ./runInstaller -ignoreSysPrereqs -silent -noconfig -responseFile
(2) 接下来就是等待安装结束了。
各安装参数的含义如下:
-ignoreSysPrereqs 让Oracle忽略系统检查,因为Oracle官方声明只支持Linux服务器产品,所以要在非服务器产品的Linux上安装就必须指定此参数。
-silent 表示以静默方式安装,不会有任何提示
-force 允许安装到一个非空目录
-noconfig 表示不运行配置助手netca
-responseFile 表示使用哪个响应文件,必需使用绝对路径
在这里我输入:
$ ./runInstaller -ignoreSysPrereqs -silent -noconfig -responseFile /mnt/hgfs/tmp/oracle11g/response/db_install.rsp
当前目录为安装目录系统反应为:
Starting Oracle Universal Installer...
Checking installer requirements...
六、系统初始化
(1) 以root用户登录
(2) 运行以下两个脚本:
$ORACLE_BASE/oraInventory/orainstRoot.sh
$ORACLE_HOME/root.sh
七、安装网络监听器
(1) 以oracle登陆
(2) 没有网络监听器,客户端就无法通过网络连接Oralce服务器。要在命令行安装网络监听器,也只能使用静默模式。
(3) 运行:
$ORACLE_HOME/bin/netca /silent /responseFile
这里我输入的命令为:
$ORACLE_HOME/bin/netca /silent /responseFile /mnt/hgfs/tmp/oracle11g/response/netca.rsp
系统反应:
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /mnt/hgfs/tmp/oracle11g/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/app/oracle/11g/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
(4) 查看监听器状态
$ORACLE_HOME/bin/lsnrctl status
八、修改dbstart
(1) 以oracle身份登录
(2) 打开 $ORACLE_HOME/bin/dbstart,将
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
改为
ORACLE_HOME_LISTNER=$ORACLE_HOME
否则网络监听器可能无法自动启动。
九、安装数据库实例
(1) 以root身份登录
(2) 编辑Oracle安装目录里response子目录下的应答文件 dbca.rsp,修改以下项目:
RESPONSEFILE_VERSION = "11.2.0" //不能更改
OPERATION_TYPE = "createDatabase"
GDBNAME="oracle11g" 全局数据库的名字=SID+主机域名,这里我设置为:oracle11g
SID="ora11g" 数据库的SID,这个比较重要,我第一次安装时就是因为这个问题无法使用,这里我修改为:ora11g
TEMPLATENAME = "General_Purpose.dbc" //建库用的模板文件
SYSPASSWORD="manager" SYS用户的初始密码,我设置为manager
SYSTEMPASSWORD="manager" SYSTEM用户的初始密码,我设置为manager
DATAFILEDESTINATION = /app/oracle/oradata //数据文件存放目录
RECOVERYAREADESTINATION=/app/oracle/oradata_back //恢复数据存放目录
CHARACTERSET="ZHS16GBK" 数据库字符集,重要!!!! 建库后一般不能更改(中文为 ZHS16GBK)
TOTALMEMORY = "800" //oracle内存800MB
(3)然后登陆oracle运行
$ORACLE_HOME/bin/dbca -silent -responseFile -cloneTemplate
这里我输入的命令为:
$ORACLE_HOME/bin/dbca -silent –responseFile /mnt/hgfs/tmp/oracle11g/response/dbca.rsp -cloneTemplate
(4) 系统反应:
Copying database files
1% complete
3% complete
11% complete
18% complete
26% 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 "/app/oracle/cfgtoollogs/dbca/oracle11g/oracle11.log" for further details.
十、修改Oracle启动配置文件:/etc/oratab
(1) 以oracle用户登录
(2) 然后编辑 /etc/oratab
将
修改为ora11g:/app/oracle/11g:Y
使数据库实例能够自动启动。
十一、启动和关闭Oracle
以oracle用户登录
(1) 检查看看监听器是否有启动
$ORACLE_HOME/bin/lsnrctl status
如果没有启动,可以输入:
$ORACLE_HOME/bin/lsnrctl start
(2) 启动Oracle实例
以sysdba身份登入数据库,输入:
$ sqlplus sys as sysdba
输入密码。(显示SQL>)
接着请输入
SQL> startup
就可以正常的启动数据库了。
备注:也可以用$ORACLE_HOME/bin/dbstart启动数据库实例
(3) 关闭数据库实例
SQL> shutdown immediate
备注:也可以用 $ORACLE_HOME/bin/dbstart 启动数据库实例
(4) 关闭监听
$ lsnrctl stop
十二、让Oracle运行为服务
(1) 以root身份登录
(2) 创建文件 /etc/init.d/oracle,输入下列内容
#!/bin/sh
# chkconfig: 35 80 10
# description: Oracle auto start-stop script.
#
# Set ORACLE_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORACLE_OWNER to the user id of the owner of the
# Oracle database in ORACLE_HOME.
ORACLE_HOME=/app/oracle/11g
ORACLE_OWNER=oracle
if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'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 - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart" >>/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 - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" >>/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 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 - $ORACLE_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 - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut" >>/var/log/oracle
echo "Done."
echo ""
echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Finished." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
;;
'restart')
$0 stop
$0 start
;;
esac
(3) 然后将这个文件赋予可执行的权限,运行
chmod a+x /etc/init.d/oracle
(4) 添加Oracle服务并设置在Linux启动时自动运行
chkconfig --level 35 oracle on #添加Oracle服务,并设置3、5启动级别自动启动oracle
chkconfig --list oracle #查看服务信息
这样就可以用service oracle start|stop|restart来启动、停止和重启Oracle了

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

The steps to build a MySQL database include: 1. Create a database and table, 2. Insert data, and 3. Conduct queries. First, use the CREATEDATABASE and CREATETABLE statements to create the database and table, then use the INSERTINTO statement to insert the data, and finally use the SELECT statement to query the data.

MySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.

MySQL is suitable for beginners because: 1) easy to install and configure, 2) rich learning resources, 3) intuitive SQL syntax, 4) powerful tool support. Nevertheless, beginners need to overcome challenges such as database design, query optimization, security management, and data backup.

Yes,SQLisaprogramminglanguagespecializedfordatamanagement.1)It'sdeclarative,focusingonwhattoachieveratherthanhow.2)SQLisessentialforquerying,inserting,updating,anddeletingdatainrelationaldatabases.3)Whileuser-friendly,itrequiresoptimizationtoavoidper

ACID attributes include atomicity, consistency, isolation and durability, and are the cornerstone of database design. 1. Atomicity ensures that the transaction is either completely successful or completely failed. 2. Consistency ensures that the database remains consistent before and after a transaction. 3. Isolation ensures that transactions do not interfere with each other. 4. Persistence ensures that data is permanently saved after transaction submission.

MySQL is not only a database management system (DBMS) but also closely related to programming languages. 1) As a DBMS, MySQL is used to store, organize and retrieve data, and optimizing indexes can improve query performance. 2) Combining SQL with programming languages, embedded in Python, using ORM tools such as SQLAlchemy can simplify operations. 3) Performance optimization includes indexing, querying, caching, library and table division and transaction management.

MySQL uses SQL commands to manage data. 1. Basic commands include SELECT, INSERT, UPDATE and DELETE. 2. Advanced usage involves JOIN, subquery and aggregate functions. 3. Common errors include syntax, logic and performance issues. 4. Optimization tips include using indexes, avoiding SELECT* and using LIMIT.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Zend Studio 13.0.1
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment