Search This Blog

Wednesday, December 28, 2011

Revoke object granted to PUBLIC for a specific USER

SELECT ' revoke all on '||owner||'.'||table_name||' from public;'
FROM table_privileges
WHERE grantee = 'PUBLIC'
AND OWNER='UM'
ORDER BY owner, table_name;

When a new table is created , a SELECT priveleges on that TABLE is added to a ROLE.

When a new table is created , a SELECT priveleges on that TABLE is added to a ROLE.
====================================================================================
--Create the tigger and the hr_s role under sys.

CREATE OR REPLACE TRIGGER ddl_trig
AFTER DDL
ON DATABASE
DECLARE
main_sql_text varchar2(100);
job_name_ varchar2(30);
job_type_ varchar2(30);
job_action_ varchar2(4000);
sql_text varchar2(400);
job_id_ varchar2(30);
start_date_ timestamp;
BEGIN

if (ora_sysevent='CREATE' and ora_dict_obj_type='TABLE' and ora_dict_obj_owner='HR' )then
sql_text := 'grant select on '||ora_dict_obj_owner||'.'||ora_dict_obj_name||' to hr_s';
select to_char(systimestamp,'DDMMYYYYHH24MISS') into job_id_ from dual;
select SYSTIMESTAMP + interval '1' minute into start_date_ from dual;
main_sql_text:=''''||sql_text||'''';
job_name_:='job'||job_id_;
job_type_:='PLSQL_BLOCK';
job_action_:='begin execute immediate('||main_sql_text||'); end;';
execute immediate ('begin DBMS_SCHEDULER.create_job (job_name=> :a,job_type=> :b,job_action => :c,start_date=> :d,repeat_interval => NULL,end_date=> NULL,enabled=>TRUE,comments=> NULL); end;') using job_name_,job_type_,job_action_,start_date_;
end if;
END ddl_trig;
/


--Grant the role on a privelges users.

Tuesday, December 27, 2011

Prepare Oracle Linux 6 for Installing Oracle 11gR2 (rpm packages))

Prepare Oracle Linux 6 for Installing Oracle 11gR2
by Michael Georgiou
============================================================
mpfr-2.4.1-6
cpp-4.4.4-13
ppl-0.10.2-11
gcc-4.4.4-13
cloog-ppl-0.15.7-1.2
binutils-2
glibc-2
nss-softokn-freebl-3
glibc-2
nss-softokn-freebl-3
compat-libstdc++-33
glibc-common-2
glibc-devel-2
glibc-headers-2
elfutils-libelf-0
elfutils-libelf-devel-0
gcc-4
gcc-c++-4
ksh-
libaio-0
libaio-devel-0
libgcc-4
libstdc++-4
libstdc++-devel-4
make-3.81mpfr-2.4.1-6
cpp-4.4.4-13
ppl-0.10.2-11
gcc-4.4.4-13
cloog-ppl-0.15.7-1.2
numactl-devel-2
sysstat-9
compat-libstdc++-33
compat-libcap


All packages are available :/media/OL6.0 i386 Disc 1 20110203/Server/Packages

Friday, December 23, 2011

SQL Performance

DECLARE
TYPE rc IS REF CURSOR;
l_rc rc;
l_dummy all_objects.object_name%TYPE;
l_start number DEFAULT dbms_utility.get_time;
BEGIN
FOR i IN 1 .. 1000
LOOP
OPEN l_rc FOR
'select object_name
from all_objects
where object_id = ' || i;
FETCH l_rc INTO l_dummy;
CLOSE l_rc;
dbms_output.put_line(l_dummy);
END LOOP;
dbms_output.put_line(ROUND((dbms_utility.get_time-l_start)/100, 2) ||' Seconds...' );
END;
/

Thursday, December 22, 2011

Create schema statistics using DBMS_STATS

dbms_stats.gather_schema_stats
(
ownname=>'HR',
cascade=>TRUE, ---Indexes are included
method_opt=>'FOR ALL INDEXED COLUMNS',--Create Histograms
estimate_percent => dbms_stats.auto_sample_size, --Takes Sample size for the tables and Indexes
degree => 2 --Parallel degree 2
);

Wednesday, December 21, 2011

Create Service in a single Instance database

