Friday, April 26, 2019

ORA-02266: unique/primary keys in table referenced by enabled foreign keys getting while import

Error:
ORA-39120: Table "SCHEMA"."TESTTAB" can't be truncated, data will be skipped. Failing error is:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
ORA-00955: name is already used by an existing object

Solution:
Step-1: Use below query to disable constraint
select 'alter table '||a.owner||'.'||a.table_name||' disable constraint '||a.constraint_name||';'
from user_constraints a, all_constraints b
where a.constraint_type = 'R'
and a.r_constraint_name = b.constraint_name
and a.r_owner  = b.owner
and b.table_name = 'TESTTAB';

Output:
alter table SCHEMA.TESTTAB disbale constraint TESTTAB_DG_FK1;
alter table SCHEMA.TESTTAB disable constraint TESTTAB_DG_FK2;

Step-2
Then start import job again


How to Export /Expdp without data in oracle database ?

Question : Use below query to export without data in oracle database.

Query:
expdp username/password DIRECTORY=directory_object_name DUMPFILE=dumpfile_name TABLES=table_names|TABLESPACES=tablespace_names|FULL=y          CONTENT=metadata_only

how to check flash recovery area usage on oracle 18c RAC database ?

Answer : Use below query to get flash recovery area usage on oracle 18c RAC database.

Query:

How to enable constraint on oracle 18c database?

Answer: Use below query to enable constraint on oracle 18c database.

Query

How to disable constraints table level on 18c database?

Answer : Using below query you can disable constraints table level on 18c database.

Query:

Wednesday, April 24, 2019

Prerequisite check “CheckActiveFilesAndExecutables” failed while applying JAN RU 2019 on 12.2 database

Today i was trying to remove the Oracle Patch (28828733) from 12.2.0.1 HOME and Database which was recently applied by me on one of our test instance, however i faced the problem while doing that.

[Apr 13, 2019 4:11:41 AM] [INFO]    Following executables are active :
                                    /app/oracle/product/12.2.0.1/dbhome1/lib/libclntsh.so.12.1
[Apr 13, 2019 4:11:41 AM] [INFO]    Prerequisite check "CheckActiveFilesAndExecutables" failed.
                                    The details are:
                                    Following executables are active :
                                    /app/oracle/product/12.2.0.1/dbhome1/lib/libclntsh.so.12.1
[Apr 13, 2019 4:11:41 AM] [SEVERE]  OUI-67073:UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
[Apr 13, 2019 4:11:41 AM] [INFO]    Finishing UtilSession at Sat Apr 13 04:11:41 EDT 2019
[Apr 13, 2019 4:11:41 AM] [INFO]    Log file location: /app/oracle/product/12.2.0.1/dbhome1/cfgtoollogs/opatchauto/core/opatch/opatch2019-04-13_04-11-13AM_1.log

After a bit troubleshooting, i understood that some application is there which is trying to access library from the ORACLE HOME because of that this is happening, however i shutdown all the instances from the ORACLE HOME.

So to find out i executed the below command to find out which application/program is using it:

[oracle@host05](+ASM)$ /sbin/fuser /usr/oracle/product/12.2.0.1/dbhome1/lib/libclntsh.so.12.1
/usr/oracle/product/12.2.0.1/dbhome1/lib/libclntsh.so.12.1:  6161m

This way i came to know which Process ID is being assigned.
[oracle@host05](+ASM)$ ps -ef|grep 6161
oracle    6161 25365  0 Mar10 pts/1    00:00:07 sqlplus   as sysdba
oracle    9150 28789  0 04:15 pts/2    00:00:00 grep --color=auto 6161

So SQLPLUS is using it, however everything was down, and then i saw there is 1 Putty Session which got inactive but made this library is in active mode somehow.

So i killed the process related to sqlplus and again executed the command to find out.

oracle@host05](+ASM)$ kill -9 6161

