centos7安装oracle12c
admin
2023-05-10 20:21:54
0
linuxamd64_12c_database_1of2.zip 
linuxamd64_12c_database_2of2.zip
  1. su - root


  2. hostnamectl set-hostname centos7.dbaora.com --static
  3. #groups for database management
    /usr/sbin/groupadd -g 501 oinstall
    /usr/sbin/groupadd -g 502 dba
    /usr/sbin/groupadd -g 503 oper
  4. /usr/sbin/useradd -u 501 -g oinstall -G dba,oper oracle
  5. passwd oracle
  6. SELINUX=permissive
  7. rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \
    gcc \
    gcc-c++ \
    glibc \
    glibc-common \
    glibc-devel \
    glibc-headers \
    ksh \
    libaio \
    libaio-devel \
    libgcc \
    libstdc++ \
    libstdc++-devel \
    libXext \
    libXtst \
    libX11 \
    libXau \
    libXi \
    make \
    sysstat \
    unixODBC \
    unixODBC-devel \
    zlib-devel \
    compat-libcap1 \
    compat-libstdc++-33

    yum install libaio-devel* unixODBC* zlib-devel* compat-libcap1* compat-libstdc++-33*


  8. Add kernel parameters to /etc/sysctl.conf
  9. # kernel parameters for 12gR1 installation
    
    fs.file-max = 6815744
    kernel.sem = 250 32000 100 128
    kernel.shmmni = 4096
    kernel.shmall = 1073741824
    kernel.shmmax = 4398046511104
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576
    fs.aio-max-nr = 1048576
    net.ipv4.ip_local_port_range = 9000 65500


  10. /sbin/sysctl -p
  11. Add following lines to set shell limits for user oracle in file /etc/security/limits.conf

  12. # shell limits for users oracle 12gR1
    
    oracle   soft   nofile   1024
    oracle   hard   nofile   65536
    oracle   soft   nproc    2047
    oracle   hard   nproc    16384
    oracle   soft   stack    10240
    oracle   hard   stack    32768
  13. Create .bash_profile for user oracle

  14. # Oracle Settings
    export TMP=/tmp
    
    export ORACLE_HOSTNAME=centos7.dbaora.com
    export ORACLE_UNQNAME=ORA12C
    export ORACLE_BASE=/ora01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
    export ORACLE_SID=ORA12C
    
    
    PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin
    
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
    export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
    
    alias cdob='cd $ORACLE_BASE'
    alias cdoh='cd $ORACLE_HOME'
    alias tns='cd $ORACLE_HOME/network/admin'
    alias envo='env | grep ORACLE'
    
    umask 022
    
    envo
  15. mkdir -p /ora01/app/oracle/product/12.1.0/db_1
    chown oracle:oinstall -R /ora01
  16. In Oracle Enterprise Linux 7 /tmp data is stored on tmpfs which consumes memory and is too small. To revert it back to storage just run following command and REBOOT machine to be effective.

  17. systemctl mask tmp.mount

注意:root用户xhost + ,然后oracle用户设置环境变量DISPLAY=:0.0,LANG=en.US.UTF-8,否则安装程序乱码





su - oracle

--unizp software it will create directory "database" 
--where you can find installation software
unzip linuxamd64_12c_database_1of2.zip
unzip linuxamd64_12c_database_2of2.zip

--I defined 4 aliases in .bash_profile of user oracle to make 
--administration heaven :)

[oracle@centos7 ~]$ alias envo cdob cdoh tns
alias envo='env | grep ORACLE'
alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'

--run alias command envo to display environment settings
envo
ORACLE_UNQNAME=ORA12C
ORACLE_SID=ORA12C
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=centos7.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/12.1.0/db_1

--run alias command cdob and cdoh 
--to check ORACLE_BASE, ORACLE_HOME 
[oracle@centos7 ~]$ cdob
[oracle@centos7 oracle]$ pwd
/ora01/app/oracle

[oracle@centos7 db_1]$ cdoh
[oracle@centos7 db_1]$ pwd
/ora01/app/oracle/product/12.1.0/db_1

--run installation from "database" directory
./runInstall

1. Uncheck checkbox “I wish to receive security updates via My Oracle Support” and then click “Next” button.

2. Ignore following message and click “Yes” button.

3. Select “Skip software updates” and click “Next” button.

4. Ignore following message. Just click “Yes” button

5. Select “Create and configure a database” then click “Next” button.

6. Select “Desktop Class” and click “Next” button.

7. On the screen you need to define global database name and pluggable database name. Rest of options you can keep default. Then click “Next” button.

