22 September 2010

Grant/Revoke object privileges

begin
  for cur in (select do.owner || '.' || do.object_name obj
                from dba_objects do
               where do.owner = 'user1'
                 and do.object_type = 'TABLE') loop
    execute immediate 'grant select on ' || cur.obj || ' to user2';
    --execute immediate 'revoke select on '||cur.obj ||' from user2';
    dbms_output.put_line(cur.obj);
  end loop;
end;

21 September 2010

OEL Installation options

Packages selection
Applications
- Grafical Internet
Development Tools
- Development Libraries
- Development Tools
- GNOME Software Development
- Java Development
- Legacy Software Development
- X Software Development
   Optional Packages
   - libXP-devel
   - openmotif-devel
Base System
- Legacy Software Support
   Optional packages
   - compat-db
- System Tools
   Optional packages
   - sysstat

14 September 2010

Linux kernel parameters for Oracle installation

1) Edit file /etc/sysctl.config
example RAM8Gb
kernel.shmmax = 2147483648 #max RAM
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=1048576
net.core.rmem_max=1048576
net.core.wmem_default=262144
net.core.wmem_max=262144

06 August 2010

LDAP essentials

LDAP is an acronym that stands for Lightweight Directory Access Protocol.


Oracle is beginning to support and use LDAP. Release 8.1.6 contain an LDAP naming adaptor for Net8. This allows you to define net service names in an LDAP directory instead of the traditional tnsnames.ora file. Another planned use for LDAP in the Oracle world is to support single sign-on. Instead of defining the same user over-and-over again in different databases, you will be able to define a user once in an LDAP directory. Information about a user's roles and privileges will be stored in the directory. The user will authenticate to the directory, and once that has been done, the user will be able to connect to any Oracle database that he has been authorized to use without having to supply a database-specific username and password.

03 August 2010

Flush buffers

alter system flush shared_pool;
alter system flush buffer_cache;

30 July 2010

Parametrized view

Following is an example which shows use of parametrized view:

CREATE OR REPLACE VIEW test_vw AS
SELECT empno,ename,sal
FROM emp
WHERE empno = to_number(userenv('client_info')) ;

In Stored Procedure, will have to call following procedure before executing the View query, as in following example:

exec dbms_application_info.set_client_info(7934);

select * from test_vw ;

And the output is:

EMPNO ENAME SAL
---------- ---------- ----------
7934 MILLER 13040

05 July 2010

Installation Oracle 10g on Slackware 13.1 Linux

The reason for this actions could be an error has been gotten while installing Oracle on Slackware.
Error description: Failure OS verification
Action: create a file - /etc/redhat-release for OS verification and add something like "Red Hat Enterprise Linux AS release 3 (Taroon)".