Oracle 12c安裝方法及一些使用問題_oracle

來源:互聯網
上載者:User

Linux Centos6.5 64bit下安裝oracle12c:

groupadd oinstallgroupadd dbamkdir -p /u01/oracleuseradd -g oinstall -G dba -d /u01/oracle oracle(這裡不是一定要把home目錄更改到/u01/oracle,預設也可。)把下面三個檔案複製到 /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添加使用者時,會自動從這個目錄下的檔案複製到使用者的家目錄password oraclechown -R oracle:oinstall /u01chmod -R 775 /u01/

/*安裝vnc*/

yum -y install tigervnc-servervncserver 斷行符號輸入密碼ps -ef | grep vncvnc用戶端串連:ip:1

檢測是否有安裝以下程式:

binutils-2.17.50.0.6compat-libstdc++-33-3.2.3 -elfutils-libelf-0.125elfutils-libelf-devel-0.125 -elfutils-libelf-devel-static-0.125 -gcc-4.1.2 -gcc-c++-4.1.2 -glibc-2.5-24glibc-common-2.5glibc-devel-2.5glibc-headers-2.5kernel-headers-2.6.18ksh-20060214 -libaio-0.3.106libaio-devel-0.3.106 -libgcc-4.1.2libgomp-4.1.2libstdc++-4.1.2libstdc++-devel-4.1.2 -make-3.81sysstat-7.0.2 unixODBC-2.2.11 -unixODBC-devel-2.2.11 -

修改 /etc/sysctl.conf 檔案,加上如下參數

fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586

為使上述配置生效而不重啟系統,執行如下命令
# /sbin/sysctl -p

修改使用者限制

root使用者:修改 /etc/security/limits.conf 檔案,加上下面的參數

oracle   soft nproc 2047oracle   hard nproc 16384oracle   soft nofile 1024oracle   hard nofile 65536

修改使用者驗證選項
root使用者下:修改/etc/pam.d/login檔案加上如下參數

session required  pam_limits.so

修改使用者設定檔
root使用者下:修改/etc/profile檔案加入如下參數:

if [ $USER = "oracle" ]; then  if [ $SHELL = "/bin/ksh" ]; then    ulimit -p 16384    ulimit -n 65536  else    ulimit -u 16384 -n 65536  fifi

修改oracle使用者bash_profile:
$ vi .bash_profile
增加如下內容,主要是修改

export ORACLE_BASE=/u01 export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1export ORACLE_SID=hxw168 export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

安裝oracle:

安裝oracle無法使用命令/usr/bin/xdpyinfo自動檢查顯示器顏色:

[root@oracle /]# xdpyinfo | grep "name of display"name of display: :1.0[root@oracle /]# 在Oracle使用者下執行命令:export DISPLAY=:1.0 (上面name of display:後面的 :1.0)

prvf-0002:無法檢索本地節點名

host檔案 ip與名稱對應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.jb51.net/article/92720.htm

調整虛擬機器的記憶體到600多M(原來1G多),啟動oracle時提示:
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系統的shm的大小比SGA設定的小造成的。
可以調整shm的大小:
vi /etc/fstab
修改如下行的設定
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簡單的啟動指令碼:

[root@oracle ~]# cat /etc/init.d/oracle su - oracle <<EOFlsnrctl startsqlplus / as sysdbastartupEOF

本文出自 “儘管錯,讓我錯到死!” 部落格

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.