In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Environment:
Oracle 11.2.0.4 single instance two sets
Only install Oracle software and monitor in the backup library.
1. Operation of the main library
1. The main library backs up pfile to record the original parameters.
SQL > create pfile='/home/oracle/pfilebak.ora' from spfile
2. Modify database parameters
Change force logging: alter database force logging; archiving mode: archivelog list; # for archiving mode View: select log_mode,force_logging from vested database alter alter system set log_archive_config='DG_CONFIG= (orcl,prod) 'scope=spfile;alter system set log_archive_dest_1='location=/u01/app/archivelog valid_for= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl' scope=both sid='*' Alter system set log_archive_dest_2='service=prod LGWR ASYNC valid_for= (ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=prod' scope=both sid='*';alter system set log_archive_dest_state_1='enable' scope=both sid='*';alter system set log_archive_dest_state_2='enable' scope=both sid='*';alter system set fal_client='orcl' scope=both sid='*';alter system set fal_server='prod' scope=both sid='*';alter system set standby_file_management='AUTO' scope=both sid='*' File path conversion parameters need to restart the database to take effect alter system set db_file_name_convert='/u01/app/oracle/oradata/orcl/','/u01/app/oracle/oradata/prod/' scope=spfile sid='*';alter system set log_file_name_convert='/u01/app/oracle/oradata/orcl/','/u01/app/oracle/oradata/prod/' scope=spfile sid='*'; to create the latest pfile file SQL > create pfile='/home/oracle/pfile.ora' from spfile
Second, prepare the library operation
Check the directory ORALCE_BASE,ORACLE_HOME,archive_log,orainventory,controlfile,datafile,adump
III. Backup of the main database
Vi / u01/backup/rman.shchmod 777 rman.shnohup sh / u01/backup/rman.sh & export ORACLE_SID=orclrman target / restore standby controlfile from'/ u01 apprenticeships control 01.ctlaccountSQL > alter database mount;catalog start with'/ u01 device type disk;allocate channel device type disk;set newname for datafile run {allocate channel C1 device type disk;allocate channel c2 device type disk;allocate channel c3 device type disk;allocate channel c4 backup 1 to'/ u01 apprenticeship oradata Set newname for datafile 2 to'/ u01 apprenticespact oracleoradataUniversset newname for datafile 3 to'/ u01applicaloracleoradataProdundotbs01.dbfpromoterset newname for datafile 4 to'/ u01apaporleexoradataSplash produsers01.dbfpercent oradataplains prods01.dbfpromotionoradataProdPlacleoradataProdPlus database;release channel c1release channel c2erelease oradataProdPlus c4b;
7. Add standby logs to the master / slave database (at least one more than online log)
The main library alter database add standby logfile thread 1 group 4 ('/ u01) size alter database add standby logfile thread 1 group 5 ('/ u01) size 50M alter database add standby logfile thread 1 group 5 ('/ u01) size 50M alter oradata database add standby logfile thread 1 orcl6 ('/ u01pr) size 50M alter oradata 1 orcl0 6 ('/ u01pr) size 50M alter oradata 1 log') size 50M alter oradata 1 group 7 ('/ u01 alter oradata 1 log') size 50m Alter database add standby logfile thread 1 group 8 ('/ u01 database add standby logfile thread database add standby logfile thread standby08.log') size 50M; make available alter database add standby logfile thread 1 oradata 4 ('/ u01) size group 4 ('/ u01) size 50m alter oradata 1 group 5 ('/ u01char database add standby logfile thread database add standby logfile thread prodstandby05.log') size 50M alter oradata 1 log') Alter database add standby logfile thread 1 group 7 ('/ u01 size size) size 50M alter database add standby logfile thread 1 oradata 8 ('/ u01max size 8)
8. The tnsnames of the master and backup libraries is consistent.
Test tnsping orcl tnsping prod
IX. Operation of preparing the library
SQL > alter database recover managed standby database disconnect from session;SQL > recover managed standby database cancel;SQL > alter database open read only;SQL > alter database recover managed standby database using current logfile disconnect from session
10. Verification
Main library v$archived_logSQL > select thread#,max (sequence#) from v$archived_log where applied='NO' group by thread#; standby library v$archived_logSQL > select thread#,max (sequence#) from v$archived_log where applied='YES' group by thread#; standby library vested managedstandards standbyfield select process,status,thread#,sequence# from v$managed_standby Or SELECT 'RECEIVED' | | chr (9) | | rtrim (received1) | | received_time1 | | chr (9) | | rtrim (received2) | |'->'| received_time2FROM (select max (sequence#) received1, to_char (max (next_time), 'YYYY/MM/DD HH24:MI:SS') RECEIVED_TIME1from V$ARCHIVED_LOGwhere thread#=1), (select max (sequence#) received2, to_char (max (next_time)) 'YYYY/MM/DD HH24:MI:SS') RECEIVED_TIME2from V$ARCHIVED_LOGwhere thread#=2) / SELECT' APPLIED'| | chr (9) | | rtrim (applied1) | |'- >'| applied_time1 | | chr (9) | | rtrim (applied2) | | applied_time2from (select MAX (SEQUENCE#) applied1, TO_CHAR (MAX (COMPLETION_TIME), 'YYYY/MM/DD HH24:MI:SS') APPLIED_TIME1from V$ARCHIVED_LOGwhere applied='YES' and thread#=1), (select MAX (SEQUENCE#) applied2, TO_CHAR (MAX (COMPLETION_TIME)) 'YYYY/MM/DD HH24:MI:SS') APPLIED_TIME2from V$ARCHIVED_LOG where applied='YES' and thread#=2) /
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.