Oracle 11gR2 RAC DG 安装前初始化

简介:

1、preusers.sh脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
#Purpose:Create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper', plus 2 users named 'oracle','grid'.
#Also setting the Environment
#variable for oracle user.
#variable for grid user.
#Usage:Log on as the superuser('root'),and then execute the command:#./1preusers.sh
#Author:Asher Huang
  
echo  "Now create 6 groups named 'oinstall','dba','asmadmin','asmdba','asmoper','oper'"
echo  "Plus 2 users named 'oracle','grid',Also setting the Environment"
  
  
groupadd -g 1000 oinstall 
groupadd -g 1200 asmadmin 
groupadd -g 1201 asmdba 
groupadd -g 1202 asmoper 
useradd  -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d  /home/grid  -s  /bin/bash  -c  "grid Infrastructure Owner"  grid 
echo  "grid"  passwd  --stdin grid
  
echo  'export PS1="`/bin/hostname -s`-> "' >>  /home/grid/ .bash_profile 
echo  "export TMP=/tmp" >>  /home/grid/ .bash_profile  
echo  'export TMPDIR=$TMP' >> /home/grid/ .bash_profile 
echo  "export ORACLE_SID=+ASM1" >>  /home/grid/ .bash_profile 
echo  "export ORACLE_BASE=/u01/app/grid" >>  /home/grid/ .bash_profile
echo  "export ORACLE_HOME=/u01/app/11.2.0/grid" >>  /home/grid/ .bash_profile
echo  "export ORACLE_TERM=xterm" >>  /home/grid/ .bash_profile
echo  "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'"  >>  /home/grid/ .bash_profile
echo  'export TNS_ADMIN=$ORACLE_HOME/network/admin'   >>  /home/grid/ .bash_profile
echo  'export PATH=/usr/sbin:$PATH' >>  /home/grid/ .bash_profile
echo  'export PATH=$ORACLE_HOME/bin:$PATH' >>  /home/grid/ .bash_profile
echo  'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib' >>  /home/grid/ .bash_profile
echo  'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib' >>  /home/grid/ .bash_profile
echo  "export EDITOR=vi"  >>  /home/grid/ .bash_profile
echo  "export LANG=en_US"  >>  /home/grid/ .bash_profile
echo  "export NLS_LANG=american_america.AL32UTF8"  >>  /home/grid/ .bash_profile
echo  "umask 022" >>  /home/grid/ .bash_profile
  
groupadd -g 1300 dba 
groupadd -g 1301 oper 
useradd  -u 1101 -g oinstall -G dba,oper,asmdba -d  /home/oracle  -s  /bin/bash  -c  "Oracle Software Owner"  oracle 
echo  "oracle"  passwd  --stdin oracle
  
echo  'export PS1="`/bin/hostname -s`-> "' >>  /home/oracle/ .bash_profile 
echo  "export TMP=/tmp" >>  /home/oracle/ .bash_profile  
echo  'export TMPDIR=$TMP' >> /home/oracle/ .bash_profile 
echo  "export ORACLE_HOSTNAME=node1.localdomain" >>  /home/oracle/ .bash_profile 
echo  "export ORACLE_SID=devdb1" >>  /home/oracle/ .bash_profile 
echo  "export ORACLE_BASE=/u01/app/oracle" >>  /home/oracle/ .bash_profile
echo  'export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1' >>  /home/oracle/ .bash_profile
echo  "export ORACLE_UNQNAME=devdb" >>  /home/oracle/ .bash_profile
echo  'export TNS_ADMIN=$ORACLE_HOME/network/admin'   >>  /home/oracle/ .bash_profile
echo  "export ORACLE_TERM=xterm" >>  /home/oracle/ .bash_profile
echo  'export PATH=/usr/sbin:$PATH' >>  /home/oracle/ .bash_profile
echo  'export PATH=$ORACLE_HOME/bin:$PATH' >>  /home/oracle/ .bash_profile
echo  'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib' >>  /home/oracle/ .bash_profile
echo  'export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib' >>  /home/oracle/ .bash_profile
echo  "export EDITOR=vi"  >>  /home/oracle/ .bash_profile
echo  "export LANG=en_US"  >>  /home/oracle/ .bash_profile
echo  "export NLS_LANG=american_america.AL32UTF8"  >>  /home/oracle/ .bash_profile
echo  "export NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss'"  >>  /home/oracle/ .bash_profile
echo  "umask 022" >>  /home/oracle/ .bash_profile
  
