Wednesday, February 20, 2008

srvctl commands

1. Stop the database

- Shut down all services in the Oracle home on each node that might be accessing a database:
$ srvctl stop service -d pdb -s pdb_taf (stop pdb_taf only, not stop the instances)
$ srvctl stop service -d pdb (stop all services accessing pdb?, including pdb_taf)

In general:
$ srvctl stop service -d db_name [-s service_name_list [-i inst_name]]

- Shut down all Oracle RAC instances on all cluster nodes by entering the following command where db_name is the name of the database:
$ srvctl stop database -d pdb
(or $ srvctl stop db -d pdb )
$ srvctl stop database -d pdb -o immediate

In general:
$ srvctl stop database -d db_name

- Shut down Automatic Storage Management (ASM) instances on all cluster nodes by entering the following command (replace node_name with each node):

$ srvctl stop asm -n node_name

- To stop the listener running on a node, where the listener is running:

$ srvctl stop listener -n node_name [-l listenername]

- Stop all node applications (gsd, ons, listener, and vip) on all cluster nodes by entering the following command as the root user, where node_name is the name of the node where the applications are running:

# srvctl stop nodeapps -n node_name

- Shut down the Oracle Clusterware processes by entering the following command on all nodes as the root user:

# CRS_home/bin/crsctl stop crs

2. Start the database

- Start all instances (database)
$ srvctl start database -d db_name
- Start an instance
$ srvctl start instance -d db_name -i inst_name
- Start a services pdb_taf:
$ srvctl start service -d pdb -s pdb_taf
(If related instances are down, it will start all instances as well)

In general:
$ srvctl start service -d db_name -s service_name
$ srvctl start service -d pdb (start all services?)

- Start listener on each node of the cluster:
$ srvctl start listener -n node

3. A way to run RAC in a single instance:
- In instance PDB1 on PDB1P, issue
SQL> alter system cluster_database=false scope=spfile;

- Stop all services and instances:
pdb2p:$ srvctl stop service -d pdb
pdb2p:$ srvctl stop database -d pdb -o immediate

- Restart all instances and services:
pdb2p:$ srvctl start database -d pdb
pdb2p:$ srvctl start service -d pdb -s pdb_taf (only need this one?)

- Check the status:
pdb2p:$ srvctl status service -d pdb
Service pdb_taf is running on instance(s) pdb2
pdb2p:$ srvctl status db -d pdb
Instance pdb1 is not running on node pdb1p
Instance pdb2 is running on node pdb2p

- alter_pdb1.log shows the message:

Sun Feb 17 15:52:09 2008
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Interface type 1 en3 192.168.10.0 configured from OCR for use as a cluster interconnect
Interface type 1 en0 10.1.0.0 configured from OCR for use as a public interface
Picked latch-free SCN scheme 3
WARNING: db_recovery_file_dest is same as db_create_online_log_dest_2
Autotune of undo retention is turned on.
IMODE=BR
ILAT =121
LICENSE_MAX_USERS = 0
SYS auditing is disabled
ksdpec: called for event 13740 prior to event group initialization
Starting up ORACLE RDBMS Version: 10.2.0.3.0.
System parameters with non-default values:
processes = 1000
sessions = 1105
sga_max_size = 4294967296
__shared_pool_size = 570425344
__large_pool_size = 33554432
__java_pool_size = 16777216
__streams_pool_size = 0
spfile = +PDATA/pdb/spfilepdb.ora
sga_target = 4294967296
control_files = +PDATA/pdb/controlfile/current.384.636108915, +PFRA/pdb/controlfile/current.272.636108915
db_block_size = 8192
__db_cache_size = 3657433088
compatible = 10.2.0.3.0
log_archive_dest_1 = LOCATION=+PFRA
db_file_multiblock_read_count= 8
cluster_database = FALSE
cluster_database_instances= 1
db_create_file_dest = +PDATA
db_create_online_log_dest_1= +PDATA
db_create_online_log_dest_2= +PFRA
db_recovery_file_dest = +PFRA
db_recovery_file_dest_size= 605590388736
thread = 1
instance_number = 1
undo_management = AUTO
undo_tablespace = UNDOTBS1
remote_login_passwordfile= EXCLUSIVE
db_domain =
dispatchers = (PROTOCOL=TCP) (SERVICE=pdwaXDB)
remote_listener = LISTENERS_PDB
job_queue_processes = 10
parallel_max_servers = 40
parallel_execution_message_size= 16384
background_dump_dest = /u01/oracle/admin/pdb/bdump
user_dump_dest = /u01/oracle/admin/pdb/udump
core_dump_dest = /u01/oracle/admin/pdb/cdump
audit_file_dest = /u01/oracle/admin/pdb/adump
db_name = pdb
open_cursors = 300
pga_aggregate_target = 536870912
Cluster communication is configured to use the following interface(s) for this instance
192.168.10.101
Sun Feb 17 15:52:09 2008
cluster interconnect IPC version:Oracle UDP/IP (generic)
IPC Vendor 1 proto 2
PMON started with pid=2, OS id=1200584
DIAG started with pid=3, OS id=831956
PSP0 started with pid=4, OS id=1409044
LMON started with pid=5, OS id=1179846
LMD0 started with pid=6, OS id=1290462
MMAN started with pid=7, OS id=1241146
DBW0 started with pid=8, OS id=1405370
LGWR started with pid=9, OS id=729280
CKPT started with pid=10, OS id=880810
SMON started with pid=11, OS id=926172
RECO started with pid=12, OS id=684094
CJQ0 started with pid=13, OS id=589840
MMON started with pid=14, OS id=1417592
Sun Feb 17 15:52:10 2008
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
MMNL started with pid=15, OS id=917530
Sun Feb 17 15:52:10 2008
starting up 1 shared server(s) ...
Sun Feb 17 15:52:10 2008
lmon registered with NM - instance id 1 (internal mem no 0)
cluster_database_instances parameter mismatch!
Instance 1 = 2, mine = 1
This instance has not mounted yet. Exiting!
Sun Feb 17 15:52:11 2008
USER: terminating instance due to error 29707
Instance terminated by USER, pid = 1474652

No comments: