ORACLE 11G R2 RAC+MUTILPATH+RAW+ASM+SILENT+ADDNODE+DG Complete installation (v)

Source: Internet
Author: User
Tags deprecated name database sqlplus
################################### DG ###################################
# here after the test can be a one-time brush script, but do not recommend that the operation of the production library there is a certain risk, it is recommended to fully understand the paragraph after the brush
# Case One: RAC + DUPLICATE + single node DG (complex, need to convert path)

# Master node RAC Main Library configuration #修改主节点 hosts add a DG IP address #vim/etc/hosts/etc/hosts mv/etc/hosts/etc/hosts.bak cat >/etc/hosts & lt;<eof 127.0.0.1 localhost # public IP (eth0) 192.168.1.91 Rac1-192.168.1.92 RAC2 DG # Pub Lic Virtual IP (eth0:1) 192.168.1.93 rac1-vip 192.168.1.94 rac2-vip # Private IP (eth1) 192.168.99.1 Rac1-priv 192. 168.99.2 Rac2-priv # single Client Access Name Virtua IP (eth0:2) 192.168.1.95 Rac-cluster-scan EOF
# Oracle Equivalence for RAC1 and DG (requires installation of media)/grid/sshsetup/sshusersetup.sh-user oracle-hosts "Rac1 DG"-advanced-exverify -confirm-nopromptpassphrase
# Routing of the Oracle Software Environment (run on the main library, direct transfer with increased node method to improve efficiency) su-oracle-c ' export ignore_preaddnode_checks=y &&/u01/ap p/oracle/product/11.2.0/db_1/oui/bin/addnode.sh "cluster_new_nodes={dg}" '
# Repair the main library (clear the DG node information on the RAC, skip over) # su-oracle-c ' $ORACLE _home/oui/bin/runinstaller-updatenodelist oracle_home= $ORACLE _ho ME "Cluster_nodes={rac1,rac2}" '
# Configure the Network service name file (both the primary and standby are matched, if you do not want to change HOSTS can be set to the corresponding IP address) cat >/u01/app/oracle/product/11.2.0/db_1/network/ad Min/tnsnames.ora << EOF primary= (description= (address= (protocol=tcp) (host= Rac1) (port=1521)) (Connect_data= ( server=dedicated) (service_name= ORCL)) standby= (description= (address= (PROTOCOL=TCP) (host= DG) (port=1521)) (CONNEC T_data= (server=dedicated) (service_name= orclbak)) EOF
# Test Network Service name Su-oracle-c ' tnsping standby && tnsping Primary '
# View CRS resources and Database status # su-grid-c "crs_stat-t" # su-grid-c "srvctl status database-d ORCL"
# Close the main library (be cautious if it is a production library, stop listening and CRS first) su-grid-c "Srvctl Stop database-d ORCL"
# Change the main library configuration su-oracle-c ' Sqlplus/as sysdba ' << EOF set linesize 300; Set pagesize 50;
--Start the database to the Mount state startup Mount; --Changing the database to mandatory log mode alter DB force logging; --Change database for archive mode alter DB Archivelog; --Open database to open mode (where only the RAC node is started) alter DB open;
--View the Flash-back path (if you have already set it, skip the modification.) The path is null by default to the path of the control file, modified to +fra Disk group)--Modify archive logs and flash-back zone storage path (db_recovery_file_dest and Log_archive_dest conflict, officially deprecated)--official recommendation to write archived logs to local disk , if the shared disk is large enough to put in the ASM (set size to open after)--if you do not enable the flashback log, you will need to rebuild a new standby when a failover occurs. (strongly recommended to turn on flashback) show parameter db_recovery; --alter system set DB_RECOVERY_FILE_DEST_SIZE=2G sid= ' * '; --alter system set db_recovery_file_dest= ' +fra ' sid= ' * '; --ALTER DATABASE flashback on;
--Toggles the online log file alter system switch logfile; --Force archive of the current redo log--alter system archive log present;
--Add Standby log file (automatically generated when copying data with RAM) SELECT * from V\ $log; -ORACLE requires standby redo to be one more than the primary online redo log group, and each RAC node is a thread ALTER DATABASE add standby logfile thread 1 Group size 50M, group size 50M, group size 50M; ALTER DATABASE ADD standby logfile thread 2 group size 50M, group size 50M, group size 50M;
--DG related configuration (fal_client 11G has been deprecated, file_name_convert after testing only RMAN replication data used to convert paths, standby settings can) alter system set fal_server= standby sid= '*'; Alter system set Standby_file_management=auto sid= ' * '; Alter system set log_archive_config= ' dg_config= (ORCL, Orclbak) ' sid= ' *; Alter system set log_archive_dest_2= ' service= standby lgwr SYNC affirm valid_for= (online_logfiles,primary_role) DB_ Unique_name= orclbak ' sid= ' *; --alter system set log_file_name_convert= ('/u01/app/oracle/oradata/orclbak ', ' +data/orcl/onlinelog ', '/u01/app/ Oracle/oradata/orclbak ', ' +fra/orcl/onlinelog ') sid= ' * '; --alter system set db_file_name_convert= ('/u01/app/oracle/oradata/orclbak ', ' +data/orcl/datafile ', '/u01/app/oracle /oradata/orclbak ', ' +data/orcl/tempfile ') sid= ' * ';
--Reboot Remote archive
Alter system set log_archive_dest_state_2= ' defer ' sid= ' * ';
Alter system set log_archive_dest_state_2= ' Enable ' sid= ' *; Eof
# Detect Master Library status
Su-oracle-c ' Sqlplus/as sysdba ' << EOF set linesize 300; Set pagesize 50;
--Detect database Instance name Database State Archive Mode force log flash back select inst_id,name,dbid,open_mode,log_mode,force_logging,flashback_on from gv\$ Database
--View various data file storage paths Select value from V\ $parameter where name like '%spfile% ' union select name from v\ $datafile Union Sele CT name from v\ $controlfile Union select v\ $logfile Union select name from v\ $tempfile Union select name from V\ $archived _log Union select name from V\ $flashback _database_logfile; Eof
# single Node DG standby configuration # Modify IP
# Modify host name (re-login to see the result of the modification) Mv/etc/hostname/etc/hostname.bak HOSTNAME dg HOSTNAME >/etc/hostname sysctl kernel.hostname= Dg
# Modify Hosts File # DG node modify Hosts file and IP address Mv/etc/hosts/etc/hosts.bak cat >/etc/hosts <<eof 127.0.0.1 localhost # public IP (eth0) 192.168.1.91 Rac1 192.168.1.96 DG EOF
#用户环境变量 echo ' Export tmp=/tmp export tmpdir= $TMP export oracle_term=xterm export threads_flag=native export ORACLE_SID=DG Export Oracle_unqname=orclbak export oracle_base=/u01/app/oracle export oracle_home= $ORACLE _base/product/11.2.0/db_ 1 export path=/usr/sbin: $PATH: $ORACLE _home/bin export ld_library_path= $ORACLE _home/lib:/lib:/usr/lib Export Classpath= $ORACLE _home/jre: $ORACLE _home/jlib: $ORACLE _home/rdbms/jlib: $ORACLE _home/network/jlib Export LANG=ZH_CN . UTF-8 export nls_date_format= "yyyy-mm-dd HH24:MI:SS" Export nls_lang= "simplified Chinese_china. Al32utf8 "Alias rsqlplus=" Rlwrap sqlplus/as sysdba "Alias rrman=" Rlwrap rman target/"' >/home/oracle/.bash_profile
# Configure static monitor cat >/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora<< EOF sid_list_listener= (SID_ List= (sid_desc= (global_dbname= orclbak) (oracle_home=/u01/app/oracle/product/11.2.0/db_1) (SID_NAME= DG)) LISTENER = (description= (address= (protocol=tcp) (HOST=DG) (port=1521))) EOF
# Start listening su-oracle-c ' lsnrctl start ' | Stop | Reload | Status
# Configure the Network service name file (both the primary and standby are matched, if you do not want to change HOSTS can be set to the corresponding IP address) cat >/u01/app/oracle/product/11.2.0/db_1/network/admin/ Tnsnames.ora << EOF primary= (description= (address= (protocol=tcp) (host= Rac1) (port=1521)) (Connect_data = (server=dedicated) (SERVICE_NAME=ORCL)) standby= (description= (address= (protocol=tcp) (HOST=DG) (PORT=1521)) ( Connect_data= (server=dedicated) (Service_name=orclbak)) EOF
# Test Network Service name Su-oracle-c ' tnsping standby && tnsping Primary '
# Empty configuration files for ORACLE software
rm-rf/u01/app/oracle/product/11.2.0/db_1/dbs/*

# Create password file (password must be the same as the main library, there is said 11G password file can not be manually created, to copy from the main library, has not met) Su-oracle-c ' Orapwd File=/u01/app/oracle/product/11.2.0/db_1/dbs /ORAPW DG password= Sys force=y '
# Create a Repository Data store folder su-oracle-c ' Mkdir-p/u01/app/oracle/oradata/orclbak '
# Create a SPFile (if only Db_name,db_unique_name and Service_names are set to follow db_name.) If the db_name is set and the Db_unique_name is set explicitly, then Service_names will follow the DB_UNIQUE_NAME,DG requirement that the main library and the repository db_unique_name must be different.
cat  >/u01/app/oracle/product/11.2.0/db_1/dbs/initdg.ora <<eof *.compatible= ' 11.2.0.4.0 ' *.db_name= ' ORCL ' *. Db_unique_name= ' Orclbak ' *.remote_login_passwordfile= ' EXCLUSIVE ' *.cluster_database=false *. Fal_server= ' primary ' *.standby_file_management= ' AUTO ' *.log_archive_config= ' dg_config= (orcl,orclbak) ' *.log_ Archive_dest_2= ' service= primary lgwr SYNC affirm valid_for= (online_logfiles,primary_role) DB_UNIQUE_NAME= ORCL ' *.log_file_name_convert= (' +data/orcl/onlinelog ', '/u01/app/oracle/oradata/orclbak ', ' +FRA/orcl/onlinelog ', ' /u01/app/oracle/oradata/orclbak ')  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.