In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Master and slave host hosts configuration
192.168.1.197 oradb1 (from)
192.168.1.198 oradb2 (main)
Second: set up the database
Operation of the main library:
1. Confirm the main library parameters
SQL > select name,open_mode,database_role,log_mode,force_logging from v$database
NAME OPEN_MODE DATABASE_ROLE LOG_MODE FOR
OREO READ WRITE PRIMARY ARCHIVELOG YES
SQL > show parameter name
NAME TYPE VALUE
Db_file_name_convert string
Db_name string oracle9i
Db_unique_name string oradb2
Global_names boolean FALSE
Instance_name string oradb2
Lock_name_space string
Log_file_name_convert string / data/ora11g/, / data/ora11g/
Service_names string oradb2
two。 Set the archiving mode of the database
SQL > archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination / data/ora11g/oradata/oracle9i/archive/
Oldest online log sequence 74
Next log sequence to archive 76
Current log sequence 76
If archiving and force logging are not enabled, do the following
Settings for archive mode:
1 、 shutdown immediate
2 、 alter database mount
3 、 alter database archive log
4 、 alter database open
3. Turn on force logging
SQL > alter database force logging
SQL > select FORCE_LOGGING from v$database
FORCE_
YES
SQL > select name,DB_UNIQUE_NAME,database_role,log_mode,force_logging from v$database
NAME DB_UNIQUE_NAME DATABASE_ROLE LOG_MODE FOR
ORACLE9I oradb2 PRIMARY ARCHIVELOG YES
4. Configure snooping
[root@oradb2 rman] # vim / data/ora11g/product/11.2.0/db_1/network/admin/listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = oradb2)
(ORACLE_HOME = / data/ora11g/product/11.2.0/db_1)
(SID_NAME = oradb2)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.198) (PORT = 1521))
)
ADR_BASE_LISTENER = / data/ora11g
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER = OFF
INBOUND_CONNECT_TIMEOUT_LISTENER = 5
DIAG_ADR_ENABLED_LISTENER = OFF
# TRACE_TIMESTAMP_LISTENER=true
# TRACE_LEVEL_LISTENER=16
5. Configure the TNSNAMES.ORA and password files of the main library and transfer them to the standby library
[root@oradb2 rman] # vim / data/ora11g/product/11.2.0/db_1/network/admin/tnsnames.ora
Tnsnames.ora Network Configuration File: / u01/app/oracle/product/OraDb11g_home1/network/admin/tnsnames.oraGenerated by Oracle configuration tools.
Ora11g_1.197 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.197) (PORT = 1521))
)
(CONNECT_DATA =
(SID = oradb2)
(SERVER = DEDICATED)
)
)
Ora11g_1.198 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.198) (PORT = 1521))
)
(CONNECT_DATA =
(SID = oradb2)
(SERVER = DEDICATED)
)
)
The password file is in
/ data/ora11g/product/11.2.0/db_1/dbs/orapworadb2
If you forget your password, you can change it:
Orapwd file='/data/ora11g/product/11.2.0/db_1/dbs/orapworadb2' password=xxxxx
Transfer listening files and passwords to slave database through ftp,scp, etc.
6. Modify main library parameters
Description of individual parameters:
Unique name of db_unique_name=' main library'
Log_archive_config='dg_config= (unique name of master library and slave library)'
Log_archive_dest_1='location= Local Archive path VALID_FOR= (ONLINE_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME= Master Library unique name'- that is, whether you are a master library or a standby library, put your online in the "local archive path"
Log_archive_dest_2='service= to the TNS valid_for= (online_logfiles,primary_role) db_unique_name= of the slave library unique name'- when the role is the master library, use "go to the tns of the slave library" to send online_redolog
Log_archive_dest_state_1=enable
Log_archive_dest_state_2=enable
Standby_file_management='auto'
Modify the parameters of the main library online: (mainly used for online construction, the main library does not stop; if you can stop, first create pfile from spfile generate / data/ora11g/product/11.2.0/db_1/dbs/initoradb2.ora file directly modify, and then start using pfile, you can also use the following CREATE SPFILE FROM PFILE
, STARTUP OPEN start)
ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG= (oradb2,oradb1)'
ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=/data/ora11g/oradata/oracle9i/archive/ LGWR VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=oradb2'
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=ora11g_1.197 ASYNC VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=oradb1'
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1='ENABLE'
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2='DEFER';# configuration is enabled from the library.
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO'
ALTER SYSTEM SET FAL_SERVER=ora11g_1.197
ALTER SYSTEM SET FAL_CLIENT=ora11g_1.198
ALTER SYSTEM SET DB_FILE_NAME_CONVERT='/data/ora11g/oradata','/data/ora11g/oradata' scope=spfile
ALTER SYSTEM SET LOG_FILE_NAME_CONVERT='/data/ora11g','/data/ora11g' scope=spfile
7. Generate the initoradb2.ora of the master library and transfer it to the slave library for modification
Create pfile from spfile;-- pfile is created here to configure some parameters of the main library, and you have to copy it to the standby database and modify the configuration of the standby database again.
Oracle9i.db_cache_size=16374562816
Oracle9i.oracle_base='/data/ora11g'#ORACLE_BASE set from environment
Oradb2.oracle_base='/data/ora11g'#ORACLE_BASE set from environment
Oracle9i.shared_pool_size=1342177280
.audit _ file_dest='/data/ora11g/admin/oracle9i/adump'
.audit _ trail='db'
. compatible='11.2.0.0.0'
.control _ files='/data/ora11g/oradata/oracle9i/control01.ctl','/data/ora11g/oradata/oracle9i/control02.ctl'
.db _ block_size=16384
.db _ cache_size=16777216000
.db _ domain=''
.db _ file_name_convert='/data/ora11g/oradata','/data/ora11g/oradata'
.db _ flashback_retention_target=60
.db _ name='oracle9i'
.db _ recovery_file_dest='/data/ora11g/flashback'
.db _ recovery_file_dest_size=4294967296
.db _ unique_name='oradb2'
.diagnostic _ dest='/data/ora11g'
.customers ='(PROTOCOL=TCP) (SERVICE=oracle9iXDB)
.fal _ client='ora11g_1.198'
.fal _ server='ora11g_1.197'
.java _ pool_size=104857600
.large _ pool_size=209715200
.log _ archive_config='DG_CONFIG= (oradb2,oradb1)'
.log _ archive_dest_1='LOCATION=/data/ora11g/oradata/oracle9i/archive/ LGWR VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=oradb2'
.log _ archive_dest_2='SERVICE=ora11g_1.197 ASYNC VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=oradb1'
.log _ archive_dest_state_1='ENABLE'
.log _ archive_dest_state_2='DEFER'
.log _ archive_max_processes=10
.log _ file_name_convert='/data/ora11g','/data/ora11g'
.open _ cursors=1000
.pga _ aggregate_target=2097152000
.clients = 1000
.remote _ login_passwordfile='EXCLUSIVE'
.percent = 885
.sga _ max_size=23068672000
.shared _ pool_size=1048576000
.standby _ file_management='AUTO'
* .undo_tablespace='UNDOTBS1'
8. Backup data and control files, due to the large amount of data in the main database, here I use a script to back up in the background. It is recommended to back up the log every day, and then transfer it to the slave database.
# / bin/bash
ORACLE_HOME=/data/ora11g/product/11.2.0/db_1
ORACLE_SID=oradb2
RMAN_LOG_FILE=/data/backup/logs/fullusedbbackupdate +% y%m%d.log
Export ORACLE_HOME
Export ORACLE_SID
Export RMAN_LOG_FILE
PATH=$ORACLE_HOME/bin:$PATH
Export PATH
Export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
Echo > > $RMAN_LOG_FILE
Echo = started on date = > > $RMAN_LOG_FILE
Echo > > $RMAN_LOG_FILE
CMD_STR= "
Rman target / msglog $RMAN_LOG_FILE append
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.