Now: Tutorial for Web and Software Design > Database > Oracle > Database Content
> Getting control of the Oracle JavaVirtual Machine [Bookmark it]
Getting control of the Oracle JavaVirtual Machine

Java Backup

A good backup is always a DBA's best friend, especially when the database has a large number of Java Classes, Java Resources, Java Grants and Policies. No special tool is provided by Oracle to handle the Java objects backup, you'll need to use standard utilities.

A Java Classes Backup is made by a full database export without rows.

Example of a full database export:

% exp userid=system full=y ROWS=N file=full_export_norows.dmp 

To restore Java Classes from previously taken backup:

 
% imp userid=system INGORE=Y full=y

Java Privileges Backup is simply a Java grants and policies extraction from the database. Here is the script to extract the Java information (Oracle Metalink, DocID: 183825):

spool setjvmprivs.sql 
set echo off 
set feedback off 
set heading off 
set linesize 80 
set pagesize 1000 
column stmt format a70 word_wrapped 
select 'exec '||stmt 
from (select seq, 'dbms_java.grant_permission('''||grantee||''','''|| 
             type_schema||':'||type_name||''','''||name||''','''||action|| 
             ''');' stmt 
      from dba_java_policy 
      where grantee not in ('JAVADEBUGPRIV', 'JAVASYSPRIV', 'JAVAUSERPRIV', 
                         'JAVA_ADMIN', 'JAVA_DEPLOY', 'SYS', 'PUBLIC') and 
            type_name!='oracle.aurora.rdbms.security.PolicyTablePermission' 
      union all 
      select seq,'dbms_java.grant_policy_permission('''||a.grantee||''','''|| 
             u.name||''','''||permition||''','''||action||''');' stmt 
      from sys.user$ u, 
           (select seq, grantee, 
                   to_number(substr(name,1,instr(name,':')-1)) userid, 
                   substr(name,instr(name,':')+1,instr(name,'#') - 
                          instr(name,':')-1) permition, 
                   substr(name,instr(name,'#')+1 ) action 
            from dba_java_policy 
            where grantee not in ('JAVADEBUGPRIV', 'JAVASYSPRIV', 
                                  'JAVAUSERPRIV', 'JAVA_ADMIN', 'JAVA_DEPLOY', 
                                  'SYS', 'PUBLIC') and 
                  type_name = 
                      'oracle.aurora.rdbms.security.PolicyTablePermission') a 
      where u.user#=userid) order by seq; 
column stmt clear 
set pagesize 24 
set heading on 
spool off 

Output from that script should produce Java recreation commands like:

exec dbms_java.grant_permission('SCOTT','SYS:java.io.FilePermission','temp\output.txt','read,write);

Conclusion

Recent surveys showed interesting answers to the question of 'why use Java'.

Some said because Java developers are easier to find than other developers, others are of the opinion that the development time is reduced due to Java code's simplicity and accessibility. Most of them believe that Java's performance will be comparable to other natively compiled languages in the future.

Once loaded, the Java option will need attention from a DBA.

When it is no longer needed, it should be removed, rather than just sizing down the Java pool.

Previous  

Prev  [1] [2] [3] [4] [5] [6] [7] 

[Bookmark][Print] [Close][To Top]
  • Prev Article-Database:

  • Next Article-Database:
  • Related Materias
    Automating ETL using Oracl
    It All Depends on the CONT
    Understanding Oracles Loca
    Using Oracle Locks to Mana
    Returning Rows Through a T
    Document Management with O
    Disk Sorts - A Subtle Thre
    Altering Oracles SQL*Plus 
    So You Want to Use Oracles
    Reporting Database Object 
    Topics
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Graphic Design Tutorial
     

    Coreldraw Tutorial

      Illustrator Tutorial
      3D Graphics Articles
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial&Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial&Articles
     

    XML Style Tutorial

      AJAX Tutorial
      XML Mobile
    Flash Tutorial&Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial&Articles
     

    Linux Tutorial

      Symbian Tutorial
      MacOS Tutorial