Thursday, February 28, 2013

UTL_FILE example

The UTL_FILE package lets your PL/SQL programs read and write operating system (OS) text files.

Example:

declare
l_output utl_file.file_type;
begin
l_output := utl_file.fopen('DUMP_DIR','output.txt','w');
utl_file.put(l_output,'utl_file example');
utl_file.fclose(l_output);
end;

 

Sunday, February 3, 2013

11gR2 RAC Tips

Configure User Equivalence :

Run below script from Grid Software location to configure user equivalance.

./sshUserSetup.sh -user grid -hosts "vm3 vm4" -advanced -noPromptPassphrase

Role Separation in 11gR2 RAC:

1.Creating groups and  Users for GI software.

$groupadd -g 1000 oinstall
$groupadd -g 1200 asmadmin
$groupadd -g 1201 asmdba
$groupadd -g 1202 asmoper

$useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -S /bin/bash -c "GI Owner"  grid

Select below options while installing GI software.

ASM Database Administrator(OSDBA) group --> asmdba
ASM Instance Administration Operator (OSOPER) group --> asmoper
ASM Instance Administrator (OSASM) group --> asmadmin

2.Creating groups and  Users for Database software.
$groupadd -g 1300 dba
$groupadd -g 1301 oper

useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -S /bin/bash -c "Database Owner"  oracle


select below options while installing oracle software

Database administrator (OSDBA)group --> dba
Database operator (OSOPER) group --> oper