exec DBMS_SERVICE.CREATE_SERVICE('TPCH','TPCH');
exec DBMS_SERVICE.START_SERVICE('TPCH','ORCL');


TPCH =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TPCH)
)
)


sqlplus system/xxxxxx@TPCH

Monday, November 14, 2011

Package persistent stage - Example

Package persistent stage - Example
--------------------------------------------------------------------------------------- Every time ( in the same session ) that a procedure EMP is executed it returns the next 30 rows from table employees until the cursor returns all rows.

CREATE OR REPLACE PACKAGE EMP AS

/* TODO enter package declarations (types, exceptions, methods etc) here */
cursor c is select * from employees;
return_rows number:=30;
procedure PRINTEMPLOYEES ;
END EMP;
----------------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE BODY EMP AS

procedure PRINTEMPLOYEES
as
cr c%ROWTYPE;
fetched number:=0;
BEGIN

IF NOT c%ISOPEN THEN
OPEN c;
END IF;
loop
fetch c into cr;
EXIT WHEN c%ROWCOUNT > return_rows OR c%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(cr.last_name);
end loop;
return_rows:=return_rows+30;
END PRINTEMPLOYEES;

END EMP;
/
----------------------------------------------------------------------------------------

Friday, November 11, 2011

Check Alert.log for ORA- errors using PLSQL

create or replace procedure write_file

( DIR IN VARCHAR2,filename IN VARCHAR2,text IN varchar2)


is

file utl_file.file_type;

begin

file:=utl_file.fopen(DIR, filename,'a');

utl_file.put_line(file,text);

utl_file.new_line(file);

utl_file.fclose(file);

end;

/


create or replace

procedure read_file ( DIR IN VARCHAR2,filename IN VARCHAR2, report IN VARCHAR2)

is

file utl_file.file_type; --file handler

buffer char(1000);

--EOF boolean:=false;

begin

if not utl_file.is_open(file) then

file := utl_file.fopen(DIR,filename,'R');

end if;

loop

begin

utl_file.get_Line(file,buffer,32767);

--dbms_output.put_line(buffer);

if instr(buffer,'ORA-')=1 then

---dbms_output.put_line(buffer);

write_file(DIR, report,buffer);

end if;

exception

when no_data_found then

exit;

end;

end loop;








-- To run everynight at midnight starting tonight

exec dbms_job.submit

(:v_JobNo, 'proc1;', TRUNC(SYSDATE)+1, 'TRUNC(SYSDATE)+1');

How to call c shared library (.so) from PLSQL

The example uses Oracle Linux 5 32bits , Oracle 11gR2 EE

Call C

csum

int csum(int a, int b)
{

return (a+b);

}

gcc -c -fPIC csum.c -o csum.o
gcc -shared -Wl,-soname,csum.so.1 -o csum.so.1.0.1 csum.o

mv csum.so.1.0.1 /oracle/product/11.2.0/dbhome_1/lib
ln -sf /oracle/product/11.2.0/dbhome_1/lib/csum.so.1.0.1 /oracle/product/11.2.0/dbhome_1/lib/csum.so

ln -sf /oracle/product/11.2.0/dbhome_1/lib/csum.so.1.0.1 /oracle/product/11.2.0/dbhome_1/lib/csum.so.1

create or replace library calc_sum as '/oracle/product/11.2.0/dbhome_1/lib/csum.so';
/

create or replace function getCSUM( a binary_integer,b binary_integer) return binary_integer
as language c
library calc_sum
name "csum";
/

select getCSUM(10,2) from dual;


How to Call C and Java from PLSQL

Call C
csum
int csum(int a, int b)
{

return (a+b);

}
gcc -c -fPIC csum.c -o csum.o
gcc -shared -Wl,-soname,csum.so.1 -o csum.so.1.0.1 csum.o
mv csum.so.1.0.1 /oracle/product/11.2.0/dbhome_1/lib
ln -sf /oracle/product/11.2.0/dbhome_1/lib/csum.so.1.0.1 /oracle/product/11.2.0/dbhome_1/lib/csum.so

ln -sf /oracle/product/11.2.0/dbhome_1/lib/csum.so.1.0.1 /oracle/product/11.2.0/dbhome_1/lib/csum.so.1
create or replace library calc_sum as '/oracle/product/11.2.0/dbhome_1/lib/csum.so';
/
create or replace function getCSUM( a binary_integer,b binary_integer) return binary_integer
as language c
library calc_sum
name "csum";
/
select getCSUM(10,2) from dual;
Call Java