/home/oracle
[oracle@host05](+ASM)$ /sbin/fuser /app/oracle/product/12.2.0.1/dbhome1/lib/libclntsh.so.12.1

/home/oracle
[oracle@ora05](+ASM)$ 

So its gone, now when i again executed the previous command to remove the patch, it went well.
Let me know if it does not for anyone.
Thanks!
Hope it helps….

ORA-01940: cannot drop a user that is currently connected error getting while drop user

Error:

SQL> drop user TEST_SCHEMA cascade;
drop user TEST_SCHEMA cascade
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected


Solution:
Step:1 Check the session details for this user by using below query

SQL> select 'alter system kill session '''||sid||','||serial#|| ''' immediate ;' from v$session where username='TEST_SCHEMA';

O/P:
SQL> select 'alter system kill session '''||sid||','||serial#|| ''' immediate ;' from v$session where username='TEST_SCHEMA';

'ALTERSYSTEMKILLSESSION'''||SID||','||SERIAL#||'''IMMEDIATE;'
--------------------------------------------------------------------------------
alter system kill session '13,32432' immediate ;
alter system kill session '15,50630' immediate ;
alter system kill session '18,13767' immediate ;
alter system kill session '19,37025' immediate ;
alter system kill session '23,25743' immediate ;
alter system kill session '386,41994' immediate ;

Step-2 Kill all the sessions by using below query;

alter system kill session '13,32432' immediate ;
alter system kill session '15,50630' immediate ;
alter system kill session '18,13767' immediate ;
alter system kill session '19,37025' immediate ;
alter system kill session '23,25743' immediate ;
alter system kill session '386,41994' immediate ;

Step:3 After kill the sessions,then we will drop the user
SQL> drop user TEST_SCHEMA cascade;

User dropped.


Wednesday, April 17, 2019

How to identify IOPS in AWR reports ?

The AWR reports are very usefull during the performance troubleshooting and also during proactive analysis.

One of the first steps in order to have apicture of the current environment is to know how are Oracle Database performance compared to the current hardware infrastructure.    The IOPS (Input/Output Operations Per Second) is one of the very interesting information to know before going deeper in the investigation.

The IOPS can tell you how many physical I/Os were executed in the last interval. If you see good performance then you can move forward in other directions.

Unfortunatelly you have to know what kind of hardware are available to the Database Server. Each different HW has different performances.

See below how to identifiy IOPS and MB/s from the AWR reports:

IOPS : 48.32+64.99 = 113.31 Per Second


Thursday, April 11, 2019

How to get full database size on oracle database 18c ?

Question : How to get full database size on oracle database 18c ?

Answer : Use below queries to get oracle database size details.

Query :  

select round(sum(bytes/1024/1024/1024)) "total database size in GB" from sm$ts_avail;

select round(sum(bytes/1024/1024/1024)) "total database size in GB" from sm$ts_used;

select round(sum(bytes/1024/1024/1024)/2) "total database size in GB" from sm$ts_free;

Output : 
SQL> select round(sum(bytes/1024/1024/1024)) "total database size in GB" from sm$ts_avail;

total database size in GB
-------------------------
                     4598

SQL> select round(sum(bytes/1024/1024/1024)) "total database size in GB" from sm$ts_used;

total database size in GB
-------------------------
                     3230

SQL> select round(sum(bytes/1024/1024/1024)/2) "total database size in GB" from sm$ts_free;

total database size in GB
-------------------------
                      684

How to check database growth size monthly size on 18c oracle database ?

Question : How to check database growth size monthly basis on 18c  oracle database ?

Answer : Use below query to get database growth size monthly basis on oracle database,

Query :
select
  to_char(CREATION_TIME,'RRRR') year, 
  to_char(CREATION_TIME,'MM') month, 
  sum(bytes/1024/1024/1024) GB 
from 
  v$datafile 
