Thursday, 25 July 2019

Change No archivelog to Archive log in Rac

srvctl stop database -d TEST

srvctl start database -d TEST -o mount


SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            +RECO_DG01
Oldest online log sequence     9
Current log sequence           12
SQL>  select instance_name,status from gv$instance;

INSTANCE_NAME    STATUS
---------------- ------------
TEST1          MOUNTED
TEST2          MOUNTED

SQL> alter database archivelog;

Database altered.

[oracle@OMPR preupgrade]$ srvctl stop database -d TEST
[oracle@OMPR preupgrade]$ srvctl start database -d TEST

SELECT log_mode FROM gv$database;

ACL

SQL> begin
DBMS_NETWORK_ACL_ADMIN.create_acl(
acl => '/sys/acls/AddressDoc.xml',
description=>'ACL for UTL_MAIL',
principal=>'STAT_CUSTGOV',
is_grant=>TRUE,
privilege=>'connect');
COMMIT;
End;
/  2    3    4    5    6    7    8    9   10

PL/SQL procedure successfully completed.

SQL> BEGIN
DBMS_NETWORK_ACL_ADMIN.assign_acl (
acl => '/sys/acls/AddressDoc.xml',
host => '*');
COMMIT;
END;
/  2    3    4    5    6    7

PL/SQL procedure successfully completed.

SQL> BEGIN
        DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE (
          acl   => '/sys/acls/AddressDoc.xml',
          principal => 'STAT_CUSTGOV',
          is_grant  => TRUE,
          privilege => 'connect');
END;
/ 

PL/SQL procedure successfully completed.

Partition DDL

Partitions


select 'alter table '||TABLE_OWNER||'.'||TABLE_NAME ||'  PARTITION '||PARTITION_NAME||' uncompress; '  from all_tab_partitions WHERE table_name='OR_LINE_FACTS';



select 'alter table '||TABLE_OWNER||'.'||TABLE_NAME ||' move PARTITION '||PARTITION_NAME||' uncompress; '  from all_tab_partitions WHERE table_name='CSW_OR_LINE_FACTS';


select 'alter table '||TABLE_OWNER||'.'||TABLE_NAME ||' move PARTITION '||PARTITION_NAME||' compress; '  from all_tab_partitions WHERE table_name in ('PO_RECEIVING_FACTS','PRIORITY_FACTS','SALES_FACTS','SALES_PROD_SUPP_ORG_MONTH_AGG','SALE_IBT_INVOICE_FACTS','SLS_PRD_SP_ORG_MO_AGG');


select 'alter table '||TABLE_OWNER||'.'||TABLE_NAME ||' move PARTITION '||PARTITION_NAME||' compress; '  from all_tab_partitions WHERE table_name in ('W_AR_BALANCE_CUSTOMER_F','W_KRONOS_HOURS_F','W_OMNI_SALES_ORDER_LINE_F','W_RP_MED_ASSIGNMENT_DETAILS_F','W_RP_MED_ASSIGNMENT_F');


select 'alter table '||TABLE_OWNER||'.'||TABLE_NAME ||' move PARTITION '||PARTITION_NAME||' compress; '  from all_tab_partitions WHERE table_name in ('AR_BALANCE_STG_HIST','CISP_ALLOCATED_REV_COSTS_HIST','CISP_ALLOCATED_REV_COSTS_HIST','DISCRETE_HIST','INSBRN_HIST','INSBRN_NK_HIST','INSBRN_NK_HIST','KVI_SUMMARY_HIST','MED_KVI_SUMMARY','OHTLNE_HIST','OHTLNE_HIST','ORSLNE_HIST','ORSLNE_HIST','WFCTOTAL_HIST');


select 'alter table '||TABLE_OWNER||'.'||TABLE_NAME ||' move PARTITION '||PARTITION_NAME||' compress; '  from all_tab_partitions WHERE table_name in ('SALES_F','ZIU_DAILY_PLANNED_ORDER_FACTS','Z_INTPART_TAB','Z_INTPART_TAB','Z_TEST');

