In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Environment introduction:
Windows 2012 R2mm 2
Main library: install oracle software, monitor, instance
Standby library: install oracle software, monitor
Database version: 11.2.0.4
Main library: orcl
Standby library: prod
1. Main library
Create pfile='C:\ Users\ Administrator\ Desktop\ file\ pfile.ora' from spfile
Alter database force logging
Alter system set log_archive_config='DG_CONFIG= (orcl,prod) 'scope=spfile
Alter system set log_archive_dest_1='location=C:\ app\ archive 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=''
Alter system set db_file_name_convert='C:\ app\ datafiles\ orcl\','C:\ app\ datafiles\ prod\ 'scope=spfile sid=''
Alter system set log_file_name_convert='C:\ app\ datafiles\ orcl\','C:\ app\ datafiles\ prod\ 'scope=spfile sid='*'
SQL > create pfile='C:\ Users\ Administrator\ Desktop\ file\ pfilebak.ora' from spfile
2. Prepare the library creation directory
Archive directory C:\ app\ archive
Data file directory C:\ app\ datafiles\ prod\
Adump directory C:\ app\ Administrator\ admin\ prod\ adump
3. Backup of the main database
Rman target /
Run {
Allocate channel a1 device type disk
Allocate channel a2 device type disk
Allocate channel a3 device type disk
Crosscheck archivelog all
Sql 'alter system archive log current'
Sql 'alter system archive log current'
Backup full database format='C:\ Users\ Administrator\ Desktop\ file\ full%U%T' include current controlfile for standby
Backup current controlfile for standby format'C:\ Users\ Administrator\ Desktop\ file\ control01.ctl'
Backup archivelog all format'C:\ Users\ Administrator\ Desktop\ file\ arch%d%T%U.arc'
Release channel a1
Release channel a2
Release channel a3
}
4. Copy files
The password file is in $ORACLE_HOME/database
Copy the password file (need to change sid), pfile, redo, temp, to the corresponding directory of the slave database.
5. Modify host file
192.168.3.2 WIN-JP7MSEND1SD
192.168.3.3 WIN-KL9BBQ52F5R
6. The tnsnames of the master and backup libraries is consistent.
7. Modify the pfile file of the repository
Change the pfile file
Db_name='orcl' should be consistent with the main database
.db _ unique_name='prod'
Audit _ file_dest='C:\ app\ Administrator\ admin\ prod\ adump' pay attention to the path
Log_archive_dest_1='C:\ app\ archive'
.db _ recovery_file_dest
Oracle_base
Delete log_archive_dest_2, log_archive_dest_state_1
Modify
Fal_client='prod'
.fal _ server='orcl'
.log _ archive_config='DG_CONFIG= (orcl,prod)'
.log _ archive_dest_1='location=C:\ app\ archive valid_for= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=prod'
* check whether the path in the file is correct * *
8. Prepare the library to add services
Oradim-new-sid prod-startmode auto
Set ORACLE_SID=prod
9. Restore the reserve library
Sql > startup nomount pfile='C:\ Users\ Administrator\ Desktop\ file\ pfilebak.ora'
Sql > create spfile from pfile='C:\ Users\ Administrator\ Desktop\ file\ pfilebak.ora'
If you need to change the data file directory, you can use the
Rman target / nocatalog
RMAN > restore standby controlfile from'C:\ Users\ Administrator\ Desktop\ file\ control01.ctl'
SQL > alter database mount
Catalog start with'C:\ Users\ Administrator\ Desktop\ file\'
Run
{
Allocate channel c1 device type disk
Allocate channel c2 device type disk
Allocate channel c3 device type disk
Allocate channel c4 device type disk
Set newname for datafile 1 to'C:\ app\ datafiles\ prod\ system01.dbf'
Set newname for datafile 2 to'C:\ app\ datafiles\ prod\ sysaux01.dbf'
Set newname for datafile 3 to'C:\ app\ datafiles\ prod\ undotbs01.dbf'
Set newname for datafile 4 to'C:\ app\ datafiles\ prod\ users01.dbf'
Set newname for datafile 5 to'C:\ app\ datafiles\ prod\ example01.dbf'
Restore database
Release channel c1
Release channel c2
Release channel c3
Release channel c4
}
Recover database
10. Add standby logs to the master / slave database (at least one more than online log)
Main library
Alter database add standby logfile thread 1 group 4 ('C:\ app\ datafiles\ orcl\ standby04.log') size 50m
Alter database add standby logfile thread 1 group 5 ('C:\ app\ datafiles\ orcl\ standby05.log') size 50m
Alter database add standby logfile thread 1 group 6 ('C:\ app\ datafiles\ orcl\ standby06.log') size 50m
Alter database add standby logfile thread 1 group 7 ('C:\ app\ datafiles\ orcl\ standby07.log') size 50m
Alter database add standby logfile thread 1 group 8 ('C:\ app\ datafiles\ orcl\ standby08.log') size 50m
Prepare the library
Alter database add standby logfile thread 1 group 4 ('C:\ app\ datafiles\ prod\ standby04.log') size 50m
Alter database add standby logfile thread 1 group 5 ('C:\ app\ datafiles\ prod\ standby05.log') size 50m
Alter database add standby logfile thread 1 group 6 ('C:\ app\ datafiles\ prod\ standby06.log') size 50m
Alter database add standby logfile thread 1 group 7 ('C:\ app\ datafiles\ prod\ standby07.log') size 50m
Alter database add standby logfile thread 1 group 8 ('C:\ app\ datafiles\ prod\ standby08.log') size 50m
11. The main library restarts DB because the restart of log_archive_config takes effect
Start synchronization
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
Verification
Main library v$archived_log
SQL > select thread#,max (sequence#) from v$archived_log where applied='NO' group by thread#
Reserve library v$archived_log
SQL > select thread#,max (sequence#) from v$archived_log where applied='YES' group by thread#
Reserve library v$managed_standby
Select process,status,thread#,sequence# from v$managed_standby
SQL > select process,status,thread#,sequence# from v$managed_standby
PROCESS STATUS THREAD# SEQUENCE#
ARCH CONNECTED 0 0
ARCH CONNECTED 0 0
ARCH CLOSING 1 10
ARCH CLOSING 1 11
RFS IDLE 0 0
RFS IDLE 0 0
RFS IDLE 0 0
RFS IDLE 1 12
MRP0 APPLYING_LOG 1 12
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.