openSuSE11.1安裝oracle10g步驟
1.增加oinstall用戶(hù)組和dba用戶(hù)組,增加oracle用戶(hù),并加入到這兩個(gè)用戶(hù)組中,默認(rèn)組是dba用戶(hù)組;
2.修改oracle用戶(hù)的環(huán)境變量(一定以oracle用戶(hù)登錄系統(tǒng)操作此步驟,su oracle),命令:
vi ~/.bashrc ("."代表隱藏文件,h—right,j—down ,k—up,l—left,o—insert,:w—save,:q—exit,i—在當(dāng)前行插入,x—?jiǎng)h除,u—撤銷(xiāo),esc—回普通模式,dd--刪除)(此處若配置不成功則裝完以后可能會(huì)出現(xiàn)在程序里連接不上等一系列問(wèn)題)
增加內(nèi)容:
export ORACLE_BASE=/home/oracle/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_6
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
完成之后,多按幾次Esc鍵,Shift+":","w",保存成功,多按幾次Esc鍵,Shift+":","q",退出成功.
(VI基本命令:http://blog.tianya.cn/blogger/post_show.asp?BlogID=126326&PostID=1537776&idWriter=0&Key=0)
3.增加核心參數(shù):
vi /etc/sysctl.conf(需要root用戶(hù)執(zhí)行,su root)
增加內(nèi)容:
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
執(zhí)行命令以確認(rèn):
sysctl -p
chkconfig boot.sysctl on(作用:解決在系統(tǒng)重新啟動(dòng)之后不能自動(dòng)讀取剛才創(chuàng)建的文件的問(wèn)題)
4.修改oracle安裝目錄的install目錄下的oraparame.ini,找到[Certified Versions],加上SuSE-11;
5.運(yùn)行安裝oracle10g安裝目錄下的./runInstaller,出現(xiàn)圖形界面(以oracle用戶(hù));
6.安裝過(guò)程中可能會(huì)出現(xiàn)版本不符合或軟件包缺少的情況,此時(shí)不要cancel或 ignore,可以使用 zypper install ...命令安裝需要的軟件包,然后 retry;
"缺少Ntcontab.o":以root用戶(hù)執(zhí)行:zypper install gcc-c++(記得插入光盤(pán))
"缺少all_no_orcl ihsodbc":以root用戶(hù)執(zhí)行:zypper install libstdc++33(記得插入光盤(pán))
安裝結(jié)束時(shí)會(huì)讓執(zhí)行兩行腳本,執(zhí)行時(shí)如遇見(jiàn):Enter the full pathname of the local bin directory: [/usr/local/bin]:,直接回車(chē)通過(guò);
7.(1)以oracle用戶(hù)登錄,su oracle;
(2)啟動(dòng)TNS監(jiān)聽(tīng)器
$ORACLE_HOME/bin/lsnrctl start (要帶$)
(3)用sqlplus啟動(dòng)數(shù)據(jù)庫(kù)
$ORACLE_HOME/bin/sqlplus /nolog
SQL> connect system/change_on_install as sysdba
SQL> startup
出現(xiàn)如下顯示,表示Oracle已經(jīng)成功啟動(dòng);
ORACLE instance started
Total System Global Area 205520896 bytes
Fixed Size 778392 bytes
Variable Size 74456936 bytes
Database Buffers 130023424 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
(4)用sqlplus停止數(shù)據(jù)庫(kù)
$ORACLE_HOME/bin/sqlplus /nolog
SQL> connect system/change_on_install as sysdba
SQL> shutdown
出現(xiàn)如下顯示,表示oracle已經(jīng)停止
Database closed.
Database dismounted.
ORACLE instance shut down.
注:shutdown可加關(guān)閉選項(xiàng),從最溫和到最粗暴的行為選項(xiàng)為(shutdown、shutdown transactional、shutdown immediate、shutdown abort)
shutdown:關(guān)閉,等待每個(gè)用戶(hù)退出系統(tǒng)戓被取消后退出關(guān)閉數(shù)據(jù)庫(kù);
shutdown transactional:事務(wù)性關(guān)閉,等待每個(gè)用戶(hù)提交戓回退當(dāng)前的事務(wù),然后oracle取消對(duì)話,在所有用戶(hù)退出系統(tǒng)后執(zhí)行關(guān)閉;
shutdown immediate:直接關(guān)閉,取消所有用戶(hù)對(duì)話(促使回退),執(zhí)行正常的關(guān)閉程序;
shutdown abort:終止關(guān)閉,關(guān)閉數(shù)據(jù)庫(kù)時(shí)沒(méi)有自動(dòng)檢查點(diǎn)戓日志開(kāi)關(guān)。
8.關(guān)閉linux防火墻:
(1)臨時(shí)關(guān)閉:sudo /sbin/rcSuSEfirewall2 stop
(2)永久關(guān)閉:
chkconfig --list|grep fire
chkconfig --level 5 SuSEfirewall2_final off
chkconfig --level 5 SuSEfirewall2_setup off
chkconfig --level 5 SuSEfirewall2_init off
9.開(kāi)啟isqlplus:
$ORACLE_HOME/bin/isqlplusctl start
$ORACLE_HOME/bin/isqlplusctl stop
iSQL*Plus URL:
http://localhost:5560/isqlplus
iSQL*Plus DBA URL:
http://localhost:5560/isqlplus/dba
10.開(kāi)啟dbconsole:
$ORACLE_HOME/bin/emctl start dbconsole
$ORACLE_HOME/bin/emctl stop dbconsole
Enterprise Manager 10g Database Control URL:
http://localhost:1158/em
11.導(dǎo)入數(shù)據(jù):
oracle@localhost:~/Desktop> imp
Import file: expdat.dmp > feq.dmp //輸入要導(dǎo)入的數(shù)據(jù)文件
Enter insert buffer size (minimum is 8192) 30720> 10000 //輸入緩沖區(qū)大小,可以默認(rèn)也可以自定義,如果數(shù)據(jù)文件較大,建議設(shè)置的大一些
List contents of import file only (yes/no): no > no //只列出導(dǎo)入文件的內(nèi)容
Ignore create error due to object existence (yes/no): no > yes //由于對(duì)象已存在, 忽略創(chuàng)建錯(cuò)誤
Import grants (yes/no): yes > yes //導(dǎo)入權(quán)限
Import table data (yes/no): yes > yes //導(dǎo)入表數(shù)據(jù),如果選NO,則導(dǎo)入表結(jié)構(gòu)
Import entire export file (yes/no): no > yes //導(dǎo)入整個(gè)導(dǎo)出文件
12.附加sql語(yǔ)句:
connect as sysdba
connect
create user aaa identified by bbb; (創(chuàng)建一個(gè)用戶(hù)名為aaa,密碼為bbb的用戶(hù))
grant dba to aaa; (將dba的權(quán)限分配給用戶(hù)aaa)
參考文檔:
http://www.oracle.com/technology/global/cn/pub/articles/smiley_10gdb_install.html
http://hi.baidu.com/zxpvikey/blog/item/dad391b72ed1daf631add1ac.html