In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
A little lazy, we forgive the position of the pictures will not be added one by one, the work is relatively busy, just copy and paste my document for everyone. Chapter III main Library configuration 3.1 create a directory and modify the name
/ / create the required folder in the main library
Mkdir / u01/app/oracle/arch
/ / modify the name
Sqlplus / assysdba
Show parametername
Alter system set db_unique_name=orclscope=spfile
! If the default is the content of the above picture, you don't have to execute the following 2 sql statements!
Alter system set service_names=orclscope=spfile
Alter system set instance_name=orclscope=spfile
3.2 configure log archiving mode
Shutdownimmediate
Startup mount
/ / set the archive log directory
Alter system set log_archive_dest_1='location=/u01/app/oracle/arch'
/ / verify the log directory
Archive log list
/ / enable archiving mode
Alter databasearchivelog
/ / enable forced logging mode
Alter databaseforce logging
Verification
SelectFORCE_LOGGING from v$database
3.3 add standby redolog log files
Alter database add standby logfile group 11'/ u01/app/oracle/oradata/orcl/std11.log'size 60m
Alter database add standby logfile group 12'/ u01/app/oracle/oradata/orcl/std12.log'size 60m
Alter database add standby logfile group 13'/ u01/app/oracle/oradata/orcl/std13.log'size 60m
Alter database add standby logfile group 14'/ u01/app/oracle/oradata/orcl/std14.log'size 60m
/ / Verification, plus the system default of three, a total of 7
Select member,type from v$logfile
3.4 Open the flashback database
/ / Open the flashback database (function: this feature is very useful in the event of a failover, allowing you to flash the old primary database back before the failure and then convert it into a backup database. If flashback is not enabled, you will have to rebuild the backup library, which means copying the data file again. In addition to this benefit, flashbacks also allow you to avoid restoring data from backups in some cases)
/ / View flashback database status
Show parameter db_recovery_file_dest
/ / change path and size
You can change the location: sql > alter system set db_recovery_file_dest=' new path'
Change the size: sql > alter system set db_recovery_file_dest_size=400G
/ / check whether it is enabled. It is disabled by default.
Select flashback_on from v$database
Alter database flashback on
/ / verify
Select flashback_on from v$database
3.5 DG configuration
/ / the name of another library in the Data Guard configuration
Alter system setlog_archive_config='DG_CONFIG= (orcl,orclstd)'
/ / configure the location of archive logs (very important)
Alter system setlog_archive_dest_1='LOCATION=/u01/app/oracle/archVALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl'
/ / configure redo logs to the backup repository (very important)
Alter system set log_archive_dest_2='SERVICE=orclstdASYNC LGWR VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orclstd'
/ / set the log format
Alter system setlog_archive_format='arch_%r_%t_%s.arc' scope=spfile
/ / set FAL_SERVER (function: this parameter specifies where to find the missing archive log when there is a problem with log transfer)
Alter system set fal_server=orclstd
Alter system set fal_client=orcl
/ / configure the data file and log file directory
Show parameter convert
Alter system set db_file_name_convert='/u01/app/oracle/oradata/orcl/','/u01/app/oracle/oradata/orcl/'scope=spfile
Alter system set log_file_name_convert='/u01/app/oracle/oradata/orcl/','/u01/app/oracle/oradata/orcl/'scope=spfile
Shutdown immediate
Startup mount
/ / verify
Show parameter convert
3.6 set up automatic management
/ / check whether the master library automatically manages files (function: when the master library adds or deletes data files, the standby database also adds and deletes data files)
Show parameter standby
Alter system set standby_file_management=auto
/ / verify
Show parameter standby
3.7Modification of fal parameters
Alter system set fal_client=orcl
Alter system set fal_server=orclstd
/ / verify
Show parameter fal
3.8 configure password file
/ / because the default password is not known, you can delete or back up a password file
Cd / u01/app/oracle/product/11.2.0/db_1/dbs/
Mv orapworcl orapworcl.bak
Create a password file
Orapwd file=orapworcl password=jinhetech force=y
3.9 configure snooping
Cd/u01/app/oracle/product/11.2.0/db_1/network/admin/
Add to the listening file:
Vim listener.ora
=
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = / u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION=
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = compute02) (PORT = 1521))
)
)
ADR_BASE_LISTENER = / u01/app/oracle
=
Restart listening, restart database.
Verify:
Lsnrctl status
/ / configure remote monitoring and add the following content
Vim tnsnames.ora
=
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = compute02) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ORCLSTD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = controller) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclstd)
)
)
=
Verification
Tnsping compute02
3.10 setting parameter file
/ / generate a pfile that modifies the main library to prepare the library
Create pfile='/tmp/init.ora' from spfile
/ / generate your own pfile configuration file
Create pfile from spfile
/ / modify the configuration of the primary and secondary libraries respectively
/ / modify the following two file configurations to manually add red fields
Vim / u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora
Vim / tmp/init.ora
=
Orcl.__db_cache_size=7784628224
Orcl.__java_pool_size=268435456
Orcl.__large_pool_size=268435456
Orcl.__oracle_base='/u01/app/oracle'#ORACLE_BASE setfrom environment
Orcl.__pga_aggregate_target=11005853696
Orcl.__sga_target=16106127360
Orcl.__shared_io_pool_size=0
Orcl.__shared_pool_size=7516192768
Orcl.__streams_pool_size=0
* .audit_file_dest='/u01/app/oracle/admin/orcl/adump'
* .audit_trail='db'
* .compatible='11.2.0.0.0'
* .control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/flash_recovery_area/orcl/control02.ctl'
* .db_block_size=8192
* .db_domain=''
* .db_file_name_convert='/u01/app/oracle/oradata/orcl/','/u01/app/oracle/oradata/orcl/'
* .db_name='orcl'
* .db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
* .db_recovery_file_dest_size=4070572032
* .db_unique_name='ORCL'
* .diagnostic_dest='/u01/app/oracle'
* .dispatchers=' (PROTOCOL=TCP) (SERVICE=orclXDB)'
* .fal_client='ORCL'
* .fal_server='ORCLSTD'
* .log_archive_config='DG_CONFIG= (orcl,orclstd)'
* .log_archive_dest_1='LOCATION=/u01/app/oracle/archVALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl'
* .log_archive_dest_2='SERVICE=orclstd ASYNC LGWRVALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orclstd'
* .log_archive_format='arch_%r_%t_%s.arc'
* .log_file_name_convert='/u01/app/oracle/oradata/orcl/','/u01/app/oracle/oradata/orcl/'
* .memory_target=26902265856
* .open_cursors=300
* .processes=150
* .remote_login_passwordfile='EXCLUSIVE'
* .standby_file_management='AUTO'
* .undo_tablespace='UNDOTBS1'
* .log_archive_dest_state_1=enable
* .log_archive_dest_state_2=enable
=
3.11 create a control file
Alter database create standby controlfile as'/ tmp/controlstb.ctl'
3.12 transfer Fil
! Do it in order!
/ / transfer password file to slave library
Cd / u01/app/oracle/product/11.2.0/db_1/dbs/
Scp orapworcl oracle@172.16.0.1:/u01/app/oracle/product/11.2.0/db_1/dbs/
/ / copy the listening file to the standby database
Cd / u01/app/oracle/product/11.2.0/db_1/network/admin/
Scp listener.ora tnsnames.ora oracle@172.16.0.1:/u01/app/oracle/product/11.2.0/db_1/network/admin/
/ / copy the parameter file to the slave library
Scp / tmp/init.ora oracle@172.16.0.1:/u01/app/oracle/product/11.2.0/db_1/dbs/
/ / copy the data file to the standby database
Scp / u01 apprenticeship * oracle@172.16.0.1:/u01/app/oracle/oradata/orcl/
/ / copy the control file to the standby library
Scp / tmp/controlstb.ctloracle@172.16.0.1:/u01/app/oracle/oradata/orcl/control01.ctl
Scp / tmp/controlstb.ctl oracle@172.16.0.1:/u01/app/oracle/flash_recovery_area/orcl/control02.ctl
Chapter 4 prepare Library configuration 4.1 create required folders
/ / create the required folder in the repository
Mkdir-p/u01/app/oracle/oradata/orcl/
Mkdir-p/u01/app/oracle/arch/
Mkdir-p / u01/app/oracle/flash_recovery_area/orcl
Mkdir-p / u01/app/oracle/admin/orcl/adump
Mkdir-p / u01/app/oracle/admin/orcl/dpdump
Chown-R oracle:oinstall/u01/app
Chmod 6751/u01/app
4.2 modify the parameter file
Cd/u01/app/oracle/product/11.2.0/db_1/dbs/
Vim init.ora
/ / modify init.ora to the following:
=
* .db_unique_name='orclstd'
Fal_server='orcl'
Fal_client='orclstd'
Log_archive_dest_1='location=/u01/app/oracle/archVALID_FOR= (ONLINE_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orclstd'
Log_archive_dest_2='service=orcl valid_for= (online_logfiles,primary_role) db_unique_name=orcl'
=
4.3 configure snooping
Cd / u01/app/oracle/product/11.2.0/db_1/network/admin/
Vim listener.ora
=
SID_LIST_LISTENER=
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orclstd)
(ORACLE_HOME = / u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = orclstd)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = controller) (PORT = 1521))
)
)
=
/ / start monitoring
Lsnrctl start
/ / verify
Tnsping orcl
Tnsping orclstd
Chapter V Daily maintenance 5.1 Startup mode (start the standby library before starting the main library)
/ / prepare the library operation
Shut immediate
Startup nomountpfile='/u01/app/oracle/product/11.2.0/db_1/dbs/init.ora'
Alter databasemount standby database
Alter databaseopen read only
Select open_modefrom v$database
Alter databaserecover managed standby database using current logfile disconnect from session
Select open_modefrom v$database
Archive log list
/ / generate your own pfile configuration file
Create pfile from spfile
/ / main library operation
Shut immediate
Startup
/ / final listening status of the main database
/ / final listening status of slave database
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.