--------------------------------每个节点和DG-------------------------------------------------------------------------
--------------------------------------DG-----------------------------------------------------------------------------------------
-- 修改内核参数
vim /etc/sysctl.conf
#for oracle softe
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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
sysctl -p
--添加资源限制参数
vim /etc/security/limits.conf
#for oracle
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
-- 配置login
vim /etc/pam.d/login
session required pam_limits.so
-- 创建用户和组
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
-- 安装目录配置
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory
-- 环境变量
vim /home/oracle/.bash_profile
export ORACLE_SID=proc
export ORACLE_UNQNAME=proc
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_TERM=xterm; export ORACLE_TERM
export PATH=$ORACLE_HOME/bin:$PATH
umask 022
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
source /home/oracle/.bash_profile
-- 安装必要的软件包
yum -y install binutils compat-libstdc++-33 compat-libcap1 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat
-- 开始安装(打开xmanager-passive)
mv database/ /home/oracle
su - oracle
cd database/
export DISPLAY=192.168.3.1:0.0
./runInstaller
-- 装到94%的时候回弹出一个框,执行两个脚本
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/db_1/root.sh
--------------------------------------------------每个节点、DG-----------------------------------------------
vim tnsnames.ora
PROCDG =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = procdg)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = proc)
)
)
PROC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = racscan)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = proc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 主机名)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = proc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = proc)
)
)
---------------------------节点1-----------------------------------------------------
-- 设置数据库archivelog模式、force logging模式
SQL> select log_mode,force_logging from v$database; #查看数据库归档状态,强日志状态
LOG_MODE FOR
------------ ---
NOARCHIVELOG NO
SQL> alter database force logging; #开启强日志
Database altered.
SQL> shutdown immediate; #关闭数据库
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount; #修改归档状态必须在mount状态
ORACLE instance started.
Total System Global Area 784998400 bytes
Fixed Size 2257352 bytes
Variable Size 541068856 bytes
Database Buffers 239075328 bytes
Redo Buffers 2596864 bytes
Database mounted.
SQL> alter database archivelog;#修改归档状态必须在mount状态,并且其他实例必须是not open状态
alter database archivelog
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any
instance
SQL> alter database archivelog;#开启归档
Database altered.
-- 再次查看archive和force logging状态
SQL> select log_mode,force_logging from v$database;
LOG_MODE FOR
------------ ---
ARCHIVELOG YES
-- 开启数据库到open状态,其他节点也打开
SQL> alter database open;
Database altered.
-------------------------------------------节点1--------------------------------------------------------------------
-- 传输密码文件,参数文件到备库
cd /u01/app/oracle/product/11.2.0/db_1/dbs/
scp orapwproc1 procdg:/u01/app/oracle/product/11.2.0/db_1/dbs/orapwproc
scp initproc1.ora procdg:/u01/app/oracle/product/11.2.0/db_1/dbs/initproc.ora
-----------------------------------------节点1-----------------------------------------------------
-- 修改主库的参数文件
[oracle@rac01 rmanbak]$ vim initproc1.ora
#以下为配置DG而添加的内容
*.db_unique_name='proc'
*.log_archive_config='dg_config=(proc,procdg)'
*.log_archive_dest_1='location=+DATA/proc/archivelog #一般放在+FRA
valid_for=(all_logfiles,all_roles) db_unique_name=proc'
*.log_archive_dest_2='service=procdg
valid_for=(online_logfiles,primary_role)
db_unique_name=procdg'
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_format='arc_%t_%s_%r.arc'
#为switchover或failover而设置的参数
*.fal_server=procdg
*.standby_file_management='auto'
*.db_file_name_convert='/u01/app/oracle/oradata/proc/datafile','+DATA/proc/datafile'
*.log_file_name_convert='/u01/app/oracle/oradata/proc/onlinelog','+DATA/proc/onlinelog'
-- 修改完后创建到spfile
SQL> create spfile from pfile;
---------------------------------DG-------------------------------------
-- 修改备库参数文件
*.control_files='/u01/app/oracle/oradata/proc/controlfile/control01.ctl'
*.db_unique_name='procdg'
*.log_archive_config='dg_config=(proc,procdg)'
*.log_archive_dest_1='location=/u01/app/oracle/oradata/proc/archivelog
valid_for=(all_logfiles,all_roles) db_unique_name=procdg'
*.log_archive_dest_2='service=proc LGWR SYNC AFFIRM
valid_for=(online_logfiles,primary_role)
db_unique_name=proc'
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_format='arc_%t_%s_%r.arc'
*.fal_server=proc
*.standby_file_management=auto
*.db_file_name_convert='+DATA/proc/datafile','/u01/app/oracle/oradata/proc/datafile'
*.log_file_name_convert='+DATA/proc/onlinelog' ,'/u01/app/oracle/oradata/proc/onlinelog'
-- 在备库创建相应目录
mkdir -p /u01/app/oracle/admin/proc/adump
mkdir -p /u01/app/oracle/oradata/proc/controlfile
mkdir -p /u01/app/oracle/oradata/proc/archivelog
mkdir -p /u01/app/oracle/oradata/proc/datafile
mkdir -p /u01/app/oracle/oradata/proc/onlinelog
--从刚才创建的参数创建spfile
SQL> create spfile from pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initproc.ora'
---------------------------------节点1-----------------------
-- 在主库创建redolog
SQL> select thread#,group#,bytes/1024/1024 M from v$log;
THREAD# GROUP# M
---------- ---------- ----------
1 1 50
1 2 50
2 3 50
2 4 50
SQL> alter database add standby logfile thread 1 group 5 size 50M ,group 6 size 50M
,group 7 size 50M;
Database altered.
SQL> alter database add standby logfile thread 2 group 8 size 50M ,group 9 size 50M
,group 10 size 50M ;
Database altered.
---------------------------------------------------------任意节点----------------
rman target sys/oracle@proc auxiliary sys/oracle@procdg
duplicate target database for standby from active database nofilenamecheck;
--------------------------------------DG---------------------------
- Win7下的C盘重新划分为两个盘
Win 7分盘 注意事项:操作之前,先备份好重要数据,以免误操作导致数据丢失 . 方法步骤如下: 1.在桌面右键点击"计算机"-"管理": 2.鼠标左键单击选& ...
- 通过sqli-labs学习sql注入——基础挑战之less1-3
首先,先看一些基础知识吧!!!!本人只是初学者,记录一下自己的学习过程,有什么错误之处请指出,谢谢!大佬请绕过!!!! url编码:一般的url编码其实就是那个字符的ASCII值得十六进制,再在前面加 ...
- 细数垃圾邮箱客户端 Live Mail 的BUG
以前用XP系统,里面自带的有outlook,使用中还行,不过bug也不少,常见的如 1.查找,邮件多了后,常常查找不到: 2.有时收件箱什么的突然空白,或部分邮件不见了(2G大小限制,超过了就不能做移 ...
- jQuery 1.11 / 2.1 beta 版发布
jQuery开发团队近日发布了jQuery 1.11和2.1的beta版本. jQuery 1.x版本支持IE 6/7/8,jQuery 2.x 不支持,如果你已经抛弃了IE 6/7/8用户,可以升级 ...
- canvas实例_在线画图工具
fadsfklasdjfklasjdklfjasdlk;fjasd;lfjaskl;dfjal
- 使用Tensorflow训练自己的数据
训练自己的数据集(以bottle为例): 1.准备数据 文件夹结构: models ├── images ├── annotations │ ├── xmls │ └── trainval.txt ...
- 【转】PHP----JS相互调用
JS调用PHP 1.取值: 执行html,得到一个弹窗,提示:I from PHP <script type="text/javascript" src="http ...
- ORB SLAM2在Ubuntu 16.04上的运行配置
http://www.mamicode.com/info-detail-1773781.html 安装依赖 安装OpenGL 1. 安装opengl Library$sudo apt-get inst ...
- 利用Python爬取豆瓣电影
目标:使用Python爬取豆瓣电影并保存MongoDB数据库中 我们先来看一下通过浏览器的方式来筛选某些特定的电影: 我们把URL来复制出来分析分析: https://movie.douban.com ...
- Docker介绍-hc课堂笔记
1,传统模式-多个服务器:申请.安装jdk等.部署环境. 容器-整包,把有东西打包到一起,把这个包放在服务器上. linux中装了docker,起100个服务,改个数字就可以,5分钟左右. 2,虚拟化 ...