1环境准备 1.1.linux系统安装 版本 RHAS4:RedHat Enterprise Linux Advance Server 4.0 1.2.检查环境 Hard Disk Space [ro
1环境准备 1.1.linux系统安装
版本
RHAS4:RedHat Enterprise Linux Advance Server 4.0
1.2.检查环境Hard Disk Space
[root@localhost /]#df –h
(目标安装目录) >2 G +1G(软件包源目录)
/tmp >400M
Mem>1G,swap>1G
[root@localhost /]#cat /proc/meminfo|grep Total
依赖软件版本
名称 最低版本 查询命令
kernel 2.6.9 #uname –a或 uname -r
glibc 2.3.2.95.27 #rpm -q glibc
gcc 3.2 #rpm -q gcc
make 3.79 #rpm -q make
binutils 2.14 #rpm -q binutils
libaio 0.3 #rpm -q libaio
openmotif 2.2.2-16 #rpm -q openmotif
setarch 1.3-1 #rpm -q setarch
1.3.检查并配置内核参数检查当前参数
/sbin/sysctl -a | grep 参数名
配置内核参数
1) 执行 [root@localhost /]#vi /etc/sysctl.conf 添加如下内容
kernel.shmall = 2097152 # OS范围内共享内存的最大页面数量, 单位4K, 默认2097152
kernel.shmmax = 536870912 # OS范围内每个共享内存段的最大尺寸. 单位Byte,默认32M
kernel.shmmni = 4096 #OS范围内共享内存段的最大数目,默认值4096
kernel.sem = 250 32000 100 128 #信号量参数
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.wmem_defaut=262144
net.core.rmem_max=262144
net.core.wmem_max=262144
2) 生效[root@localhost /]# /sbin/sysctl -p
1.4.创建Oracle组及用户
创建用户组oinstall,dba
创建安装数据库时所需要使用的用户组oinstall,dba
[root@localhost /]#groupadd oinstall
[root@localhost /]#groupadd dba
创建用户oracle
创建用户oracle并将oinstamll,dba组定义成oracle用户的主次组
[root@localhost /]# useradd -g oinstall -G dba oracle (设定oracle用户为oinstall、dba用户组的成员)
[root@localhost /]#passwd oracle (设定oracle用户的密码)
设置shell限制(可选)
(Oracle建议对每个Linux帐户可以使用的进程数和打开的文件数设置限制)
1)执行[root@localhost /]#vi /etc/security/limits.conf添加以下四行
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
2)修改安全限制,执行[root@localhost /]# vi /etc/pam.d/login加入如下1行
session required /lib/security/pam_limits.so
1.5.配置相关目录创建Oracle系统的安装目录和数据库文件存放的目录
[root@localhost /]# mkdir -p /oracle/product/ 10.2.0 (创建数据目录)
[root@localhost /]# mkdir -p /oracle/oradata(创建数据文件目录)
[root@localhost /]# mkdir -p /oracle/flash_recovery_area(创建闪回目录)
[root@localhost /]# mkdir -p /oracle/arc_pstat(创建归档日志目录)
[root@localhost /]# mkdir -p /home/oracle/install_temp(创建oracle安装文件临时存放目录
[root@localhost /]# chown -R oracle.oinstall /home/oracle/install_temp
[root@localhost /]# chown -R oracle.oinstall /oracle
[root@localhost /]# chmod -R 775 /oracle (设定目录的读写权限)
1.6.配置环境变量确定ORACLE_SID
确定oracle_sid=oracletest #后续安装后创建数据库时的服务名也保持一致,
以oracle用户登录,修改oracle用户下的 .bash_profile 文件,完成后重启或或执行soure .bash_profile(. .bash_profile)或重登录生效
[oracle@localhost ~]$ vi /home/oracle/.bash_profile增加以下内容
umask 022
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0; export ORACLE_HOME
#图形界面安装时要使用的变量
ORACLE_TERM=xterm; export ORACLE_TERM
ORACLE_OWNER=oracle; export ORACLE_OWNER
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_SID= oracletest
export ORACLE_SID
退出后查看PATH source /home/oracle/.bash_profile
[oracle@localhost ~]$ set|grep PATH
2安装Oracle 1.1.oracle安装文件准备版本
oracle10g01_10.2.0.1.0_database_linux32
文件准备
1)拷贝oracle10g01_10.2.0.1.0_database_linux32.zip
到目录/home/oracle/install_temp/下
2)解压:
unzip oracle10g01_10.2.0.1.0_database_linux32.zip
1.2.安装1.1开始
[oracle@localhost ~]$cd /home/oracle/install_temp/
[oracle@localhost ~]$cd database
[oracle@localhost ~]$ ./runInstaller #开始执行安装,等待一会出现
1.1后续安装与window上基本一致(略)
后续安装与windows上基本一致,,最后完成后出现如下图,切换用户到root下执行下两个配置脚本即可:
执行[root@localhost /]#/oracle/oraInventory/orainRoot.sh
执行[root@localhost /]#/oracle/product/10.2.0/root.sh如下所示,输入/oracle/product/ 10.2.0/bin/
3配置Oracle 1.1.创建数据库oracletest
执行[oracle@localhost ~]$dbca或图形菜单进行,注意下面一致即可(sys/oracletest)
1.2.配置监听,TNS
[oracle@localhost ~]$netca或图形菜单
最终 listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = oracletest)
(ORACLE_HOME = /oracle/product/10.2.0/)
(SID_NAME = oracletest)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
tnsnames.ora
ORACLETEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = oracletest)
)
)
1.3.EM
[oracle@localhost ~]$ emctl start| stop| status dbconsole
:1158/em
1.4.isqlplus[oracle@localhost ~]$ isqlplusctl startstart| stop| status
:5560/isqlplus
1.5.配置自动启动
配置机器启动时自动启动数据库,监听与EM管理平台
停止时自动停止数据库,监听与EM管理平台
修改Oracle系统配置文件/etc/oratab,把AUTO域由默认的N设置为Y,使oracle 自带的dbstart和dbshut才能够发挥作用
[root@localhost /]#vi /etc/oratab
创建启动脚本
1)[oracle@localhost ~] vi $ORACLE_HOME/bin/dbstart 找到第78行ORACLE_HOME_LISTNER=…
改为ORACLE_HOME_LISTNER=$ORACLE_HOME,
[oracle@localhost ~]cd $ORACLE_HOME/bin/
手动运行 [oracle@localhost ~] ./ dbstart
[oracle@localhost ~] ./ dbshut
测试正常与否
(日志:$ORACLE_HOME/startup.log与$ORACLE_HOME/shutdown.log)
2) [root@localhost /]#vi /etc/init.d/oracle10g
#!/bin/sh
# description: Oracle auto start-stop script.
# chkconfig: - 20 80
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/oracle/product/10.2.0/
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
#su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
;;
'restart')
$0 stop
$0 start
;;
esac
3) [root@localhost ~]# chmod 750 /etc/init.d/oracle10g
[root@localhost ~]# ln -s /etc/init.d/oracle10g /etc/rc0.d/K10oracle10g
[root@localhost ~]#ln -s /etc/init.d/oracle10g /etc/rc3.d/S99oracle10g
[root@localhost ~]# chkconfig --list oracle10g
[root@localhost ~]# chkconfig --level 345 oracle10g on
[root@localhost ~]# chkconfig --list oracle10g

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.