select 'alter table '||TABLE_OWNER||'.'||TABLE_NAME ||' move PARTITION '||PARTITION_NAME||' compress; '  from all_tab_partitions WHERE table_name in ('SALES_FACTS_NEW');

SUB partitions
____________

select 'alter table '||TABLE_OWNER||'.'||TABLE_NAME ||' move SUBPARTITION '||SUBPARTITION_NAME||' compress; '  from all_tab_subpartitions WHERE table_name in ('KVI_SUMMARY_WBREAKS_FINAL_STG','KVI_SUMMARY_WBREAKS_STG','OMSTG.MED_KVI_SUMMARY','OMSTG.KVI_SUMMARY_WBREAKS_STG');


Advance compression query
________________________

 select 'alter table '||TABLE_OWNER||'.'||TABLE_NAME ||' move PARTITION '||PARTITION_NAME||' ONLINE ROW STORE COM
PRESS ADVANCED NOLOGGING PARALLEL 4; '  from all_tab_partitions WHERE table_name in ('W_AR_BALANCE_CUSTOMER_F','W_KRONOS_HOURS_F','W_OMNI_SALES_ORDER_LINE_F');




recompile objects

set pagesize 0 head off feedb off echo off
spool validate_all.sql

select 'alter '||object_type||' '||owner||'.'||object_name||' compile;'
from dba_objects where object_type in ('PROCEDURE','FUNCTION','VIEW','TRIGGER','MATERIALIZED VIEW')
and status='INVALID' order by owner
/
select 'alter package '||owner||'.'||object_name||' compile package;'
from dba_objects where object_type in ('PACKAGE')
and status='INVALID' order by owner
/
select 'alter package '||owner||'.'||object_name||' compile body;'
from dba_objects where object_type in ('PACKAGE BODY')
and status='INVALID' order by owner
/
select 'ALTER JAVA SOURCE "' || object_name || '" COMPILE;'
from user_objects where object_type = 'JAVA SOURCE' and status = 'INVALID';
/
select 'ALTER JAVA CLASS "' || object_name || '" RESOLVE;'
from user_objects where object_type = 'JAVA CLASS' and status = 'INVALID';
/
spool off

Wednesday, 24 July 2019

srvctl commands

1. STOP DATABASE :

SYNTAX – srvctl stop database -d db_name [-o stop_options] where stop_options is normal/immediate(default)/transactional/abort

e.g

srvctl stop database -d PRODB -o normal
srvctl stop database -d PRODB -o immediate
srvctl stop database -d PRODB -o transactional
srvctl stop database -d PRODB -o abort

2. START DATABASE
SYNTAX – srvctl start database -d db_name [-o start_options] where start_option is nomount/mount/open(default)

e.g

srvctl start database -d PRODB -o nomount
srvctl start database -d PRODB -o mount
srvctl start database -d PRODB -o open

3. STOP AN INSTANCE

SYNTAX – srvctl stop instance -d db_unique_name [-i “instance_name_list”]} [-o stop_options] [-f]
e.g

srvctl stop instance -d PRODB -i PRODB

4. START AN INSTANCE

SYNTAX – srvctl start instance -d db_unique_name [-i “instance_name_list”} [-o start_options]
e.g

srvctl start instance -d PRODB -i PRODB1

5. REMOVING DB FROM CRS:
SYNTAX – srvctl remove database -d db_unique_name [-f] [-y] [-v]
e.g

srvctl remove database -d PRODB -f -y

6. ADDING DB IN CRS :
SYNTAX – srvctl add database -d db_unique_name -o ORACLE_HOME [-p spfile]
e.g

srvctl add database -d PRODB -o /u01/app/oracle/product/12.1.0.2/dbhome_1 -p +DATA/PRODDB/parameterfile/spfilePRODB.ora