java

public class JSUM
{
public static int sum ( int a , int b){return a+b;}
}


[oracle@db11g myC]$ /oracle/product/11.2.0/dbhome_1/jdk/bin/javac JSUM.java
[oracle@db11g myC]$ loadjava -user hr/hr JSUM.class


 ALTER JAVA CLASS "JSUM"
    RESOLVER (("C:\app\Administrator\product\11.2.0\dbhome_1\jdk\bin\*" pm)(* public))
   RESOLVE;

create or replace function javaSUM( a number,b number) return number
as
language java
name 'JSUM.sum(int,int) return int';
/

select javaSUM(1,2) from dual;

PLSQL Large objects example

Large objects exercise

As sys create the oracle directory EMP_DATA. Grant the appropriate privileges to user HR to read and write on this directory.

Modify your employees table (_emp) add columns emp_resume clob and emp_photo bfile. For each employee that exist in your table update the new columns as follows: (a) for emp_resume add the String 32000 bytes String emp_name ||' resume is: '||plus dots(....) till 32000 characters (b) add the anonymous photo for all employee.

Write a procedure to print your table's date. For the resume print its length,for photo just print the photo size.

Solution

As sys:


create or replace directory IMG as 'C:\Libraries\Pictures';

grant read,write on directory IMG to hr;


As hr:

drop table michael_emp purge;


create table michael_emp

(

emp_id number primary key,

emp_name varchar2(30) not null

);


insert into michael_emp values ( 1,'mmmmm');

insert into michael_emp values ( 2,'ggggg');


commit;


alter table michael_emp add emp_resume clob;

alter table michael_emp add emp_photo bfile;


create or replace procedure updateEMP

as

cursor c is select emp_id,emp_name from michael_emp FOR UPDATE;

cr c%ROWTYPE;

begin

for cr in c loop

update michael_emp set emp_resume=RPAD(cr.emp_name||' resume is: ',32000,'.') ,

emp_photo=bfilename('EMP_DATA','anonymous.jpg')

where current of c;

end loop;

commit;

end;


CREATE OR REPLACE PROCEDURE PRINTEMP AS

cursor c is select * from michael_emp ;

cr c%ROWTYPE;

BEGIN

for cr in c loop

dbms_lob.fileopen(cr.emp_photo);

dbms_output.put_line('Employee ID:'||cr.emp_id||' Name:'||cr.emp_name||' Resume size: '||dbms_lob.getlength(cr.emp_resume) ||' Photo size: '||dbms_lob.getlength(cr.emp_photo));

dbms_lob.fileclose(cr.emp_photo);

end loop;

END PRINTEMP;

Create a small plsql parser

CREATE OR REPLACE FUNCTION pl_parser ( SQL_ IN VARCHAR2) RETURN varchar2
AS
cursor_name INTEGER;
ecode NUMBER;
emesg VARCHAR2(200);
BEGIN
cursor_name := dbms_sql.open_cursor;
DBMS_SQL.PARSE(cursor_name,SQL_,DBMS_SQL.NATIVE);
return 0;
EXCEPTION WHEN OTHERS THEN
ecode := SQLCODE;
emesg := SQLERRM;
return SQLERRM;
END;
/

Using PLSQL Collections -- Simple Example with Nested Table

Scenario:
============
Three intelligence sensors are used to keep the temperature and humidity of an Area XYZ .
Create a table that will be host sensors results.
Create a procedure to add the temperature (Celsius) and humidity per sensor.
Create a procedure to display temperature (Fahrenheit or Celsius) and humidity per sensor.
Use the TABLE expression to display the table's results
Note : You ust use a NESTED TABLE for your COLLECTION.



create or replace type sensor_measure is object
(
temperature number,
humidity number
);
/

create or replace type sensor_measure_tab as table of sensor_measure;
/

create table sensors
(
sensor_id number primary key,
sensor_name char(1) unique,
location char(3)
);

create table weather
(
sensor_id number,
m_date number(8) not null,
time number(4) not null,
s_measures sensor_measure_tab
)
NESTED TABLE s_measures STORE AS s_measures_storage;

