четверг, 2 декабря 2010 г.

way to connect to APPS or how to bypass default Login screen.

Check this out

http://app.com:8000/OA_HTML/fndvald.jsp?username=&password=pass

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

FAILED: file FNDNLINS.sql on worker 1 for product fnd username APPLSYS.

If you use ADADMIN utility and get ERROR

FAILED: file FNDNLINS.sql on worker 1 for product fnd username APPLSYS.

sqlplus> @..... FNDNLINS.sql
MESG
--------------------------------------------------------------------------------
LANGUAGE=AMERICAN
PACKAGE=FND_LOOKUP_VALUES_PKG
SQLERRM=ORA-00001: unique constraint(APPLSYS.FND_LOOKUP_VALUES_U2) violated


Solution



[applmgr@app u02]$
adctrl


Copyright (c) 2002 Oracle Corporation
Redwood Shores, California, USA

AD Controller

Version 11.5.0

NOTE: You may not use this utility for custom development
unless you have written permission from Oracle Corporation.


Attention: AD Controller no longer checks for unapplied pre-requisite patches.
You must use OAM Patch Wizard for this feature. Alternatively, you can
review the README for pre-requisite information.


Your default directory is '/u02/oracle/pr/prappl'.
Is this the correct APPL_TOP [Yes] ?

AD Controller records your AD Controller session in a text file
you specify. Enter your AD Controller log file name or press [Return]
to accept the default file name shown in brackets.

Filename [adctrl.log] :

************* Start of AD Controller session *************
AD Controller version: 11.5.0
AD Controller started at: Tue Nov 09 2010 12:14:42

APPL_TOP is set to /u02/oracle/pr/prappl

Reading product information from file...

Reading language and territory information from file...

Reading language information from applUS.txt ...

Enter the ORACLE username of Application Object Library [APPLSYS] :

Enter the ORACLE password of Application Object Library [APPS] : APPS_password

AD Controller is verifying your username/password.
The status of various features in this run of AD Controller is:

<-Feature version in->
Feature Active? APPLTOP Data model Flags
------------------------------ ------- -------- ----------- -----------
CHECKFILE Yes 1 1 Y N N Y N Y
PREREQ Yes 6 6 Y N N Y N Y
CONCURRENT_SESSIONS No 2 2 Y Y N Y Y N
PATCH_TIMING Yes 2 2 Y N N Y N Y
PATCH_HIST_IN_DB Yes 6 6 Y N N Y N Y
SCHEMA_SWAP Yes 1 1 Y N N Y Y Y


AD Controller Menu
---------------------------------------------------

1. Show worker status
2. Tell worker to restart a failed job
3. Tell worker to quit
4. Tell manager that a worker failed its job
5. Tell manager that a worker acknowledges quit
6. Restart a worker on the current machine
7. Exit
HIDDEN 8.

Enter your choice [1] : 8

Enter the worker number(s)/range(s) or 'all' for all workers,
or press [Return] to go back to the menu : 1

Status changed to 'Skip & restart' for worker 1.
Review the messages above, then press [Return] to continue.

Fixed: file FNDNLINS.sql on worker 1 for product fnd username APPLSYS.
Completed: file FNDNLINS.sql on worker 1 for product fnd username APPLSYS.

Telling workers to quit...

2 workers have quit. Waiting for 30 more.
12 workers have quit. Waiting for 20 more.
15 workers have quit. Waiting for 17 more.
22 workers have quit. Waiting for 10 more.
23 workers have quit. Waiting for 9 more.
29 workers have quit. Waiting for 3 more.

All workers have quit.


Dropping FND_INSTALL_PROCESSES table...


FND_INSTALL_PROCESSES table dropped.


Dropping AD_DEFERRED_JOBS table...


AD_DEFERRED_JOBS table dropped.


Review the messages above, then press [Return] to continue.
You should check the file
/u02/oracle/pr/prappl/admin/pr/log/adadmin.log

for errors.

четверг, 4 ноября 2010 г.

Waiting for snapshot controlfile enqueue

When RMAN needs to back up or resynchronize from the control file, it first
creates a snapshot or consistent image of the control file. If one RMAN job is
already backing up the control file while another needs to create a new snapshot
control file, then you may see the following message:

RMAN-08512: waiting for snapshot controlfile enqueue


Under normal circumstances, a job that must wait for the control file enqueue
waits for a brief interval and then successfully retrieves the enqueue.
Recovery Manager makes up to five attempts to get the enqueue and then fails the
job. The conflict is usually caused when two jobs are both backing up the control
file, and the job that first starts backing up the control file waits for service
from the media manager.

To determine which job is holding the conflicting enqueue:

1. After you see the first RMAN-08512: waiting for snapshot controlfile enqueue
message, start a new SQL*Plus session on the target database:

% sqlplus sys/sys_pwd@prod1


2. Execute the following query to determine which job is causing the wait:

SELECT s.sid, username AS "User", program, module, action, logon_time "Logon", l.*
FROM v$session s, v$enqueue_lock l
WHERE l.sid = s.sid and l.type = 'CF' AND l.id1 = 0 and l.id2 = 2;


You should see output similar to the following (the output in this example has
been truncated):

SID User Program Module Action Logon
--- ---- -------------------- ------------------------- ---------------- ---------
9 SYS rman@h13 (TNS V1-V3) backup full datafile: c1 0000210 STARTED 21-JUN-10


To kill active session
Run


select vs.sid, vs.username, vs.osuser, vs.process fg_pid,
vp.spid bg_pid
from v$session vs, v$process vp
where vs.paddr = vp.addr
/


If you get something like:

SID USERNAME OSUSER FG_PID BG_PID
---- --------------- ---------- --------- ---------
10 JULIAN JULIAN 1965:6969 1234

run in unix as the oracle user

kill -9 1234

среда, 3 ноября 2010 г.

Rman catalog Database creation

Rman catalog Database creation

1.connect to the catalog database

a)here create a catalog tablespace

sql> create tablespace catalog
datafile ‘/……………………/catalog01.dbf’ size 250 m

b)create a user for recover catalog

sql> create user rmancat identified by rman
default tablespace catalog
default temporary tablespace temp
quota unlimited on catalog;

c)Grant the appropriate privilages.

sql>grant connect,resource,recover_catalog_owner to rmancat;

2. Login to the operating system

export ORACLE_SID=catalog

rman
rman> connect catalog rmancat/rman

rman>create catalog tablespace “CATALOG”

rman> exit

3.log in to the Operating system

export ORACLE_SID=sample
rman

rman> connect target sys/sys
rman>connect catalog rmancat/rman@catalog
rman > register database.

Now you configured your catalog database….


a)Go to the tnsname.ora file.

Add the following highlighted entries

CATALOG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = your_host_with_rmancat)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = your_global_name)
)
)

среда, 27 октября 2010 г.

Oracle Grid Control Agent 11.1.0.1 Installation and Configuration

Agent Installation and Configuration

More detailed documents can be found at
http://download.oracle.com/docs/cd/B16240_01/doc/install.102/e10953/toc.htm

Installation


Method 1: Install agent from local file with silent mode.


This is the fastest method to install agent. Take 11.1.0 agent for example.

1) download Linux_Grid_Control_agent_download_11_1_0_1_0.zip from /ade_autofs/shiphomes_linux/em/11.1.0/100227/agentdownload_only/ , you can execute command in host emqa1-vm9.cn.oracle.com as below
scp -rvp aime@stsdc02-1.us.oracle.com:/ade_autofs/shiphomes_linux/em/11.1.0/100227/agentdownload_only/download Linux_Grid_Control_agent_download_11_1_0_1_0.zip /home/oracle/

2) extract the zip file to local folder, unzip Linux_Grid_Control_agent_download_11_1_0_1_0.zip -d ./agent

