AIX7.1_ORALCE11GR2 Installation documentation for ADG

Source: Internet
Author: User


Environment Description:
Main Library: ip:10.143.183.31 sid:primary1 establish GI, ASM, Oracle database software, Oracle database
Library: ip:10.143.183.33 sid:standsty1 build GI, ASM, Oracle database software, no need to build Oracle database

ASM Disk Group Description: Data: +dg_data1 +dg_data2, Index: +dg_index, archive: +dg_arch


Installation steps:
1, modify the listening Main Library: Modify Tnsnames.ora:primary1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 10.143.53.31) (PORT = 1521)) (C Onnect_data = (SERVER = dedicated) (service_name = Primary1))) Standsty1 = (DESCRIPTION = (ADDRESS = ( PROTOCOL = TCP) (HOST = 10.143.53.33) (PORT = 1521)) (Connect_data = (SERVER = dedicated) (Service_Name = stand) STY1))) Modify listener.ora:sid_list_listener= (Sid_list = (Sid_desc = (global_dbname= primary1) ( oracle_home=/oracle/app/oracle/product/11.2.0/db) (sid_name=primary1)) LISTENER = (description_li ST = (DESCRIPTION = (address = (PROTOCOL = IPC) (KEY =extproc1521)) (address = (PROTOCOL = TCP) (HOST = 1 0.143.53.31) (PORT = 1521))) Prepare library: Modify Tnsnames.ora:primary1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 10.143.53.31) (PORT = 1521)) (Connect_data = (SERVER = dedicated) (service_name = Primary1))) Standsty 1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 10.143.53.33) (PORT = 1521)) (Connect_data = (SERVER = dedicated) (Service_n AME = standsty1))) Modify listener.ora:sid_list_listener= (Sid_list = (Sid_desc = (global_dbname= primary 1) (oracle_home=/oracle/app/oracle/product/11.2.0/db) (sid_name=standsty1)) LISTENER = (DE Scription_list = (DESCRIPTION = (address = (PROTOCOL = IPC) (KEY =extproc1521)) (address = (PROTOCOL = T CP) (host = 10.143.53.33) (PORT = 1521))) 2, Main Library Settings archive: Open archive sql> ALTER DATABASE Archivelog;database altered. Set Archive Path sql> alter system set log_archive_dest_1= ' Location=+dg_arch ' Scope=both; System altered. Toggle Log sql> alter system archive log current; System altered. Query archive log asmcmd> ls-ltype redund striped time Sys namearchivelog Unprot Coarse J UN 20:00:00 y thread_1_seq_1.256.915051109archivelog unprot coarse June 20:00:00 y thread_1_seq_2.257.915 051111ARChivelog Unprot Coarse June 20:00:00 Y thread_1_seq_3.258.9150512313, Main Library set force logging mode sql> ALTER DATABASE F  Orce logging; Database Altered.4, main Library modify parameter file sql> create pfile= '/oracle/app/oracle/product/11.2.0/db/dbs/initprimary1.ora ' from SPFile File created. Modify the Pfile file/oracle/app/oracle/product/11.2.0/db/dbs/initprimary1.ora to add the following *.db_name=primary1*.db_ Unique_name=primary1 *.dispatchers= ' (protocol=tcp) (service=primary1xdb) ' *.fal_client= ' primary1 ' *.fal_server= ' Standsty1 ' *.log_archive_config= ' dg_config= (primary1,standsty1) ' *.log_archive_dest_1= ' Location=+dg_arch VALID_ For= (all_logfiles,all_roles) db_unique_name=primary1 ' *.log_archive_dest_2= ' service=standsty1 OPTIONAL LGWR SYNC Affirm valid_for= (online_logfiles,primary_role) db_unique_name=standsty1 ' *.log_archive_dest_state_1= ' ENABLE ' *.lo G_archive_dest_state_2= ' ENABLE ' *.log_archive_format= '%t_%s_%r.arc ' *.standby_file_management=auto*.log_archive_ Max_processes=30*.db_file_name_convert= ' standsty1 ', ' PRImary1 ' *.log_file_name_convert= ' standsty1 ', ' primary1 ' to spfile start the database sql> shutdown immediatedatabase closed. Database dismounted. ORACLE instance shut down. sql> startup pfile= '/oracle/app/oracle/product/11.2.0/db/dbs/initprimary1.ora ' Oracle instance started. Total System Global area 3.6081E+10 bytesfixed size 2253536 bytesvariable size 1.3959E+10 byte Sdatabase buffers 2.1475E+10 Bytesredo buffers 644853760 bytesdatabase mounted. Database opened. sql> create spfile= ' +dg_data1/primary1/spfileprimary1.ora ' from pfile= '/oracle/app/oracle/product/11.2.0/db/dbs /initprimary1.ora '; File created. sql> shutdown immediate;database closed. Database dismounted. ORACLE instance shut down. Sql> Startuporacle instance started. Total System Global area 3.6081E+10 bytesfixed size 2253536 bytesvariable size 1.3959E+10 byte Sdatabase buffers 2.1475E+10 Bytesredo buffers 644853760 bytesdatabase mounted. Database Opened. Sql> Show parameter Spfile;name TYPE VALUE------------------------------------- ----------------------------------------SPFile String +dg_data1/primary1/spfileprimary 1.ora5, copy the pfile and password files from the master library to the repository [YTHISBILLDBN1] cd/oracle/app/oracle/product/11.2.0/db/dbs/[ythisbilldbn1] SCP Initprimary1.ora 10.143.53.33:/ORACLE/APP/ORACLE/PRODUCT/11.2.0/DB/DBS[YTHISBILLDBN1] SCP orapwprimary1 10.143.53.33:/ORACLE/APP/ORACLE/PRODUCT/11.2.0/DB/DBS6, repository modify parameter file modify the Pfile file that was copied from the main library/oracle/app/oracle/product/ 11.2.0/db/dbs/initprimary1.ora, replace the following *.audit_file_dest= '/oracle/app/oracle/admin/standsty1/adump ' *.db_name=  Primary1*.db_unique_name=standsty1 *.dispatchers= ' (protocol=tcp) (service=standsty1xdb) ' *.fal_client= ' standsty1 ' *.fal_server= ' primary1 ' *.log_archive_config= ' dg_config= (standsty1,primary1) ' *.log_archive_dest_1= ' LOCATION=+DG _arch valid_for= (all_logfiles,all_roles) db_unique_name=standsty1 ' *.log_archive_dest_2= ' Service=primary1 OPTIONAL lgwr SYNC affirm valid_for= (online_logfiles,primary_role) db_unique_name=primary1 ' *.log _archive_dest_state_1= ' Enable ' *.log_archive_dest_state_2= ' Enable ' *.log_archive_format= '%t_%s_%r.arc ' *.standby_ File_management=auto*.log_archive_max_processes=30*.db_file_name_convert= ' Primary1 ', ' standsty1 ' *.log_file_name _convert= ' Primary1 ', ' standsty1 ' 7, in the main library through the Rman duplicate to create the repository, the main library execution [Ythisbilldbn1:oracle:/home/oracle]rman target sys/[ Email protected] Auxiliary sys/[email protected] Nocatalogrecovery manager:release 11.2.0.4.0-production  On Tue June 09:44:29 2016Copyright (c) 1982, and Oracle and/or its affiliates. All rights reserved.connected to target Database:primary1 (dbid=32832276) using target database control file instead of RE Covery catalogconnected to auxiliary database:primary1 (not mounted) #duplicate到备库中 #rman> duplicate target database fo R Standby from active database Nofilenamecheck; Starting Duplicate Db at 2016-06-21 11:49:06Allocated Channel:ora_aux_disk_1channel ora_aux_disk_1:sid=9391 device type=diskcontents of Memory Script:{backup as Copy Reuse TargetFile '/oracle/app/oracle/product/11.2.0/db/dbs/orapwprimary1 ' auxiliary format '/oracle/app/oracle/ Product/11.2.0/db/dbs/orapwstandsty1 ';} Executing Memory scriptstarting backup at 2016-06-21 11:49:07allocated channel:ora_disk_1channel ora_disk_1:sid=4037 de Vice type=diskfinished backup at 2016-06-21 11:49:08contents of Memory script:{backup as copy current controlfile for S   Tandby auxiliary format ' +dg_data1/standsty1/controlfile/current.256.915104949 ';   SQL Clone "Create SPFile from memory";   Shutdown clone Immediate;   Startup clone Nomount; SQL Clone "alter system set Control_files =" +dg_data1/standsty1/controlfile/current.256.915104949 "comment=" set by   RMAN ' Scope=spfile ';   Shutdown clone Immediate; Startup clone Nomount;} Executing Memory scriptstarting backup at 2016-06-21 11:49:08using channel Ora_disk_1channel Ora_disk_1:starting datafile copycopying Standby control fileoutput file name=/oracle/app/oracle/product/11.2.0/db/dbs/ Snapcf_primary1.f tag=tag20160621t114908 recid=1 stamp=915104949channel ora_disk_1:datafile copy complete, elapsed time:00:00:03finished backup at 2016-06-21 11:49:12sql statement:create SPFile from memoryoracle instance shut Downconne                     CTED to auxiliary database (not started) Oracle instance startedtotal System Global area 42757922816 bytesfixed Size 2255784 bytesvariable Size 20669531224 bytesdatabase buffers 21474836480 Bytesredo Buffers 611299328 bytessql statement:alter system Set Control_files = ' +dg_data1/standsty1/controlfil e/current.256.915104949 "comment=" Set by RMAN "scope=spfileoracle instance shut downconnected to auxiliary database (n OT started) Oracle instance startedtotal System Global area 42757922816 bytesfixed Size 2255784 bytes Variable Size 20669531224 Bytesdatabase buffers 21474836480 Bytesredo buffers 611299328 bytescontents of Memory script:{ SQL clone ' ALTER DATABASE mount standby database ';} Executing Memory scriptsql statement:alter database mount standby Databaserman-05529:warning:db_file_name_convert resu Lted in invalid ASM names;   Names changed to disk group only.contents of Memory script:{set newname for Tempfile 1 to "+dg_data1";   Switch clone tempfile all;   Set newname for datafile 1 to "+dg_data1";   Set newname for datafile 2 to "+dg_data1";   Set newname for DataFile 3 to "+dg_data1";   Set newname for datafile 4 to "+dg_data1"; Backup as Copy reuse datafile 1 auxiliary format "+DG_DATA1" datafile 2 auxiliary format "+dg_data1" DataFile 3 aux   Iliary format "+DG_DATA1" datafile 4 auxiliary format "+DG_DATA1"; SQL ' alter system archive log current ';} Executing Memory scriptexecuting command:set newnamerenamed tempfile 1 to +dg_data1 in Control fileexecuting command:SET newnameexecuting command:set newnameexecuting command:set newnameexecuting command:set NEWNAMEStarting backup at 20 16-06-21 11:49:48using Channel Ora_disk_1channel ora_disk_1:starting datafile copyinput datafile file number=00001 name= +dg_data1/primary1/datafile/system.261.915031245output file name=+dg_data1/standsty1/datafile/ system.257.915104989 tag=tag20160621t114948channel ora_disk_1:datafile copy complete, elapsed Time:00:05:35channel ora_disk_1:starting datafile copyinput datafile file number=00003 name=+dg_data1/primary1/datafile/ Undotbs1.263.915031305output file name=+dg_data1/standsty1/datafile/undotbs1.258.915105325 tag= Tag20160621t114948channel ora_disk_1:datafile copy complete, elapsed Time:00:05:25channel ora_disk_1:starting DataFile copyinput datafile file number=00002 name=+dg_data1/primary1/datafile/sysaux.262.915031285output file name=+ dg_data1/standsty1/datafile/sysaux.259.915105649 tag=tag20160621t114948channel ora_disk_1:datafile Copy complete, ElapseD time:00:02:45channel ora_disk_1:starting datafile copyinput datafile file number=00004 name=+DG_DATA1/primary1/ Datafile/users.265.915031353output file name=+dg_data1/standsty1/datafile/users.260.915105815 tag= Tag20160621t114948channel ora_disk_1:datafile copy complete, elapsed time:00:00:01finished backup at 2016-06-21 12:03:3 5sql Statement:alter System Archive Log currentcontents of Memory script:{switch clone datafile all;} Executing Memory scriptdatafile 1 switched to datafile copyinput datafile copy recid=1 stamp=915105815 file name=+DG_DATA1 /standsty1/datafile/system.257.915104989datafile 2 switched to datafile copyinput datafile copy RECID=2 STAMP=915105815 File Name=+dg_data1/standsty1/datafile/sysaux.259.915105649datafile 3 switched to datafile copyinput datafile copy recid=3 stamp=915105815 file Name=+dg_data1/standsty1/datafile/undotbs1.258.915105325datafile 4 switched to DataFile Copyinput datafile Copy recid=4 stamp=915105815 file name=+dg_data1/standsty1/datafile/users.260.915105815finished Duplicate Db at 2016-06-21 12:04:218 additional 4 sets of alternate logs sql> ALTER DATABASE add standby logfile Gro   Up 5 size 5G, Group 6 size 5G, Group 7 size 5G, group 8 size 5G; #因每组两个成员, add the alternate log member #sql> ALTER DATABASE add standby logfile member ' +dg_data1 ' to group 5; sql> ALTER DATABASE Add standby logfile member ' +dg_data1 ' to group 6; sql> ALTER DATABASE Add standby logfile member ' +dg_data1 ' to group 7; sql> ALTER DATABASE Add standby logfile member ' +dg_data1 ' to group 8; #查看日志文件是否添加成功 #sql> Select group#, member from V$logfile;9, open in standby to read only status # View current standby status for mounted#sql> select Open_  Mode,database_role,db_unique_name from V$database;open_mode database_role db_unique_name-------------------- ----------------------------------------------Mounted Physical STANDBY standsty1# close database #sql> shutdown IMM Ediateora-01109:database not OpenDatabase dismounted. ORACLE instance shut down. #启动数据库 #sql> startuporacle instance started. Total SysTem Global Area 4.2758E+10 bytesfixed size 2255784 bytesvariable size 2.0670E+10 bytesdatabase Buffers 2.1475E+10 Bytesredo buffers 611299328 bytesdatabase mounted. Database opened. #查看数据库状态, for Read only read-only mode #sql> select Open_mode,database_role,db_unique_name from V$database;open_ MODE database_role db_unique_name------------------------------------------------------------------READ on LY physical STANDBY standsty110, open real-time log application in standby sql> ALTER database RECOVER MANAGED STANDBY DATABASE DISCONNECT F ROM session;database altered. #取消实时日志应用的语句 #--alter database RECOVER MANAGED STANDBY database cancel; #查看备库是否应用redo, Master Reserve Check Command #select sequence#,applied from V$archived_log where dest_id=2 order by sequence#;-------------------here. ADG has been basically completed 11, the main library, the repository of deleted archive logging policy, with Rman configuration CONFIGURE ARCHIVELOG deletion policy parameter #none: When set to this value, the archive file deletion policy is not enabled. By default, none# #主库设置 SHIPPED to all STANDBY: When set to this value, you can delete #rman> CONFIGURE ARCHIVELOG when the archive is transferred to the Standby library deletionPolicy to SHIPPED-standby;new RMAN configuration parameters:configure ARCHIVELOG deletion policy to SHIPPED Standby;new RMAN configuration parameters is successfully stored# repository settings applied on STANDBY: When set to this value, the log to be deleted is forced to check whether the logs are already in the library app Ly, only log after apply can delete #rman> CONFIGURE ARCHIVELOG deletion POLICY to applied on standby;new RMAN configuration parameters : CONFIGURE ARCHIVELOG deletion POLICY to applied on standby;new RMAN configuration parameters is successfully stored# Delete archive Day Log #rman> Delete Archivelog all/* set automatically delete archive log crontab# settings Delete archive log script [Ythisbilldbn1:oracle:/oracle/script]vi DEL_ Arch.shexport oracle_sid=primary1export oracle_base=/oracle/app/oracleexport oracle_home= $ORACLE _base/product/ 11.2.0/dbexport name= ' Date +%y%m%d%t ' $ORACLE _home/bin/rman target/nocatalog log=/oracle/script/delete_archivelog_ Log/del_arch_$name.log<<eofrun{delete noprompt Archivelog all completed before ' sysdate-1 ';} exiteof# set crontab 0 minutes per hour delete [ythisbilldbn1:oracle:/oracle/script]crontab-e0 * * * * */oracle/script/del_arch.sh*/-------------------------------------------------Test 1: Establish a user-created tablespace data file-start--------- ------------------------------------------------------Main Library: Establish a user to create a tablespace data file sql> create tablespace tbs_dpub datafile ' +dg_data1 ' size 1M autoextend on maxsize 62G; Tablespace created. Sql>alter tablespace tbs_dpub Add datafile ' +dg_data2 ' size 1M autoextend on maxsize 62G; Tablespace altered. Sql> create user Cy identified by CY; sql> alter user CY default Tablespace tbs_dpub; User altered. sql> alter system switch logfile; System altered: Check if the user is set up to create a tablespace data file sql> select name from V$tablespace; NAME------------------------------systemsysauxundotbs1tempuserstbs_dpub6 rows selected. Sql> Select Default_tablespace,username from dba_users;default_tablespace username-------------------------                       -----------------------------------SYSTEM Syssystem systemtbs_dpub          Cysystem               Outlnsysaux Appqossyssysaux Dbsnmpsysaux Wmsysusers dipusers oracle_ocm------------------------------------ -------------Test 1: Establish a user-created tablespace data file- End----------------------------------------------------------------------------------------------------------------Test 2: Master Repository Switch-start-----------------------------------------------------------------test purpose: Master standby switch, test success-Current master Repository information: Main Library: Primary1 Library : standsty1--Switch Master Repository information: Main Library: Standsty1 repository: primary1--Main Library: primary1# switch to standby standby mode #sql> ALTER DATABASE commit to SW Itchover to physical standby;database altered. #重启数据库 #sql> shutdown Immediateora-01012:not logged onSQL> Startuporacle instance started. Total System Global area 4.2758E+10 bytesfixed size 2255784 bytesvariable size 2.0670E+10 byte Sdatabase buffers 2.1475E+10 Bytesredo buffers 611299328 bytesdatabase Mounted. Database opened. #查看状态为备库 #sql> select Open_mode,database_role,db_unique_name from V$database;open_mode Databa  Se_role db_unique_name------------------------------------------------------------------READ only physical STANDBY primary1# turn on real-time log application #sql> ALTER DATABASE recover managed STANDBY database disconnect from Session;database Altere d.--repository: standsty1# switch to primary main library mode #sql> ALTER DATABASE commit to switchover to Primary;database altered./* The problem encountered in the Physical DG Master Standby Library switch encounters Ora-16139:media recovery required error sql> ALTER DATABASE COMMIT to switchover to PRIMARY; ALTER DATABASE COMMIT to switchover to Primary*error on line 1:ora-16139:media recovery required Solution:--If reported ora-16139:med IA recovery required, may be caused by not applying the log, you can first execute the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT from SESSION, and then execute the command */ #重启数据库 #sql> shutdown immediateora-01109:database not opendatabase dismounted.startuporacle instance shut down. Sql> Startuporacle instance started. Total System Global area 4.2758E+10 bytesfixed size 2255784 bytesvariable size 2.0670E+10 bytesdatabase Bu Ffers 2.1475E+10 Bytesredo buffers 611299328 bytesdatabase mounted. Database opened. #查看状态为主库 #sql> select Open_mode,database_role,db_unique_name from V$database;open_mode Databa          Se_role db_unique_name------------------------------------------------------------------READ WRITE PRIMARY standsty1--Test if the switch succeeds # view, and switch the main library standsty1 log file #SQL > select Max (sequence#) from V$archived_log; MAX (sequence#)--------------38sql> alter system switch logfile; System altered. Sql> select Max (sequence#) from V$archived_log; MAX (sequence#)--------------#备库primary1 to view the same log file as the main library, switch successful SQL > select Max (sequence#) from V$archived_log; MAX (sequence#)---------------------------------------------------------------Test 2: Master standby Switch-end------------------- -------------------------------------------- 

AIX7.1_ORALCE11GR2 Installation documentation for ADG

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.