oracle 單實例DG(搭建篇一)

一,介紹

  lodding...java

二,安裝前環境配置

   01,依賴包的安裝:c++

yum install binutils-* yum install compat-libstdc++-* yum install elfutils-libelf-* yum install elfutils-libelf-devel-* yum install elfutils-libelf-devel-static-* yum install gcc-* yum install gcc-c++-* yum install glibc-* yum install glibc-common-* yum install glibc-devel-* yum install glibc-headers-* yum install kernel-headers-* yum install ksh-* yum install libaio-* yum install libaio-devel-* yum install libgcc-* yum install libgomp-* yum install libstdc++-* yum install libstdc++-devel-* yum install make-* yum install sysstat-* yum install unixODBC-* yum install unixODBC-devel-*

    依賴包檢查:web

 1 rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \
 2 compat-libstdc++ \
 3 elfutils-libelf-devel \
 4 elfutils-libelf-devel-static \
 5 gcc \
 6 gcc-c++ \
 7 glibc \
 8 glibc-common \
 9 glibc-devel \
10 glibc-headers \
11 kernel-headers \
12 ksh \
13 libaio \
14 libaio-devel \
15 libgcc \
16 libgomp \
17 libstdc++ \
18 libstdc++-devel \
19 make \
20 sysstat \
21 unixODBC \
22 unixODBC-devel \
23 libXp
View Code

    02,建立對應的用戶,及管理用戶數據庫

1 /usr/sbin/groupadd oinstall 2 /usr/sbin/groupadd dba 3 /usr/sbin/useradd -g oinstall -G dba oracle 4 
5 echo oracle | passwd --stdin oracle
View Code

    03, 修改內核參數 vim

 1 vim /etc/sysctl.conf  2 
 3 fs.aio-max-nr = 1048576
 4 fs.file-max = 6815744
 5 kernel.shmall = 2097152
 6 kernel.shmmax = 536870912
 7 kernel.shmmni = 4096
 8 kernel.sem = 250 32000 100 128
 9 net.ipv4.ip_local_port_range = 9000 65500
10 net.core.rmem_default = 262144
11 net.core.rmem_max = 4194304
12 net.core.wmem_default = 262144
13 net.core.wmem_max = 1048586
14 
15 sysctl -p
View Code

     04,修改系統限制bash

1 vim /etc/security/limits.conf 2 oracle           soft    nproc   2047
3 oracle           hard    nproc   16384
4 oracle           soft    nofile  1024
5 oracle           hard    nofile  65536
View Code

    05,修改認證 網絡

/etc/pam.d/login
1 session    required     pam_limits.so
View Code

    06,修改profilesession

1 if [ $USER = "oracle" ]; then 2         if [ $SHELL = "/bin/ksh" ]; then 3               ulimit -p 16384
4               ulimit -n 65536
5         else
6               ulimit -u 16384 -n 65536
7  fi 8 fi
View Code

    07,建立須要的目錄oracle

 1 #建立必須目錄:  2 #ORACLE_BASE:存放各種日誌
 3 mkdir -p /u01/app/oracle  4 #ORACLE_HOME:存放程序的目錄
 5 mkdir -p /u01/app/oracle/product/11.2.0/db_1  6 
 7 #更改權限:
 8 chown -R oracle:oinstall /u01/
 9 chmod -R 775 /u01/
10 chown -R oracle:oinstall /oradata
View Code

     08, 更改環境變量app

1 su - oracle 2 vim .bash_profile 3 export ORACLE_BASE=/u01/app/oracle 4 export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 5 export ORACLE_SID=orcl 6 export PATH=$ORACLE_HOME/bin:$PATH
7 
8 source .bash_profile
View Code

三,安裝運行

    ./runInstaller

    進入環境配置頁面

報錯提示:  

 1 [oracle@oracle01 grid]$ ./runInstaller  2 Starting Oracle Universal Installer...
 3 
 4 Checking Temp space: must be greater than 120 MB.   Actual 39866 MB Passed  5 Checking swap space: must be greater than 150 MB.   Actual 2047 MB Passed  6 Checking monitor: must be configured to display at least 256 colors  7     >>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.    Failed <<<<
 8 
 9 Some requirement checks failed. You must fulfill these requirements before 10 
11 continuing with the installation,
12 
13 Continue? (y/n) [n] y 14 
15 
16 >>> Ignoring required pre-requisite failures. Continuing...
17 Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-02-19_02-07-59AM. Please wait ...[oracle@oracle01 grid]$ No protocol specified 18 Exception in thread "main" java.lang.NoClassDefFoundError 19         at java.lang.Class.forName0(Native Method) 20         at java.lang.Class.forName(Class.java:164) 21         at java.awt.Toolkit$2.run(Toolkit.java:821) 22         at java.security.AccessController.doPrivileged(Native Method) 23         at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804) 24         at com.jgoodies.looks.LookUtils.isLowResolution(LookUtils.java:484) 25         at com.jgoodies.looks.LookUtils.<clinit>(LookUtils.java:249) 26         at com.jgoodies.looks.plastic.PlasticLookAndFeel.<clinit>(PlasticLookAndFeel.java:135) 27         at java.lang.Class.forName0(Native Method) 28         at java.lang.Class.forName(Class.java:242) 29         at javax.swing.SwingUtilities.loadSystemClass(SwingUtilities.java:1779) 30         at javax.swing.UIManager.setLookAndFeel(UIManager.java:453) 31         at oracle.install.commons.util.Application.startup(Application.java:785) 32         at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:165) 33         at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:182) 34         at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:348) 35         at oracle.install.ivw.crs.driver.CRSInstaller.startup(CRSInstaller.java:98) 36         at oracle.install.ivw.crs.driver.CRSInstaller.main(CRSInstaller.java:105) 37 
38 :q
View Code