3) prepare the additional_agent.rsp file. modify the rsp file as below, the values depend on oms information.
SECURITY_UPDATES_VIA_MYORACLESUPPORT=False
DECLINE_SECURITY_UPDATES=True
SKIP_SOFTWARE_UPDATES=True
ORACLE_AGENT_HOME_LOCATION=”/scratch/aime”
OMS_HOST=smptst-svc1.us.oracle.com
OMS_PORT=1159
AGENT_REGISTRATION_PASSWORD=agent4321

4) install agent with silent mode.
$cd agent_install_home/linux/agent
$./runInstaller -silent -responseFile ~/additional_agent.rsp

5) after installation finished and successfully, run root.sh under agent_home directory

Method 2: Install agent using agent push on oms deploy page.


1) Go to GC console page , click on Deployments, then click on Install Agent under Agent Installation, Click on Fresh Install.

2) Provide the host where you want to install the agent, the credential, Install_dir. Leave port blank ,then it will use a random port so that it won’t fail if the default port 3872 used. Remember provide the Management Server Registration Password and then click on next to the end.

Method 3: Install agent using NFS Agent Installation.

Suppose there is agent installed on emqa1-vm1.cn.oracle.com, the agent_home is /scratch/aime/agent11g , this need get installed on vm9.
1) mount emqa1-vm1.cn.oracle.com:/scratch/aime/agent11g /scratch/aime/agent11g . verify that the folder path is same as the agent_home in vm1.

2) $cd /scratch/aime/agent11g/sysman/install
$./nfsagentinstall -s /scratch/state_dir

3) then the agent will be installed to /scratch/state_dir , you can use emcli start/stop/status agent under /scratch/state_dir/bin

Method 4: Install agent using OUI.

Make sure that the agent installation file is released or it can be installed by oui. It’s the easiest method to install agent.
1) access the host via vnc and then run the runInstaller .

2) provide the information according to the oui and then it’ll be installed successfully.

Configuration


This part describes how to change agent pointing to another oms without re-install.
1) make sure you stop the agent. check the status of agent, /agent_home/bin/emctl status agent , stop the agent /agent_home/bin/emctl stop agent
2) cd agent_home/sysman/emd , delete all files under upload and state
3) cd agent_home/sysman/config , vi emd.properties , modify REPOSITORY_URL and emdWalletSrcUrl .
4) /agent_home/bin/emctl start agent
agent_home/bin/emctl secure agent, provide the register password
agent_home/bin/emctl upload agent
make sure the three command above executed successfully
5) then you’ll see your agent pointing to the new oms.

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

Installing Oracle Enterprise Manager Grid Control 11gR1 on Linux

Installing Oracle Enterprise Manager Grid Control 11gR1 on Linux

This document will detail the installation of Oracle Enterprise Manager Grid Control 11gR1 on Oracle Enterprise Linux 5.5.

Oracle WebLogic Server 10.3.2 or higher is required to be installed on the host in which you are going to install Enterprise Manager Grid Control.

The Oracle Database for the repository needs to be Oracle Database 10gR2 (10.2.0.4) or higher. The UNDO table space must have at least 200MB allocated at the time of install. The parameter SESSION_CACHED_CURSORS must be 200 or greater and the parameter PROCESSES must be 500 or greater. If these parameters along with the UNDO table space size are not set at the time of installation they will produce errors on Step 7 Connect to Oracle Database. If the database was created with Database Control enabled you will need to remove the Database Control repository.

To start the installation process execute the runInstaller script.

Enter your My Oracle Support user name and password to set up security update notification and initiate configuration manager. This information is option. Click the Next button to continue.


It is possible to install patches/updates during the installation process. If you choose to apply patches/updates you can either get them on demand using your My Oracle Support login credentials or you can download the patches/updates prior to installation and store them in a central location. After making your choices click the Next button to continue.

You can either install a new Enterprise Manager system or add an addition management server. Both install options require an existing certified Oracle WebLogic server. For this document we are going to install a new Enterprise Manager system. Click the Next button to continue.

Next are the standard prerequisite checks that are common with Oracle software installs. Click the Next button to continue.