7. REMOVING AN INSTANCE
SYNTAX – srvctl remove instance -d DB_UNIQUE_NAME -i INSTANCE_NAME
e.g

srvctl remove instance -d PRODB – I PRODB1

8.ADDING AN INSTANCE
SYNTAX – srvctl add instance –d db_unique_name –i inst_name -n node_name
e.g

srvctl add instance -d PRODB – i PRODB1 -n rachost1

9. Enable/disable auto restart of the instance

srvctl enable instance -d DB_UNIQUE_NAME-i INSTANCE_NAME
srvctl disable instance -d DB_UNIQUE_NAME-i INSTANCE_NAME

10. Enable/disable auto restart of the database

 srvctl enable database -d DB_UNIQUE_NAME
srvctl disable database -d DB_UNIQUE_NAME
11. ADDING A SERVICE:

SYNTAX – srvctl add servicec -d {DB_NAME} -s {SERVICE_NAME} -r {“preferred_list”} -a {“available_list”} [-P {BASIC | NONE | PRECONNECT}]

e.g

12.REMOVING A SERVICE:

SYNTAX – srvctl remove service -d {DB_NAME} -s {SERVICE_NAME}
e.g

srvctl remove service -d PREDB -s PRDB_SRV

13. START A SERVICE
SYNTAX– srvctl start servicec -d {DB_NAME} -s {SERVICE_NAME}
e.g

srvctl start service -d PREDB -s PRDB_SRV

14. START A SERVICE

SYNTAX– srvctl stop servicec -d {DB_NAME} -s {SERVICE_NAME}
e.g

 srvctl stop service -d PREDB -s PRDB_SRV
15. RELOCATE A SERVICE

SYNTAX – srvctl relocate service -d {database_name} -s {service_name} -i {old_inst_name} -r {new_inst_name}

EXAMPLE: (Relocating service PRDB_SRV from PREDB2 to PREDB1)

srvctl relocate service –d PREDB –s PRDB_SVC –i PREDB2 –t PREDB1
16. Check the status of service
SYNTAX – srvctl status service -d {database_name} -s {service_name}
srvctl status service -d PREDB -s PRDB_SVC
17. Check the configuration of service
SYNTAX – srvctl config service -d {database_name} -s {service_name}

Rac commands

Cluster Related     Commands
---------------         --------
crs_stat -t        Shows HA resource status (hard to read)
crsstat            Ouptut of crs_stat -t formatted nicely
ps -ef|grep d.bin    crsd.bin evmd.bin ocssd.bin
crsctl check crs    CSS,CRS,EVM appears healthy
crsctl stop crs        Stop crs and all other services
crsctl disable crs*    Prevents CRS from starting on reboot
crsctl enable crs*    Enables CRS start on reboot
crs_stop -all        Stops all registered resources
crs_start -all        Starts all registered resources

NOTE
----
* These commands update the file /etc/oracle/scls_scr/<node>/root/crsstart which contains the string “enable” or “disable” as appropriate.

Database Related Commands
-------------------------
srvctl start instance -d <db_name> -i <inst_name>    Starts an instance
srvctl stop instance -d <db_name> -i <inst_name>    Stops an instance
srvctl status instance -d <db_name> -i <inst_name>    Checks an individual instance

srvctl start database -d <db_name>            Starts all instances
srvctl stop database -d <db_name>            Stops all instances, closes database
srvctl status database -d <db_name>            Checks status of all instances

srvctl start service -d <db_name> -s <service_name>    Starts a service
srvctl stop service -d <db_name> -s <service_name>    Stops a service
srvctl status service -d <db_name>            Checks status of a service

examples