alter table weather add constraint weather_fk foreign key(sensor_id) references sensors ( sensor_id);

insert into sensors values ( 1,'A','XYZ');
insert into sensors values ( 2,'B','XYZ');
insert into sensors values ( 3,'C','XYZ');

commit;
-------------------------------------------------------



CREATE OR REPLACE PROCEDURE ADD_SENSOR_MEASURES
(
SENSOR_ID_ IN NUMBER
, TEMPERATURE_ IN NUMBER
, HUMIDITY_ IN NUMBER
)
AS
sm sensor_measure;
s sensor_measure_tab;
i integer;
m_date_ number;
r_date_ number;
BEGIN
sm:=sensor_measure(TEMPERATURE_,HUMIDITY_);
s:=sensor_measure_tab(sm);
m_date_ := to_number(to_char(sysdate,'YYYYMMDD'));
r_date_ := to_number(to_char(sysdate,'HH24MI'));
insert into weather values (
SENSOR_ID_,
m_date_,
r_date_,
s);
commit;
END ADD_SENSOR_MEASURES;

--------------------------------------------------------------------------------------------
CREATE OR REPLACE PROCEDURE PRINT_WEATHER_PER_SENSOR
(
SENSOR_ID_ IN NUMBER
)
AS
cursor data_(sensorid number) is
select w.sensor_id, w.m_date,w.time,w.s_measures
from weather w
where w.sensor_id=SENSORID;
r data_%ROWTYPE;
s sensor_measure_tab;
sm sensor_measure;
BEGIN
dbms_output.put_line('Data for sensor:'||SENSOR_ID_);
For r_data IN data_(sensor_id_) loop
for i in r_data.s_measures.first..r_data.s_measures.last loop
sm:=r_data.s_measures(i);
dbms_output.put_line('Date:'||r_data.m_date||' '||'Time:'||r_data.time||' Temperature:'||sm.temperature||' Humidity:'||sm.humidity);
end loop;
end loop;
END PRINT_WEATHER_PER_SENSOR;
------------------------------------------------------------------------------------------------------------
select w.sensor_id, w.m_date,time,ws.temperature,ws.humidity from weather w,table(w.s_measures) ws

PLSQL Fine Grained Control Example

-- sys --
CREATE OR REPLACE
PACKAGE PROTECT_HR_SALARY_PKG AS
procedure set_app_context(emp_id_value IN number);
function the_predicate (schema_in IN varchar2,name_in IN VARCHAR2) return varchar2;

END PROTECT_HR_SALARY_PKG;

CREATE OR REPLACE
PACKAGE BODY PROTECT_HR_SALARY_PKG
AS
procedure set_app_context(emp_id_value IN number) AS
BEGIN
dbms_session.set_context ('protect_hr_salaries','emp_id_value',''||emp_id_value);
NULL;
END set_app_context;

function the_predicate (schema_in IN varchar2,name_in IN VARCHAR2) return varchar2
AS
v_r varchar2(2000);
employee_id_ number;
BEGIN
employee_id_:=nvl(sys_context('protect_hr_salaries','emp_id_value'),0);
v_r := 'department_id=( select department_id from hr.departments where manager_id='||employee_id_||')';
return v_r;
END the_predicate;

END PROTECT_HR_SALARY_PKG;

create or replace context protect_hr_salaries using PROTECT_HR_SALARY_PKG;

-- Apply the policy function to the table.
BEGIN
DBMS_RLS.ADD_POLICY (object_schema => 'HR',
object_name => 'EMPLOYEES',
policy_name => 'PROTECT_EMPLOYEES',
function_schema => 'sys',
policy_function => 'PROTECT_HR_SALARY_PKG.the_predicate',
statement_types => 'SELECT,INSERT,UPDATE,DELETE',
enable => TRUE);
END;
/

grant execute on PROTECT_HR_SALARY_PKG to hr


hr
begin
sys.PROTECT_HR_SALARY_PKG. set_app_context(103);
end;
/

SQL> select first_name,salary from employees;

FIRST_NAME SALARY
-------------------- ----------
Alexander 9000
Bruce 6000
David 4800
Valli 4800
Diana 4200

begin
sys.PROTECT_HR_SALARY_PKG. set_app_context(102);
end;
/

SQL> select first_name,salary from employees;

