In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Premise: after installing ASM in Linux system, both ASM and Oracle databases are used normally, but the Oracle-related commands are not recognized after restarting the server.
1 、
[grid@udevasm:/home/grid] $crsctl status res-t-bash: crsctl: command not found
2. To check whether the environment variable is normal, the command is as follows:
[grid@udevasm:/home/grid] $env | grep griUSER=gridORACLE_BASE=/oracle/app/gridMAIL=/var/spool/mail/gridPATH=.:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/grid/bin:/home/grid/bin:/oracle/app/11.2.0/grid/binPWD=/home/gridPS1= [grid@udevasm:$PWD] $HOME=/home/gridLOGNAME=gridORACLE_HOME= / oracle/app/11.2.0/grid [grid@udevasm:/home/grid] $
3. Initially determine that the environment variables are normal through the query results, and then consider whether there is a problem with the installation of the Oracle program itself, because the ASM and Oracle databases were installed yesterday, and the test is normal. It should be said that there is no problem, but suddenly remember that when the server is restarted, the startup interface prompts you to load the file system for a long time. The screenshot is as follows:
4. Through the message prompted at startup, that is, check whether there is a problem with the file system, remember that the hard disk was mounted in a different path, and the command is as follows:
[oracle@udevasm] $df-lhFilesystem Size Used Avail Use% Mounted on/dev/sda1 95G 4.5G 86G 5% / tmpfs 996M 72K 996m 1% / dev/shm/dev/sdb1 50G 8.3G 39G 18% / oradata/dev/sdb2 20G 7.4G 12G 40% / soft
5. Through the query results of the above command, we found the problem, because sdb1 I adjusted and mounted under the / oracle path, the original sdc1 is mounted / oradata path, because sdc1mount is not set to start at boot time under the / oradata path, and sdb1 is the default startup, resulting in the mount failure in the startup sdc1, affecting the startup of Oracle-related programs, so the command failure can not be found, to check the fstab content.
[root@udevasm ~] # more / etc/fstab# # / etc/fstab# Created by anaconda on Fri May 19 04:21:30 2017 September # Accessible filesystems, by reference, are maintained under'/ dev/disk'# See man pages fstab (5), findfs (8) Mount (8) and/or blkid (8) for more info#UUID=a6cc0566-d29b-44fa-8741-b78170483210 / ext4 defaults 1 1UUID=8a211faf-b2d7-4384-9c9d-fc25cb79f19b / oradata ext4 defaults 1 2UUID=08d48193-8c4e-40e9-a333-47fe86568029 / soft ext4 defaults 1 2UUID=6e9b041a-1687-430f-9209-c06b6558e6fe swap swap defaults 0 0tmpfs / dev/shm tmpfs defaults 0 0devpts / dev/pts devpts gid=5 Mode=620 0 0sysfs / sys sysfs defaults 0 0proc / proc proc defaults 0 0
6. After checking through the command, no devices under the oracle path are found, and then query which devices are under the UUID block device.
[root@udevasm ~] # sudo blkid
/ dev/sda1: UUID= "a6cc0566-d29b-44fa-8741-b78170483210" TYPE= "ext4"
Dev/sda2: UUID= "6e9b041a-1687-430f-9209-c06b6558e6fe" TYPE= "swap"
Dev/sdb1: UUID= "8a211faf-b2d7-4384-9c9d-fc25cb79f19b" TYPE= "ext4"
/ dev/sdb2: UUID= "08d48193-8c4e-40e9-a333-47fe86568029" TYPE= "ext4"
/ dev/sdc1: UUID= "07af4d45-14d3-4a8f-89ae-53a276f7c01e" TYPE= "ext4"
/ dev/asm_grid1: TYPE= "oracleasm"
/ dev/asm_system: TYPE= "oracleasm"
/ dev/asm_recovery: TYPE= "oracleasm"
/ dev/asm_data01: TYPE= "oracleasm"
/ dev/asm_data02: TYPE= "oracleasm"
[root@udevasm ~] # more / etc/fstab
7. Use the lsblk-f command to query the detailed information under the block device as follows:
[root@udevasm ~] # lsblk-fNAME FSTYPE LABEL UUID MOUNTPOINTsda ├─ sda1 ext4 a6cc0566-d29b-44fa-8741-b78170483210 / └─ sda2 swap 6e9b041a -1687-430f-9209-c06b6558e6fe [SWAP] sdb ├─ sdb1 ext4 8a211faf-b2d7-4384-9c9d-fc25cb79f19b / oradata └─ sdb2 ext4 08d48193-8c4e-40e9-a333-47fe86568029 / softsdd └─ sdd1 sde └─ sde1 Sdf └─ sdf1 sdg └─ sdg1 sdh └─ sdh2 sr0 iso9660 RHEL_6.5 x86_64 Disc 1
From the above commands, it can be concluded that the sdc1 program cannot be started because the Oracle partition is not automatically mounted.
8. Modify the / etc/fstab configuration file to allow the sdc1 device to start automatically when it is booted. It is best to mount it through UUID, because:
The function and significance of Linux UUID
Reason 1: it's the only real marker.
UUID provides a unique identification string for storage devices in the system, regardless of the type of device. If you add a new storage device such as a hard disk to your system, it is likely to cause some problems, such as failure to boot because you can't find the device, but there will be no such problem with UUID.
Reason 2: device names are not always the same
Automatically assigned device names are not always consistent, and they depend on the order in which the kernel loads modules at startup. If you start the system when you insert the USB disk and unplug it the next time you boot, it may lead to inconsistent device name assignments.
Using UUID is also very good for mounting mobile devices ── for example, I have a 24-in-one card reader that supports a variety of cards, while using UUID can always mount the same card in the same place.
Many of the key features in reason 3:Ubuntu are now dependent on UUID
9. In steps 6 and 7, you can modify the relevant content to the desired content of the previous configuration, as follows:
[root@udevasm ~] # more / etc/fstab# # / etc/fstab# Created by anaconda on Fri May 19 04:21:30 2017 September # Accessible filesystems, by reference, are maintained under'/ dev/disk'# See man pages fstab (5), findfs (8) Mount (8) and/or blkid (8) for more info#UUID=a6cc0566-d29b-44fa-8741-b78170483210 / ext4 defaults 1 1UUID=8a211faf-b2d7-4384-9c9d-fc25cb79f19b / oracle ext4 defaults 0 0UUID=07af4d45-14d3-4a8f-89ae-53a276f7c01e / oradata ext4 defaults 0 0UUID=08d48193-8c4e-40e9-a333-47fe86568029 / soft ext4 defaults 0 0UUID=6e9b041a-1687-430f-9209-c06b6558e6fe swap swap defaults 0 0tmpfs / dev/shm tmpfs defaults 0 0devpts / dev/pts devpts gid=5 Mode=620 0 0sysfs / sys sysfs defaults 0 0proc / proc proc defaults 0 0
Note: the following number is changed to 0 0. If 0 is not set, the server will detect when it starts. If the hard disk is full, it will cause the operating system not to start normally. Here, the system should disable detection.
10. Note: mount again to determine whether the mount is successful. If there is a mount problem, the system will not be able to start normally.
[root@udevasm ~] # mount/dev/sda1 on / type ext4 (rw) proc on / proc type proc (rw) sysfs on / sys type sysfs (rw) devpts on / dev/pts type devpts (rw,gid=5,mode=620) tmpfs on / dev/shm type tmpfs (rw) / dev/sdb2 on / soft type ext4 (rw) none on / proc/sys/fs/binfmt_misc type binfmt_misc (rw) / dev/sdc1 on / oradata type ext4 (rw) / dev/sdb1 on / oracle type ext4 (rw)
11. Restart the server to determine whether the device is mounted successfully
[root@udevasm ~] # reboot
When rebooting, the server system starts quickly, so there is no previous prompt to load the file system content.
12. After the system starts successfully, use grid users to check the ASM status:
[grid@udevasm:/home/grid] $crs_stat-tName Type Target State Host-ora....TA01.dg ora....up.type ONLINE ONLINE udevasm ora .... TA02.dg ora....up.type ONLINE ONLINE udevasm ora....VERY.dg ora....up.type ONLINE ONLINE udevasm ora....STEM.dg ora....up.type ONLINE ONLINE udevasm ora.GRID1.dg ora....up.type ONLINE ONLINE udevasm ora....ER.lsnr ora....er.type ONLINE ONLINE udevasm ora.asm ora. Asm.type ONLINE ONLINE udevasm ora.cssd ora.cssd.type ONLINE ONLINE udevasm ora.diskmon ora....on.type OFFLINE OFFLINE ora.evmd ora.evm.type ONLINE ONLINE udevasm ora.ons ora.ons.type OFFLINE OFFLINE ora.udevasm.db ora....se.type OFFLINE OFFLINE
13. This indicates that the hard disk is set to restart automatically, and then use the lsblk-f command to query the detailed information under the block device as follows
[root@udevasm ~] # lsblk-fNAME FSTYPE LABEL UUID MOUNTPOINTsda ├─ sda1 ext4 a6cc0566-d29b-44fa-8741-b78170483210 / └─ sda2 swap 6e9b041a -1687-430f-9209-c06b6558e6fe [SWAP] sdb ├─ sdb1 ext4 8a211faf-b2d7-4384-9c9d-fc25cb79f19b / oracle └─ sdb2 ext4 08d48193-8c4e-40e9-a333-47fe86568029 / softsdc └─ sdc1 ext4 07af4d45-14d3-4a8f-89ae-53a276f7c01e / oradatasdd └─ sdd1 Sde └─ sde1 sdf └─ sdf1 Sdg └─ sdg1 sdh └─ sdh2 sr0 iso9660 RHEL_6.5 x86_64 Disc 1
From the above instructions, we can judge that we are set to start automatically.
Summary: 1. When you find that the command cannot be used, you should first find the problem from the cause that may lead to the command. If you first judge that there is no problem, then judge the problems in other aspects.
2. The system will give us some detailed startup parameters when it starts, and if there is a problem, it will be printed in detail. It is best to take a look at the log content of the system startup.
3. When using mount devices, you must let the system mount itself, which can avoid some program problems. At the same time, when using UUID, you should also pay attention to prevent the system from starting up normally.
Detailed instructions on fstab configuration files in linux systems
Reference: http://xiaocao13140.blog.51cto.com/6198256/1930572
About the acquisition of UUID in Linux disk Partition and the function of UUID
Reference: http://xiaocao13140.blog.51cto.com/6198256/1930571
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.