srvctl stop service -d DWDB -s DWDB_SRI_ETLUSER
srvctl add service -d DWDB -s DWDB_SRI_ETLUSER -r DWDB1,DWDB2 -a DWDB1,DWDB2
srvctl add service -d DWDB -s DWDB_SRI_ETLUSER -r DWDB1 -a DWDB2
srvctl add service -d DWDB -s DWDB_export_import -r DWDB1 -a DWDB2
srvctl modify service -db DWDB -service DWDB_SRI_USER -n -preferred DWDB1,DWDB2
srvctl relocate service -s DWDB_SRI_USER -d DWDB -i DWDB1 -t DWDB2
srvctl modify service -db DWDB -service DWDB_SRI_USER -n -preferred DWDB1,DWDB2 -a DWDB1,DWDB2
srvctl config service -db DWDB
srvctl modify service -db DWDB -service DWDB_sri_user -modifyconfig -available DWDB1,DWDB2


relocating services


[oracle@rac1 ~]$ srvctl status service -d orcl -s myservice
Service myservice is running on instance(s) orcl1


[oracle@rac1 ~]$ srvctl relocate service -d orcl -s myservice -i orcl1 -t orcl2

[oracle@rac1 ~]$ srvctl relocate service -d orcl -s myservice -i orcl1 -t orcl2
-i represents an old instance

-t represents a new instance

Now check the status of service.


[oracle@rac1 ~]$ srvctl status service -d orcl -s myservice
Service myservice is running on instance(s) orcl2
[oracle@rac1 ~]$

srvctl start nodeapps -n <node_name>            Starts gsd, vip, listener, and ons
srvctl stop nodeapps -n <node_name>            Stops gsd, vip and listener

_________________________________________________________________________

BACKGROUND PROCESSES
----------------------------------
There are three main background processes you can see when doing a ps –ef|grep d.bin.  They are normally started by init during the operating system boot process.  They can be started and stopped manually by issuing the command /etc/init.d/init.crs {start|stop|enable|disable}

/etc/rc.d/init.d/init.evmd
/etc/rc.d/init.d/init.cssd
/etc/rc.d/init.d/init.crsd

SERVICES
------------
Once the above processes are running, they will automatically start the following services in the following order if they are enabled.  This list assumes you are using ASM and have a service set up for TAF/load balancing.

1.The nodeapps (gsd, VIP, ons, listener) are brought online.
2.The ASM instances are brought online.
3.The database instances are brought online.
4.Any defined services are brought online.





























Node Startup Sequence:


Operating System > Oracle Clusterware > ASM > Instance > Listener > Service


================================================================================================
CRSCTL (Clusterware Control utility)                    (crsctl)
CRS_STAT (Cluster Ready Services Statistics)            (crs_stat -h)
OCRCHECK (Oracle Cluster Registry Check Utility)        (ocrcheck -help)
OCRCONFIG (Oracle Cluster Registry Config Utility)      (ocrconfig -help)
CLSCFG (Clusterware Config Tool)                        (clscfg -help)
CLUVFY (Clusterware Verification Utility)               (cluvfy)
================================================================================================

Node Verification:
------------------

olsnodes Clusterware command is used to list the node name and their numbers configured in a cluster:

olsnodes -n
olsnodes -p
olsnodes -i

================================================================================================

Use the crs_stat command to verify the status and state of the cluster sources such as gsd, ons, and vip. Ensure all resources Target and State are flagged as ONLINE

crs_stat -t

================================================================================================

OS-level background processes that belong to the cluster

ps -ef | grep init.d

================================================================================================

cluster stack daemon processes that are running at the OS level

ps -ef | grep d.bin


================================================================================================

For init deamon processess

cd /etc/init.d
pwd
ls -l ini*


================================================================================================

Ensure that the following entries exist in the /etc/inittab OS file to facilitate the Clusterware auto startup and shutdown operations at system (node) restarts. These entries are added at the time of the root.sh script execution.


cat /etc/inittab

# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null
h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/nul l
h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null

================================================================================================

To display Oracle High Availability Services automatic startup configuration:
crsctl config crs

crsctl stop cluster   (for clusterstack)
crsctl stop crs       (for HA Services)
crsctl start cluster   (for clusterstack)
crsctl start crs       (for HA Services)

