In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
It is believed that many inexperienced people are at a loss about how to solve the problem of ocssd process. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Problem resolution for the ocssd process:
Yesterday, a user of the database proposed to write some logs every 5 seconds in the / var/log/messages file on the database server:
Feb 27 08:11:44 bj su (pam_unix) [7692]: session opened for user oracle by (uid=0)
Feb 27 08:11:44 bj su (pam_unix) [7692]: session closed for user oracle
Feb 27 08:11:44 bj logger: Failure in CSS initialization opening OCR.
Feb 27 08:11:49 bj su (pam_unix) [7731]: session opened for user oracle by (uid=0)
Feb 27 08:11:49 bj su (pam_unix) [7731]: session closed for user oracle
Feb 27 08:11:49 bj logger: Failure in CSS initialization opening OCR.
I checked another 10g database server, the same file:
Feb 28 10:02:27 bj sshd (pam_unix) [5985]: session opened for user lisa by (uid=502)
Feb 28 10:06:40 bj sshd (pam_unix) [5985]: session closed for user lisa
Feb 28 15:31:17 bj sshd (pam_unix) [6115]: session opened for user lisa by (uid=502)
Feb 28 15:32:09 bj sshd (pam_unix) [6115]: session closed for user lisa
Mar 1 10:19:54 bj sshd (pam_unix) [15042]: session opened for user lisa by (uid=502)
Mar 1 10:54:29 bj su (pam_unix) [15086]: session opened for user root by lisa (uid=502)
Mar 1 10:54:33 bj su (pam_unix) [15119]: session opened for user oracle by lisa (uid=0)
Mar 1 12:12:30 bj su (pam_unix) [15189]: session opened for user root by lisa (uid=501)
Record some user login information, as well as user su information, where the previous code is the process's ID, followed by the user's ID.
Look at the bdump directory and udump directory of the database server in question, as well as the alert.log file, and no exception records are found.
View the system process:
[oracle@db1 udump] $ps-ef | grep css
Root 5716 1 0 Jan11? 00:00:00 / bin/sh / etc/init.d/init.cssd run
Root 5721 5716 0 Jan11? 00:13:17 / bin/sh / etc/init.d/init.cssd startcheck
Oracle 17210 5844 0 14:02 pts/2 00:00:00 grep css
System processes on the correct database server:
[root@bj log] # ps-ef | grep css
Root 4669 10 2004? 00:00:00 / bin/su oracle-c exec / home/oracle/product/10.1.0/db_1/bin/ocssd
Oracle 4771 4669 0 2004? 00:25:53 / home/oracle/product/10.1.0/db_1/bin/ocssd.bin
Root 15278 15225 0 14:05 pts/0 00:00:00 grep css
Then I checked / etc/init.d/init.cssd and got nothing. It was too long. I didn't read it carefully.
Take a look at the css section of oracle's documentation:
Oracle Cluster Synchronization Services (CSS) is a daemon process that is configured by the root.sh script when you install Oracle Database 10g for the first time. It is configured to start every time the system boots. This daemon process is required to enable synchronization between Oracle ASM and database instances. It must be running if an Oracle database is using ASM for database file storage.
CSS is a background process, installed by default during installation, automatically started when the system starts, and is used to synchronize ASM and database instances. If you use ASM, you must use this process.
First half of the worry, because the current database does not use ASM, really can not stop it.
Then take a look at the Reconfiguring Oracle Cluster Synchronization Services section of the oracle document, and the excerpt is as follows:
1 、 Identifying Oracle Database 10g Oracle Homes
To identify all of the Oracle Database 10g Oracle home directories, enter one of the following commands:
$more / etc/oratab
This is the result on my server.
[root@bj log] # more / etc/oratab
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon,':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign,'#, are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should, "Y", or should not
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
# *: / home/oracle/product/10.1.0/db_1:N
$ORACLE_SID:/home/oracle/product/10.1.0/db_1:N
*: / home/oracle/product/10.1.0/db_1:N
$ORACLE_SID:/home/oracle/product/10.1.0/db_1:N
From the output, identify any Oracle home directories where Oracle Database 10g is installed. Oracle homes that contain Oracle Database 10g typically have paths similar to the following. However, they might use different paths.
/ mount_point/app/oracle/product/10.1.0/db_n
If there is only one Oracle home directory that contains Oracle Database 10g, see the "Deleting the Oracle CSS Daemon Configuration" section for information about deleting the Oracle CSS daemon configuration.
If you identify more than one Oracle Database 10g Oracle home directory, see the following section for information about reconfiguring the Oracle CSS daemon.
2 、 Reconfiguring the Oracle CSS Daemon
To reconfigure the Oracle CSS daemon so that it runs from an Oracle home that you are not removing, follow these steps:
In all Oracle home directories on the system, stop all Oracle ASM instances and any Oracle Database instances that use ASM for database file storage.
Switch user to root.
Depending on your operating system, enter one of the following commands to identify the Oracle home directory being used to run the CSS daemon:
# more / etc/oracle/ocr.loc
The output from this command is similar to the following:
Ocrconfig_loc=/u01/app/oracle/product/10.1.0/db_1/cdata/localhost/local.ocr
Local_only=TRUE
This is the result on my server.
[root@bj log] # more / etc/oracle/ocr.loc
Ocrconfig_loc=/home/oracle/product/10.1.0/db_1/cdata/localhost/local.ocr
Local_only=TRUE
The ocrconfig_loc parameter specifies the location of the Oracle Cluster Registry (OCR) used by the CSS daemon. The path up to the cdata directory is the Oracle home directory where the CSS daemon is running (/ Volumes/u01/app/oracle/product/10.1.0/db_1 in this example).
Note:
If the value for the local_only parameter is FALSE, Oracle CRS is installed on this system. See the Oracle Real Application Clusters Installation and Configuration Guide for information about removing RAC or CRS.
If this Oracle home directory is not the Oracle home that you want to remove, you can continue to the "Removing Oracle Software" section.
Change directory to the Oracle home directory for an Oracle Database 10g installation that you are not removing.
Set the ORACLE_HOME environment variable to specify the path to this Oracle home directory:
Bourne, Bash, or Korn shell:
# ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_2
# export ORACLE_HOME
C shell:
# setenv ORACLE_HOME / u01/app/oracle/product/10.1.0/db_2
Enter the following command to reconfigure the CSS daemon to run from this Oracle home:
# $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME
The script stops the Oracle CSS daemon, reconfigures it in the new Oracle home, and then restarts it. When the system boots, the CSS daemon starts automatically from the new Oracle home.
To remove the original Oracle home directory, see the "Removing Oracle Software" section.
3 、 Deleting the Oracle CSS Daemon Configuration
To delete the Oracle CSS daemon configuration, follow these steps:
Note:
Delete the CSS daemon configuration only if you are certain that no other Oracle Database 10g installation requires it.
Remove any databases or ASM instances associated with this Oracle home. See the preceding sections for information about how to complete these tasks.
Switch user to root.
Change directory to the Oracle home directory that you are removing.
Set the ORACLE_HOME environment variable to specify the path to this Oracle home directory:
Bourne, Bash, or Korn shell:
# ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1
# export ORACLE_HOME
C shell:
# setenv ORACLE_HOME / u01/app/oracle/product/10.1.0/db_1
Enter the following command to delete the CSS daemon configuration from this Oracle home:
# $ORACLE_HOME/bin/localconfig delete
The script stops the Oracle CSS daemon, then deletes its configuration. When the system boots, the CSS daemon no longer starts.
Then you can try to reset or delete the configuration of the css process, but these two operations need to be done by the root user, but on the wrong server, I don't have the root password, and I'm not sure.
So I started checking my other two servers with 10g installed:
First server:
[lisa@localhost lisa] $ps-ef | grep css
Lisa 3336 3294 0 14:39 pts/0 00:00:00 grep css no progress, hehe
Someone on the Internet mentioned that removing the last part of this file would remove the occsd.bin process, but this is not recommended:
[lisa@localhost lisa] $cat / etc/inittab
.
# Run xdm in runlevel 5
X:5:respawn:/etc/X11/prefdm-nodaemon
H2:35:respawn:/etc/init.d/init.cssd run > / dev/null 2 > & 1
There is nothing wrong with looking at / etc/oracle/ocr.loc and / etc/oratab, which is the same as the configuration on the correct server.
Looking at the log file, the phenomenon is to execute crsstart every 5 minutes. I understand that you want to start the ocssd process:
[root@localhost log] # tail messages
Mar 1 14:39:39 localhost logger: Oracle Cluster Ready Services disabled by corrupt install
Mar 1 14:39:39 localhost logger: Could not access / etc/oracle/scls_scr/localhost.localdomain/root/crsstart.
Mar 1 14:39:39 localhost logger: Oracle Cluster Ready Services disabled by corrupt install
Mar 1 14:39:39 localhost logger: Could not access / etc/oracle/scls_scr/localhost.localdomain/root/crsstart.
Mar 1 14:39:39 localhost logger: Oracle Cluster Ready Services disabled by corrupt install
Mar 1 14:39:39 localhost logger: Could not access / etc/oracle/scls_scr/localhost.localdomain/root/crsstart.
Mar 1 14:39:39 localhost logger: Oracle Cluster Ready Services disabled by corrupt install
Mar 1 14:39:39 localhost logger: Could not access / etc/oracle/scls_scr/localhost.localdomain/root/crsstart.
Mar 1 14:39:39 localhost init: Id "H2" respawning too fast: disabled for 5 minutes
Mar 1 14:41:48 localhost su (pam_unix) [3482]: session opened for user root by lisa (uid=502)
There is no localhost.localdomain directory under the / etc/oracle/scls_scr/ directory.
View the environment variables:
[root@localhost scls_scr] # env
HOSTNAME=localhost.localdomain should be caused by incorrect HOSTNAME, so modify HOSTNAME.
Due to a bit of a problem with modifying the HOSTNAME operation, I was going to give up and leave out the last line of / etc/inittab in an attempt to stop the process from starting.
[lisa@localhost lisa] $cat / etc/inittab
.
# Run xdm in runlevel 5
X:5:respawn:/etc/X11/prefdm-nodaemon
# h2:35:respawn:/etc/init.d/init.cssd run > / dev/null 2 > & 1
However, after leaving out this line, I did not write any more journals as I had hoped, and the problem remained as always.
If I execute that file directly, it prompts me that I have no permissions (whether using root or oracle):
[root@localhost log] # / etc/oracle/scls_scr/*/root/crsstart
Bash: / etc/oracle/scls_scr/****/root/crsstart: Permission denied
Finally, under the guidance of the network management, the HOSTNAME was successfully modified (hehe, shame)
Check the log file again:
[root@bj34 log] # tail messages
Mar 1 15:23:01 localhost su (pam_unix) [8583]: session opened for user oracle by (uid=0)
Mar 1 15:23:01 localhost su (pam_unix) [8583]: session closed for user oracle
Mar 1 15:23:01 localhost logger: Failed 3 to bind listening endpoint: (ADDRESS= (PROTOCOL=tcp) (HOST=**))
Mar 1 15:23:05 localhost su (pam_unix) [8623]: session opened for user root by lisa (uid=502)
Mar 1 15:23:06 localhost su (pam_unix) [8655]: session opened for user oracle by (uid=0)
Mar 1 15:23:06 localhost su (pam_unix) [8655]: session closed for user oracle
Mar 1 15:23:06 localhost logger: Failed 3 to bind listening endpoint: (ADDRESS= (PROTOCOL=tcp) (HOST=**))
Mar 1 15:23:11 localhost su (pam_unix) [8695]: session opened for user oracle by (uid=0)
Mar 1 15:23:11 localhost su (pam_unix) [8695]: session closed for user oracle
Mar 1 15:23:11 localhost logger: Failed 3 to bind listening endpoint: (ADDRESS= (PROTOCOL=tcp) (HOST=**)) still prompts an error, but the problem has changed. If you write it every 5 seconds, it should still be a problem with the machine name configuration.
View the system process:
[root@bj34 log] # ps-ef | grep css
Root 4722 10 15:14? 00:00:00 / bin/su-l oracle-c exec / home/oracle/product/10.1.0/db_1/bin/ocssd
Oracle 9834 4722 0 15:25? 00:00:00 / home/oracle/product/10.1.0/db_1/bin/ocssd.bin
Root 9957 9921 0 15:27 pts/0 00:00:00 grep css
It was right in the process.
This time I modified / etc/hosts, and the problem was solved:
No more log files are written.
Second server:
System process:
[root@bj72 root] # ps-ef | grep css
Root 5498 1 0 15:50? 00:00:00 / bin/sh / etc/init.d/init.cssd run
Root 5501 5498 0 15:50? 00:00:00 / bin/sh / etc/init.d/init.cssd startcheck
Root 5515 5465 0 15:51 pts/0 00:00:00 grep css
[root@bj72 lisa] # tail / var/log/messages
Mar 1 15:45:50 bj72 logger: Oracle Cluster Ready Services disabled by corrupt install
Mar 1 15:45:50 bj72 logger: Could not access / etc/oracle/scls_scr/****/root/crsstart.
Mar 1 15:45:50 bj72 logger: Oracle Cluster Ready Services disabled by corrupt install
Mar 1 15:45:50 bj72 logger: Could not access / etc/oracle/scls_scr/****/root/crsstart.
Mar 1 15:45:50 bj72 logger: Oracle Cluster Ready Services disabled by corrupt install
Mar 1 15:45:50 bj72 logger: Could not access / etc/oracle/scls_scr/****/root/crsstart.
Mar 1 15:45:50 bj72 logger: Oracle Cluster Ready Services disabled by corrupt install
Mar 1 15:45:50 bj72 logger: Could not access / etc/oracle/scls_scr/****/root/crsstart.
Mar 1 15:45:50 bj72 init: Id "H2" respawning too fast: disabled for 5 minutes
Mar 1 15:47:55 bj72 su (pam_unix) [5464]: session opened for user root by lisa (uid=502)
It is also the wrong prompt, but the situation of the error is different.
There is no * directory under the / etc/oracle/scls_scr/ directory. Check the environment variable. * is HOSTNAME. Since the server has been installed in the database and migrated to other data centers after running for a period of time, IP and HOSTNAME have been replaced. This must be the reason.
I can't change HOSTNAME this time, so I renamed the * * directory to the new HOSTNAME, five minutes later:
[root@bj72 root] # tail / var/log/messages
Mar 1 15:45:50 bj72 logger: Oracle Cluster Ready Services disabled by corrupt install
Mar 1 15:45:50 bj72 logger: Could not access / etc/oracle/scls_scr/****/root/crsstart.
Mar 1 15:45:50 bj72 init: Id "H2" respawning too fast: disabled for 5 minutes
Mar 1 15:47:55 bj72 su (pam_unix) [5464]: session opened for user root by lisa (uid=502)
Mar 1 15:50:51 bj72 su (pam_unix) [5505]: session opened for user oracle by (uid=0)
Mar 1 15:50:51 bj72 su (pam_unix) [5505]: session closed for user oracle
Mar 1 15:51:51 bj72 su (pam_unix) [5498]: session opened for user oracle by (uid=0)
Mar 1 15:51:52 bj72 su (pam_unix) [5498]: session closed for user oracle
Mar 1 15:51:52 bj72 su (pam_unix) [5532]: session opened for user oracle by (uid=0)
Mar 1 15:51:52 bj72 su (pam_unix) [5532]: session closed for user oracle
The problem has changed, but it still exists. This time I couldn't try again and again, so I decided to stop the process:
First
[root@bj72 etc] # cp inittab.no_cssd inittab feels like he just deleted the last line and still writes a journal.
Execute:
[root@bj72 bin] # $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp' root'..
Operation successful.
Oracle Cluster Registry for cluster has been initialized
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Adding to inittab
/ home/oracle/product/10.1.0/db_1/bin/localconfig: line 1: / bin/cp: No such file or directory
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
Giving up: Oracle CSS stack appears NOT to be running.
Oracle CSS service would not start as installed
Automatic Storage Management (ASM) cannot be used until Oracle CSS service is started
If you look at the process again, it is gone:
[root@bj72 bin] # ps-ef | grep css
Root 6279 5465 0 16:30 pts/0 00:00:00 grep css
Looking at the log file, you can see the process of reconfiguration, and then did not write again:
[root@bj72 bin] # tail / var/log/messages
Mar 1 16:17:19 bj72 su (pam_unix) [6125]: session opened for user oracle by (uid=0)
Mar 1 16:17:20 bj72 su (pam_unix) [6125]: session closed for user oracle
Mar 1 16:17:20 bj72 su (pam_unix) [6156]: session opened for user oracle by (uid=0)
Mar 1 16:17:20 bj72 su (pam_unix) [6156]: session closed for user oracle
Mar 1 16:18:20 bj72 su (pam_unix) [6149]: session opened for user oracle by (uid=0)
Mar 1 16:18:21 bj72 su (pam_unix) [6149]: session closed for user oracle
Mar 1 16:18:21 bj72 su (pam_unix) [6178]: session opened for user oracle by (uid=0)
Mar 1 16:18:21 bj72 su (pam_unix) [6178]: session closed for user oracle
Mar 1 16:19:09 bj72 lisa: (Oracle CSSD will be run out of init)
Mar 1 16:19:09 bj72 init: Re-reading inittab
According to the situation of these three servers, the problem raised by the user should be caused by the modification of HOSTNAME, so it is suggested that the user should execute it with root.
$ORACLE_HOME/bin/localconfig reset $ORACLE_HOME
Result of execution:
[root@db1 oracle] # $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME
NThe following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= / home1/oracle/product/10.1.0/db_1
Failure at scls_scr_create with code 1
Internal Error Information:
Category: 1234
Operation: scls_scr_create
Location: mkdir
Other: Unable to make user dir
Dep: 2
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp' root'..
Operation successful.
Oracle Cluster Registry for cluster has been initialized
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Usage: / etc/init.d/init.cssd {start | stop | run | fatal | startcheck | activatevg}
Adding to inittab
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
Db1
CSS is active on all nodes.
Oracle CSS service is installed and running under init (1m)
View the process:
[oracle@db1 oracle] $ps-ef | grep css
Root 5716 10 Jan11? 00:00:00 / bin/su-l oracle-c exec / home1/oracle/product/10.1.0/db_1/bin/ocssd
Oracle 9933 5716 0 17:15? 00:00:00 / home1/oracle/product/10.1.0/db_1/bin/ocssd.bin
No more log files are written, so the problem is solved.
To sum up, after the database server is installed, if you modify the HOSTNAME, it will cause the ocssd process startup error, because the directory where the process starts is written dead to the machine name, execute
$ORACLE_HOME/bin/localconfig reset $ORACLE_HOME
Reconfiguring the parameters can be solved.
After reading the above, have you mastered how to solve the problems of the ocssd process? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.