Oracle 11g Direct NFS
source: http://www.oracle.com/technology/deploy/performance/pdf/directnfsclient_11gr1_twp.pdf
I have tested the Oracle NFS Driver on Oracle Enterprise Linux 5.1 with Oracle 11.1.0.7
Instead of using the Kernel NFS Driver, Oracle 11g provides its own Direct NFS driver. Hence Oracle will optimize the I/O path between Oracle and the NFS server.
The following is the order where Oracle searchs for NFS exports.
- $ORACLE_HOME/dbs/oranfstab
- /etc/oranfstab
- /etc/mtab (content of mounted /etc/fstab)
So you have just to configure your /etc/fstab, with no special parameter as mentioned in metalink#359515.1 , as follow:
filername:/vol/nfs_data01/q_nfs_data01 /nfs/SID/data1 nfs mount -a
Then you have to link some libraries in your $ORACLE_HOME
cd $ORACLE_HOME/lib mv libodm11.so libodm11.so_stub ln -s libnfsodm11.so libodm11.so
Now you can start your Oracle Instance and check the alertlog file for this line:
Oracle instance running with ODM: Oracle Direct NFS ODM Library Version 2.0
Hence the Driver of Oracle is used for NFS.
There are also some Views to check the stats and the current nfs exports you are using:
SQL> SELECT svrname, dirname FROM v$dnfs_servers; SVRNAME DIRNAME --------------- filername /vol/nfs_data01/q_nfs_data01
Some other views:
v$dnfs_servers v$dnfs_files v$dnfs_channels v$dnfs_stats
De-Support of RAW devices in Oracle 12g
In Oracle 12g there are no more raw devices support for datafiles, redologs etc… also in a RAC environment no more raw device support for voting and ocr disks. Hence you have to change to ASM, NFS, OCFS,…
source: Metalink Note: 578455.1
Java Versions
Sometimes you read JDK 6.0 or JDK 1.6. So where is the difference?
JDK 6.0 is the product version whereas JDK 1.6 is the developer version.
Source: http://java.sun.com/javase/6/webnotes/version-6.html
XWiki on OC4J
Configuring XWiki in an OC4J instance of an Oracle Application Server and an Oracle Database.
- Download the Software:
- xwiki-enterprise-web-1.4-milestone-2.war for OC4J Container
- xwiki-enterprise-wiki-1.4-milestone-2.xar Import in new XWiki (some default pages etc..)
- Create a XWiki OC4J Instance for the additional extenstion use for example xwiki
- Create a Oracle 10g Database or just a new user/schema in an existing db. Install Guide
- Don’t forget to download the Oracle JDBC Driver (e.g. ojdbc14.jar) and to adapt your hibernate.cfg.xml file
- Now connect http://server_name:port/xwiki then the tables in the xwiki scheme will be created. after this you will get an error “document not found..” go on adminisration and import the xwiki-enterprise-wiki-1.4-milestone-2.xar – file. now you have a default xwiki page.
It’s on you to adapt the wiki to your needs.
Known Bugs:
- Export PDF and RTF
- Recyclebin of XWiki
An useful link to get an overview of some wiki’s is www.wikimatrix.org
Oracle 10g Basics
Here is a short overview for Oracle 10g Basics including Memory Structure, Background Processes and Storage Structures.
Memory Structure
System Global Area (SGA) (sga_max_size and sga_target)
This is a shared memory area containing data and control information for the instance. Users can share data to avoid repeated access from physical disk.
SGA Components
Buffer Cache (db_cache_size)
If you select/modify any data it stores them from disk in the buffer cache, hence all user processes share this buffer cache
Shared Pool (shared_pool_size)
This pool chaches information that can be shared among users:
SQL statements can be reused (use bind variable)
Information from datadictionary (table/index description, user account data and privileges)
Stored procedures
Redo Log Buffer (log_buffer)
This buffer caches redo information before it can be written to the physical redo log files stored on disk
Large Pool (large_pool_size)
This buffers large I/O requests for various server processes
Java Pool (java_pool_size)
This is used for all session specific Java code and data within the JVM
Streams Pool (streams_pool_size)
This is used by Oracle Streams product
Program Global Area (PGA) (pga_aggregate_target)
This is a nonshared memory area. Each Oracle server process has its own PGA. It’s used to process SQL statements and to hold logon and other session information. The amount of the PGA depends on the instance configuration
Background Processes
The background processes depend on the features that are being used in the database. Here the most common background processes:
Database Writer (DBWn) (db_writer_processes max. 20)
Writes modified blocks from the database buffer cache to the files on the disk.
Log Writer (LGWR)
Writes redo log entries sequentially to the redologfiles generated in redo log buffer of the SGA. Force it with:
alter system switch logfile;
Checkpoint (CKPT)
At a specific time. all modified database buffers in the SGA are written to the datafiles by a DBWn. This event signal is called a checkpoint. The checkpoint process signals the DBWn to update all datafiles and control files of the database. To force it use:
alter system checkpoint;
System Monitor (SMON)
This performs a crash recovery when a faild instance starts up.
Process Monitor (PMON)
This perfomrs a recovery when a user process fails. E.g. if a session gets killed. It cleans up the cache and frees recources that the filed process was using.
Achiver (ARCn) (log_archive_dest_n max. 10)
This copy the redo log files to archival storage when the log files are full or a log switch occurs. The database must be in archive log mode to run archive process. (log_archive_start)
Storage Structures
Conrol Files (control_files)
A control file tracks the physical components of the database. It is also the repository for RMAN. It is essential to the functioning of the database. Because its importance, Oracle recommend three copies of the controlfile of course on different disks.
Online Redo Log Files
The redo log records all changes made to data. If a failure prevents modified data from being permanently written to the datafiles, then the changes can be obtained from the redo log, so work is never lost. The switch of the redo log should be between 15 and 20 minutes, so you must size the redo logs to size which correlates with this times.
Archive Log Files (if log_archive_start=true)
This is the archive of the redo log files. So the redo log files are written to an other location with an other filename (log_archive_format)
Datafiles
Datafiles are the operating system files that hold data within the database. The files have a special format that can only be readen/written by Oracle.
Components of datafiles:
Segments and Extents
There exists data segments for tables and index segments for indexes. An extent is a contiguous set of data blocks within a segment. Oracle allocates an extent of a specific size for a segment, but if that extent fills, the more extens can be allocated.
Data Blocks
These is the smallest unit of I/O to database storage. An extent consists of several contiguous data blocks. If you create a database you must set the db_block_size parameter. You cannot change this parameter anymore.
Tablespaces
A tablespace is a logical structur consisting of one or more datafiles or temfiles.
Oracle recommends locally-managed tablespaces over dictionary-managed tablespaces. With locally-managed tablespaces offers a better performance and they keep the space allocation information within the tablespace not in the data-dictionary.
Type of tablespaces
Permanent Tablespaces
This type stores permanent data, such as system data, user data and application data.
Undo Tablespace
A database running in automatic undo management mode transparently creates and manages undo data in the undo tablespace. Oracle uses undo data to provide read-consistency and to enable features such as Flashback query. You can only have one active undo tablespace at a time.
Temporary Tablespace
Temporary tablespaces are used for storing temporary data, as would be created when SQL statements perform sorts (order by)
Default Tablespaces
After creating a database there are some predefined tablespaces
EXAMPLE
This one contains sample schemas for documentation and educational uses.
SYSAUX
This is an auxiliary tablespace to the SYSTEM tablespace.
Using SYSUAX reduces the load on the SYSTEM tablespace and reduces maintenance because there are fewer tablespaces to monitor and maintain. Every Oracle Database 10g or higher level database must have a SYSAUX tablespace. Components that uses SYSAUX as their default tablespace are: Automatic Workload Repository, Oracle Streams, Oracle Text, Enterprise Manager Repository etc…
SYSTEM
Oracle uses this tablespace to managa the database. It contains the data dictionary, which is a central set of tables and view used as a read-only reference for a particular database. It contains also tables and views under the SYS schema that contain administrative information about the database.
TEMP
This one would be used for query sorting. A temporary tablespace should be defined as the default temp tablespace.
UNDOTBS1
This is used to store undo information. Every database must have an undo tablespace.
USERS
This is uesd to store permanent user objects and data. This sould be the default tablespace for new users.
Source: Oracle 2 Day DBA
SQL Injection (dbms_assert)
Using SQL injection, a hacker can pass string input to an application in hopes of gaining unauthorized access to a database. Here is a nice tutorial about this subject and how to prevent it. It shows also the use of the undocumented (in 10g not in 11g) dbms_assert Package.
Oracle Clusterware: Third Voting disk on NFS
A voting disk is a critical file for Oracle Clusterware. You must have at least 3 voting disks. If you have “only” two SAN then you can configure the third on a NFS share.
Oracle supports now a third voting disk on NFS for HPUX. But only for HPUX 11.31 and Oracle Clusterware 10.2.0.2 onwards.
This white paper describse how to configure it:
Using standard NFS to support a third voting disk on an Extended Distance cluster configuration on Linux,AIX,HP, or Solaris (PDF)
Inheritance and Interface in Java
Here are some possibilities of how to use and mix inheritances and interfaces in Java.
implements: implements an interface to the class
extends: extends the subclass from the superclass
interface Ione {}
interface Itwo {}
interface Ithree extends Ione {}
interface Ifour extends Ione, Itwo {}
class Cone {}
class Ctwo extends Cone {}
class Cthree implements Ione {}
class Cfour extends Cone implements Ione {}
class Cfive extends Cone implements Ione, Itwo {}
Eclipse with Oracle JDBC
Follow this steps to use Eclipse with an Oracle JDBC Driver.
- Download the Oracle JDBC Driver (Interoperability Matrix)
- Classpath must include the location of the Driver (.jar file)
OR
Save it in:JAVA_HOME/jre/lib/ext/ - Now let’s code… example
- Rename to DBconnect.java and adapt the parameters for DriverManager.getConnection
C:\>javac DBconnect.java C:\>java DBconnect Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi PL/SQL Release 10.2.0.3.0 - Production CORE 10.2.0.3.0 Production TNS for HPUX: Version 10.2.0.3.0 - Production NLSRTL Version 10.2.0.3.0 - Production
Hack Oracle
There is a new interesting article about different ways to hack oracle and how to prevent this attacks.
Eight Ways to Hack Oracle Part I
- SQL Injection
- Default Passwords
- Brute Force
- Sneaking Data out the Back Door
Part II is coming soon…