crsctl enable/disable crs       (for HA Services)


crsctl check crs      (for specific Node)
crsctl check cluster
crsctl check cluster -all   (for all Nodes)


crsctl query css votedisk


crsctl query crs activeversion
crsctl query crs softwareversion [hostname]


cluvfy comp crs -n all -verbose  (checks the complete Cluster Stack)


For OCR Check:
--------------


ocrcheck -config
ocrcheck -local

(OR)

NOTE:  The location of the OCR file can be determined by using the cat /etc/oracle/ocr.loc command. Because these files are always located on shared storage, the command can be executed from any node.


To check the integrity of the OCR file:
---------------------------------------

$ ocrcheck
$ cluvfy comp ocr –n all –verbose


To chek Voting Disk integrity or Voting Disk Issues:
----------------------------------------------------

To check the integrity of the voting disks, examine ocssd.log. Errors with the voting disks appear in the log. The following is a snippet of the output that indicates what an error may look like:

$ grep voting ocssd.log

[    CSSD]2008-09-09 10:47:09.711 [100494224] >ERROR:   clssnmvReadFatal: voting device corrupt (0x00000000/0x00000000/1//dev/sda6)
[    CSSD]2008-09-09 10:47:09.711 [3082128272] >ERROR:   clssnmvReadFatal: voting device corrupt (0x00000000/0x00000000/2//dev/sda7)


Locating OCR Backup:
--------------------

ocrconfig -showbackup auto
ocrconfig -manualbackup
ocrconfig –showbackup manual


Virtual IP (VIP) host name, VIP address, VIP subnet mask and VIP interface name:
--------------------------------------------------------------------------------

srvctl config nodeapps -a
srvctl status nodeapps -n host01


Public, private, and storage interfaces for Oracle Clusterware:
---------------------------------------------------------------

oifcfg getif


current IP address for the VIP address:
---------------------------------------
srvctl config vip -n host01


To view SCAN LISTENER configuration:
------------------------------------

srvctl config scan_listener


To view SCAN VIP configuration:
-------------------------------

srvctl config scan




NOTE:  srvctl -help   (OR)   srvctl  -h


================================================================================================

onsctl ping
onsctl start


SELECT name FROM v$database;
SELECT instance_name FROM v$instance;
SELECT instance_name FROM gv$instance;
SELECT instance_name, host_name FROM gv$instance;

To verify that instances are running, on any node:

SELECT * FROM V$ACTIVE_INSTANCES;

SELECT * FROM gv$cluster_interconnects;


srvctl -h
srvctl verb noun -h


srvctl config database -d orcl  (to display current policy of the Database orcl)
srvctl status database -d orcl -v
srvctl getenv database –d racdb
srvctl status instance -d orcl -i orcl1, orcl2
srvctl status -o oracle_home
srvctl status asm -a
srvctl status asm -n host01
srvctl config asm -n host02
srvctl status service -d orcl


srvctl stop instance -d db_unique_name -i inst_name -n node_name
srvctl start/stop/config/status -d db_unique_name

srvctl start instance -d orcl -i orcl1,orcl2
srvctl stop instance -d orcl -i orcl1,orcl2
srvctl start database -d orcl -o open
srvctl stop database -d orcl
srvctl stop instance -d orcl -i orcl1


srvctl modify database -d <dbname> -y AUTOMATIC|MANUAL
srvctl modify database -d orcl -y MANUAL;


==============================================================



SQL> select instance_name, host_name from gv$instance;

 col host_name for a20

select instance_name, host_name from gv$instance;


ps -ef | grep ora_ | grep orcl2  current running oracle process


– stop the execution of all rdbms processes (by sending the STOP signal)

[root@host02 ~]#  ps -ef | grep ora_ | grep orcl2 | awk ‘{print $2}’ | while read PID
                               do
                               kill -STOP $PID
                               done





rac command to stop and start cluster

[oracle@OMPRLEXD001 grid]$ oifcfg getif
em1 10.96.32.0 global public
em2 192.168.0.0 global cluster_interconnect,asm
[oracle@OMPRLEXD001 grid]$

[root@racnode1 bin]# olsnodes
racnode1
racnode2
Olsnodes is especially useful using the following options:
-i - includes VIP information
-n - includes node number
-p - includes private interconnect information
-v - verbose mode
[root@racnode1 bin]# olsnodes -i -n -p
racnode1 1 racnode1-priv racnode1-vip
racnode2 2 racnode2-priv racnode2-vip

[root@hseau376 ~]# 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



Show CRS stat verbosely.
[grid@primary01 ~]$ crs_stat -v
NAME=ora.DATA.dg

NAME=ora.hsuuat.db
TYPE=ora.database.type
GEN_START_OPTIONS@SERVERNAME(hseau375)=open
GEN_START_OPTIONS@SERVERNAME(hseau376)=open
GEN_USR_ORA_INST_NAME@SERVERNAME(hseau375)=hsuuat1
GEN_USR_ORA_INST_NAME@SERVERNAME(hseau376)=hsuuat2
RESTART_ATTEMPTS=2
RESTART_COUNT=0
USR_ORA_INST_NAME@SERVERNAME(hseau375)=hsuuat1
USR_ORA_INST_NAME@SERVERNAME(hseau376)=hsuuat2
FAILURE_THRESHOLD=1
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.hsuuat.ismuatservice1.svc
TYPE=ora.service.type
RESTART_ATTEMPTS=0
RESTART_COUNT=0
FAILURE_THRESHOLD=0
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.net1.network
TYPE=ora.network.type
RESTART_ATTEMPTS=5
RESTART_COUNT=0
FAILURE_THRESHOLD=
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.oc4j
TYPE=ora.oc4j.type
RESTART_ATTEMPTS=1
RESTART_COUNT=0
FAILURE_THRESHOLD=2
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.ons
TYPE=ora.ons.type
RESTART_ATTEMPTS=3
RESTART_COUNT=0
FAILURE_THRESHOLD=
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.registry.acfs
TYPE=ora.registry.acfs.type
RESTART_ATTEMPTS=5
RESTART_COUNT=0
FAILURE_THRESHOLD=
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375

NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
RESTART_ATTEMPTS=0
RESTART_COUNT=0
FAILURE_THRESHOLD=0
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau376

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
RESTART_ATTEMPTS=0
RESTART_COUNT=0
FAILURE_THRESHOLD=0
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau376

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
RESTART_ATTEMPTS=0
RESTART_COUNT=0
FAILURE_THRESHOLD=0
FAILURE_COUNT=0
TARGET=ONLINE
STATE=ONLINE on hseau375


[root@hseau376 ~]# ps -ef | grep lsnr | grep -v 'grep' | grep -v 'ocfs' | awk '{print $9}'
LISTENER_SCAN2
LISTENER
LISTENER_SCAN1





















*****************************************************************************







http://satya-racdba.blogspot.in/2009/12/srvctl-commands.html

Refer :


How to Stop/Start RAC components

In this article, I am going to explain how to stop/start rac components. Here is the my system:

My db version : 11.2.0.3
My Operating System : AIX 7.1
My servers hostname : node1-node2
My database name : TEST01
My instance name : TEST011-TEST012

Here is the some basic  commands, for commands details&options  please review Reference docs:


Checking CRS Status
[oracle@node1]</home/oracle> 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

[oracle@node2]</home/oracle> 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

Checking Node Status

[oracle@node1]</home/oracle> srvctl status nodeapps

VIP node1-vip is enabled
VIP node1-vip is running on node: node1
VIP 192.168.100.101 is enabled
VIP 192.168.100.101 is running on node: node2
Network is enabled
Network is running on node: node1
Network is running on node: node2
GSD is disabled
GSD is not running on node: node1
GSD is not running on node: node2
ONS is enabled
ONS daemon is running on node: node1
ONS daemon is running on node: node2

[oracle@node2]</home/oracle> srvctl status nodeapps

VIP node1-vip is enabled
VIP node1-vip is running on node: node1
VIP 192.168.100.101 is enabled
VIP 192.168.100.101 is running on node: node2
Network is enabled
Network is running on node: node1
Network is running on node: node2
GSD is disabled
GSD is not running on node: node1
GSD is not running on node: node2
ONS is enabled
ONS daemon is running on node: node1
ONS daemon is running on node: node2

Checking Clusterware Resource Status
[oracle@node1]</home/oracle> crsctl status resource -t

I will not paste result because output is not clear in that page

You can use below command which is not recommended for 11g and which is depreciated

[oracle@node1]</home/oracle> crs_stat -t
Name Type Target State Host
————————————————————
ora….DATA.dg ora….up.type ONLINE ONLINE node1
ora….ER.lsnr ora….er.type ONLINE ONLINE node1
ora….N1.lsnr ora….er.type ONLINE ONLINE node1
ora….N2.lsnr ora….er.type ONLINE ONLINE node2
ora.ORADATA.dg ora….up.type ONLINE ONLINE node1
ora.asm ora.asm.type ONLINE ONLINE node1
ora.cvu ora.cvu.type ONLINE ONLINE node2
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora….SM1.asm application ONLINE ONLINE node1
ora….11.lsnr application ONLINE ONLINE node1
ora….b11.gsd application OFFLINE OFFLINE
ora….b11.ons application ONLINE ONLINE node1
ora….b11.vip ora….t1.type ONLINE ONLINE node1
ora….SM2.asm application ONLINE ONLINE node2
ora….12.lsnr application ONLINE ONLINE node2
ora….b12.gsd application OFFLINE OFFLINE
ora….b12.ons application ONLINE ONLINE node2
ora….b12.vip ora….t1.type ONLINE ONLINE node2
ora….network ora….rk.type ONLINE ONLINE node1
ora.oc4j ora.oc4j.type ONLINE ONLINE node2
ora.ons ora.ons.type ONLINE ONLINE node1
ora.test01.db ora….se.type ONLINE ONLINE node1
ora….int.svc ora….ce.type ONLINE ONLINE node2
ora….int.svc ora….ce.type ONLINE ONLINE node2
ora….kis.svc ora….ce.type ONLINE ONLINE node2
ora….est.svc ora….ce.type ONLINE ONLINE node1
ora….ry.acfs ora….fs.type ONLINE ONLINE node1
ora.scan1.vip ora….ip.type ONLINE ONLINE node1
ora.scan2.vip ora….ip.type ONLINE ONLINE node2

Oracle High Availability Services

— disable/enable Oracle HAS.
Use the “crsctl enable/disable has” command to disable automatic startup of the Oracle High Availability Services stack when the server boots up.

To can see current settings for Oracle High Availability Services stack when the server boots up, follow:

[root@node1]crsctl config has
CRS-4622: Oracle High Availability Services autostart is enabled.

or

[root@node1]cat /etc/oracle/scls_scr/node1/root/ohasdstr
enable

So as you can see my current setting is enable.If your system shown disable than :

For Disable:
[root@node1]crsctl disable has
CRS-4621: Oracle High Availability Services autostart is disabled.

[root@node1] crsctl config has
CRS-4621: Oracle High Availability Services autostart is disabled.

# cat /etc/oracle/scls_scr/node1/root/ohasdstr
disable

For Enable:
[root@node1]crsctl enable has
CRS-4621: Oracle High Availability Services autostart is enabled.

Check new setting:

[root@node1] crsctl config has
CRS-4621: Oracle High Availability Services autostart is enabled.

[root@node1] cat /etc/oracle/scls_scr/node1/root/ohasdstr
enable

Stop the Oracle clusterware stack

You can use below commands:

With root user:

crsctl stop crs or crsctl stop has

[root@node1]crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘node1'
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘node1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘node1'
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN2.lsnr’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.test01.db’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN3.lsnr’ on ‘node1'
CRS-2677: Stop of ‘ora.LISTENER_SCAN2.lsnr’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.scan2.vip’ on ‘node1'
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.node1.vip’ on ‘node1'
CRS-2677: Stop of ‘ora.LISTENER_SCAN3.lsnr’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.scan3.vip’ on ‘node1'
CRS-2677: Stop of ‘ora.node1.vip’ on ‘node1' succeeded
CRS-2672: Attempting to start ‘ora.node1.vip’ on ‘node2'
CRS-2677: Stop of ‘ora.scan2.vip’ on ‘node1' succeeded
CRS-2672: Attempting to start ‘ora.scan2.vip’ on ‘node2'
CRS-2677: Stop of ‘ora.scan3.vip’ on ‘node1' succeeded
CRS-2672: Attempting to start ‘ora.scan3.vip’ on ‘node2'
CRS-2676: Start of ‘ora.node1.vip’ on ‘node2' succeeded
CRS-2677: Stop of ‘ora.test01.db’ on ‘node1' succeeded
CRS-2676: Start of ‘ora.scan2.vip’ on ‘node2' succeeded
CRS-2672: Attempting to start ‘ora.LISTENER_SCAN2.lsnr’ on ‘node2'
CRS-2676: Start of ‘ora.scan3.vip’ on ‘node2' succeeded
CRS-2672: Attempting to start ‘ora.LISTENER_SCAN3.lsnr’ on ‘node2'
CRS-2676: Start of ‘ora.LISTENER_SCAN2.lsnr’ on ‘node2' succeeded
CRS-2676: Start of ‘ora.LISTENER_SCAN3.lsnr’ on ‘node2' succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.eons’ on ‘node1'
CRS-2677: Stop of ‘ora.ons’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ‘node1'
CRS-2677: Stop of ‘ora.net1.network’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.eons’ on ‘node1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘node1' has completed
CRS-2677: Stop of ‘ora.crsd’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.cssdmonitor’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘node1'
CRS-2677: Stop of ‘ora.cssdmonitor’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.mdnsd’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.gpnpd’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.evmd’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘node1'
CRS-2677: Stop of ‘ora.cssd’ on ‘node1' succeeded
CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘node1'
CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘node1'
CRS-2677: Stop of ‘ora.gipcd’ on ‘node1' succeeded
CRS-2677: Stop of ‘ora.diskmon’ on ‘node1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘node1' has completed
CRS-4133: Oracle High Availability Services has been stopped.

Start the Oracle clusterware stack

You can use below commands:

With root user:
crsctl start crs or crsctl start has

[root@node1] crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

Start the Oracle Database
To start all Oracle RAC instances for a database:
[oracle@node1]</home/oracle> $ORACLE_HOME/bin/srvctl start database -d db_name

PS: db_name is the name of the databasethis command is starting all the instances

Stop the Oracle Database
To shut down all Oracle RAC instances for a database:
[oracle@node1]</home/oracle> $ORACLE_HOME/bin/srvctl stop database -d db_name

PS: db_name is the name of the databasethis command is starting all the instances

Start the Oracle Instance:

[oracle@node1]</home/oracle> $ORACLE_HOME/bin/srvctl start instance –d db_name –i instance_name

Stop the Oracle Instance:

[oracle@node1]</home/oracle> $ORACLE_HOME/bin/srvctl stop instance –d db_name –i instance_name
Stop/Start Listener-SCAN_LISTENER
–
srvctl stop/start listener -n node1
srvctl stop/start listener -n node2
srvctl stop scan_listener

Stop ASM

srvctl stop asm [-o stop_options] [-f]
srvctl stop asm -n node1

**************************************************************************************************************************






Featured post

Restircted session due to sync filed with ora-65177

Application is unable to connect the database due to restricted session. sql> show pdbs; SQL> show con_name CON_NAME -----------------...