вторник, 26 октября 2010 г.

UNDO tablespace size has to be at least 200MB



Click the OK button to dismiss the error and resize the data file associated with the undo table space to 200MB or more.

SQL> select file_name from dba_data_files;
FILE_NAME
---------------------------------------------------
/u02/app/oracle/oradata/gcrepo/users01.dbf
/u02/app/oracle/oradata/gcrepo/undotbs01.dbf
/u02/app/oracle/oradata/gcrepo/sysaux01.dbf

SQL> alter database datafile '/u02/app/oracle/oradata/gcrepo/undotbs01.dbf' resize 400M;
Database altered.

воскресенье, 24 октября 2010 г.

How to find log files locations in 11i and R12

The following log files location could help you to find-out issues and errors from your application 11i instance.

Database Tier Logs are

Alert Log File location:
$ORACLE_HOME/admin/$CONTEXT_NAME/bdump/alert_$SID.log

Trace file location:
$ORACLE_HOME/admin/SID_Hostname/udump

Application Tier Logs

Start/Stop script log files location:
$COMMON_TOP/admin/log/CONTEXT_NAME/

OPMN log file location
$ORACLE_HOME/opmn/logs/ipm.log

Apache, Jserv, JVM log files locations:
$IAS_ORACLE_HOME/Apache/Apache/logs/ssl_engine_log
$IAS_ORACLE_HOME/Apache/Apache/logs/ssl_request_log
$IAS_ORACLE_HOME/Apache/Apache/logs/access_log
$IAS_ORACLE_HOME/Apache/Apache/logs/error_log
$IAS_ORACLE_HOME/Apache/JServ/logs

Concurrent log file location:
$APPL_TOP/admin/PROD/log or $APPLLOG/$APPLCSF

Patch log file location:
$APPL_TOP/admin/PROD/log

Worker Log file location:
$APPL_TOP/admin/PROD/log

AutoConfig log files location:
Application Tier:
$APPL_TOP/admin/SID_Hostname/log//DDMMTime/adconfig.log

Database Tier:
$ORACLE_HOME/appsutil/log/SID_Hostname/DDMMTime/adconfig.log

Error log file location:
Application Tier:
$APPL_TOP/admin/PROD/log

Database Tier :
$ORACLE_HOME/appsutil/log/SID_Hostname


In Oracle Applications R12, the log files are located in $LOG_HOME (which translates to $INST_TOP/logs)
Below list of log file locations could be helpful for you:

Concurrent Reqeust related logs
$LOG_HOME/appl/conc - > location for concurrent requests log and out files
$LOG_HOME/appl/admin - > location for mid tier startup scripts log files

Apache Logs (10.1.3 Oracle Home which is equivalent to iAS Oracle Home - Apache, OC4J and OPMN)
$LOG_HOME/ora/10.1.3/Apache - > Location for Apache Error and Access log files
$LOG_HOME/ora/10.1.3/j2ee - > location for j2ee related log files
$LOG_HOME/ora/10.1.3/opmn - > location for opmn related log files

Forms & Reports related logs (10.1.2 Oracle home which is equivalent to 806 Oracle Home)
$LOG_HOME/ora/10.1.2/forms
$LOG_HOME/ora/10.1.2/reports

Startup/Shutdown Log files location:
$INST_TOP/apps/$CONTEXT_NAME/logs/appl/admin/log

Patch log files location:
$APPL_TOP/admin/$SID/log/

Clone and AutoConfig log files location in Oracle E-Business Suite Release 12

Logs for the adpreclone.pl are located:
On the database tier:
RDBMS $ORACLE_HOME/appsutil/log/<>/StageDBTier_<>.log

On the application tier:
$INST_TOP/admin/log/StageAppsTier_<>.log

Where the logs for the admkappsutil.pl are located?
On the application tier:
$INST_TOP/admin/log/MakeAppsUtil_<>.log

Logs for the adcfgclone.pl are located:

On the database tier:
RDBMS $ORACLE_HOME/appsutil/log/<>/ApplyDBTier_<>.log