The installer should pickup the location of the middleware home that was used for the installation of Oracle WebLogic Server. If the installer does not find middleware home either type in or browse to the location that contains the Oracle WebLogic Server. You can also provide another location for the Oracle Management Service. Click the Next button to continue.

The installation process will create a WebLogic domain called GCDomain all that we need to provide is the password. Click the Next button to continue.

Now we need to provide the install the connection information for the database to be used as the repository. Provide the hostname, port, SID and SYS password for the database you are going to use for the Grid Control Repository. Click the Next button to continue.

Three table spaces are created to house the Enterprise Manager Grid Control repository. You can either accept the defaults for the data files or provide names that match your naming scheme. You also need to provide a password for the SYSMAN user.


Enter the password to be used to secure the communications between the agents and management service. You can also choose to only allow secure agents to communicate with the repository and to only allow secure access to the console. Both are set by default.


You have the ability to customize the ports used by Enterprise Manager to fit in your environment. Click the Next button to continue.

The Review screen is your last chance to make any changes to previous steps before starting the installation. Click the Install button to start the installation.

Installation steps and progress are displayed on the Install Progress screen.

At the end of the installation you will be asked to run a configuration script as the root user. In a terminal session connect as the root user and run MW_HOME/weblogic/oms11g/allroot.sh. Note I chose not to overwrite any files.

[root@gc ~]# /u02/app/oracle/product/weblogic/oms11g/allroot.sh

After the scripts are complete click the OK button to continue.

Next several configuration assistants will be executed.

After the entire configuration is complete you will get the Finish dialog that will detail the installation and provide the URL to access Enterprise Manager Grid Control.

Possible Errors

Step 7 of 13 Connect to Oracle Database

If the database you are going to use as a repository is configured with Database Control you will receive an error message like the one below.

If you do get this error, click the OK button to dismiss the error and open another terminal session and run the $ORACLE_HOME/bin/emca – deconfig dbcontrol db command. Note: If your repository database is in a RAC cluster you will need to add –cluster after –repos drop.

[oracle@gc ~]$ emca -deconfig dbcontrol db -repos drop -SYS_PWD password -SYSMAN_PWD password


After removing database control from the database you may receive another error such as the one below.

The database to be used as the Grid Control repository needs to have the parameters SESSION_CACHED_CURSORS set to 200 or greater and PROCESSES set to 500 or greater. Setting these parameters will require the database to be bounced in order for the changes to take effect. Click the OK button to dismiss the error and connect to the database to change the parameters.

SQL> alter system set session_cached_cursors=200 scope=spfile;

SQL> alter system set processes=500 scope=spfile;

SQL> shutdown immediate

SQL> startup


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.

четверг, 1 июля 2010 г.

HOW TO REPLACE THE LOGOS IN ORACLE APPLICATIONS Rel 11i

There are 4 main logos screens in the signon process of Rel 11i
Initial Screen (with Jinitiator Download notice)
Splash Screen
FNDSCSGN (Applictaions Signon Screen)
ICXINDEX.htm (Self Service Signon Screen)

Changing the images that appear when signing on to Oracle Applications R11i
is a customization of that form. Applications sign-on form FNDSCSGN contains
a procedure called START_UP that uses a built-in READ_IMAGE_FILE to call the
logo image file from the operating system at the runtime.

The signon Form uses both the JAR files and files stored on the file system.
Applying any patches that modifies JAR files can revert to the default logo and
must be modified each time, and is therefore NOT supported.

However, this may offer some guidelines for how I did it

I. First when you call the dynamic html page from the Rel 11i Portal Page

http://machine_name:port_number/dev60cgi/f60cgi

This logo.gif file can be found and replaced in the directory

$OA_MEDIA/logo.gif

II. Next a Splash screen pops up while the jar files are loading and then goes
away. This screen picture is called splash.gif.
(looks like a purple/blue color and says WEB DEVELOPER and has a hammer)
can be changed in FORMS60/java/oracle/forms/icons/splash.gif

