Oracle在linux上的安裝參數配置

來源:互聯網
上載者:User

 首先要為Oracle的正常安裝設定使用者組;

[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba

使用者帳戶將稱為 oracle,而組將稱為 oinstall 和 dba

[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# passwd oracle

這是系統回給你彈出需要你進行基於UNIX的密碼管理的密碼校正。
你需要輸入輸入兩次密碼:

    Changing password for user Oracle.
    New UNIX password:
    BAD PASSWORD: it does not contain enough DIFFERENT characters
    Retype new UNIX password:
    passwd: all authentication tokens updated successfully.

修改Linux系統的核心參數檔案:
Linux 允許在系統啟動和運行時修改大多數核心參數。
Oracle 資料庫 10g 需要以下所示的核心參數設定。其中給出的是最小值,因此如果您的系統使用的值較大,則不要更改它。

vi /etc/sysctl.conf

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 9000 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
---------------------------------------------
kernel.shmall為實體記憶體除以pagesize;
kernel.shmmax為實體記憶體的一半;
fs.file-max為512 乘以 processes (如128個process則為 65536);
net.ipv4.ip_local_port_range/net.core.rmem_default/net.core.rmem_max三個參數設定和官方文檔不一樣, 這是根據metalink 343431.1 最新要求更改的;
net.ipv4.tcp_rmem/net.ipv4.tcp_wmem兩個參數一般情況下無需設定, 除非是在Dataguard/Streams等需很多網路傳輸情況下;
--------------------------------------------
使用命令: sysctl  -p 來查看左右參數的設定

[root@localhost ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144

Oracle 建議對每個 Linux 帳戶可以使用的進程數和開啟的檔案數設定限制。
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so

vi /etc/profile
if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ];then
    ulimit -p 16384
    ulimit -n 65536
    else
    ulimit -u 16384 -n 65536
    fi
    umask 022
fi

建立Oracle安裝的目錄包括資料檔案的安裝
mkdir -p /u1/app/oracle/product/1002/db
mkdir -p /u2/oradata

安裝目錄檔案的授權:
這樣使得非root許可權的使用者也具有讀的許可權。
chown -R oracle:oinstall /u1/app/oracle /u1/app/oracle/product/1002/db /u2/oradata
chmod -R 777 /u1/app/oracle /u1/app/oracle/product/1002/db /u2/oradata

如果您在同一伺服器上安裝了多個 Oracle 產品或資料庫,則 ORACLE_HOME、ORACLE_SID 和 PATH 變數可能會更改。ORACLE_BASE 變數不應更改,並可以在需要時在您的登入設定檔中設定它。Oracle 提供了一個稱作 oraenv 的公用程式來設定其他變數。
以 oracle 身份登入(或者一root的身份登陸到Oracle的使用者目錄),並通過在 .bash_profile 或 .profile(bash 或 ksh)中添加以下行,將 ORACLE_BASE 添加到登入設定檔:

cd /home/oracle
vi .bash_profile
export ORACLE_BASE=/u1/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/1002/db
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=oracl

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.