On the application tier:
$INST_TOP/admin/log/ApplyAppsTier_<>.log
.
Logs for the adconfig are located:

On the database tier:
RDBMS $ORACLE_HOME/appsutil/log/<>/<>/adconfig.log
RDBMS $ORACLE_HOME/appsutil/log/<>/<>/NetServiceHandler.log

On the application tier:
$INST_TOP/admin/log/<>/adconfig.log
$INST_TOP/admin/log/<>/NetServiceHandler.log

пятница, 8 октября 2010 г.

Oracle Discoverer 10g How to kown User that ran the report

User that ran the report:

SELECT

DISTINCT QPP.QS_DOC_NAME WORKBOOK_NAME,QPP.QS_DOC_DETAILS WORKSHEET,

QS_DOC_OWNER WORKBOOK_OWNER,

qs_created_date, qs_cost, qs_act_elap_time, qs_act_cpu_time,

QPP.QS_CREATED_BY OWNER, f.user_name

FROM

eul5_us.EUL5_QPP_STATS QPP, fnd_user f

where substr(qs_created_by, 2, 4) = to_char(f.user_id)

вторник, 5 октября 2010 г.

Encountered RMAN-03002 and RMAN-06091 when Deleting Obsolete Backups

Symptoms

When attempting to delete obsolete backups from RMAN using the following command:

RMAN> delete obsolete;

the following error occurs:

RMAN-00571: =======================================
RMAN-00569: ===== ERROR MESSAGE STACK FOLLOWS ====
RMAN-00571: =======================================
RMAN-03002: failure of delete command at 05/07/2008 22:04:21
RMAN-06091: no channel allocated for maintenance (of an appropriate type)


Cause

Tape channel had not being allocated when attempt to delete obsolete backup on tape.

Using the following command to verify that there are backup sets on tape.


RMAN> list backup;
List of Backup Sets
==============

BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Incr 0 113.25M SBT_TAPE 00:08:35 01-MAR-08
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Handle: bk_4_1_648250152 Media:
List of Datafiles in backup set 1
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
5 0 Incr 1342657 01-MAR-08 /u01/oracle/app/oracle/undotbs2
75 0 Incr 1342657 01-MAR-08 /u01/oracle/app/oracle/USER_DAT_08_vg3_002
91 0 Incr 1342657 01-MAR-08 /u01/oracle/app/oracle/USER_DAT_12_vg3_002

==>The Device Type is SBT_TAPE.
Solution

To implement the solution, please execute the following steps:

Please run the following commands to delete obsolete backup sets on both disk and tape:

RMAN> allocate channel for maintenance type disk;
RMAN> allocate channel for maintenance device type 'sbt_tape' PARMS '...';
==>Please change '...' to your actual tape params

RMAN> delete obsolete;

If you want to delete obsolete backup sets on disk, you can use the following commands:

RMAN> allocate channel for maintenance type disk;
RMAN> delete obsolete device type disk;
RMAN> delete expired backup of database archivelog all;

понедельник, 20 сентября 2010 г.

STANDBY Database Adding a Datafile or Creating a Tablespace

When STANDBY_FILE_MANAGEMENT Is Set to AUTO

The following example shows the steps required to add a new datafile to the primary and standby databases when the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.

1. Add a new tablespace to the primary database:

SQL> CREATE TABLESPACE new_ts DATAFILE '/disk1/oracle/oradata/payroll/t_db2.dbf' 2> SIZE 1m AUTOEXTEND ON MAXSIZE UNLIMITED;

2. Archive the current online redo log file so the redo data will be transmitted to and applied on the standby database:

SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

3. Verify the new datafile was added to the primary database:

SQL> SELECT NAME FROM V$DATAFILE;



NAME
----------------------------------------------------------------------
/disk1/oracle/t_db1.dbf /disk1/oracle/t_db2.dbf

4. Verify the new datafile was added to the standby database:

SQL> SELECT NAME FROM V$DATAFILE;