echo  "The Groups and users has been created"
echo  "The Environment for grid,oracle also has been set successfully"



2、predir.sh脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
#Purpose:Create the necessary directory for oracle,grid users and change the authention to oracle,grid users.
#Usage:Log on as the superuser('root'),and then execute the command:#./2predir.sh
#Author:Asher Huang
  
echo  "Now create the necessary directory for oracle,grid users and change the authention to oracle,grid users..."
mkdir  -p  /u01/app/grid
mkdir  -p  /u01/app/11 .2.0 /grid
mkdir  -p  /u01/app/oracle
chown  -R oracle:oinstall  /u01
chown  -R grid:oinstall  /u01/app/grid
chown  -R grid:oinstall  /u01/app/11 .2.0
chmod  -R 775  /u01
echo  "The necessary directory for oracle,grid users and change the authention to oracle,grid users has been finished"


3、prelimits.sh脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
#Purpose:Change the /etc/security/limits.conf.
#Usage:Log on as the superuser('root'),and then execute the command:#./3prelimits.sh
#Author:Asher Huang
  
echo  "Now modify the /etc/security/limits.conf,but backup it named /etc/security/limits.conf.bak before"
cp  /etc/security/limits .conf  /etc/security/limits .conf.bak
echo  "oracle soft nproc 2047"  >> /etc/security/limits .conf
echo  "oracle hard nproc 16384"  >> /etc/security/limits .conf
echo  "oracle soft nofile 1024"  >> /etc/security/limits .conf
echo  "oracle hard nofile 65536"  >> /etc/security/limits .conf
echo  "grid soft nproc 2047"  >> /etc/security/limits .conf
echo  "grid hard nproc 16384"  >> /etc/security/limits .conf
echo  "grid soft nofile 1024"  >> /etc/security/limits .conf
echo  "grid hard nofile 65536"  >> /etc/security/limits .conf
echo  "Modifing the /etc/security/limits.conf has been succeed."



4、prelogin.sh脚本

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
#Purpose:Modify the /etc/pam.d/login.
#Usage:Log on as the superuser('root'),and then execute the command:#./4prelimits.sh
#Author:Asher Huang
  
echo  "Now modify the /etc/pam.d/login,but with a backup named /etc/pam.d/login.bak"
cp  /etc/pam .d /login  /etc/pam .d /login .bak
  
echo  "session required /lib/security/pam_limits.so"  >> /etc/pam .d /login
echo  "session required pam_limits.so"  >> /etc/pam .d /login
  
echo  "Modifing the /etc/pam.d/login has been succeed."


5、preprofile.sh脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
#Purpose:Modify the /etc/profile.
#Usage:Log on as the superuser('root'),and then execute the command:#./5preprofile.sh
#Author:Asher Huang
  
echo  "Now modify the  /etc/profile,but with a backup named  /etc/profile.bak"
cp  /etc/profile  /etc/profile .bak
echo  'if [ $USER = "oracle" ]||[ $USER = "grid" ]; then'  >>   /etc/profile
echo  'if [ $SHELL = "/bin/ksh" ]; then'  >>  /etc/profile
echo  'ulimit -p 16384'  >>  /etc/profile
echo  'ulimit -n 65536'  >>  /etc/profile
echo  'else'  >>  /etc/profile
echo  'ulimit -u 16384 -n 65536'  >>  /etc/profile
echo  'fi'  >>  /etc/profile
echo  'fi'  >>  /etc/profile
echo  "Modifing the /etc/profile has been succeed."



6、presysctl.sh脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
#Purpose:Modify the /etc/sysctl.conf.
#Usage:Log on as the superuser('root'),and then execute the command:#./6presysctl.sh
#Author:Asher Huang
  
echo  "Now modify the /etc/sysctl.conf,but with a backup named /etc/sysctl.bak"
cp  /etc/sysctl .conf  /etc/sysctl .conf.bak
  
echo  "fs.aio-max-nr = 1048576"  >>  /etc/sysctl .conf
echo  "fs.file-max = 6815744"  >>  /etc/sysctl .conf
echo  "kernel.shmall = 2097152"  >>  /etc/sysctl .conf
echo  "kernel.shmmax = 1054472192"  >>  /etc/sysctl .conf
echo  "kernel.shmmni = 4096"  >>  /etc/sysctl .conf
echo  "kernel.sem = 250 32000 100 128"  >>  /etc/sysctl .conf
echo  "net.ipv4.ip_local_port_range = 9000 65500"  >>  /etc/sysctl .conf
echo  "net.core.rmem_default = 262144"  >>  /etc/sysctl .conf
echo  "net.core.rmem_max = 4194304"  >>  /etc/sysctl .conf
echo  "net.core.wmem_default = 262144"  >>  /etc/sysctl .conf
echo  "net.core.wmem_max = 1048586"  >>  /etc/sysctl .conf
echo  "net.ipv4.tcp_wmem = 262144 262144 262144"  >>  /etc/sysctl .conf
echo  "net.ipv4.tcp_rmem = 4194304 4194304 4194304"  >>  /etc/sysctl .conf
  