group by 
  to_char(CREATION_TIME,'RRRR'), 
  to_char(CREATION_TIME,'MM') 
order by 
  1, 2;

Output,
YEAR MO         GB
---- -- ----------
2017 08 41.9999345
2017 09 870.683594
2017 10       1367
2017 11        241
2017 12         49
2018 02          6
2018 03         55
2018 04          5
2018 05        450
2018 06         76
2018 07 797.097656

YEAR MO         GB
---- -- ----------
2018 08          4
2018 09         10
2018 12        120
2019 01         35
2019 02         12

2019 03          1

How to get all schema details on oracle database 18c?

Question : How to get all schema details on oracle database18c ?

Answer : use below query to get all schema details.

Query : select username from dba_users order by username;

Output :
SQL> select username from dba_users order by username;

USERNAME
----------------------
TEST1
TEST2
TEST3
TEST4
TEST5
TEST6

TEST7



How check ASM space usage on oarcle 18c database ?

Question : How check ASM space usage on oarcle 18c database ?

Answer : Use below query to get ASM space usage on oracle database.

Query:
select group_number, name, block_size state, (total_mb/1024) total_GB,(free_mb/1024) free_GB from v$asm_diskgroup;

output:
SQL> select group_number, name, block_size state, (total_mb/1024) total_GB,(free_mb/1024) free_GB from v$asm_diskgroup;

GROUP_NUMBER NAME            STATE   TOTAL_GB    FREE_GB
------------ ---------- ---------- ---------- ----------
           1 ARCH             4096 1000.14844 899.109375
           2 DATA             4096 5500.81641 743.882813

Oracle database startup fails ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated

Error:
ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated 
ORA-01262: Stat failed on a file destination directory Linux-x86_64 Error: 2: No such file or directory

Problem Description
While I start my database with my initialization parameter it fails with oracle error

Solution of The Problem

su oracle 
run environment variable
sqlplus / as sysdba 
SQL>create pfile from spfile;

Then remove or comment below line in pfile

db_recovery_file_dest  

Save and exi

su oracle 
run environment variable
sqlplus / as sysdba 
SQL>startup mount;
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size                  2166536 bytes
Variable Size             427819256 bytes
Database Buffers          624951296 bytes
Redo Buffers               14000128 bytes
it should  became the mount stage then open the DB as follows 

SQL>alter database open;

Database altered.

SQL>

Tuesday, April 9, 2019

How to check cpu information on Linux RHEL 7.6?

Question:How to check cpu information on Linux  RHEL 7.6?

Query:
[oracle@testhost](DEVDB)$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             4
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 63
Model name:            Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
Stepping:              0
CPU MHz:               2197.455
BogoMIPS:              4394.91
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              30720K
NUMA node0 CPU(s):     0-7
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx hypervisor lahf_lm arat

ORA-39142: incompatible version number 5.1 in dump file "/backup/dump/tab.dmp" while import

Reason : Oracle Version Incompatible.You are exporting data from 12.2 and importing into 11.2 database,then that time you are getting error ORA-39142.


Error Message:
Import: Release 11.2.0.4.0 - Production on Tue Apr 9 04:39:26 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management and Real Application Testing options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39142: incompatible version number 5.1 in dump file "/backup/dump/tab.dmp"

Solution : While taking export use version=11.2 parameter on expdp command.Then import the dump into 11.2 database.

Output Logs:
Export Log:
expdp system tables=schema.tab directory=dpump_dir1 dumpfile=tab.dmp exclude=statistics exclude=TRIGGER exclude=REF_CONSTRAINT logfile=out.log version=11.2

Import Log:
impdp system TABLE_EXISTS_ACTION=REPLACE remap_tablespace=TEST_DATA:TAR_DATA remap_tablespace=TEST_INDX:TAR_INDX directory=dpumpdir dumpfile=tab.dmp logfile=out.log

How to find table size on oracle database (12.2 & 18c)?

