In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Configure local archiv
There are two ways of archiving configuration: one is online archiving configuration, when the database server is started, use SQL statements to complete dmarch.ini and ARCH_INI configuration; the other is to manually configure archiving, when the database server is not started, manually write the dmarch.ini file and set the parameter ARCH_INI. How to configure these two types of archives is described below.
Online configuration archiving
Use SQL statements to configure local archiving. The syntax is as follows:
ALTER DATABASE ARCHIVELOG
:: = 'DEST =, TYPE ='
:: = |
:: = LOCAL [, FILE_SIZE =] [, SPACE_LIMIT =]
:: = REMOTE [, FILE_SIZE =] [, SPACE_LIMIT =], INCOMING_PATH =
Use SQL statements to turn archive mode on and off.
The syntax is as follows:
ALTER DATABASE ARCHIVELOG | NOARCHIVELOG
In archive mode, deleting a local archive is not allowed.
For example, the online archiving configuration for the RAC environment is as follows:
1) modify the database to MOUNT state.
Node 1:
SQL > alter database mount;executed successfullyused time: 01.852. Execute id is 0.
Node 2:
SQL > alter database mount;executed successfullyused time: 01.853. Execute id is 0.
2) configure local archiving.
Node 1:
SQL > alter database add archivelog 'dest=/dm7/data/local_arch,type=local,file_size=256,space_limit=0';executed successfullyused time: 3.110 (ms). Execute id is 0.
Node 2:
SQL > alter database add archivelog 'dest=/dm7/data/local_arch,type=local,file_size=256,space_limit=0';executed successfullyused time: 3.171 (ms). Execute id is 0.
3) enable archiving mode.
Node 1:
SQL > alter database archivelog;executed successfullyused time: 11.986 (ms). Execute id is 0.
Node 2:
SQL > alter database archivelog;executed successfullyused time: 11.780 (ms). Execute id is 0.
4) modify the database to OPEN state.
Node 1:
SQL > alter database open;executed successfullyused time: 01.466. Execute id is 0.
Node 2:
SQL > alter database open;executed successfullyused time: 711.999 (ms). Execute id is 0.
5) View the archive configuration file dmarch.ini
Node 1:
[dmdba@dmrac1 rac0_config] $pwd/dm7/data/rac0_ config[ dmdba @ dmrac1 rac0_config] $cat dmarch.ini#DaMeng Database Archive Configuration file#this is comments ARCH_WAIT_APPLY = 1-performance mode. Value range: 0: high performance mode, 1: data consistency mode. The value of local archive is null [archive _ LOCAL1] ARCH_TYPE = LOCAL ARCH_DEST = / dm7/data/local_arch ARCH_FILE_SIZE = 256 ARCH_SPACE_LIMIT = 0
Node 2:
[dmdba@dmrac2 rac1_config] $pwd/dm7/data/rac1_ config[ dmdba @ dmrac2 rac1_config] $cat dmarch.ini#DaMeng Database Archive Configuration file#this is comments ARCH_WAIT_APPLY = 1-performance mode. Value range: 0: high performance mode, 1: data consistency mode. The value of local archive is null [archive _ LOCAL1] ARCH_TYPE = LOCAL ARCH_DEST = / dm7/data/local_arch ARCH_FILE_SIZE = 256 ARCH_SPACE_LIMIT = 0
6) check whether the ARCH_INI parameter is 1
Node 1:
SQL > select * from v$dm_ini where para_name='ARCH_INI' LINEID PARA_NAME PARA_VALUE MIN_VALUE MAX_VALUE MPP_CHK SESS_VALUE FILE_VALUE DESCRIPTION PARA_TYPE -- 1 ARCH_INI 1 01 N 1 1 dmarch.ini SYSused time: 30.251 (ms). Execute id is 5.
Node 2:
SQL > select * from v$dm_ini where para_name='ARCH_INI' LINEID PARA_NAME PARA_VALUE MIN_VALUE MAX_VALUE MPP_CHK SESS_VALUE FILE_VALUE DESCRIPTION PARA_TYPE -- 1 ARCH_INI 1 01 N 1 1 dmarch.ini SYSused time: 29.498 (ms). Execute id is 13.
Disable archiving
1 modify the database to MOUNT state.
Node 1:
SQL > alter database mount;executed successfullyused time: 01.858. Execute id is 0.
Node 2:
SQL > alter database mount;executed successfullyused time: 01.858. Execute id is 0.
two。 Disable archiving
Node 1:
SQL > alter database noarchivelog;executed successfullyused time: 42.916 (ms). Execute id is 0.
Node 2:
SQL > alter database noarchivelog;executed successfullyused time: 42.533 (ms). Execute id is 0.
3. Delete configured local archive settings
Node 1:
SQL > alter database delete archivelog 'dest=/dm7/data/local_arch,type=local,file_size=256,space_limit=0';executed successfullyused time: 0.931 (ms). Execute id is 0.
Node 2:
SQL > alter database delete archivelog 'dest=/dm7/data/local_arch,type=local,file_size=256,space_limit=0';executed successfullyused time: 0.952 (ms). Execute id is 0.
4. Delete previously generated archive log files (optional)
Node 1:
SQL > sf_archivelog_delete_before_time (sysdate+1); DMSQL executed successfullyused time: 2.907 (ms). Execute id is 7.
Node 2:
SQL > sf_archivelog_delete_before_time (sysdate+1); DMSQL executed successfullyused time: 3.542 (ms). Execute id is 16.
5. Open the database
Node 1:
SQL > alter database open;executed successfullyused time: 01.609. Execute id is 0.
Node 2:
SQL > alter database open;executed successfullyused time: 02.304. Execute id is 0.
6. Check whether the contents of the archived configuration file dmarch.ini have been deleted
Node 1:
[dmdba@dmrac1 rac0_config] $cat dmarch.ini#DaMeng Database Archive Configuration file#this is comments ARCH_WAIT_APPLY = 1-performance mode, whether to wait for the replay to be completed. Value: 0: high performance mode, 1: data consistent mode. Local archive value NULL
Node 2:
[dmdba@dmrac2 rac1_config] $cat dmarch.ini#DaMeng Database Archive Configuration file#this is comments ARCH_WAIT_APPLY = 1-performance mode, whether to wait for the replay to be completed. Value: 0: high performance mode, 1: data consistent mode. Local archive value NULL
7. Check whether the ARCH_INI parameter is 0
Node 1:
SQL > select * from v$dm_ini where para_name='ARCH_INI' LINEID PARA_NAME PARA_VALUE MIN_VALUE MAX_VALUE MPP_CHK SESS_VALUE FILE_VALUE DESCRIPTION PARA_TYPE -- 1 ARCH_INI 0 01 N 00 dmarch.ini SYSused time: 7.086 (ms). Execute id is 8.
Node 2:
SQL > select * from v$dm_ini where para_name='ARCH_INI' LINEID PARA_NAME PARA_VALUE MIN_VALUE MAX_VALUE MPP_CHK SESS_VALUE FILE_VALUE DESCRIPTION PARA_TYPE -- 1 ARCH_INI 0 01 N 00 dmarch.ini SYSused time: 14.366 (ms). Execute id is 18.
Examples of manual configuration archives are as follows:
1) manually edit the dmarch.ini file and save it in the same directory as dm.ini. The dmarch.ini file is as follows:
[ARCHIVE_LOCAL1] ARCH_TYPE = LOCALARCH_DEST = / dm7/data/local_archARCH_FILE_SIZE = 256ARCH_SPACE_LIMIT = 0
2) Edit the dm.ini file, set the parameter ARCH_INI=1, and save.
3) start the server, which is already running in archive mode.
Multiplex archiving, which refers to the configuration of multiple local archives. The first archive of the configuration is called the first archive, followed by the second and the third.
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.