解決:

1 su 登入root 用戶 2  
3 運行:
4 
5 xhost +
6 
7 再登入oracle 用戶執行命令
View Code

緣由:

1 由於Xserver默認狀況下不容許別的用戶的圖形程序的圖形顯示在當前屏幕上. 若是須要別的用戶的圖形顯示在當前屏幕上, 則應以當前登錄的用戶, 也就是切換身份前的用戶執行以下命令 2  xhost +
View Code

  

    安裝界面:

    

從新受權文件

[root@oracle01 ~]# chown -R oracle:oinstall /u01/
[root@oracle01 ~]# chmod -R 775 /u01/

看見有三個問題須要解決:

 

用root 運行命令

 

問題二:

  yum install compat-libstdc++-33

 

其餘問題就過濾把

等待安裝完成

須要運行命令

好了到這裏安裝就完成了

 

主庫搭建安裝上訴方式

備庫的話選擇克隆的方式完成

備庫須要跟改oracle 的位置有:

 

四,配置監聽netca

      進入oracle用戶

     運行 netca

    可能存在報錯沒有這個命令,能夠查看.bash_profile是否配置環境變量合規,

    而且運行  source .bash_profile

   

  netca 啓動各類問題:

    

 1 1.環境變量問題  2 
 3 環境變量路徑設置不對,找不到netca命令,--bash什麼balabala提示,設置環境變量到ORACLE_HOME/bin  4 
 5    6 
 7 2.沒法顯示圖形界面  8 
 9 比較容易解決,用root用戶執行xhost +命令,切到Oracle用戶下再次執行 10 
11 若是依舊不行,查看是否是缺乏libXp這個rpm包 12 
13 此錯誤的錯誤提示有java.awt等 14 
15 java.lang.NullPointerException 16         at oracle.ewt.lwAWT.BufferedApplet.<init>(Unknown Source) 17         at oracle.net.ca.NetCA.<init>(Unknown Source) 18         at oracle.net.ca.NetCA.main(Unknown Source) 19 Oracle Net Services configuration failed.  The exit code is -1
20 
21 Exception in thread "main" java.lang.UnsatisfiedLinkError: /ora/app/oracle/db10g/jdk/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory 22 
23         at java.lang.ClassLoader$NativeLibrary.load(Native Method) 24 
25         at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) 26 
27         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) 28 
29         at java.lang.Runtime.loadLibrary0(Runtime.java:788) 30 
31         at java.lang.System.loadLibrary(System.java:834) 32 
33         at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50) 34 
35         at java.security.AccessController.doPrivileged(Native Method) 36 
37         at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38) 38 
39         at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29) 40 
41         at java.awt.Component.<clinit>(Component.java:506) 42 
43   44 
45 3.權限問題 46 
47 肯定oracle用戶和root用戶分別什麼用,從新把ORACLE_HOME賦權給oracle 48 
49 錯誤提示 50 
51 java.io.FileNotFoundException:/u01/cfgtoollogs/netca/netca_OraDb11g_home1_0809062PM5029.log(Permission denied) 52 at java.io.FileOutputStream.open(Native Method) 53 at java.io.FileOutputStream.<init>(FileOutputStream.java:179) 54 at java.io.FileOutputStream.<init>(FileOutputStream.java:102) 55 at oracle.net.ca.NetCA.main(Unknown Source) 56 Oracle Net Services configuration failed. The exit code is -1
57 
58   59 
60 4.主機名錯誤 61 
62 錯誤提示: 63 
64 Oracle Net Services Configuration: 65 # 66 # An unexpected error has been detected by HotSpot Virtual Machine: 67 # 68 #  SIGSEGV (0xb) at pc=0x004f0ab3, pid=19917, tid=3086797008
69 # 70 # Java VM: Java HotSpot(TM) Client VM (1.4.2_14-b05 mixed mode) 71 # Problematic frame: 72 # C  [libc.so.6+0x6fab3]  index+0x63
73 # 74 # An error report file with more information is saved as hs_err_pid19917.log 75 # 76 # If you would like to submit a bug report, please visit: 77 #   http://java.sun.com/webapps/bugreport/crash.jsp
78 # 79 /u01/app/oracle/product/10.2.0/db_1/bin/netca: line 190: 19917 Aborted 80 $JRE -mx64m $SRVM_PROPERTY_DEFS -Dsun.java2d.font.DisableAlgorithmicStyles=true -classpath 81 
82 因爲默認主機名錯誤致使,修改配置文件/etc/hosts,修改 83 
84 # Do not remove the following line, or various programs 85 # that require network functionality will fail. 86 127.0.0.1               localhost.localdomain localhost 你的主機名
View Code

   再root用戶下xhost +

  oracle用戶

   export DISPLAY=:0.0

  

最後點擊 結束

五,安裝數據庫 dbca  

 

七,從庫網絡配置netmgr 

     命令行輸入命令:  netmgr

    

 

 

八, 從庫netca  

    

 

詳情請見下篇------oracle 單實例DG(雙機配置篇)

相關文章
相關標籤/搜索