安裝Oracle 10g資料庫常出現的問題

2021-08-30 10:13:21 字數 4453 閱讀 7542

安裝環境:

os:red hat linux 4(我用的本版是4)

資料庫:oracle10g

1、首先,必要的硬體資訊檢查(摘抄網上資料):

檢查內容 最小值 檢查命令參考

物理記憶體 512m # grep memtotal /proc/meminfo

交換空間 max # grep swaptotal /proc/meminfo

/tmp 空間 400 mb # df -k /tmp

軟體所需空間 2.5 gb # df -k

資料庫檔案 1.2 gb # df -k

注:個人理解,除了最後兩項為安裝中硬性要求外,其他幾項均可以適當放寬限制,並不影響安裝程序;

2、建使用者組、使用者指令碼

使用root使用者登入

# groupadd oracle

# useradd -g oracle -d /oracle -m oracle

# passwd oracle

注:值得一提的是最後一條命令,通過useradd命令所建立的使用者,沒有指定密碼(即便執行useradd時使用了-p引數),無法進行登入,故需用passwd進行指定密碼,這 是經歷多次失敗嘗試後的經驗;

3.設定oracle環境變數

$ vi $oracle_base/.bash_profile

---在原有內容後面新增如下設定

export dispaly="localhost:0.0" #此句尤為重要,直接影響後續安裝程序,其中localhost可以使用ip或主機名替代

export oracle_base=/oracle

export oracle_home=/oracle

export oracle_sid=orclx #此引數應根據安裝節點進行修改

export ld_library_path=$$oracle_home/lib:$oracle_home/ctx/lib

export classpath=$oracle_home/jre:$oracle_home/jlib:$oracle_home/rdbms/jlib:$oracle_home/network/jlib

export tns_admin=$oracle_home/network/admin

export ora_nls33=$oracle_home/ocommon/nls/admin/data

export path=$path:$oracle_home/bin:/sbin

export nls_lang="american_america.zhs16gbk" #此句設定oracle字符集 ,影響到安裝後字元顯示問題

umask 022

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 = 1024 65000

編輯完之後,儲存,執行 # /sbin/sysctl -p 命令操作來使我們所做的變更生效。

注意:核心引數配置可能需要根據實際環境進行適當的變動.

5.檢查linux 的安裝元件(在安裝oracle期間,需要使用到gcc元件包,故須檢查是否安裝完整)

直接在linux圖形介面中,選擇主選單->系統設定->新增/刪除應用程式,選中"開發"部分的"開發工具",然後預設"更新"即可。

注:安裝這部分程式需用到linux9的第二張光碟(這部分程式是linux9預設安裝未包含的)。

如果沒有安裝這部分,在後面的oracle安裝過程中,將出現一系列的呼叫錯誤。

另外,還需檢查libaio的安裝:在linux9的第二張光碟中有

ls -l libaio*.rpm

rpm - i libaio*.rpm

6.接下來,開始安裝oracle

執行runinstaller,錯誤提示如下:

checking requirements...

checking operating system version: must be redhat-2.1,redhat-3,suse-9,suse-8,unitedlinux-1.0

failed<<<<

這是因為oracle10g所認可的linux發行套件沒有包括linux9,所以需要降低linux核心

流行的解決方法有三種:

方法一:

在/etc下建立unitedlinux-release檔案

#cat > /etc/unitedlinux-release << eof

>unitedlinux 1.0 (i586)

>version=1.0

>eof

然後就可以正常啟動安裝程式。注意不要使用vi編輯該檔案,否則可能會引起ora-12547: tns: lost contact的錯誤。

方法二:

執行runinstaller -ignoresysprereqs,這樣會跳過檢查(呵呵,相信百分之99.9999999的人都會選擇這種方法)

方法三:

修改oracle 的/.../disk1/install/linux/oraparam.ini這個引數檔案

7.如果接下來,安裝遇到如下錯誤:

xlib: connection to "localhost:0.0" refused by server

xlib: no protocol specified

呵呵,你的oracle使用者沒有x window許可權,解決辦法:

使用root使用者登入(必要時重新啟動os),然後輸入:

# xhost +localhost

如果x window設定成功,可以用oracle使用者登入後,輸入: $ xclock

是不是看到乙個小鬧鐘,呵呵,恭喜你又解決乙個問題!

8.當程式進行到,建立資料庫時,建議先不要建立,等安裝完系統後,通過dbca命令來建立,不要問我為什麼,反正這樣子會順利不少。

否則下面這些問題,不幸的話,可能你都會遇到:

資料庫啟動:

$sqlplus /nolog

sql>connect / as sysdba

sql>startup

ora-00371: not enougsh shared pool memory, should be atleast 52132659 bytes.

解決方法:

shared_pool_size = 52132659

資料庫啟動:

$sqlplus /nolog

sql>connect / as sysdba

sql>startup

ora-01102: cannot mount database in exclusive mode

解決方法:

完全關閉資料庫,更改$oracle_home/dbs/init.ora檔案裡的db_name為建庫時定義的「全域性資料庫名」,然後再重新啟動資料庫

資料庫啟動:

$sqlplus /nolog

sql>connect / as sysdba

sql>startup

ora-00205:error in identifying conrolfile, check alert log for more info

解決方法:

sql>show parameter control_files

sql>create controlfile

將$oracle_base/admin/$gid/pfile/init$sid.ora***************拷貝到$oracle_home/dbs下,命名為init$sid.ora,即可解決。

資料庫啟動:

$sqlplus /nolog

sql>connect / as sysdba

sql>startup

ora-01990:error opening password file '$oracle_name/dbs/orapw'

ora-27037:unable to obtain file status

linux error:2: no such file or directory

additional information: 3

解決方法:

將$oracle_home/dbs下的orapw$db_name檔案拷貝生成乙個orapw檔案。

ora-12547: tns: lost contact

引起該錯誤的環境比較複雜,原因可能是:

1、用vi編輯的/etc/unitedlinux-release檔案

2、核心引數設定不正確

3、察看一下listener是否正常啟動: lsnrct1 status

4、機器負載過大

9、系統安裝完畢,在oracle使用者下,開啟終端,執行dbca命令,後有乙個嚮導出現,你可以按照提示建立資料庫,至此安裝大功告成。

Oracle 10g資料庫管理

oracle 10g資料庫管理 課程介紹 本課程面向企業 oracle 10g 資料庫管理的學員。通過 oracle 10g 資料庫管理課程的系統培訓,使學員能夠在較短的時間內掌握 oralcle10g 資料庫管理和維護的各種技術,從而掌握最新版 oracle 的新特性和 oracle 資料通用技術...

oracle 10g 資料庫遷移

它是最常用最簡單的方法,一般是基於應用的owner級做匯出匯入。操作方法為 在新庫建立好owner和表空間,停老庫的應用,在老庫執行 exp user pwd owner file exp dmp log exp log buffer 6000000,匯入dmp檔案到新庫,在新庫執行如下命令 imp...

Oracle 10g資料庫概述

一 oracle 10g簡介 1 oracle 10g資料庫是首個為網咯計算而設計的資料庫 甲骨文公司的一款關聯式資料庫管理系統 2 分為以下幾個版本 a oracle 10g資料庫標準版 1 b oracle 10g資料庫標準版 c oracle 10g資料庫企業版 d oracle 10g資料庫...