Oracle安裝之簡單篇
為張家口等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及張家口網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為網(wǎng)站建設(shè)、成都做網(wǎng)站、張家口網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!安裝準(zhǔn)備包
linuxredhat5.8操作系統(tǒng)
oracle11g(以下是包名)
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
安裝準(zhǔn)備
配置IP,hosts,主機(jī)名。
備注hosts文件一定要與主機(jī)名對應(yīng)。(如下)
127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.66.249 dbserver.cjl.com配置oracle環(huán)境腳本
#!/bin/bash #查看內(nèi)存大小 echo "Mem Check:swap >2G,MEM >2G" grep -i memtotal /proc/meminfo grep -i swaptotal /proc/meminfo #配置yum本地源 cat <解壓Oracle11g的包到oracle用戶的home目錄
unzip -d /home/oracle linux.x64_11gR2_database_1of2.zip && unzip -d /home/oraclelinux.x64_11gR2_database_2of2.zip允許用戶oracle從本機(jī)訪問
[root@dbserver ~]# xhost + access control disabled, clients can connect from any host切換用戶并進(jìn)入解壓目錄運(yùn)行安裝
[root@dbserver ~]# su - oracle [oracle@dbserver ~]$ ls database [oracle@dbserver ~]$ cd database/ [oracle@dbserver database]$ ./runInstaller運(yùn)行root用戶執(zhí)行提示腳本
[root@dbserver ~]# /opt/oracle/oraInventory/orainstRoot.sh 更改權(quán)限/opt/oracle/oraInventory. 添加組的讀取和寫入權(quán)限。 刪除全局的讀取, 寫入和執(zhí)行權(quán)限。 更改組名/opt/oracle/oraInventory 到 oinstall. 腳本的執(zhí)行已完成。 [root@dbserver ~]# /opt/oracle/product/11.2/db_1/root.sh Running Oracle 11g root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /opt/oracle/product/11.2/db_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... Creating /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. Finished product-specific root actions. [root@dbserver ~]#訪問以上地址測試https://dbserver.cjl.com:1158/em/
oracle用戶訪問測試
[oracle@dbserver database]$ sqlplus sys as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Fri Sep 18 05:28:47 2015 Copyright (c) 1982, 2009, Oracle. All rights reserved. Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> show user; USER is "SYS" SQL>圖形界面添加數(shù)據(jù)庫
如果重新啟動還需web訪問可用以下命令重新獲取網(wǎng)址
[oracle@dbserver ~]$ emctl start dbconsole Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0 Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved. https://dbserver.cjl.com:1158/em/console/aboutApplication Starting Oracle Enterprise Manager 11g Database Control ........ started. ------------------------------------------------------------------ Logs are generated in directory /opt/oracle/product/11.2/db_1/dbserver.cjl.com_orcl/sysman/log如果發(fā)現(xiàn)不能使用dbca命令時(shí)試試它
[oracle@dbserver ~]$ /opt/oracle/product/11.2/db_1/bin/dbca Xlib: connection to ":0.0" refused by server Xlib: No protocol specified [root@dbserver ~]# xhost + access control disabled, clients can connect from any host啟動數(shù)據(jù)庫先啟動監(jiān)聽
[oracle@dbserver ~]$ lsnrctl LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 18-SEP-2015 05:07:44 Copyright (c) 1991, 2009, Oracle. All rights reserved. Welcome to LSNRCTL, type "help" for information. LSNRCTL> start Starting /opt/oracle/product/11.2/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.2.0.1.0 - Production System parameter file is /opt/oracle/product/11.2/db_1/network/admin/listener.ora Log messages written to /opt/oracle/diag/tnslsnr/dbserver/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver.cjl.com)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 18-SEP-2015 05:07:50 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/oracle/product/11.2/db_1/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/dbserver/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver.cjl.com)(PORT=1521))) The listener supports no services The command completed successfully LSNRCTL> quit [oracle@dbserver ~]$ sqlplus sys as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Fri Sep 18 05:08:12 2015 Copyright (c) 1982, 2009, Oracle. All rights reserved. Enter password: Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 839282688 bytes Fixed Size 2217992 bytes Variable Size 541067256 bytes Database Buffers 289406976 bytes Redo Buffers 6590464 bytes Database mounted. Database opened. SQL> show user; USER is "SYS" SQL> alter database open; alter database open * ERROR at line 1: ORA-01531: a database already open by the instance SQL> quit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options關(guān)閉數(shù)據(jù)庫
shutdown immediate
shutdown abort (上一條關(guān)閉不能執(zhí)行,則執(zhí)行這條強(qiáng)制關(guān)機(jī))
關(guān)閉監(jiān)聽
lsnrctl stop
本文如出現(xiàn)錯(cuò)誤請留言!
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。