This Web Developer logo appears as a splash screen on Applications 11i Startup.
This is due to the missing Apps logo in 11i. The original fix was to copy the
Appslogo.gif (or your company logo) over the Developer logo
FORMS60/java/oracle/forms/icons/splash.gif .

The new fix (rerelease of 11iRI) is to ADD the Appslogo.gif (or your company logo)
into $FND_TOP/media/splash.gif from where it can be AD copied (or manually
copied) to $JAVA_TOP/oracle/apps/media/

Next, we need to point to it in $OA_HTML/bin/appsweb.cfg by adding the PATH
to the splashScreen= line of appsweb.cfg .
like this....

splashScreen=oracle/apps/media/splash.gif

This will be fixed in the appsweb.cfg of Rapid Installer for 11.5.2 according to BUG
1355330

III. $FNDTOP/media/logo.gif is where you change for the Self Service signon screen
Remember that you will need to bounce the WebDB 2.5 listener once a change is
made.

IV. Changing the actual FNDSCSGN SignOn screen, which is an Oracle Form.
there are two logo/pictures in this window.

The SignOn screen FNDSCSGN references a *.gif file called logo.gif and tries to get
it from the JAR file FNDAOL.jar, if it doesn't find it then it looks for it on the file
system, so you need to replace logo.gif in both places.

Oracle/prodcomn/java/oracle/apps/media/logo.gif
Oracle/prodcomn/java/oracle/apps/media/appslogo.gif

Oracle/prodappl/fnd/11.5.0/java/jar/fndaol.jar
You can use WinZip to open FNDAOL.jar and replace (delete then add) the logo.gif file.
Remember to clear your Client PC's browser cache and delete all the files in jcache

c:\Program Files\oracle\Jinitiator11727\jcache\*.*

to download the new jar files and the changes that you made.

OTHER NOTES ON THIS TOPIC
-------------------------
Note 421636.1 - How to replace the default Oracle Logo with a Customized Logo?

среда, 26 мая 2010 г.

Discoverer 10g (10.1.2) Portlets Show 25 Rows Even Though You Have Changed The 'RowsPerHTML' and 'RowsPerPage' Preferences [ID 456868.1]

1. Setting the global setting:

* Set the 'RowsPerPage' parameter in the $ORACLE_HOME/discoverer/util/pref.txt file to your desired global setting for all newly created worksheets.

* Next, run the applypreferences.sh (or .bat) to set the preferences for an new Discoverer sessions.

2. Changing existing portlets / Viewer worksheets:

* To change individual worksheets displayed in a portlet, you will need to log into Discoverer Viewer as the owner of the worksheet.
* Click on the 'Rows and Columns' link above the table. If the link does not exist, then see your Discoverer Administrator, they may have removed it from your layout via a customization.
* Click on Save line under the Actions section on the left.
* The portlets will now display the desired rows

среда, 5 мая 2010 г.

Physical Standby

Как Создать Physical Standby базу в ORACLE 9i

Step 1 :

Добавляем следующие параметры в init<SID>.ora на primary базе данных

log_archive_dest_1 = 'LOCATION=/u01/oracle/pr/prdb/arch MANDATORY'

log_archive_dest_state_1 = ENABLE

log_archive_start = TRUE

log_archive_dest_2 = 'SERVICE=STBY2','ARCH SYNC NOAFFIRM delay=0 OPTIONAL max_failure=0 reopen=60 register’

Или ( Просто добавить tns запись для STANDBY базы)

log_archive_dest_2 = 'service="(DESCRIPTION=(ADDRESS_LIST = (ADDRESS=(PROTOCOL=tcp)(HOST=app2.tidici.com)(PORT=1526)))(CONNECT_DATA=(SID=pr)(SERVER=DEDIC ATED)))"','ARCH SYNC NOAFFIRM delay=0 OPTIONAL max_failure=0 reopen=60 register '

standby_file_management=auto

# archive_lag_target = 1800 ( этот параметр используется для автоматического переключения archive log на primary базе. Значение в переделах от 0 до 7200 секунд )