NAME
----------------------------------------------------------------------
/disk1/oracle/oradata/payroll/s2t_db1.dbf
/disk1/oracle/oradata/payroll/s2t_db2.dbf



When STANDBY_FILE_MANAGEMENT Is Set to MANUAL

This section shows how to add a new datafile to the primary and standby database when the STANDBY_FILE_MANAGEMENT initialization parameter is set to MANUAL. You must set the STANDBY_FILE_MANAGEMENT initialization parameter to MANUAL when the standby datafiles reside on raw devices. This section also describes how to recover from errors after they have occurred.

Note:
Do not use the following procedure with databases that use Oracle Managed Files. Also, if the raw device path names are not the same on the primary and standby servers, use the DB_FILE_NAME_CONVERT initialization parameter to convert the path names.

вторник, 17 августа 2010 г.

Purging of Old pending Notification & workflow data

SQL> select count(*),status from wf_notifications group by status;
COUNT(*) STATUS
---------- --------
1530 CANCELED
1627 CLOSED
15266 OPEN

SQL> select count(*),status, MAIL_STATUS from wf_notifications group by
2 status, MAIL_STATUS order by status;

COUNT(*) STATUS MAIL_STA
---------- -------- --------
5 CANCELED ERROR
1031 CANCELED MAIL
427 CANCELED SENT
67 CANCELED
1 CLOSED ERROR
40 CLOSED SENT
1586 CLOSED
1 OPEN ERROR
1131 OPEN MAIL
3101 OPEN SENT
11033 OPEN



update wf_notifications
set mail_status = 'SENT'
where status = 'OPEN';


commit;


$FND_TOP/sql/wfrmitms.sql (to delete status information in Oracle Workflow runtime tables for a particular item type),
$FND_TOP/sql/wfrmitt.sql (to delete all data in all Oracle Workflow design time and runtime tables for a particular item type).
and $FND_TOP/sql/wfrmall.sql (to delete all data in all Oracle Workflow design time and runtime tables for all item type).

среда, 11 августа 2010 г.

An almost invisible ssh connection

An almost invisible ssh connection
----------------------------------

In the worse case if you have to ssh on a box, do it every time
with no tty allocation

ssh -T user@host

If you connect to a host with this way, a command like "w" will not
show your connection. Better, add 'bash -i' at the end of the command to
simulate a shell

ssh -T user@host /bin/bash -i

Another trick with ssh is to use the -o option which allow you to
specify a particular know_hosts file (by default it's ~/.ssh/know_hosts).
The trick is to use -o with /dev/null:

ssh -o UserKnownHostsFile=/dev/null -T user@host /bin/bash -i

With this trick the IP of the box you connect to won't be logged in
know_hosts.

Using an alias is a good idea.


Erasing a file
--------------

In the case of you have to erase a file on a owned computer, try
to use a tool like shred which is available on most of Linux.

shred -n 31337 -z -u file_to_delete

-n 31337 : overwrite 313337 times the content of the file
-z : add a final overwrite with zeros to hide shredding
-u : truncate and remove file after overwriting

A better idea is to do a small partition in RAM with tmpfs or
ramdisk and storing all your files inside.

Again, using an alias is a good idea.


The quick way to copy a file
----------------------------

If you have to copy a file on a remote host, don't bore yourself with
an FTP connection or similar. Do a simple copy and paste in your Xconsole.
If the file is a binary, uuencode the file before transferring it.

A more eleet way is to use the program 'screen' which allows copying a
file from one screen to another:

To start/stop : C-a H or C-a : log

And when it's logging, just do a cat on the file you want to transfer.


Changing your shell
-------------------

The first thing you should do when you are on an owned computer is to
change the shell. Generally, systems are configured to keep a history for
only one shell (say bash), if you change the shell (say ksh), you won't be
logged.

This will prevent you being logged in case you forget to clean
the logs. Also, don't forget 'unset HISTFILE' which is often useful.


Some of these tricks are really stupid and for sure all old school
hackers know them (or don't use them because they have more eleet tricks).
But they are still useful in many cases and it should be interesting to
compare everyone's tricks.