Question : How to find table size on oracle database (12.2,18c)?

Answer : By using below query you will table size on oracle database

Query: select segment_name,segment_type,bytes/1024/1024/1024 GB from dba_segments where segment_type='TABLE' and segment_name='TEST_TAB';

Output:

SQL>select segment_name,segment_type,bytes/1024/1024/1024 GB from dba_segments where segment_type='TABLE' and segment_name='TEST_TAB';

SEGMENT_NAME         SEGMENT_TYPE               GB
-------------------- ------------------ ----------
TEST_TAB_DATA        TABLE              108.838806


Monday, April 8, 2019

How to check ASM disk space usage on oracle 18c RAC database ?

Question : How to check ASM disk space usage on oracle 18c RAC database


Answer : By using below query you will get ASM disk space usage

Query:

SQL> select group_number, name, block_size state, (total_mb/1024) total_GB,(free_mb/1024) free_GB from v$asm_diskgroup;

GROUP_NUMBER NAME                      STATE   TOTAL_GB    FREE_GB
------------ -------------------- ---------- ---------- ----------
           1 ARCH                       4096 1000.14844 261.183594
           2 DATA                       4096 6500.96484 1371.67578


How to check blocking session on oracle 18c database

Question : How to check blocking session on oracle 18c database

Answer: By using below query you will get blocking session on oracle 18c RAC database

Query:

select s1.username || '@' || s1.machine
   || ' ( SID=' || s1.sid || ' )  is blocking '
    || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
    from gv$lock l1, gv$session s1, gv$lock l2, gv$session s2
    where s1.sid=l1.sid and s2.sid=l2.sid
    and l1.BLOCK=1 and l2.request > 0
    and l1.id1 = l2.id1
    and l2.id2 = l2.id2 ;

Output:
BLOCKING_STATUS
---------------------
TESTSCHEMA@testhost.net ( SID=3637 )  is blocking TESTSCHEMA@testhost.net ( SID=3988 )
TESTSCHEMA@testhost.net ( SID=3637 )  is blocking TESTSCHEMA@testhost.net ( SID=4319 )

Drop a user on oracle 18c database

Question : How to drop a user on oracle 18c database

Answer : By using below query you can drop user on oracle 18c database.

Query:
drop user TEST cascade;


How to check Flash Recovery Area Usage on oracle 18c ?

Question:How to check Flash Recovery Area Usage on oracle 18c ?

Answer :

Use below query to get Flash Recovery Area Usage on oracle 18c database.

set lines 100
col name format a60
select name,floor(space_limit / 1024 / 1024 / 1024) "Size GB",ceil(space_used / 1024 / 1024 / 1024) "Used GB" from v$recovery_file_dest order by name;

Output:
SQL> set lines 100
col name format a60
select name,floor(space_limit / 1024 / 1024 / 1024) "Size GB",ceil(space_used / 1024 / 1024 / 1024) "Used GB" from v$recovery_file_dest order by name;SQL> SQL>

NAME                    Size GB    Used GB
-------------------- ---------- ----------
+ARCH                       500        225


Friday, April 5, 2019

Check long running queries on oracle 18c or 12.2 database

Question : How to check  long running queries on oracle 18c or 12.2 database

Query : Use below query to get long running quires on databases.

