Oracle 12c安裝方法及一些使用問題
Linux Centos6.5 64bit下安裝oracle12c:
groupadd oinstall groupadd dba mkdir -p /u01/oracle useradd -g oinstall -G dba -d /u01/oracle oracle (這里不是一定要把home目錄更改到/u01/oracle,默認(rèn)也可。) 把下面三個(gè)文件復(fù)制到 /u01/oracle目錄下 [root@oracle /]# cd /etc/skel/ [root@oracle skel]# ll -a -rw-r--r--. 1 root root 18 7月 18 2013 .bash_logout -rw-r--r--. 1 root root 176 7月 18 2013 .bash_profile -rw-r--r--. 1 root root 124 7月 18 2013 .bashrc 注:useradd添加用戶時(shí),會(huì)自動(dòng)從這個(gè)目錄下的文件復(fù)制到用戶的家目錄 password oracle chown -R oracle:oinstall /u01 chmod -R 775 /u01/
/*安裝vnc*/
yum -y install tigervnc-server vncserver 回車 輸入密碼 ps -ef | grep vnc vnc客戶端連接:ip:1
檢測(cè)是否有安裝以下程序:
binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 - elfutils-libelf-0.125 elfutils-libelf-devel-0.125 - elfutils-libelf-devel-static-0.125 - gcc-4.1.2 - gcc-c++-4.1.2 - glibc-2.5-24 glibc-common-2.5 glibc-devel-2.5 glibc-headers-2.5 kernel-headers-2.6.18 ksh-20060214 - libaio-0.3.106 libaio-devel-0.3.106 - libgcc-4.1.2 libgomp-4.1.2 libstdc++-4.1.2 libstdc++-devel-4.1.2 - make-3.81 sysstat-7.0.2 unixODBC-2.2.11 - unixODBC-devel-2.2.11 -
修改 /etc/sysctl.conf 文件,加上如下參數(shù)
fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 536870912 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
為使上述配置生效而不重啟系統(tǒng),執(zhí)行如下命令
# /sbin/sysctl -p
修改用戶限制
root用戶:修改 /etc/security/limits.conf 文件,加上下面的參數(shù)
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
修改用戶驗(yàn)證選項(xiàng)
root用戶下:修改/etc/pam.d/login文件加上如下參數(shù)
session required pam_limits.so
修改用戶配置文件
root用戶下:修改/etc/profile文件加入如下參數(shù):
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
修改oracle用戶bash_profile:
$ vi .bash_profile
增加如下內(nèi)容,主要是修改
export ORACLE_BASE=/u01 export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1 export ORACLE_SID=hxw168 export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
安裝oracle:
安裝oracle無法使用命令/usr/bin/xdpyinfo自動(dòng)檢查顯示器顏色:
[root@oracle /]# xdpyinfo | grep "name of display" name of display: :1.0 [root@oracle /]# 在Oracle用戶下執(zhí)行命令: export DISPLAY=:1.0 (上面name of display:后面的 :1.0)
prvf-0002:無法檢索本地節(jié)點(diǎn)名
host文件 ip與名稱對(duì)應(yīng) 192.168.198.188 oracle
SQL> create user admin identified by zerostudy;
create user admin identified by zerostudy
*
ERROR at line 1:
ORA-65096: invalid common user or role name
SQL> !oerr ora 65096
65096, 00000, "invalid common user or role name"
// *Cause: An attempt was made to create a common user or role with a name
// that wass not valid for common users or roles. In addition to
// the usual rules for user and role names, common user and role
// names must start with C## or c## and consist only of ASCII
// characters.
// *Action: Specify a valid common user or role name.
//
解決方法:http://www.dhdzp.com/article/92720.htm
調(diào)整虛擬機(jī)的內(nèi)存到600多M(原來1G多),啟動(dòng)oracle時(shí)提示:
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
SQL> !oerr ora 00854
00854, 00000, "ASM IOServer Instance Fence monitor process terminated."
// *Cause: The ASM IOServer Fence monitor process died.
// *Action: Warm start the instance.
原因就是Linux系統(tǒng)的shm的大小比SGA設(shè)置的小造成的。
可以調(diào)整shm的大小:
vi /etc/fstab
修改如下行的設(shè)置
tmpfs /dev/shm tmpfs defaults 0 0
改成
tmpfs /dev/shm tmpfs defaults,size=6G 0 0
重新mount下shm使其生效
mount -o remount /dev/shm
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
需要更改listener.ora文件(跟徑在$ORACLE_HOME/network/admin),然后重啟lsnrctl
# Generated by Oracle configuration tools. #LISTENER = # (DESCRIPTION_LIST = # (DESCRIPTION = # (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) # (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.198.188)(PORT = 1521)) # ) # ) hxw168 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.198.188)(PORT = 1521)) ) ) SID_LIST_hxw168= (SID_LIST = (SID_DESC= (ORACLE_HOME = /u01/app/product/12.1.0/db_1) (SID_NAME = hxw168) ) )
oracle簡(jiǎn)單的啟動(dòng)腳本:
[root@oracle ~]# cat /etc/init.d/oracle su - oracle <<EOF lsnrctl start sqlplus / as sysdba startup EOF
本文出自 “盡管錯(cuò),讓我錯(cuò)到死!” 博客
相關(guān)文章
有關(guān)Oracle數(shù)據(jù)庫的備份情況
有關(guān)Oracle數(shù)據(jù)庫的備份情況...2007-03-03
ORACLE時(shí)間函數(shù)(SYSDATE)深入理解
有些朋友對(duì)ORACLE時(shí)間函數(shù)理解不是很透徹,接下來講詳細(xì)介紹,希望可以幫助到你們2012-12-12
ORACLE 11g安裝中出現(xiàn)xhost: unable to open display問題解決步驟
這篇文章主要給大家介紹了關(guān)于在ORACLE 11g安裝中出現(xiàn)xhost: unable to open display問題的解決方法,文中介紹的非常詳細(xì),對(duì)大家具有一定的參考價(jià)值,需要的朋友們下面來一起看看吧。2017-03-03
oracle 查詢當(dāng)天數(shù)據(jù)的sql條件寫法
這篇文章主要介紹了oracle 查詢當(dāng)天數(shù)據(jù)的sql條件寫法,需要的朋友可以參考下2017-04-04
Windows系統(tǒng)下Oracle數(shù)據(jù)庫每天自動(dòng)備份
linux和unix下面使用shell可以很方便實(shí)現(xiàn),如果windows環(huán)境下可以結(jié)合計(jì)劃任務(wù)實(shí)現(xiàn)自動(dòng)備份,下面通過本文給大家介紹實(shí)現(xiàn)方法,需要的朋友參考下吧2016-12-12
Linux服務(wù)器下oracle實(shí)現(xiàn)rman自動(dòng)備份的方式
為確保oracle數(shù)據(jù)庫數(shù)據(jù)的安全和一致性,一般我們都需要利用備份手段進(jìn)行數(shù)據(jù)庫的備份,在oracle數(shù)據(jù)庫中,rman因其強(qiáng)大的功能和完善的手段,成為數(shù)據(jù)庫備份的首選,故以下通過兩種方式配置腳本,實(shí)現(xiàn)rman自動(dòng)備份,需要的朋友可以參考下2024-11-11
Oracle數(shù)據(jù)庫中RETURNING子句的使用
RETURNING子句允許您檢索插入、刪除或更新所修改的列的值,本文主要介紹了Oracle數(shù)據(jù)庫中RETURNING子句的使用,感興趣的可以了解一下2024-08-08
Oracle sqlldr導(dǎo)入一個(gè)日期列實(shí)例詳解
這篇文章主要介紹了Oracle sqlldr導(dǎo)入一個(gè)日期列實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下2017-06-06
PLSQL配置遠(yuǎn)程Oracle數(shù)據(jù)庫連接的示例代碼
這篇文章主要介紹了PLSQL配置遠(yuǎn)程Oracle數(shù)據(jù)庫連接的示例代碼,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09