log_archive_dest_state_2 = ENABLE

#log_archive_dest=/home/oracle/proddata/arch (Закомментировать этот параметр на primary базе)

Step 2 :

Добавляем в tnsnames.ora на primary базе

STDBY2 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = gc.tidici.com)(PORT = 1526))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME =pr)

)

)

Step 3 :

Редактируем init.ora на standby базе

fal_client = 'fal_stdby2'

fal_server = 'fal_prod'

standby_file_management = AUTO

control_files=/home/users/PROD/m3stndby.ctl

standby_archive_dest = '/ms11/archm3/m3'

log_archive_dest = /ms11/archm3/m3

log_archive_start = true

#db_file_name_convert = ('/u06/','/u06e/','/u07/','/u07e/') -> Использовать если отличаются калаги standby базы то primary базы

#log_file_name_convert = ('/u06/','/u06e/','/u07/','/u07e/') -> Использовать если отличаются калаги standby базы то primary базы

Step 4 : (a).

Редактируем tnsnames.ora на standby базе

fal_prod =

(DESCRIPTION =

(ADDRESS =

(PROTOCOL = TCP)(HOST = db.tidici.com)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME=pr)

)

)

fal_stby2 =

(DESCRIPTION =

(ADDRESS =

(PROTOCOL = TCP)(HOST = app2.tidici.com)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = pr)

)

)

(b). Редактируем listner.ora на standby базе

FAL_stby1 =

(DESCRIPTION =

(ADDRESS =

(PROTOCOL = TCP)(HOST = 192.168.20.180)(PORT = 1530)

)

)

SID_LIST_FAL_stdby =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = PROD)

(ORACLE_HOME = /ms10/oracle/9.2.0)

(SID_NAME = PROD )

)

)

Step 5 :

(a) . Switch one archive on the primary

alter system switch logfile;

(b). Теперь переведём tablespace на primary базе в backup режим

[ Если необходимо создать базу из hot backup ]

select ' alter tablespace '||tablespace_name||' begin backup ;' from dba_tablespaces where CONTENTS <> 'TEMPORARY';

alter tablespace esvc begin backup ;

alter tablespace samora begin backup;

………………………………………

………………………………………

………………………………………

Выполните команду приведенную выше . Она переведет все tablespace в backup режим.

Перед копированием файлов на standby базу. Проверяем статус.

select status,count(*) from v$backup group by status;

STATUS COUNT(*)

----------------- --------------

ACTIVE 29

(b) . Копируем все datafiles c primary базы на standby базу

scp oracle@192.168.14.32:/u06/oracle/pr/prdata/a_txn_data14.dbf /u06/oracle/pr/prdata/

(d). Теперь возвращаем tablespace в обычный режим.

select ' alter tablespace '||tablespace_name||' end backup ;' from dba_tablespaces where CONTENTS <> 'TEMPORARY';

alter tablespace esvc end backup ;

alter tablespace samora end backup;

……………………………………..

……………………………………..

Выполняем команды приведённые вверху. Тем самым возвращаем tablespace в обычный режим. Проверяем состояние.

select status,count(*) from v$backup group by status;

STATUS COUNT(*)

----------------- --------------

NOT ACTIVE 29

(е). После завершения копирования. Создаём standby controlfile с помощью команды:

alter database create standby controlfile as ' /u04/oracle /stbycf.ctl ';

Затем , переместим его на Standby в каталог указанный в init.ora

Step 6:

Now up the Standby database as follows

(a ). Запустим standby базу nomount режиме

startup nomount pfile=’u01/file/initPROD.ora’

(b). Монтируем standby базу

alter database mount standby database ;

Заметка :

Теперь , наша standby база в mount режиме. Для автоматического восстановления standby, необходимо перегрузить нашу PRIMARY базу. Таким образом, все изменения, которые мы внесли в initPROD.ora на primary базе будут применены.

---------------------------------------------------------------------------------------------------------------------

C.1 # После перезагрузке primary базы. Для введения standby базы в managed recover режим, выполним команду:

alter database recover managed standby database disconnect from session ;

C.2 # Если нет возможности перегрузить primary базу, то необходимо в ручную скопировать archive логии на standby базу . И выполнить команду:

recover standby database;

далее, выбираем “AUTO” режим, чтобы применить все недостающие archive логии.

Note 1 : При создании standby базы на одном и том же сервере с primary базой

Необходимо использовать LOCK_NAME_SPACE параметр .

LOCK_NAME_SPACE = standby

И добавить “instance_name” в init.ora на Primary и Standby.

Note 2 : Как проверить max количество archive log применённых на standby базе.

select max(sequence#) from v$archived_log where applied=’YES’;

Switch Stand-by database to Primary Database role

1. SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;

2. SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH SKIP STANDBY LOGFILE;

3. SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;

After this , you cannot use this database as a stand-by database anymore.
You will need to create a new standby database as a replica of this new primary database.

четверг, 29 апреля 2010 г.

How To Change The Default Export Location For Discoverer Plus 10g(DefaultExportPath)

Applies to:

Oracle Discoverer - Version: 10.1.2.0.0 to 10.1.2.3
Information in this document applies to any platform.

Goal

When exporting to various formats via Discoverer Plus 10g (10.1.2), the file is always sent to a location like "C:\Documents and Settings\."

How can this default export location be changed?

Solution

The Sun java virtual machine plug-in used for Discoverer Plus is installed and is specific to each PC.
You can set some system-level properties per the Sun JVM "Deployment Configuration File and Properties Guide.

However, the guide does not specifically indicate you can set the user home at the system-level.
Setting the user home at the local PC level will allow changing the default export path for Sun JRE 1.4.
This option is only available for Sun JRE 1.4.

NOTE: For Sun JRE 1.5 and above, you can only specify a different location for all users (not for individual user), for more information please refer to Note 365245.1.

The user (or administrator) is required to make the following changes locally on every PC.

For Sun Java Plugin:

  1. Locate the file "C:\Documents and Settings\\Application Data\Sun\Java\Deployment\deployment.properties",
    and add the entry below :


    user.home=


    For example: If the new directory is: 'D:\DISCO_1012\TEMP', then the entry would look like this
    (with double backslashes in lieu of a single backslash):

    user.home=D:\\DISCO_1012\\TEMP


  2. Save the "deployment.properties" file once the entry is added.

  3. Close all browsers and relaunch Discoverer Plus in a new browser session.

  4. Run a workbook and perform export, which will attempt to export to the new directory.

For Oracle Jinitiator Plug-in:

1. Open Windows Control Panel,  double click on "Jinitiator 1.3.1.xx" icon,
click on cache tab and note down the value set for Location under
"JAR cache Settings".
Suppose the value is set to "C:\WINNT\Profiles\jdoe\Oracle Jar Cache"

2. Click on Start >> Run
and type the command:

explorer %userprofile%\.jinit

This opens Windows Explorer with the current directory as %userprofile%\.jinit

3. Check if there is any file with name:

properties13xx (used by Jinitiator 1.3.1.xx)

4. If there is no such a file create a new file with name properties13xx
(for example properties1318, if using jinitiator 1.3.1.8) and add
the following entries:

jarcache.directory=

(make sure to put two backslashes in the place of single backslash)

user.home=

(make sure to put two backslashes in the place of single backslash)

For example:

user.home=D:\\TEMP
jarcache.directory=C:\\WINNT\\Profiles\\jdoe\\Oracle Jar Cache

(Note there are two '\' between directory name separators)

5. If there is already existing file properties13xx in the
%userprofile%\.jinit directory and jarcache.directory entry
exists in this file and it is pointing to a directory, then do not change it.
Only add the entry for user.home as shown in step 4 at the end of the file.
Before modifying properties13xx file, take a backup of those files.

6. Save the file.

7. Exit all the browser windows.

8. Invoke a new browser window to run Discoverer Plus.

Now export from Discoverer Plus should create files under the directory to
which user.home entry points to.