set lines 300
set pages 300
col session# for a15
col sql_text for a40
col spid for a7
col sid for 999999
col username format a15
col machine format a20
col Elapsed for 9999,9999
select substr(machine,instr(machine,'\')+1) machine,s.last_call_et as Elapsed,s.username,t.SQL_ID,t.sql_text,s.sid,s.serial#,s.inst_id from gv$session s, gv$sqlarea t, gv$process p
where (s.username is not null )
and s.status='ACTIVE' 
and s.sql_address = t.address
and s.sql_address = t.address
and s.sql_hash_value = t.hash_value
and s.inst_id = t.inst_id
and p.addr=s.paddr
and p.inst_id = s.inst_id
and s.last_call_et>1
order by s.last_call_et
/

Output:

MACHINE                 ELAPSED USERNAME        SQL_ID                                  SQL_TEXT                                     SID    SERIAL#    INST_ID
-------------------- ---------- --------------- --------------------------------------- ---------------------------------------- ------- ---------- ----------
VM-ABC                   3 SCHEMA      73qrr5x5162nm                                select COUNT(ABC_ID), CUSTOMER,    4060      41920          1
                                                                                        PRODUCTION_OWNER,PRODUCTION_STATUS,DAYS_


Oracle 18c Database Backup Monitoring

Question : How We will check Oracle 18c or 12.2 Database Backup Monitoring

Query : Use below query to get backup status details

set line 300
col STATUS format a30
col INPUT_TYPE for a10
col hrs format 999.99
col START_TIME for a30
col END_TIME for a30
select SESSION_KEY, INPUT_TYPE, STATUS,
to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi') end_time,
elapsed_seconds/3600 hrs
from V$RMAN_BACKUP_JOB_DETAILS
order by session_key;

Output :
SQL> set line 300
SQL> col STATUS format a30
col INPUT_TYPE for a10
col hrs format 999.99
col START_TIME for a30
col END_TIME for a30
SQL> SQL> SQL> SQL> SQL> select SESSION_KEY, INPUT_TYPE, STATUS,
to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,
to_char(END_TIME,'mm/dd/yy hh24:mi') end_time,
elapsed_seconds/3600 hrs
from V$RMAN_BACKUP_JOB_DETAILS
order by session_key;  2    3    4    5    6

SESSION_KEY INPUT_TYPE STATUS                         START_TIME                     END_TIME                           HRS
----------- ---------- ------------------------------ ------------------------------ ------------------------------ -------
      25133 DB INCR    COMPLETED                      02/28/19 20:25                 02/28/19 23:00                    2.59
      25141 DB INCR    COMPLETED                      03/01/19 20:25                 03/01/19 23:01                    2.61
      25149 DB FULL    COMPLETED                      03/02/19 20:25                 03/03/19 00:00                    3.59
      25155 DB INCR    COMPLETED                      03/03/19 20:25                 03/03/19 22:53                    2.47

      25163 DB INCR    COMPLETED                      03/04/19 20:25                 03/04/19 23:05                    2.67

How to get single tablespace size on oracle 18c ?

Solution :

Use below query to get singe tablespace usage on oracle 18c or 12.2

Query :

SELECT A.TABLESPACE_NAME,A.TOTAL_GB,B.FREE_GB, (A.TOTAL_GB-B.FREE_GB) USED_GB FROM 
(SELECT ROUND(SUM(BYTES/1024/1024/1024)) TOTAL_GB ,TABLESPACE_NAME FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) A,
(SELECT ROUND(SUM(BYTES/1024/1024/1024)) FREE_GB, TABLESPACE_NAME FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) B 
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME and A.TABLESPACE_NAME ='TEST_DEV_DATA';

Output:
TABLESPACE_NAME                  TOTAL_GB    FREE_GB    USED_GB
------------------------------ ---------- ---------- ----------

TEST_DEV_DATA                          30          6         24



How to check tablespace usage on oracle 12.2 database.


Solution:

Use below query to get all tablespace usage on oracle 12.2 database.

col used for 99,999,999
col total for 999,999,999
col percent for 999
col tablespace_name for a30
select tablespace_name, 
sum(used) used, sum(total) total, round(100*sum(used)/sum(total),0) percent
from 
(select tablespace_name
,round(sum(bytes)/1024/1024,0) used, 0 total
from dba_segments 
group by tablespace_name
union
select tablespace_name
,0 used
,round(sum(bytes)/1024/1024,0) total
from dba_data_files 
group by tablespace_name)
group by tablespace_name
order by tablespace_name
/

Output:

TABLESPACE_NAME                       USED        TOTAL PERCENT
------------------------------ ----------- ------------ -------
AUDIT_USER_DATA                          0          500       0
AUDIT_USER_INDX                          0          200       0
TEST_DATA                          222,437      245,760      91
TEST_INDX                                0          100       0
ABC_DATA                             1,584        3,072      52
ABC_INDX                                 0        1,024       0

ORA-01081: cannot start already-running ORACLE - shut it down first

Issue : While starting up oracle database 12.2,I am getting ORA-01081 error.

Error Message:

SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first


Solution:
Step-1 Shutdown the database by using below command

SQL> shut immediate;
ORA-01507: database not mounted


ORACLE instance shut down.

Step-2: Then try to startup database by using startup option

SQL> startup
ORACLE instance started.

Total System Global Area 3758096384 bytes
Fixed Size                  8627392 bytes
Variable Size             872418112 bytes
Database Buffers         2868903936 bytes
Redo Buffers                8146944 bytes
Database mounted.
Database opened.



How do I find the size of a schema in my oracle database 12.2 ?

How do I find the size of a schema in my oracle database 12.2 ?

Solution: 

It depends on how you define "size".  If you want the total disk space consumed by the schema (including indexes, tablespace free space), then the SQL query is quite simple:

select owner,sum(bytes)/1024/1024/1024 schema_size_gig from dba_segments  group by owner;
OWNER                          SCHEMA_SIZE_GIG
------------------------------ ---------------
TEST                                .252441406
MENT                                .001831055
TTTT                                .000305176
NEW_SCHEMA                          .017822266
TEST1                               25.3795166
FRP_TT                               .00012207


If you just want the size of the schema in terms of the space consumed by table rows, you would use a different query to calculate the schema size:

select sum(bytes)/1024/1024/1024 as size_in_gig,segment_type from dba_segments where owner='TEST1' group by segment_type;

OWNER                          SCHEMA_SIZE_GIG
------------------------------ ---------------
TEST1                               25.3795166

Thursday, April 4, 2019

ERROR [main] 2019-04-03 15:34:23,376 CassandraDaemon.java:706 - Exception encountered during startup

ERROR [main] 2019-04-03 15:34:23,376 CassandraDaemon.java:706 - Exception encountered during startup

Error Message:


ERROR [main] 2019-04-03 15:34:23,376 CassandraDaemon.java:706 - Exception encountered during startup
java.lang.RuntimeException: A node with address /10.142.0.7 already exists, cancelling join. Use cassandra.replace_address if you want to replace this node.
        at org.apache.cassandra.service.StorageService.checkForEndpointCollision(StorageService.java:557) ~[apache-cassandra-3.11.0.jar:3.11.0]
        at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:801) ~[apache-cassandra-3.11.0.jar:3.11.0]
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:666) ~[apache-cassandra-3.11.0.jar:3.11.0]
        at org.apache.cassandra.service.StorageService.initServer(StorageService.java:612) ~[apache-cassandra-3.11.0.jar:3.11.0]
        at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:393) [apache-cassandra-3.11.0.jar:3.11.0]
        at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:600) [apache-cassandra-3.11.0.jar:3.11.0]
        at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:689) [apache-cassandra-3.11.0.jar:3.11.0]