no rows selected

Using PLSQL Collections -- Simple Example with VARRAY

Using Collections
===================
Simple Example with VARRAY

create or replace type colors as varray (10) of varchar2(10);

set serveroutput on size 1000000;
DECLARE
rainbow colors;
BEGIN
rainbow := Colors('Red','Orange','Yellow','Green','Blue','Indigo','Violet');
for i in rainbow.first..rainbow.last loop
DBMS_OUTPUT.put_line(rainbow(i));
end loop;
END;
/


create table my_rainbows_per_day
(
r_date number(8),
rainbow colors
);

---INSERT DATA---

insert into my_rainbows_per_day values ( '20111024',Colors('Red','Orange','Yellow','Green','Blue','Indigo','Violet'));
insert into my_rainbows_per_day values ( '20111025',Colors('Red','Orange','Yellow','Green'));
insert into my_rainbows_per_day values ( '20111026',Colors('Red','Orange','Yellow','Green'));

--- Read data using first and last methods

set serveroutput on size 1000000
DECLARE
cursor c is
select r_date ,rainbow
from MY_RAINBOWS_PER_DAY;
c_r c%rowtype;
BEGIN
FOR c_r IN c LOOP
DBMS_OUTPUT.put_line('DAY:'||c_r.r_date);
for i in c_r.rainbow.first..c_r.rainbow.last loop
DBMS_OUTPUT.put_line(c_r.rainbow(i));
end loop;
END LOOP;

END;
/

--- Read data using first and next methods

set serveroutput on size 1000000
DECLARE
cursor c is
select r_date ,rainbow
from MY_RAINBOWS_PER_DAY;
c_r c%rowtype;
i integer;
BEGIN
FOR c_r IN c LOOP
DBMS_OUTPUT.put_line('DAY:'||c_r.r_date);
i:=c_r.rainbow.first;
while i is not null loop
DBMS_OUTPUT.put_line(c_r.rainbow(i));
i:=c_r.rainbow.next(i);
end loop;
END LOOP;
END;
/


---- Read data using the TABLE expression

select * from TABLE( select r.rainbow from my_rainbows_per_day r where r.r_date=20111024);

---------------------------------------------------------------------------------------------

Sunday, October 16, 2011

Summarizing RAC's service control utility ( SRVCTL) 10gR2

Summarizing RAC's service control utility ( SRVCTL) 10gR2

by Michael Georgiou

Srvctl is the main Oracle Real Application Cluster (RAC) utility which administer RAC objects. RAC objects are databases, instances, asm, nodeapps and services. The purposes of the srvctl is divided in three categories:

  1. Oracle cluster database configuration tasks
  2. General Oracle cluster database administration tasks
  3. Node level tasks

Oracle cluster database configuration tasks

Add, remove modify databases, instances, services

Set and unset environment from databases, instances, services

General Oracle cluster database administration tasks

Start, stop, enable, disable and get statuses for databases, instances, services

Relocate a service back to the preferred instance.

Node level tasks

Add, remove modify node level applications

Set and unset environment from node level applications

Start , stop applications ( Applications can be Virtual IP Adress, Listeners, Oracle notification services and Oracle enterprise manager) .

Srvctl commands

  1. add
  2. config
  3. enable
  4. disable
  5. start
  6. stop
  7. modify
  8. relocate
  9. status
  10. getenv
  11. setenv
  12. unsetenv
  13. remove

Commands description

add

database

instance

service

asm

nodeapps

examples:

srvctl add database -d ORCL -o $ORACLE_HOME

srvctl add instance -d ORCL -i ORCL1 -n racnode1

srvctl add service -d ORCL -s ORCLSRV -r racnode1 -a racnode2

srvctl add asm -n racnode1 -i asm1 -o $ORACLE_HOME

srvctl add nodeapps -n racnode1 -o $ORACLE_HOME \

-A 192.168.0.1/255.255.255.0

config

database

database

service

asm

nodeapps

listener

examples:

srvctl config database -ORCL

srvctl config -d ORCL -s ORCLSRV

srvctl config asm -n noderac1

srvctl config nodeapps -n noderac1

srvctl config listener -n noderac1

enable|disable

database

instance

service

asm

examples:

srvctl enable database -d ORCL

srvctl enable instance -d ORCL -i ORCL1,ORCL2

