Wednesday, December 26, 2012

File Permissions in Unix - Numeric Representation

chmod 777 file_name - gets you full access to everybody in Unix. What does 777 mean?
First digit is OWNER, Second digit is GROUP and the Third is OTHERS.

So, if a file has rwx-x-x which means, Owner can Read, Write an Execute (rwx) and the Group and the Other can only Execute (x). Below chart represents the numbers (like 755, 644) and its meaning.

Octal digit
Text equivalent
Binary value
Meaning
0
---
000
All types of access are denied
1
--x
001
Execute access is allowed only
2
-w-
010
Write access is allowed only
3
-wx
011
Write and execute access are allowed
4
r--
100
Read access is allowed only
5
r-x
101
Read and execute access are allowed
6
rw-
110
Read and write access are allowed
7
rwx
111
Everything is allowed


As you see that "1" stands for execute only, "2" stands for write only, "4" stands for read only. To combine the permissions you can simply add 1, 2 and 4 to get a needed combination. For instance, to get read and write permissions, you add 4 (read) and 2 (write), thus getting 6 (read and write). To get read and execute permissions, you add  4 (read) and 1 (execute), thus getting 5 (read and execute).

PS: Adding this here for my quick reference not that the world doesn't know about it :)

Monday, November 12, 2012

How to find Cluster Interconnect IP in RAC

Couple of ways around to find the Interconnect IP Address defined in RAC environment.

First thing would be to look in /etc/hosts to see which IP is assigned based on the comments or naming conventions.

Or check ASM Alert logs for the wording "Cluster Communication is configured to use the following interface(s)"

Or
Run the following sql:

select inst_id, ip_address from gv$cluster_interconnects;

Wednesday, October 31, 2012

ORA-13516: AWR Operation failed: only a subset of SQL can be issued

First started noticing that OEM is not showing any stats in other words no change in the session activity...
Digging into more found that the error "ORA-13516: AWR Operation failed: only a subset of SQL can be issued" showing up.

So, tried to create a snapshot manually and got the same error:

SQL> exec dbms_workload_repository.create_snapshot;
BEGIN dbms_workload_repository.create_snapshot; END;

*
ERROR at line 1:
ORA-13516: AWR Operation failed: only a subset of SQL can be issued
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 10
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 33
ORA-06512: at line 1


Looking into metalinks note#1226534 its apparent that either you have to run CATAWR.SQL or just bounce the instance (well, in my case its RAC database so no need to bounce the entire db but just the instance). 

Bounced the instance and now everything is running smooth again...
SQL> exec dbms_workload_repository.create_snapshot;

PL/SQL procedure successfully completed.