ToaddauserremotelytoMySQL,followthesesteps:1)ConnecttoMySQLasroot,2)Createanewuserwithremoteaccess,3)Grantnecessaryprivileges,and4)Flushprivileges.BecautiousofsecurityrisksbylimitingprivilegesandaccesstospecificIPs,ensuringstrongpasswords,andmonitori

TostorestringsefficientlyinMySQL,choosetherightdatatypebasedonyourneeds:1)UseCHARforfixed-lengthstringslikecountrycodes.2)UseVARCHARforvariable-lengthstringslikenames.3)UseTEXTforlong-formtextcontent.4)UseBLOBforbinarydatalikeimages.Considerstorageov

When selecting MySQL's BLOB and TEXT data types, BLOB is suitable for storing binary data, and TEXT is suitable for storing text data. 1) BLOB is suitable for binary data such as pictures and audio, 2) TEXT is suitable for text data such as articles and comments. When choosing, data properties and performance optimization must be considered.

No,youshouldnotusetherootuserinMySQLforyourproduct.Instead,createspecificuserswithlimitedprivilegestoenhancesecurityandperformance:1)Createanewuserwithastrongpassword,2)Grantonlynecessarypermissionstothisuser,3)Regularlyreviewandupdateuserpermissions

MySQLstringdatatypesshouldbechosenbasedondatacharacteristicsandusecases:1)UseCHARforfixed-lengthstringslikecountrycodes.2)UseVARCHARforvariable-lengthstringslikenames.3)UseBINARYorVARBINARYforbinarydatalikecryptographickeys.4)UseBLOBorTEXTforlargeuns


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

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.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Linux new version
SublimeText3 Linux latest version