echo  "Modifing the /etc/sysctl.conf has been succeed."
echo  "Now make the changes take effect....."
sysctl -p



参考博文:http://www.oracleonlinux.cn/2012/06/step-by-step-install-11gr2-rac-on-linux-8/









     本文转自1321385590 51CTO博客,原文链接:http://blog.51cto.com/linux10000/1899253,如需转载请自行联系原作者


相关文章
|
Oracle 关系型数据库 MySQL
Oracle linux 8 二进制安装 MySQL 8.4企业版
Oracle linux 8 二进制安装 MySQL 8.4企业版
582 1
|
Oracle 关系型数据库 Linux
linux8安装oracle 11g遇到的问题记录
Oracle 11g在Linux 8上安装时会遇到link编译环节的问题。官方建议忽略安装中的链接错误,安装完成后应用DBPSU 11.2.0.4.240716补丁及一次性补丁33991024,再重新编译二进制文件,并配置监听器和数据库。但因11g已退出服务期,这些补丁需付费获取。网上信息显示22年1月的PSU补丁也可解决问题,找到该补丁后按常规方式打补丁即可。如有需求或疑问可咨询我。
796 20
|
存储 Oracle 关系型数据库
|
Oracle 关系型数据库 网络安全
Oracle 19c 安装教程学习
Oracle 19c 安装教程学习
5503 2
|
机器学习/深度学习 Oracle 关系型数据库
Oracle 19c单机一键安装脚本分享
Oracle 19c单机一键安装脚本分享
997 2
|
8月前
|
Oracle 关系型数据库 Linux
【赵渝强老师】Oracle数据库配置助手:DBCA
Oracle数据库配置助手(DBCA)是用于创建和配置Oracle数据库的工具,支持图形界面和静默执行模式。本文介绍了使用DBCA在Linux环境下创建数据库的完整步骤,包括选择数据库操作类型、配置存储与网络选项、设置管理密码等,并提供了界面截图与视频讲解,帮助用户快速掌握数据库创建流程。
723 93
|
7月前
|
Oracle 关系型数据库 Linux
【赵渝强老师】使用NetManager创建Oracle数据库的监听器
Oracle NetManager是数据库网络配置工具,用于创建监听器、配置服务命名与网络连接,支持多数据库共享监听,确保客户端与服务器通信顺畅。
394 0
|
10月前
|
存储 Oracle 关系型数据库
服务器数据恢复—光纤存储上oracle数据库数据恢复案例
一台光纤服务器存储上有16块FC硬盘,上层部署了Oracle数据库。服务器存储前面板2个硬盘指示灯显示异常,存储映射到linux操作系统上的卷挂载不上,业务中断。 通过storage manager查看存储状态,发现逻辑卷状态失败。再查看物理磁盘状态,发现其中一块盘报告“警告”,硬盘指示灯显示异常的2块盘报告“失败”。 将当前存储的完整日志状态备份下来,解析备份出来的存储日志并获得了关于逻辑卷结构的部分信息。
|
8月前
|
SQL Oracle 关系型数据库
Oracle数据库创建表空间和索引的SQL语法示例
以上SQL语法提供了一种标准方式去组织Oracle数据库内部结构,并且通过合理使用可以显著改善查询速度及整体性能。需要注意,在实际应用过程当中应该根据具体业务需求、系统资源状况以及预期目标去合理规划并调整参数设置以达到最佳效果。
573 8
|
10月前
|
SQL Oracle 关系型数据库
比较MySQL和Oracle数据库系统,特别是在进行分页查询的方法上的不同
两者的性能差异将取决于数据量大小、索引优化、查询设计以及具体版本的数据库服务器。考虑硬件资源、数据库设计和具体需求对于实现优化的分页查询至关重要。开发者和数据库管理员需要根据自身使用的具体数据库系统版本和环境,选择最合适的分页机制,并进行必要的性能调优来满足应用需求。
486 11

推荐镜像

更多