--------------------------------每个节点和DG-------------------------------------------------------------------------
--------------------------------------DG-----------------------------------------------------------------------------------------
p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip
unzip p13390677_112040_Linux-x86-64_1of7.zip
unzip p13390677_112040_Linux-x86-64_2of7.zip
vim /etc/yum.repos.d/server.repo
baseurl=file:///mnt/Server
kernel.shmmax = 4294967295
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
vim /etc/security/limits.conf
session required pam_limits.so
useradd -g oinstall -G dba 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_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
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
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
export DISPLAY=192.168.3.1:0.0
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/db_1/root.sh
--------------------------------------------------每个节点、DG-----------------------------------------------
(ADDRESS = (PROTOCOL = TCP)(HOST = procdg)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = racscan)(PORT = 1521))
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;
#查看数据库归档状态,强日志状态 SQL> alter database force logging;
#开启强日志 SQL> shutdown immediate;
#关闭数据库 ORACLE instance shut down.
SQL> startup mount;
#修改归档状态必须在mount状态 Total System Global Area 784998400 bytes
Variable Size 541068856 bytes
Database Buffers 239075328 bytes
Redo Buffers 2596864 bytes
SQL> alter database archivelog;
#修改归档状态必须在mount状态,并且其他实例必须是not open状态 alter database archivelog
ORA-01126: database must be mounted in this instance and not open in any
SQL> alter database archivelog;
#开启归档 -- 再次查看archive和force logging状态 SQL> select log_mode,force_logging from v$database;
SQL> alter database open;
-------------------------------------------节点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
*.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)
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_format='arc_%t_%s_%r.arc'
#为switchover或failover而设置的参数
*.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'
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)
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.log_archive_format='arc_%t_%s_%r.arc'
*.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
SQL> create spfile from pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initproc.ora'
---------------------------------节点1-----------------------
SQL> select thread#,group#,bytes/1024/1024 M from v$log;
---------- ---------- ----------
SQL> alter database add standby logfile thread 1 group 5 size 50M ,group 6 size 50M
SQL> alter database add standby logfile thread 2 group 8 size 50M ,group 9 size 50M
---------------------------------------------------------任意节点----------------
rman target sys/oracle@proc auxiliary sys/oracle@procdg
duplicate target database for standby from active database nofilenamecheck;
--------------------------------------DG---------------------------