Wednesday, January 27, 2010

Backup issue

In this issue backup was transferred to another server.
Backup files was succesfully restored and recovered, but database opened with errors:

=============================================================

RMAN> alter database open resetlogs;

database opened
RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
ORACLE error from target database:
ORA-06553: PLS-801: internal error [56327]

RMAN>
=============================================================

Also alert.log was full with those errors:
==================================================================
Wed Jan 27 13:06:27 2010
Errors in file /oracle/diag/rdbms/mydb/trace/mydb_cjq0_10153.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-06544: PL/SQL: internal error, arguments: [56327], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [56327]
Errors in file /oracle/diag/rdbms/mydb/trace/mydb_cjq0_10153.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-06544: PL/SQL: internal error, arguments: [56327], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [56327]
==================================================================

In this case the problem was that backup originally was done with Oracle 64bit, but restored with Oracle 32bit.
To resolve this issue, swith your database to 32bit with help of Metalink NOTE [ID 62290.1] --
Changing between 32-bit and 64-bit Word Sizes.

Good luck!

Wednesday, June 4, 2008

dbstart -- can't find init file

Hello,

It was Oracle Database 9.2 on Linux, and dbstart script worked with error "Can't find init file for Database "DB1" Database "DB1" NOT started." :
==================================================
[oracle@DB1 ~]$ dbstart $ORACLE_HOME

Can't find init file for Database "DB1".
Database "DB1" NOT started.
[oracle@DB1 ~]$
==================================================
If you check $ORACLE_HOME/dbs/ directory, then there is spfile, but no pfile.
Solution was to edit dbstart script to let him understand any initializations files correctly.

To do it, add this line after line 55:
SPFILE=${ORACLE_HOME}/dbs/spfile${ORACLE_SID}.ora
and change line 116 to be:
if [ -f $PFILE -o -f $SPFILE ] ; then
That is all, now dbstart can see not only pfile, but spfile too, and working without problem.
8)

P.S.
Line 55 was:
PFILE=${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora
Line 116 was:
if [ -f $PFILE ] ; then


Friday, May 23, 2008

rman: can't open target

If you have Oracle database on Linux, when you run rman utility to connect to database, you can get an error "rman: can't open target":
========================================
[oracle@db1 /]$ rman target /
rman: can't open target
========================================

In this case check, which rman is used, it can be from another direcroty:
========================================
[oracle@db1 /]$ which rman
/usr/X11R6/bin/rman
========================================

If it is, more likely, that in you PATH environment variable $ORACLE_HOME is not on the first place:
========================================
[oracle@db1 /]$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/OraHome/bin
========================================

All, that you need now, is to change PATH variable, set is to be $ORACLE_HOME at the first place. To do it for you login profile, in case of bash shell, modify ~/.bash_profile file. For example:
========================================
...
export ORACLE_HOME=/oracle/product/10.2/DB1/bin
export PATH=$ORACLE_HOME:$PATH
...
========================================

Good luck!

Wednesday, May 7, 2008

Linux archivers

TAR:
Compress: tar -czvf filename.tgz file
Extract: tar -czvf filename.tgz file
View: tar -tzvf filename.tgz file


CPIO
Compress: find ./dir1/* -print | cpio -ovc > /dir2/file2.cpio
Extract: cpio -ivcdum < /dir2/file2.cpio
View: cpio -itv < /dir2/file2.cpio

Example: cpio -i "*users01.dbf" "*xdb01.dbf" "*undotbs01.dbf" < /u00/oradata/NITISB/NITIS_20051003.cpio

Tuesday, May 6, 2008

LINUX commands

### HOST Resources ###
RAM size: grep MemTotal /proc/meminfo
Swap size: grep SwapTotal /proc/meminfo
Available RAM and swap space: free
System CPU architecture: grep "model name" /proc/cpuinfo

### LINUX (x86) ###
Distribution and version:
cat /etc/issue

Kernel version: uname -r

Oracle, Database auditing

Mērķis -- ieslēgt visa veida operāciju auditēšanu lietotājam ar lietotājvārdu JANIS.


### Servera konfigurēšana, lai varētu auditēt: ###

* Uzstādi "audit_trail = true" inicializācijas parametru
* Palaiž no SYS lietotāja: "$ORACLE_HOME/rdbms/admin/cataudit.sql" skriptu.


### Auditēšanas uzstādīšana: ###

====================================================================
CONNECT sys AS SYSDBA

AUDIT ALL BY janis BY ACCESS;
AUDIT SELECT TABLE, UPDATE TABLE, INSERT TABLE, DELETE TABLE BY janis BY ACCESS;
AUDIT EXECUTE PROCEDURE BY janis BY ACCESS;
====================================================================

Tas ieslēgs auditēšanu visām DDL & DML operācijām, kuras iniciēs lietotājs "janis" un citus notikumus:

* DDL (CREATE, ALTER & DROP of objects)
* DML (INSERT UPDATE, DELETE, SELECT, EXECUTE).
* SYSTEM EVENTS (LOGON, LOGOFF etc.)

### Audita pārskats ###

Audita ieraksti glabajas SYS.AUD$ tabulā un pieejami arī caur sekojošiem skatiem:

* DBA_AUDIT_EXISTS
* DBA_AUDIT_OBJECT
* DBA_AUDIT_SESSION
* DBA_AUDIT_STATEMENT
* DBA_AUDIT_TRAIL
* DBA_OBJ_AUDIT_OPTS
* DBA_PRIV_AUDIT_OPTS
* DBA_STMT_AUDIT_OPTS

Datus ir daudz, bet pamatieraksti būs:
* Username : Oracle Username.
* Terminal : Machine that the user performed the action from.
* Timestamp : When the action occured.
* Object Owner : The owner of the object that was interacted with.
* Object Name : The name of the object that was interacted with.
* Action Name : The action that occured against the object. (INSERT, UPDATE, DELETE, SELECT, EXECUTE)

### Audita uzturēšana ###
Galvēnais neaizmirst periodiski dzēst vai arhivēt audita ierakstus, lai nepārpilda ar laiku sistēmas datu nesējus.

Pārliecinies arī, ka piekļuve pie "sys.aud$" tabulas ir ierobežota, jo audita ierakstus var viltot.


P.S.
Ieslēdz auditu vispirms savam lietotajām, lai pārliecināties, ka audits nostrādā tieši tā, ka tu vēlies.

Oracle, Desupport Notices

You want to know, how long Oracle is planning to support Oracle Database or other product ?

Check this information -- Oracle Lifetime Support:
http://www.oracle.com/support/library/data-sheet/oracle-lifetime-support-policy-datasheet.pdf

Or, if you have Metalink account, then:
1) Login to Metalink (http://metalink.oracle.com/metalink/plsql/ml2_gui.startup)
2) on Home Page choose Tab: Cerity
3) Third Tab on that Page: Desupport Notices.


P.S.
Premier Support provides a standard five-year support policy for Oracle Technology and
Oracle Applications products. You can extend support for an additional three years with
Extended Support for specific releases, or receive indefinite technical support with
Sustaining Support.




Expect Lifetime Support - http://www.oracle.com/support/lifetime-support-policy.html


P.P.S.
Latest Patch Set Release by Platform - http://www.oracle.com/technology/support/patches.htm
Certification Matrix -- http://www.oracle.com/technology/support/metalink/index.html