8. Accept default settings then click “Next” button.

9. Summary screen just before installation. It’s the last moment to make changes in previous steps. If you are ready click “Install” button.

10. Installation begins …

11. Unfortunately I received error during binaries linking

in log you should see

/usr/bin/ld: note: '__tls_get_addr@@GLIBC_2.3' is defined in 
DSO /lib64/ld-linux-x86-64.so.2 so try adding it to the linker 
command line /lib64/ld-linux-x86-64.so.2: could not read symbols: 
Invalid operation

INFO: collect2: error: ld returned 1 exit status

12. To solve this problem do following as user Oracle

  • remove directory /ora01/app/oracle/product/12.1.0/db_1/lib/stubs

rm -rf /ora01/app/oracle/product/12.1.0/db_1/lib/stubs
  • backup file $ORACLE_HOME/rdbms/lib/env_rdbms.mk

cd $ORACLE_HOME/rdbms/lib/
cp env_rdbms.mk env_rdbms.mk.bck
  • make changes in $ORACLE_HOME/rdbms/lib/env_rdbms.mk

modify line 176

LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS)

to

LINKTTLIBS=$(LLIBCLNTSH) $(ORACLETTLIBS) $(LINKLDLIBS) -lons

modify line 279 and 280

LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS)
LINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS)

to

LINK=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS) $(COMPSOBJS) -Wl,--no-as-neededLINK32=$(FORT_CMD) $(PURECMDS) $(ORALD) $(LDFLAGS32) $(COMPSOBJS) -Wl,--no-as-needed

modify line 3041 and 3042

TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \
        $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS)

to

TG4PWD_LINKLINE= $(LINK) $(OPT) $(TG4PWDMAI) \
        $(LLIBTHREAD) $(LLIBCLNTSH) $(LINKLDLIBS) -lnnz12

Once it’s done click “Retry” button on screen from point 11 to continue with installation. Linking should finish properly and binaries installation should continue.

13. In the end you will be asked to run as root two scripts. Once they are completed click “OK” button – installation will proceed.

/ora01/app/oraInventory/orainstRoot.sh
/ora01/app/oracle/product/12.1.0/db_1/root.sh

18. Once binaries are installed automatically DBCA (database configuration assistant) will start to create new database.
19. You should see summary screen for your database. You can click “Password Management” to unlock and change passwords for default account. Click “OK” button.

20. Installation is finished. Click “Close” button.

21. Post installation steps

Edit the “/etc/oratab” file to set restart flag for ORA12C to ‘Y’.

ORA12C:/u01/app/oracle/product/12.1.0/db_1:Y


相关内容

热门资讯

以军士兵集体丢掉武器抗命,大喊... 据凤凰卫视报道,以色列国防军一军事基地7月30日发生士兵抗命事件,约120名士兵抗议指挥官做法,将武...
蒋成华任商务部副部长 国务院任免国家工作人员。任命蒋成华为商务部副部长。免去蒋成华的商务部国际贸易谈判副代表职务。
伊朗驻华大使:在军事威胁下,不... 新华社北京7月31日电(记者刁慧琳) 伊朗驻华大使法兹里7月28日表示,伊美回到谈判桌的前提是美国必...
伊朗革命卫队在霍尔木兹海峡击中... 当地时间31日,伊朗伊斯兰革命卫队发布声明称,革命卫队海军当天在霍尔木兹海峡击中并扣留了两艘违反禁令...
美媒:特朗普,遇到了一个更强硬... 据《纽约时报》7月29日报道,就在特朗普总统看似放弃战事升级计划几天后,美国再次与伊朗交火。上周末,...
女子做气管镜时不幸身亡,丈夫称... 7月29日,西安刘先生反映妻子在当地医院做支气管镜检查时死亡,看监控时发现医生疑有违规操作。刘先生表...
全网“帮卖西瓜”,然后呢? 近日,河南部分地区西瓜滞销的消息在网上热度很高。很多地方也伸出援手:有景区收购千斤西瓜、免费赠予游客...
美媒:乌克兰袭击伊朗船只,险引... 据《纽约时报》7月28日报道,据伊朗和西方官员称,伊朗曾考虑攻击乌克兰的一个港口,以报复乌克兰对一艘...
20年里,他只画美女,用东方风... 迈进KIM在上海的工作室,迎面是一整墙的美女们。她们像是刚从一场时髦的沙龙里退场,或倚或立,眉宇间是...
Google在港推出AI代理G... 观点网讯:7月29日,Google在香港推出AI代理Gemini Spark,该代理可全天候在后台运...