srvctl enable service -d ORCL -s ORCLSRV

srvctl enable asm -n noderac1 -i asm1

srvctl disable database -d ORCL

srvctl disable instance -d ORCL -i ORCL2,ORCL3

srvctl disable service -d ORCL -s ORCLSRV

srvctl disable asm -n noderac1 -i asm1

start|stop

database

database

service

asm

nodeapps

listener

examples:

srvctl start database -d ORCL -o open

srvctl start instance -d ORCL -i ORCL1,ORCL2

srvctl start service -d ORCL -s ORCLSRV

srvctl start asm -n noderac1 -i asm1

srvctl start nodeapps -n noderac1

srvcrl start listener -n noderac1

srvctl stop database -d ORCL -o immediate -c sys/****@ORCL1

srvctl stop instance -d ORCL -i ORCL1,ORCL2

srvctl stop service -d ORCL -s ORCLSRV

srvctl stop asm -n noderac1 -i asm1

srvctl stop nodeapps -n noderac1

srvcrl stop listener -n noderac1

modify

database

instance

service

nodeapps

Use modify database when:

-change ORACLE_HOME location

-change spfile location

-change the database role (primary,physical_standby,logical_standby)

-change startup option

-change management policy(automatic,manual

Use modify instance when:

-relocate a database instance

-establish a dependency between an asm instance and database instance

Use modify service when:

-Move service from one instance to another

-Changes which instances to be preferred and available

examples:

srvctl modify database -d ORCL -r logical_standby

srvctl modify instance -d ORCL -i ORCL1 -s ASM1

srvctl modify service -d ORCL -s ORCLSRV -r ORCL2 -a ORCL1

srvctl modify nodeapps -n noderac1 -A 192.168.100.2/255.255.255.0/etch0

More service examples:

-Move a service from instance ORCL1 to ORCL2

srvctl modify service -d ORCL -s ORCLSRV -i ORCL1 -t ORCL2

-Change an available instance to be a preferred instance

srvctl modify service -d ORCL -s ORCLSRV -i ORCL1 -r

relocate

service

example:

srvctl relocate service -d ORCL -s ORCLSRV -i ORCL1 -t ORCL3

status

database

instance

service

nodeapps

asm

examples:

srvctl status database -d ORCL -f

srvctl status instance -d ORCL -i ORCL1

srvctl status service -d ORCL -s ORCLSRV

srvctl status asm -n noderac1

srvctl status nodeapps -n noderac1

getenv

database

instance

service

nodeapps

examples:

srvctl getenv database -d ORCL

srvctl getenv instance -d ORCL -i ORCL1

srvctl getenv service -d ORCL -s ORCLSRV

srvctl getenv nodeapps -n noderac1

setenv

database

instance

service

nodeapps

examples:

srvctl setenv database -d ORCL -t LANG=EN

srvctl setenv instance -d ORCL -i ORCL1 -t LANG=EN

srvctl setenv service -d ORCL -s ORCLSRV -t CLASSPATH=/usr/local/jdk/jre/rt.jar

srvctl setenv nodeapps -n noderac1 -t CLASSPATH=/usr/local/jdk/jre/rt.jar

unsetenv

database

instance

service

nodeapps

examples:

srvctl unsetenv database -d ORCL -t LANG

srvctl unsetenv instance -d ORCL -i ORCL1 -t LANG=EN

srvctl unsetenv service -d ORCL -s ORCLSRV -t CLASSPATH

srvctl unsetenv nodeapps -n noderac1 -t CLASSPATH

remove

database

instance

service

nodeapps

asm

examples:

srvctl remove database -d ORCL

srvctl remove instance -d ORCL -i ORCL1

srvctl remove service -d ORCL -s ORCLSRV

srvctl remove service -d ORCL -s ORCLSRV -i ORCL3,ORCL4

srvctl remove nodeapps -n noderac1

srvctl remove asm -n noderac1

Note : use crs_stat -t or crs_stat -u for validating commands

Table: Available commands per RAC's object

Command

Database

Instance

Service

ASM

Nodeapps

add

config

enable|disable

start|stop

modify

relocate

Status

getenv

setenv

unsetenv

remove

For more details please read oracle's reference Oracle database clusterware and oracle real application clusters administration and deployment appendix E.