INFO  [StorageServiceShutdownHook] 2019-04-03 15:34:23,417 HintsService.java:220 - Paused hints dispatch
WARN  [StorageServiceShutdownHook] 2019-04-03 15:34:23,419 Gossiper.java:1538 - No local state, state is in silent shutdown, or node hasn't joined, not announcing shutdown
INFO  [StorageServiceShutdownHook] 2019-04-03 15:34:23,421 MessagingService.java:984 - Waiting for messaging service to quiesce
INFO  [ACCEPT-/10.142.0.7] 2019-04-03 15:34:23,422 MessagingService.java:1338 - MessagingService has terminated the accept() thread

INFO  [StorageServiceShutdownHook] 2019-04-03 15:34:23,810 HintsService.java:220 - Paused hints dispatch


Solution:
Remove Node from cluster by using nodetool removenode, then Start the Cassandra on that particular node.

Step-1 :Check the status of node by using below command
root@node1:~/cassandra/apache-cassandra-3.11.0/bin# ./nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load       Tokens       Owns    Host ID                               Rack
DN  10.142.0.9  75.02 KiB  256          ?       901bc4ca-0936-4c4a-9c76-9dfda2b0906c  rack1
UN  10.142.0.6  205.25 KiB  256          ?       967507db-2a28-4657-81ad-c0b965479466  rack1
DN  10.142.0.7  240.03 KiB  256          ?       fd2066b5-6ed3-4724-bdd5-c243c8748aa4  rack1

Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless

