oracle 11g安裝在centos5.9×64下過程
1.
先檢查是否安裝開發工具、JAVA、ksh等,及其它如下
yum search檢查,若沒有安裝,則用
yum groupinstall 開發工具 開發庫 Java開發
yum install pdksh
yum install sysstat
yum install libaio-devel
yum install numactl-devel
yum install unixODBC unixODBC-devel
#ulimit -S -c unlimited
2.
vi /etc/sysctl.conf
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6553560
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
#kernel.shmall = 2097152
#kernel.shmmax = 536870912
3.
vi /etc/pam.d/login
session required pam_limits.so
vi /etc/security/limits.conf
(在該檔案的最後新增下面四行)
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
4.
groupadd oinstall
groupadd dba
useradd oracle -g oinstall -G dba
passwd oracle
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/11g/db_1
ls -l
chown -R oracle:oinstall /u01
ls -l
chmod 755 -R /u01
5.
su – oracle
vi .bash_profile
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11g/db_1
export ORACLE_SID=jxwpxdb
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
6.
移動ORACLE安裝檔案到 /u01/app
mv database /u01/app
chown -R oracle.oinstall database
至此配置完畢,設定靜態IP地址,然後重啟。
7.
執行安裝程式
/u01/app/database/runInstaller
8.
提示進行,會建立庫。等待完成(然後建立網路偵聽和庫例項 netca dbca)
9.完成後用oracle使用者登入,執行
sqlplus sys as sysdba
show user;
select * fromt tabs;
———oracle 11g安裝在centos5.9×64下過程-過程說明——————————–
安裝開發工具、JAVA等,及其它
yum install libaio-devel
yum install numactl-devel
yum install sysstat unixODBC unixODBC-devel
ulimit -S -c unlimited
vi /etc/sysctl.conf
fs.suid_dumpable = 1 #允許coredump
fs.aio-max-nr = 1048576 #同時可以擁有的非同步IO請求數目
fs.file-max = 6553560 #系統所有程式一共可以開啟的檔案數量
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 #最大的TCP資料接收緩衝
net.core.wmem_default = 262144 #預設的傳送視窗大小
net.core.wmem_max = 1048586 #最大的TCP資料傳送緩衝
#kernel.shmall = 2097152 #(可以以預設為準,設定為記憶體的90%,值為shmmax/4k)全部允許使用的共享記憶體大小
#kernel.shmmax = 536870912 (可以以預設為準,設定為記憶體的90%)單個段允許使用的共享記憶體大小
vi /etc/security/limits.conf
(在該檔案的最後新增下面四行)
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@localhost ~]#groupadd oinstall
[root@localhost ~]#groupadd dba
[root@localhost ~]#useradd oracle -g oinstall -G dba
[root@localhost ~]#passwd oracle
[root@localhost ~]# mkdir -p /u01/app/oracle
[root@localhost ~]# mkdir -p /u01/app/oracle/product/11g/db_1
[root@localhost ~]#ls -l
[root@localhost ~]# chown -R oracle:oinstall /u01
[root@localhost ~]#ls -l
[root@localhost ~]# chmod 755 -R /u01
su – oracle
vi .bash_profile
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11g/db_1
export ORACLE_SID=linux-oracle
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
移動ORACLE安裝檔案到 /u01/app
mv database /u01/app
chown -R oracle.oinstall database
執行安裝程式
/u01/app/database/runInstaller
提示進行,然後建立網路偵聽和庫例項
netca
dbca
----------------------------------
LEMP整合環境安裝
wget http://nginx.org/download/nginx-1.5.3.tar.gz
tar zxvf nginx-1.5.3.tar.gz
cd nginx-1.5.3
useradd nginx
./configure –prefix=/usr/local/nginx –user=nginx –group=nginx –with-http_stub_status_module
make
make install
cd /usr/local/nginx/
chown nginx.nginx logs
vi /usr/local/nginx/conf/nginx.conf
tar zxvf mysql-5.1.70.tar.gz
cd mysql-5.1.70
./configure –prefix=/usr/local/mysql –with-charset=utf8 –with-collation=utf8_general_ci –with-extra-charsets=gbk,gb2312
make;make install
cp support-files/my-medium.cnf.sh /etc/my.cnf
cp support-files/mysql.server.sh /etc/init.d/mysql51d
/etc/init.d/mysql51d start
cat /etc/my.cnf
[client]
port = 3306
socket = /usr/local/mysql/var/mysql51.sock
[mysqld]
datadir = /data/mysql51
port = 3306
socket = /usr/local/mysql/var/mysql51.sock
skip-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[mysqld_safe]
log-error=/usr/local/mysql/var/mysqlerr.log
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
tar zxvf php-5.3.27.tar.gz
cd php-5.3.27
./configure –prefix=/usr/local/php53 –with-gd –with-zlib –with-mysql=/usr/local/mysql –with-config-file-path=/usr/local/php53 –enable-mbstring –enable-fpm
make
make install
cp php.ini-production /usr/local/php53/php.ini
tar zxvf ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz
cd ZendGuardLoader-php-5.3-linux-glibc23-x86_64/php-5.3.x/
cp ZendGuardLoader.so /usr/local/php53/lib/php/
vi /usr/local/php53/ php.ini
;report_zend_debug = 0
zend_extension=/usr/local/php53/lib/php/ZendGuardLoader.so
zend_loader.enable=1
cd /usr/local/php53/etc
cp php-fpm.conf.default php-fpm.conf
vi /usr/local/php53/etc/php-fpm.conf
[global]
pid = run/php-fpm.pid
error_log = log/php-fpm.log
[www]
user = nginx
group = nginx
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 35
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
vi /usr/local/nginx/conf/nginx.conf
location ~ .php$ {
root phphtml;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi.conf;
}
cat /etc/init.d/nginxfpm
#!/bin/bash
# chkconfig: – 65 55
# description: nginx
# processname: nginx
case $1 in
start)
/usr/local/php53/sbin/php-fpm -c /usr/local/php53/php.ini
/usr/local/nginx/sbin/nginx
;;
stop)
kill -s QUIT $(cat /usr/local/php53/var/run/php-fpm.pid)
kill -s QUIT $(cat /usr/local/nginx/logs/nginx.pid)
;;
*)
echo “You input wrong.”
esac
[root@jxwpx phphtml]# cat index.php
<?php
$link=mysql_connect(`localhost`,`dbuser`,`123123`);
if($link) echo “<h1>Success to mysql.</h1>”;
else
echo “<h1> No to db</h1>”;
mysql_close();
?>
[root@jxwpx phphtml]# cat i.php
<?php
phpinfo();
?>
注:若網頁連線不正常。
排錯
Warning: mysql_connect() [function.mysql-connect]: Can`t connect to local MySQL server through socket `/tmp/mysql.sock` (2) in /usr/local/nginx/phphtml/index.php on line 2
Warning: mysql_close(): no MySQL-Link resource supplied in /usr/local/nginx/phphtml/index.php on line 6
一般是由於沒有/tmp/mysql.sock檔案造成的,可連結此檔案到此位置解決。
附加:
模組curl 安裝擴充套件
在PHP的安裝目錄中進行
cd php-5.3.27/ext/curl/
phpize
./configure –with-curl=/usr/local/curl2 –with-php-config=/usr/local/php53/bin/php-config
make
cp modules/curl.so /usr/local/php53/lib/php/
vi /usr/local/php53/php.ini
extension=”/usr/local/php53/lib/php/curl.so”