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 > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about the common operations of Oracle11g RAC maintenance and management, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
1. View the resource status (nodeapps node application, ASM instance, database instance, etc.):
[root@rac01 U01] # su-grid
[grid@rac01 ~] $crs_stat-t (command compatible with 10g)
Name Type Target State Host
Ora....ER.lsnr ora....er.type ONLINE ONLINE rac01
Ora....N1.lsnr ora....er.type ONLINE ONLINE rac01
Ora....VOTE.dg ora....up.type ONLINE ONLINE rac01
Ora.ORADATA.dg ora....up.type ONLINE ONLINE rac01
Ora....LASH.dg ora....up.type ONLINE ONLINE rac01
Ora.asm ora.asm.type ONLINE ONLINE rac01
Ora.eons ora.eons.type ONLINE ONLINE rac01
Ora.gsd ora.gsd.type OFFLINE OFFLINE
Ora....network ora....rk.type ONLINE ONLINE rac01
Ora.oc4j ora.oc4j.type OFFLINE OFFLINE
Ora.ons ora.ons.type ONLINE ONLINE rac01
Ora....SM1.asm application ONLINE ONLINE rac01
Ora....01.lsnr application ONLINE ONLINE rac01
Ora.rac01.gsd application OFFLINE OFFLINE
Ora.rac01.ons application ONLINE ONLINE rac01
Ora.rac01.vip ora....t1.type ONLINE ONLINE rac01
Ora....SM2.asm application ONLINE ONLINE rac02
Ora....02.lsnr application ONLINE ONLINE rac02
Ora.rac02.gsd application OFFLINE OFFLINE
Ora.rac02.ons application ONLINE ONLINE rac02
Ora.rac02.vip ora....t1.type ONLINE ONLINE rac02
Ora.racdb.db ora....se.type ONLINE ONLINE rac01
Ora....ry.acfs ora....fs.type ONLINE ONLINE rac01
Ora.scan1.vip ora....ip.type ONLINE ONLINE rac01
In 11g R2, the default oc4j and gsd resources are disable; oc4j is one for WLM
Resource, WLM is not available until 11.2.0.2; gsd is one of the things that CRS uses to communicate with 9i RAC
Modules are reserved for backward compatibility and do not affect performance. It is recommended that you do not delete or try to open them.
Open them and ignore them.
11g RAC is commonly used with the following command: crsctl stat resource-t.
[root@rac01 U01] # su-grid
[grid@rac01] $crsctl stat resource-t
If it is not followed by-t, then you can see the relatively detailed resource information.
[grid@rac01 ~] $crsctl stat resource
two。 Common on / off commands
Note that 11g RAC is relatively slow to start resources (even if the resources shown after the command are start succeeded
Check through crs_stat-t may not be online), please pay attention to observe the crs log changes after the command operation, so as to avoid
It is suspected that there is an abnormal start-up and repeated action is taken before it is opened.
The following commands are for reference:
Stop the Oracle Clusterware system on the local server:
[root@rac01 ~] # / u01/grid/11.2.0/bin/crsctl stop cluster
Note: after running the "crsctl stop cluster" command, if Oracle Clusterware manages
If any one of the resources is still running, the entire command fails. Stop all resources unconditionally using the-f option
And stop the Oracle Clusterware system.
[root@rac02] # / u01/grid/11.2.0/bin/crsctl stop cluster-all
Stop the clusterware system on all nodes.
Start the oralce clusterware system on the local server:
[root@rac01 ~] # / u01/grid/11.2.0/bin/crsctl start cluster
Note: you can start the Oracle Clusterware system on all servers in the cluster by specifying the-all option.
[root@rac02] # / u01/grid/11.2.0/bin/crsctl start cluster-all
You can also start the Oracle Clusterware system on one or more specified servers in the cluster by listing the servers (separated by spaces)
Tong:
[root@rac01] # / u01/grid/11.2.0/bin/crsctl start cluster-n rac01 rac02
Start / stop all instances using SRVCTL:
[oracle@rac01] # srvctl stop database-d racdb
[oracle@rac01] # srvctl start database-d racdb
Reference order
Shutdown sequence: first shut down the Oracle instance (or database), then shut down the ASM instance, and finally close the node application
Programs (virtual IP, GSD, TNS listeners and ONS).
Manual boot sequence: start node applications (virtual IP, GSD, TNS listeners, and ONS) first. When successful
After starting the node application, start the ASM instance. Finally, start the Oracle instance (related services) and
Enterprise Manager database console.
Example:
Close:
Turn off the clusterware of all nodes on Node 1 (use-f if there are resources that cannot be closed).
[root@rac01 bin] # / u01/grid/11.2.0/bin/crsctl stop cluster-all
We will check after all nodes 1 and 2 are closed.
[grid@rac02 rac02] $crsctl stat resource-t
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.
Enable:
[root@rac01 bin] # / u01/grid/11.2.0/bin/crsctl start cluster-all
Generally speaking, it is enough to open the above command, but if an exception is found, such as db, etc., it is very long.
There is no onine in time, and we can also open the database manually (executed by any node):
[root@rac02] # / u01/grid/11.2.0/bin/srvctl start database-d racdb
Note:
If necessary, you can also open one instance at a time.
[root@rac02] # / u01/grid/11.2.0/bin/srvctl start instance-d racdb-I racdb1
[root@rac02] # / u01/grid/11.2.0/bin/srvctl start instance-d racdb-I racdb2
3. It is commonly used to establish tablespaces and add data files.
Reference: http://space.itpub.net/?uid-7607759-action-viewspace-itemid-670722
[root@rac01 bin] # su-oracle
[oracle@rac01 ~] $sqlplus / as sysdba
SQL > create tablespace test datafile'+ oradata/racdb/datafile/test01.dbf' size 50m
Tablespace created.
[root@rac02 ~] # su-grid
[grid@rac02 ~] $asmcmd
ASMCMD >
ASMCMD > pwd
+ oradata/racdb/datafile
ASMCMD >
ASMCMD > ls
SYSAUX.261.739387301
SYSTEM.260.739387283
TEST.340.740166807
UNDOTBS1.262.739387315
UNDOTBS2.264.739387351
USERS.265.739387361
Test01.dbf
SQL > alter tablespace test add datafile'+ oradata/racdb/datafile/test02.dbf' size 50m
Tablespace altered.
SQL >
ASMCMD > ls
SYSAUX.261.739387301
SYSTEM.260.739387283
TEST.340.740166807
TEST.341.740166937
UNDOTBS1.262.739387315
UNDOTBS2.264.739387351
USERS.265.739387361
Test01.dbf
Test02.dbf
ASMCMD >
ASMCMD > ls-al
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE JAN 11 17:00:00 Y none = > SYSAUX.261.739387301
DATAFILE UNPROT COARSE JAN 11 17:00:00 Y none = > SYSTEM.260.739387283
DATAFILE UNPROT COARSE JAN 11 17:00:00 Y + ORADATA/RACDB/DATAFILE/test01.dbf = >
TEST.340.740166807
DATAFILE UNPROT COARSE JAN 11 17:00:00 Y + ORADATA/RACDB/DATAFILE/test02.dbf = >
TEST.341.740166937
DATAFILE UNPROT COARSE JAN 11 17:00:00 Y none = > UNDOTBS1.262.739387315
DATAFILE UNPROT COARSE JAN 11 17:00:00 Y none = > UNDOTBS2.264.739387351
DATAFILE UNPROT COARSE JAN 11 17:00:00 Y none = > USERS.265.739387361
N test01.dbf = >
+ ORADATA/RACDB/DATAFILE/TEST.340.740166807
N test02.dbf = >
+ ORADATA/RACDB/DATAFILE/TEST.341.740166937
ASMCMD >
4. View the ASM instance and the user database instance (note that they are grid and oracle users respectively):
View the ASM instance (log in as grid user, and you can see the instance_name=+ASM1 by viewing the initial parameters):
[grid@rac01 ~] $id
Uid=501 (grid) gid=501 (oinstall) groups=501 (oinstall), 504,506 (asmdba), 507 (asmoper)
[grid@rac01 ~] $sqlplus "/ as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 4 00:58:52 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Real Application Clusters and Automatic Storage Management options
SQL > show parameter
NAME TYPE VALUE
-
Asm_diskgroups string ORADATA, ORAFLASH
Asm_diskstring string
Asm_power_limit integer 1
Asm_preferred_read_failure_groups string
Audit_file_dest string / u01/grid/11.2.0/rdbms/audit
.
View the user database instance (log in as oracle user, view instance_name=racdb2, obviously user instance):
[root@rac02 U01] # su-oracle
[oracle@rac02 ~] $
[oracle@rac02 ~] $sqlplus "/ as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jan 4 01:01:04 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP
Data Mining and Real Application Testing options
SQL > show parameter
NAME TYPE VALUE
-
O7_DICTIONARY_ACCESSIBILITY boolean FALSE
Active_instance_count integer
Aq_tm_processes integer 0
Archive_lag_target integer 0
Asm_diskgroups string
Asm_diskstring string
Asm_power_limit integer 1
.
5. View the alert log and trace of 11g database instance:
[oracle@rac01 trace] $pwd
/ u01/product/oracle/diag/rdbms/racdb/racdb1/trace
[oracle@rac01 trace] $
[oracle@rac01 trace] $vi alert_racdb1.log
6. View the log of 11g RAC Clusterware:
[root@rac01 sbin] # su-grid
[grid@rac01 ~] $
[grid@rac01 rac01] $pwd
/ u01/grid/11.2.0/log/rac01
[grid@rac01 trace] $pwd
/ u01/grid/11.2.0/log/diag/tnslsnr/rac01/listener_scan1/trace
[grid@rac01 trace] $ls
Listener_scan1.log
[grid@rac01 rac01] $pwd
/ u01/grid/11.2.0/log/rac01
[grid@rac01 rac01] $ls
Admin/ alertrac01.log crsd/ ctssd/ evmd/ gnsd/ mdnsd/ racg/
Agent/ client/ cssd/ diskmon/ gipcd/ gpnpd/ ohasd/ srvm/
7. Common cluster commands
[grid@rac02] $crs_stat-t
Check whether Oracle Clusterware is online
[grid@rac02 ~] $crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
Check if cssd (Cluster Synchronization Services) is online
[grid@rac02 ~] $crsctl check cssd
CRS-272: This command remains for backward compatibility only
Cluster Synchronization Services is online
Check if crsd (Cluster Ready Services) is online
[grid@rac02 ~] $crsctl check crsd
CRS-272: This command remains for backward compatibility only
Cluster Ready Services is online
Check if evmd (Event Mananger) is online
[grid@rac02 ~] $crsctl check evmd
CRS-272: This command remains for backward compatibility only
Event Manager is online
Check the survival of CSS between nodes
[grid@rac02] $crsctl check cluster-n rac01
* * *
Rac01:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
* * *
[grid@rac02] $crsctl check cluster-n rac02
* * *
Rac02:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
* * *
Open the database
[grid@rac02] $srvctl start database-d racdb
Enable oc4j:
[grid@rac02] $. / srvctl enable oc4j
[grid@rac02] $. / srvctl start oc4j
[grid@rac02] $. / crs_stat-t
8. Vote disk management
[grid@rac01 ~] $ocrcheck
Status of Oracle Cluster Registry is as follows:
Version: 3
Total space (kbytes): 262120
Used space (kbytes): 2720
Available space (kbytes): 259400
ID: 132900461
Device/File Name: + OCR_VOTE
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
In Oracle11g R2, you don't have to back up voting disk, and when any configuration changes, voting disk
The data is automatically backed up in OCR and automatically restored to any joined voting disk. You can see it from below.
To OCR and VotingDisk is a file.
[grid@rac01 ~] $crsctl query css votedisk
# # STATE File Universal Id File Name Disk group
1. ONLINE 095112005ec24f57bf98f6148818cc53 (ORCL:OCR_VOTE01) [OCR_VOTE]
Located 1 voting disk (s).
[grid@rac01 ~] $
[grid@rac01 ~] $asmcmd
ASMCMD > ls
OCR_VOTE/
ORADATA/
ORAFLASH/
ASMCMD > cd ocr_vote
ASMCMD > cd rac
ASMCMD > ls
ASMPARAMETERFILE/
OCRFILE/
ASMCMD > cd ocrfile
ASMCMD > ls
REGISTRY.255.739337635
OCR management
[grid@rac01 ~] $crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.2.0.1.0]
[grid@rac01 ~] $ocrcheck
Status of Oracle Cluster Registry is as follows:
Version: 3
Total space (kbytes): 262120
Used space (kbytes): 2720
Available space (kbytes): 259400
ID: 132900461
Device/File Name: + OCR_VOTE
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
Use the following command (root login) to replace the current OCR Location with destination_file or + ASM_disk_group:
# ocrconfig-replace current_OCR_location-replacement new_OCR_location
If there is only one OCR Location, use the following command:
# ocrconfig-add + new_storage_disk_group
# ocrconfig-delete + current_disk_group
Run the following command to display the backup:
[grid@rac01 ~] $ocrconfig-showbackup
Rac01 2011-01-08 17:54:51 / u01/grid/11.2.0/cdata/rac/backup00.ocr
Rac01 2011-01-08 13:54:49 / u01/grid/11.2.0/cdata/rac/backup01.ocr
Rac02 2011-01-08 06:34:46 / u01/grid/11.2.0/cdata/rac/backup02.ocr
Rac01 2011-01-07 02:15:37 / u01/grid/11.2.0/cdata/rac/day.ocr
Rac01 2011-01-02 07:51:43 / u01/grid/11.2.0/cdata/rac/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available
When Oracle Clusterware is up, run the ocrconfig-manualbackup command on a node
[grid@rac01 ~] $ocrconfig-manualbackup
Generate backup file backup_20100112_141900.ocr under / u01/grid/11.2.0/cdata/rac/day.ocr
Then use $ocrconfig-showbackup to view the backup information.
Run the following command to verify the contents and integrity of the backup file.
$ocrdump-backupfile backup_file_name
The above are the common operations of Oracle11g RAC maintenance and management, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.