Step-2 :Remove the down node by using nodetool remove command
root@node1:~/cassandra/apache-cassandra-3.11.0/bin# ./nodetool removenode fd2066b5-6ed3-4724-bdd5-c243c8748aa4

root@node1:~/cassandra/apache-cassandra-3.11.0/bin#
root@node1:~/cassandra/apache-cassandra-3.11.0/bin# ./nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load       Tokens       Owns    Host ID                               Rack
DN  10.142.0.9  75.02 KiB  256          ?       901bc4ca-0936-4c4a-9c76-9dfda2b0906c  rack1
UN  10.142.0.6  191.2 KiB  256          ?       967507db-2a28-4657-81ad-c0b965479466  rack1

Note: Non-system keyspaces don't have the same replication settings, effective ownership information is meaningless

root@node1:~/cassandra/apache-cassandra-3.11.0/bin#

Step-3 : Start the Cassandra process on particular node.

root@node1:~/cassandra/apache-cassandra-3.11.0/bin# start cassandra



Installing OpenJDK 8 on RHEL-based Systems

Installing OpenJDK 8 on RHEL-based Systems

Procedure:

Step-1 :Install the OpenJDK 8:
su -c "yum install java-1.8.0-openjdk"

Step-2 :If you have more than one Java version installed on your system use the following command to switch versions:
sudo alternatives --config java

Step-3 Make sure your system is using the correct JDK:
java -version
openjdk version "1.8.0_71"
OpenJDK Runtime Environment (build 1.8.0_71-b15)
OpenJDK 64-Bit Server VM (build 25.71-b15, mixed mode)


Output on Terminal:
Step-1

[root@dev1 ~]# su -c "yum install java-1.8.0-openjdk"
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/x86_64/metalink                                                                                                                                                  |  11 kB  00:00:00
 * base: mirrors.advancedhosters.com
 * epel: reflector.westga.edu
 * extras: mirrors.advancedhosters.com
 * updates: mirrors.advancedhosters.com
base                                                                                                                                                                  | 3.6 kB  00:00:00
epel                                                                                                                                                                  | 4.7 kB  00:00:00
extras                                                                                                                                                                | 3.4 kB  00:00:00
google-cloud-compute/signature                                                                                                                                        |  454 B  00:00:00
.
.
.
.
.
Transaction Summary
=============================================================================================================================================================================================
Install  1 Package (+64 Dependent packages)

Total download size: 45 M
Installed size: 146 M
Is this ok [y/d/N]: y

Step-2
[root@dev1 ~]# sudo alternatives --config java

There is 1 program that provides 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/jre/bin/java)

Enter to keep the current selection[+], or type selection number: 1

Step-3
[root@dev1 ~]# java -version
openjdk version "1.8.0_201"
OpenJDK Runtime Environment (build 1.8.0_201-b09)

OpenJDK 64-Bit Server VM (build 25.201-b09, mixed mode)

How can I restore Cassandra snapshots?