EXP (export) and IMP (import) are the two tools you need. It's is better to try to run these on the command line and on the same machine.
It can be run from remote, you just need to setup you TNSNAMES.ORA correctly and install all the developer tools with the same version as the database. Without knowing the error message you are experiencing then I can't help you to get exp/imp to work.
The command to export a single user:
exp userid=dba/dbapassword OWNER=username DIRECT=Y FILE=filename.dmp This will create the export dump file.
To import the dump file into a different user schema, first create the newuser in SQLPLUS:
SQL> create user newuser identified by 'password' quota unlimited users; Then import the data:
imp userid=dba/dbapassword FILE=filename.dmp FROMUSER=username TOUSER=newusername If there is a lot of data then investigate increasing the BUFFERS or look into expdp/impdp
*Most common errors for exp and imp are setup. Check your PATH includes $ORACLE_HOME/bin, check $ORACLE_HOME is set correctly and check $ORACLE_SID is set*
Welcome to my Blog. It is a public blog on subject matters to DBAs. The views expressed here are my own.
Friday, December 31, 2010
Step Install Oracle 10g R2 on Solaris 10 x86
This paper (HOWTO) describes step-by-step installation of Oracle 10g release 2 (10.2.0.2) database software on Solaris 10 x86.
This paper covers following steps:
Pre-Instalation Tasks
1. Create oracle User Account
su -
# groupadd dba
# useradd -G dba -m -d /export/home/oracle -s /usr/bin/bash oracle
Note: "#" sign means that you need execute this command as root user.
2. Setting System parameters
Edit the /etc/system and add following line:
set noexec_user_stack=1
Note: Since Solaris 10 shared memory settings for Oracle in /etc/system is obsolete.
Execute following commands to configure system settings for Oracle.
# projadd -U oracle -K "project.max-shm-memory=(priv,4g,deny)" user.oracle
# projmod -sK "project.max-sem-nsems=(priv,256,deny)" user.oracle
# projmod -sK "project.max-sem-ids=(priv,100,deny)" user.oracle
# projmod -sK "project.max-shm-ids=(priv,100,deny)" user.oracle
Note: Use "prctl -i project user.oracle" command to check the settings.
3. Enviroment settings
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/102
ORACLE_SID=ORA10GR2
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
Note: This configuration assumes that user oracle is using Bash as default shell.
Save the .bash_profile and execute following commands for load new enviroment:
cd /export/home/oracle
. .bash_profile
4. Create base directory for Oracle
su -
# cd /opt
# mkdir oracle
# chown oracle:dba oracle
pkginfo -i SUNWlibms SUNWtoo SUNWi1cs SUNWi15cs SUNWxwfnt SUNWxwplt SUNWmfrun SUNWxwplr SUNWxwdv SUNWgcc SUNWbtool SUNWi1of SUNWhea SUNWlibm SUNWsprot SUNWuiu8
# pkgadd -d . SUNWlibms SUNWtoo SUNWi1cs SUNWi15cs SUNWxwfnt SUNWxwplt SUNWmfrun SUNWxwplr SUNWxwdv SUNWgcc SUNWbtool \
SUNWi1of SUNWhea SUNWlibm SUNWsprot SUNWuiu8
Extract the files using following command:
unzip 10202_database_solx86.zip
4. Start the Oracle software installation process.
Now the system is prepared for Oracle software installation. To start the installation process execute the following commands:
cd database
./runInstaller
Post-Instalation Tasks
# /opt/oracle/oraInventory/orainstRoot.sh
su -
# gunzip rlwrap-solaris-x86.gz
# pkgadd -d readline-5.1-solaris-x86 rlwrap-solaris-x86
# exit
echo "alias sqlplus='/usr/local/bin/rlwrap sqlplus'" >> /export/home/oracle/.bash_profile
. /export/home/oracle/.bash_profile
Solution: Install SUNWuiu8 package.
Checking monitor: must be configured to display at least 256 colors >>> Could not execute auto check for display colors using command /usr/openwin/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< Some requirement checks failed. You must fulfill these requirements before continuing with the installation,at which time they will be rechecked.
Solution(s):
1. Install SUNWxwplt package
2. Set DISPLAY variable
3. Execute xhost + on target (set in DISPLAY) computer
Exception in thread "main" java.lang.UnsatisfiedLinkError:
... libmawt.so: ld.so.1: java: fatal: libXm.so.4: open failed: No such file or directory
Can't load '/usr/perl5/5.8.4/lib/i86pc-solaris-64int/auto/Sun/Solaris/Project/Project.so' for module Sun::Solaris::Project: ld.so.1: perl: fatal: libpool.so.1: open failed: No such file or directory at /usr/perl5/5.8.4/lib/i86pc-solaris-64int/DynaLoader.pm line 230. at /usr/sbin/projadd line 19 Compilation failed in require at /usr/sbin/projadd line 19. BEGIN failed--compilation aborted at /usr/sbin/projadd line 19.
This paper covers following steps:
- Pre-Instalation Tasks
- Download & Install
- Post-Instalation Tasks
- Common Installation Errors
Pre-Instalation Tasks
1. Create oracle User Account
Login as root and create te user oracle which belongs to dba group.
su -
# groupadd dba
# useradd -G dba -m -d /export/home/oracle -s /usr/bin/bash oracle
Note: "#" sign means that you need execute this command as root user.
2. Setting System parameters
Edit the /etc/system and add following line:
set noexec_user_stack=1
Note: Since Solaris 10 shared memory settings for Oracle in /etc/system is obsolete.
Execute following commands to configure system settings for Oracle.
# projadd -U oracle -K "project.max-shm-memory=(priv,4g,deny)" user.oracle
# projmod -sK "project.max-sem-nsems=(priv,256,deny)" user.oracle
# projmod -sK "project.max-sem-ids=(priv,100,deny)" user.oracle
# projmod -sK "project.max-shm-ids=(priv,100,deny)" user.oracle
Note: Use "prctl -i project user.oracle" command to check the settings.
3. Enviroment settings
Edit the /export/home/oracle/.bash_profile file and add following lines:
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/102
ORACLE_SID=ORA10GR2
LD_LIBRARY_PATH=$ORACLE_HOME/lib
PATH=$PATH:/usr/local/bin:/usr/ccs/bin:/usr/sfw/bin:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
Note: This configuration assumes that user oracle is using Bash as default shell.
Save the .bash_profile and execute following commands for load new enviroment:
cd /export/home/oracle
. .bash_profile
Login as root and create base directory for Oracle ($ORACLE_BASE).
su -
# cd /opt
# mkdir oracle
# chown oracle:dba oracle
Download & Install
1. Installation of required packages
Some additional packages are required for succesful instalation of Oracle software. To check whether required packages are installed on your operating system use following command:
pkginfo -i SUNWlibms SUNWtoo SUNWi1cs SUNWi15cs SUNWxwfnt SUNWxwplt SUNWmfrun SUNWxwplr SUNWxwdv SUNWgcc SUNWbtool SUNWi1of SUNWhea SUNWlibm SUNWsprot SUNWuiu8
Install the required packages using the pkgadd command:
# pkgadd -d . SUNWlibms SUNWtoo SUNWi1cs SUNWi15cs SUNWxwfnt SUNWxwplt SUNWmfrun SUNWxwplr SUNWxwdv SUNWgcc SUNWbtool \
SUNWi1of SUNWhea SUNWlibm SUNWsprot SUNWuiu8
3. Download the Oracle 10g (10.2.0.2) software from Oracle website.
Extract the files using following command:
unzip 10202_database_solx86.zip
4. Start the Oracle software installation process.
Now the system is prepared for Oracle software installation. To start the installation process execute the following commands:
cd database
./runInstaller
Post-Instalation Tasks
1. Execute scripts (# means "as root"):
# /opt/oracle/oraInventory/orainstRoot.sh
# /opt/oracle/102/root.sh
2. (Optional) You may consider to use rlwrap for comfortable wor with sqlplus. Package for Solaris 10 (x86) release you can download here. Note rlwrap is dependent on readline library which should be installed first. Download readline library package.
su -
# gunzip readline-5.1-solaris-x86.gz
# gunzip rlwrap-solaris-x86.gz
# pkgadd -d readline-5.1-solaris-x86 rlwrap-solaris-x86
# exit
echo "alias sqlplus='/usr/local/bin/rlwrap sqlplus'" >> /export/home/oracle/.bash_profile
. /export/home/oracle/.bash_profile
Common Installation Errors
Unable to convert from "UTF-8" to "646" for NLS!
Solution: Install SUNWuiu8 package.
Checking monitor: must be configured to display at least 256 colors >>> Could not execute auto check for display colors using command /usr/openwin/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< Some requirement checks failed. You must fulfill these requirements before continuing with the installation,at which time they will be rechecked.
Solution(s):
1. Install SUNWxwplt package
2. Set DISPLAY variable
3. Execute xhost + on target (set in DISPLAY) computer
Exception in thread "main" java.lang.UnsatisfiedLinkError:
... libmawt.so: ld.so.1: java: fatal: libXm.so.4: open failed: No such file or directory
Solution: Install the SUNWmfrun package.
Can't load '/usr/perl5/5.8.4/lib/i86pc-solaris-64int/auto/Sun/Solaris/Project/Project.so' for module Sun::Solaris::Project: ld.so.1: perl: fatal: libpool.so.1: open failed: No such file or directory at /usr/perl5/5.8.4/lib/i86pc-solaris-64int/DynaLoader.pm line 230. at /usr/sbin/projadd line 19 Compilation failed in require at /usr/sbin/projadd line 19. BEGIN failed--compilation aborted at /usr/sbin/projadd line 19.
Solution: Install the SUNWpool SUNWpoolr packages.
Sunday, November 21, 2010
Enabling ARCHIVELOG Mode
SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;
LOG_MODE
------------
NOARCHIVELOG
We can use a database alter statement or edit the pfile in either $ORACLE_BASE/admin/SID/pfile or $ORACLE_HOME/admin/SID/pfile. Add the following lines to the end of the file:
############################
# Archive Log Destinations
############################
log_archive_dest_1='location=/u02/oradata/cuddle/archive'
log_archive_start=TRUE
Startup the database in mount mode and put it in archivelog mode.
[oracle@vixen pfile]$sqlplus sys/passwd as sysdba;
SQL*Plus: Release 10.1.0.2.0 - Production on Fri Oct 15 16:00:58 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 1300928 bytes
Variable Size 157820480 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
LOG_MODE
------------
NOARCHIVELOG
We can use a database alter statement or edit the pfile in either $ORACLE_BASE/admin/SID/pfile or $ORACLE_HOME/admin/SID/pfile. Add the following lines to the end of the file:
############################
# Archive Log Destinations
############################
log_archive_dest_1='location=/u02/oradata/cuddle/archive'
log_archive_start=TRUE
Startup the database in mount mode and put it in archivelog mode.
[oracle@vixen pfile]$sqlplus sys/passwd as sysdba;
SQL*Plus: Release 10.1.0.2.0 - Production on Fri Oct 15 16:00:58 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 184549376 bytes
Fixed Size 1300928 bytes
Variable Size 157820480 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
How to enable flashback database in Oracle
-- Set flashback database parameters
alter system set db_recovery_file_dest_size=10G;
alter system set db_recovery_file_dest='/dir/fra';
-- value in minutes
alter system set db_flashback_retention_target=2160;
-- Turn flashback on for the database
startup mount;
alter database flashback on;
alter database open;
-- Check if flashback is enabled
select flashback_on from v$database;
select * from v$flashback_database_log;
--
--
-- To create a guaranteed restore point
create restore point RESTORE_POINT guarantee flashback database;
select NAME, SCN, TIME from V$RESTORE_POINT;
-- To flashback the database to specific time
flashback database to timestamp to_timestamp('dd/mm/ccyy HH24:MI:SS', 'DD/MM/YYYY
HH24:MI:SS');
-- To drop a restore point
select NAME, SCN, TIME from V$RESTORE_POINT;
drop restore point RESTORE_POINT;
alter system set db_recovery_file_dest_size=10G;
alter system set db_recovery_file_dest='/dir/fra';
-- value in minutes
alter system set db_flashback_retention_target=2160;
-- Turn flashback on for the database
startup mount;
alter database flashback on;
alter database open;
-- Check if flashback is enabled
select flashback_on from v$database;
select * from v$flashback_database_log;
--
--
-- To create a guaranteed restore point
create restore point RESTORE_POINT guarantee flashback database;
select NAME, SCN, TIME from V$RESTORE_POINT;
-- To flashback the database to specific time
flashback database to timestamp to_timestamp('dd/mm/ccyy HH24:MI:SS', 'DD/MM/YYYY
HH24:MI:SS');
-- To drop a restore point
select NAME, SCN, TIME from V$RESTORE_POINT;
drop restore point RESTORE_POINT;
Wednesday, August 25, 2010
A Procedure to drop partitions by date or by partition name
CREATE OR REPLACE procedure SYS.drop_partitions
(
p_schema_owner varchar2,
p_table_name varchar2,
p_partition_name varchar2,
p_partition_date date
)
is
l_current_partition_date date;
begin
--DEAL WITH PARTITION'S BY DATE
if p_partition_date is not null
then
for all_parts in
(
select
high_value,
partition_name
from
dba_tab_partitions
where
table_owner = p_schema_owner
and
table_name = p_table_name
order by
partition_position asc
)
loop
execute immediate 'select ' || all_parts.high_value || ' from dual' into l_current_partition_date;
if l_current_partition_date <= p_partition_date
then
execute immediate 'alter table ' || p_schema_owner || '.' || p_table_name || ' drop partition ' || all_parts.partition_name || ' update global indexes';
end if;
end loop;
end if;
--DEAL WITH PARTITION'S BY NAME
if p_partition_name is not null
then
for all_parts in
(
select
d.high_value,
d.partition_name
from
dba_tab_partitions d
where
d.table_owner = p_schema_owner
and
d.table_name = p_table_name
and
d.partition_position <= (
select
d2.partition_position
from
dba_tab_partitions d2
where
d2.table_owner = d.table_owner
and
d2.table_name = d.table_name
and
d2.partition_name = p_partition_name
)
order by
d.partition_position asc
)
loop
execute immediate 'alter table ' || p_schema_owner || '.' || p_table_name || ' drop partition ' || all_parts.partition_name || ' update global indexes';
end loop;
end if;
end;
/
HOW TO GIVE VALUE IN THE RELATIVE FIELDS;
========================================
p_schema_owner :: SIEMENS_BSS
p_table_name :: SCANBTS_DY
p_partition_name :: P20100429
p_partition_date :: TO_DATE(' 2010-04-26 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
(
p_schema_owner varchar2,
p_table_name varchar2,
p_partition_name varchar2,
p_partition_date date
)
is
l_current_partition_date date;
begin
--DEAL WITH PARTITION'S BY DATE
if p_partition_date is not null
then
for all_parts in
(
select
high_value,
partition_name
from
dba_tab_partitions
where
table_owner = p_schema_owner
and
table_name = p_table_name
order by
partition_position asc
)
loop
execute immediate 'select ' || all_parts.high_value || ' from dual' into l_current_partition_date;
if l_current_partition_date <= p_partition_date
then
execute immediate 'alter table ' || p_schema_owner || '.' || p_table_name || ' drop partition ' || all_parts.partition_name || ' update global indexes';
end if;
end loop;
end if;
--DEAL WITH PARTITION'S BY NAME
if p_partition_name is not null
then
for all_parts in
(
select
d.high_value,
d.partition_name
from
dba_tab_partitions d
where
d.table_owner = p_schema_owner
and
d.table_name = p_table_name
and
d.partition_position <= (
select
d2.partition_position
from
dba_tab_partitions d2
where
d2.table_owner = d.table_owner
and
d2.table_name = d.table_name
and
d2.partition_name = p_partition_name
)
order by
d.partition_position asc
)
loop
execute immediate 'alter table ' || p_schema_owner || '.' || p_table_name || ' drop partition ' || all_parts.partition_name || ' update global indexes';
end loop;
end if;
end;
/
HOW TO GIVE VALUE IN THE RELATIVE FIELDS;
========================================
p_schema_owner :: SIEMENS_BSS
p_table_name :: SCANBTS_DY
p_partition_name :: P20100429
p_partition_date :: TO_DATE(' 2010-04-26 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
Tuesday, July 6, 2010
Recreate EM DB Configuration and Repository
DB Control Options:
Delete DB Control Objects:
1. Delete DB control configuration files with EMCA scripts
2. Delete DB control configuration files Manually
3. Delete DB control repository objects using RepManager
4. Delete DB control repository objects Manually
5. Delete DB control configuration files and repository objects using EMCA
Option 1 using EMCA scripts
10.1.x run $ORACLE_HOME/bin/emca -x
10.2.x run $ORACLE_HOME/bin/emca -deconfig dbcontrol db
The option -deconfig removes the EM jobs from Scheduling before the DB Control
is deconfigured, otherwise, the repository, which is not dropped, could be corrupted or inconsistent if EM jobs were scheduled as the time the DB control is dropped. It could also cause some errors during the DB Control deletion.
Option 2 manually remove configuration files
Remove the following directories from your filesystem:
$ORACLE_HOME/
$ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole__
Note: On Windows you also need to delete the DB Console service:
run regedit
navigate to HKEY_LOCAL_MACHINE/SYTEM/CurrentControlSet/Services
locate the OracleDBConsole entry and delete it.
Alternatively on Windows XP and Windows Server 2003 you can run the following
from the command line:
sc delete
- where is the DB Control service name (typically: OracleDBConsole)
Also available from Microsoft is the delsrv.exe command.
Option 3 – delete DB control repository using RepManager
This option is not as complete as the other options. You may find that dropping the repository using the commandline options is a better solution. Also, note RepManager is not used to create a DB Control Repository.
10g R1 and R2 execute:
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -action drop
Warning: this command puts the database in Quiesce Mode.
Option 4 – delete the DB Control Repository Objects Manually
step 1: drop AQ related objects in the SYSMAN schema, logon SQL*Plus as user SYSMAN:
sql> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>’MGMT_NOTIFY_QTABLE’,force=>TRUE);
step 2: drop the DB control repository objects by logging on as SYS or SYSTEM, via SQL*Plus and drop the sysman account and management objects:
sql> shutdown immediate;
sql> startup restrict;
sql> exec sysman.emd_maintenance.remove_em_dbms_jobs;
sql> exec sysman.setEMUserContext(”,5);
sql> revoke dba from sysman;
sql> declare cursor c1 is select owner, synonym_name name from dba_synonyms
where table_owner = ‘SYSMAN’;
begin
for r1 in C1 LOOP
if r1.owner = ‘PUBLIC’ then
execute immediate ‘DROP PUBLIC SYNONYM ‘||r1.name;
else
execute immediate ‘DROP SYNONYM ‘||r1.owner||’.'||r1.name;
end if;
end loop;
end;
/
sql> drop user mgmt_view cascade;
sql> drop role mgmt_user;
sql> drop user sysman cascade;
sql> alter system disable restricted session;
Note: The above will completely delete the DB Control repository from the database; under certain circumstances (e.g. you want to recreate the repository later on) the following statements may be sufficient to remove the repository:
Logon SQL*Plus as user SYS or SYSTEM, and drop the sysman account and management objects:
sql> drop user sysman cascade;
sql> drop role mgmt_user;
sql> drop user mgmt_view cascade;
sql> drop public synonym MGMT_TARGET_BLACKOUTS;
sql> drop public synonym SETEMVIEWUSERCONTEXT;
Option 5 – delete the db control configuration files and repository objects using EMCA
for DB control 10.1.x, dropping both the configuration files and the repository objects is a two step process. Run the following two commands:
$ORACLE_HOME/bin/emca -x
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -action drop
for DB Control 10.2.x, both configuration files and repository objects can be
deleted with a single command. Run the command:
$ORACLE_HOME/bin/emca -deconfig dbcontrol db -repos drop
Create the DB Control Objects
Option 1. Create the DB Control Configuration Files
Option 2. Create the DB Control Repository Objects and Configuration Files
Option 1. Create the DB Control Configuration Files – to create only the DB
Control configuration files, skipping the repository creation (this would be done for instance if you dropped only the files and left the repository in place)
for 10.1.x, run $ORACLE_HOME/bin/emca -r
for 10.2.x, run $ORACLE_HOME/bin/emca -config dbcontrol db
Option 2. Create the DB Control Repository Objects and Configuration Files
for 10.1.x, run $ORACLE_HOME/bin/emca
for 10.2.x, run $ORACLE_HOME/bin/emca -config dbcontrol db -repos create
Recreate / ReConfig DB Control
Option 1. Recreate the DB Control Configuration Files only (leave Repository intact)
Option 2. Recreate the DB Control Configuration Files and Repository
Option 1 – recreate the DB Control Configuration Files and Repository
for 10.2, the EMCA commands can be used to reconfigure the existing installs
without removing them first.
$ORACLE_HOME/bin/emca -config dbcontrol db
Option 2 – recreate the DB Control Configuration Files and Repository
for DB Control 10.2.x, run the command:
$ORACLE_HOME/bin/emca -config dbcontrol db -repos recreate
Delete DB Control Objects:
1. Delete DB control configuration files with EMCA scripts
2. Delete DB control configuration files Manually
3. Delete DB control repository objects using RepManager
4. Delete DB control repository objects Manually
5. Delete DB control configuration files and repository objects using EMCA
Option 1 using EMCA scripts
10.1.x run $ORACLE_HOME/bin/emca -x
10.2.x run $ORACLE_HOME/bin/emca -deconfig dbcontrol db
The option -deconfig removes the EM jobs from Scheduling before the DB Control
is deconfigured, otherwise, the repository, which is not dropped, could be corrupted or inconsistent if EM jobs were scheduled as the time the DB control is dropped. It could also cause some errors during the DB Control deletion.
Option 2 manually remove configuration files
Remove the following directories from your filesystem:
$ORACLE_HOME/
$ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_
Note: On Windows you also need to delete the DB Console service:
run regedit
navigate to HKEY_LOCAL_MACHINE/SYTEM/CurrentControlSet/Services
locate the OracleDBConsole entry and delete it.
Alternatively on Windows XP and Windows Server 2003 you can run the following
from the command line:
sc delete
- where is the DB Control service name (typically: OracleDBConsole)
Also available from Microsoft is the delsrv.exe command.
Option 3 – delete DB control repository using RepManager
This option is not as complete as the other options. You may find that dropping the repository using the commandline options is a better solution. Also, note RepManager is not used to create a DB Control Repository.
10g R1 and R2 execute:
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -action drop
Warning: this command puts the database in Quiesce Mode.
Option 4 – delete the DB Control Repository Objects Manually
step 1: drop AQ related objects in the SYSMAN schema, logon SQL*Plus as user SYSMAN:
sql> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>’MGMT_NOTIFY_QTABLE’,force=>TRUE);
step 2: drop the DB control repository objects by logging on as SYS or SYSTEM, via SQL*Plus and drop the sysman account and management objects:
sql> shutdown immediate;
sql> startup restrict;
sql> exec sysman.emd_maintenance.remove_em_dbms_jobs;
sql> exec sysman.setEMUserContext(”,5);
sql> revoke dba from sysman;
sql> declare cursor c1 is select owner, synonym_name name from dba_synonyms
where table_owner = ‘SYSMAN’;
begin
for r1 in C1 LOOP
if r1.owner = ‘PUBLIC’ then
execute immediate ‘DROP PUBLIC SYNONYM ‘||r1.name;
else
execute immediate ‘DROP SYNONYM ‘||r1.owner||’.'||r1.name;
end if;
end loop;
end;
/
sql> drop user mgmt_view cascade;
sql> drop role mgmt_user;
sql> drop user sysman cascade;
sql> alter system disable restricted session;
Note: The above will completely delete the DB Control repository from the database; under certain circumstances (e.g. you want to recreate the repository later on) the following statements may be sufficient to remove the repository:
Logon SQL*Plus as user SYS or SYSTEM, and drop the sysman account and management objects:
sql> drop user sysman cascade;
sql> drop role mgmt_user;
sql> drop user mgmt_view cascade;
sql> drop public synonym MGMT_TARGET_BLACKOUTS;
sql> drop public synonym SETEMVIEWUSERCONTEXT;
Option 5 – delete the db control configuration files and repository objects using EMCA
for DB control 10.1.x, dropping both the configuration files and the repository objects is a two step process. Run the following two commands:
$ORACLE_HOME/bin/emca -x
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -action drop
for DB Control 10.2.x, both configuration files and repository objects can be
deleted with a single command. Run the command:
$ORACLE_HOME/bin/emca -deconfig dbcontrol db -repos drop
Create the DB Control Objects
Option 1. Create the DB Control Configuration Files
Option 2. Create the DB Control Repository Objects and Configuration Files
Option 1. Create the DB Control Configuration Files – to create only the DB
Control configuration files, skipping the repository creation (this would be done for instance if you dropped only the files and left the repository in place)
for 10.1.x, run $ORACLE_HOME/bin/emca -r
for 10.2.x, run $ORACLE_HOME/bin/emca -config dbcontrol db
Option 2. Create the DB Control Repository Objects and Configuration Files
for 10.1.x, run $ORACLE_HOME/bin/emca
for 10.2.x, run $ORACLE_HOME/bin/emca -config dbcontrol db -repos create
Recreate / ReConfig DB Control
Option 1. Recreate the DB Control Configuration Files only (leave Repository intact)
Option 2. Recreate the DB Control Configuration Files and Repository
Option 1 – recreate the DB Control Configuration Files and Repository
for 10.2, the EMCA commands can be used to reconfigure the existing installs
without removing them first.
$ORACLE_HOME/bin/emca -config dbcontrol db
Option 2 – recreate the DB Control Configuration Files and Repository
for DB Control 10.2.x, run the command:
$ORACLE_HOME/bin/emca -config dbcontrol db -repos recreate
Wednesday, June 16, 2010
To reclaim the free space
Method 1.
To reclaim the free space you can Move the table to the tablespace that it currently belongs, ie. Doing nothing but just moving it to itself.
This can be only done if it is an LMT (locally managed tablespace), we tend to move the data to the "front" of the file (allowing you to shrink the file)
____ ____ ____ ____
If you are not using LMTs then try 'alter tablespace tblspc-name coalesce'
Method 2
1) delete million rows from table A
2) create table B as select * from table A
3) truncate table A
4) insert into table A select * from table B
5) drop table B
6) rebuild indexes
1) alter table (tablename) move;
2) rebuild all the UNUSABLE indexes on the table.
To reclaim the free space you can Move the table to the tablespace that it currently belongs, ie. Doing nothing but just moving it to itself.
This can be only done if it is an LMT (locally managed tablespace), we tend to move the data to the "front" of the file (allowing you to shrink the file)
____ ____ ____ ____
If you are not using LMTs then try 'alter tablespace tblspc-name coalesce'
Method 2
1) delete million rows from table A
2) create table B as select * from table A
3) truncate table A
4) insert into table A select * from table B
5) drop table B
6) rebuild indexes
1) alter table (tablename) move;
2) rebuild all the UNUSABLE indexes on the table.
Converting Gloabal Indexes into Local Indexes
Rem ******************************************
Rem IF THE INDEX IS PARTIONED, THEN IT'S LOCAL
Rem ******************************************
select index_type, partitioned, count(*) from dba_indexes group by index_type, partitioned;
select index_name, index_type, table_owner, table_name, partitioned from dba_indexes;
____________________________________________________________________
STEP 1. Drop CONSTRAINT
SQL> alter table P_NBSC_RES_ACCESS_HR drop constraint P_NBSC_RES_ACCESS_HR_PK;
------------------------------------------------------------------------------
STEP 2. Drop INDEX
SQL> DROP INDEX P_NBSC_RES_ACCESS_HR_PK;
----
Use the following command to verify if the index has been dropped.
----
SQL> select index_name, index_type, partitioned, table_name from dba_indexes where table_name like '%P_NBSC_RES_ACCESS_HR';
no rows selected
------------------------------------------------------------------------------------------------
Step 3. Create Local Index
SQL> CREATE INDEX P_NBSC_RES_ACCESS_HR_PK ON P_NBSC_RES_ACCESS_HR
(DATETIME, BSC, SEGMENT_ID) TABLESPACE NOK_P_NBSC_RES_ACCESS_AGG_I LOCAL NOLOGGING
PARALLEL;
----
Use the syntax given below to verfiy the type of index and its creation.
----
SQL> select index_name, index_type, partitioned, table_name from dba_indexes where table_name like '%P_NBSC_RES_ACCESS_HR';
INDEX_NAME INDEX_TYPE PAR TABLE_NAME
------------------------------ --------------------------- --- ------------------------------
P_NBSC_RES_ACCESS_HR_PK NORMAL YES P_NBSC_RES_ACCESS_HR
Rem IF THE INDEX IS PARTIONED, THEN IT'S LOCAL
Rem ******************************************
select index_type, partitioned, count(*) from dba_indexes group by index_type, partitioned;
select index_name, index_type, table_owner, table_name, partitioned from dba_indexes;
____________________________________________________________________
STEP 1. Drop CONSTRAINT
SQL> alter table P_NBSC_RES_ACCESS_HR drop constraint P_NBSC_RES_ACCESS_HR_PK;
------------------------------------------------------------------------------
STEP 2. Drop INDEX
SQL> DROP INDEX P_NBSC_RES_ACCESS_HR_PK;
----
Use the following command to verify if the index has been dropped.
----
SQL> select index_name, index_type, partitioned, table_name from dba_indexes where table_name like '%P_NBSC_RES_ACCESS_HR';
no rows selected
------------------------------------------------------------------------------------------------
Step 3. Create Local Index
SQL> CREATE INDEX P_NBSC_RES_ACCESS_HR_PK ON P_NBSC_RES_ACCESS_HR
(DATETIME, BSC, SEGMENT_ID) TABLESPACE NOK_P_NBSC_RES_ACCESS_AGG_I LOCAL NOLOGGING
PARALLEL;
----
Use the syntax given below to verfiy the type of index and its creation.
----
SQL> select index_name, index_type, partitioned, table_name from dba_indexes where table_name like '%P_NBSC_RES_ACCESS_HR';
INDEX_NAME INDEX_TYPE PAR TABLE_NAME
------------------------------ --------------------------- --- ------------------------------
P_NBSC_RES_ACCESS_HR_PK NORMAL YES P_NBSC_RES_ACCESS_HR
Wednesday, April 7, 2010
Query to display long running concurrent requests
--
--
SET LINESIZE 200;
SET PAGES 9999;
SET HEAD ON;
--
SET HEAD off;
ACCEPT enddt PROMPT 'ENTER the date (ex: 01-AUG-99) > ' ;
PROMPT ;
SET HEAD on;
--
SPOOL fnd_cp_time.txt;
--
COLUMN request_id HEADING 'Request ID' FORMAT 99999999;
COLUMN pn HEADING 'Program
Name' FORMAT A40;
COLUMN qn HEADING 'Queue
Name' FORMAT A20;
COLUMN strttime HEADING 'Start
Time' FORMAT A17;
COLUMN rtime HEADING 'Elapsed
(Min)' FORMAT 9990.99;
--
SELECT r.REQUEST_ID,
DECODE(cptl.user_concurrent_program_name,
'Report Set', substr(r.description,1,40),
SUBSTR(cptl.user_concurrent_program_name,1,40)) pn,
q.concurrent_queue_name qn,
TO_CHAR(r.ACTUAL_START_DATE,'MM/DD/YY HH:MI:SS') strttime,
ROUND((r.ACTUAL_COMPLETION_DATE - r.ACTUAL_START_DATE)*(60*24),2) rtime
FROM fnd_concurrent_requests r,
fnd_concurrent_processes p,
fnd_concurrent_programs cp,
fnd_concurrent_programs_tl cptl,
fnd_concurrent_queues q
WHERE p.concurrent_queue_id = q.concurrent_queue_id
AND p.queue_application_id = q.application_id
AND r.controlling_manager = p.concurrent_process_id
AND r.phase_code = 'C'
AND r.program_application_id = cp.application_id
AND r.concurrent_program_id = cp.concurrent_program_id
AND cp.application_id = cptl.application_id
AND cp.concurrent_program_id = cptl.concurrent_program_id
AND TRUNC(ACTUAL_START_DATE) = TO_DATE(UPPER('&&enddt'),'DD-MON-YY')
ORDER BY 4
/
--
SET LINESIZE 200;
SET PAGES 9999;
SET HEAD ON;
--
SET HEAD off;
ACCEPT enddt PROMPT 'ENTER the date (ex: 01-AUG-99) > ' ;
PROMPT ;
SET HEAD on;
--
SPOOL fnd_cp_time.txt;
--
COLUMN request_id HEADING 'Request ID' FORMAT 99999999;
COLUMN pn HEADING 'Program
Name' FORMAT A40;
COLUMN qn HEADING 'Queue
Name' FORMAT A20;
COLUMN strttime HEADING 'Start
Time' FORMAT A17;
COLUMN rtime HEADING 'Elapsed
(Min)' FORMAT 9990.99;
--
SELECT r.REQUEST_ID,
DECODE(cptl.user_concurrent_program_name,
'Report Set', substr(r.description,1,40),
SUBSTR(cptl.user_concurrent_program_name,1,40)) pn,
q.concurrent_queue_name qn,
TO_CHAR(r.ACTUAL_START_DATE,'MM/DD/YY HH:MI:SS') strttime,
ROUND((r.ACTUAL_COMPLETION_DATE - r.ACTUAL_START_DATE)*(60*24),2) rtime
FROM fnd_concurrent_requests r,
fnd_concurrent_processes p,
fnd_concurrent_programs cp,
fnd_concurrent_programs_tl cptl,
fnd_concurrent_queues q
WHERE p.concurrent_queue_id = q.concurrent_queue_id
AND p.queue_application_id = q.application_id
AND r.controlling_manager = p.concurrent_process_id
AND r.phase_code = 'C'
AND r.program_application_id = cp.application_id
AND r.concurrent_program_id = cp.concurrent_program_id
AND cp.application_id = cptl.application_id
AND cp.concurrent_program_id = cptl.concurrent_program_id
AND TRUNC(ACTUAL_START_DATE) = TO_DATE(UPPER('&&enddt'),'DD-MON-YY')
ORDER BY 4
/
Query to display all current database locks for Oracle Application User
NOTE: Like the monitor users screen, this script requires that
-- Sign-On Auditing has been enabled at the User level or
-- higher.
The map between FND_LOGINS and V$PROCESS and V$SESSION is not 100%
-- accurate. The problem is end_time may not get populated. The query
-- now gets a unique pid from fnd_logins by using the MAX(start_time),pid
-- combination.
_________________________________________________________________________________
SET LINESIZE 150;
SET PAGESIZE 60;
--
COLUMN username HEADING 'ORACLE
User' FORMAT A7 TRUNCATE;
COLUMN oanam HEADING 'OA User' FORMAT A10 WORD_WRAPPED;
COLUMN sid HEADING 'SID' FORMAT 9999;
COLUMN command HEADING 'SQL
Command' FORMAT A10 WORD_WRAPPED;
COLUMN ltype HEADING 'Lock
Type' FORMAT A11 WORD_WRAPPED;
COLUMN lmode HEADING 'Mode
Held' FORMAT A10 WORD_WRAPPED;
COLUMN request HEADING 'Mode
Request' FORMAT A10 WORD_WRAPPED;
COLUMN ctime HEADING 'Last
Cnvrt
Time' FORMAT 999999;
COLUMN blkothr HEADING 'Blocking' FORMAT A8;
COLUMN owner HEADING 'Owner' FORMAT A7 WORD_WRAPPED;
COLUMN image HEADING 'Object' FORMAT A30 WORD_WRAPPED;
--
ALTER SESSION SET OPTIMIZER_GOAL = RULE;
--
SELECT se.username,
fndu.user_name oanam,
se.sid,
DECODE( se.command,
0, 'No command',
1, 'CREATE TABLE',
2, 'INSERT',
3, 'SELECT',
4, 'CREATE CLUSTER',
5, 'ALTER CLUSTER',
6, 'UPDATE',
7, 'DELETE',
8, 'DROP CLUSTER',
9, 'CREATE INDEX',
10, 'DROP INDEX',
11, 'ALTER INDEX',
12, 'DROP TABLE',
13, 'CREATE SEQUENCE',
14, 'ALTER SEQUENCE',
15, 'ALTER TABLE',
16, 'DROP SEQUENCE',
17, 'GRANT',
18, 'REVOKE',
19, 'CREATE SYNONYM',
20, 'DROP SYNONYM',
21, 'CREATE VIEW',
22, 'DROP VIEW',
23, 'VALIDATE INDEX',
24, 'CREATE PROCEDURE',
25, 'ALTER PROCEDURE',
26, 'LOCK TABLE',
27, 'NO OPERATION',
28, 'RENAME',
29, 'COMMENT',
30, 'AUDIT',
31, 'NOAUDIT',
32, 'CREATE DATABASE LINK',
33, 'DROP DATABASE LINK',
34, 'CREATE DATABASE',
35, 'ALTER DATABASE',
36, 'CREATE ROLLBACK SEGMENT',
37, 'ALTER ROLLBACK SEGMENT',
38, 'DROP ROLLBACK SEGMENT',
39, 'CREATE TABLESPACE',
40, 'ALTER TABLESPACE',
41, 'DROP TABLESPACE',
42, 'ALTER SESSION',
43, 'ALTER USER',
44, 'COMMIT',
45, 'ROLLBACK',
46, 'SAVEPOINT',
47, 'PL/SQL EXECUTE',
48, 'SET TRANSACTION',
49, 'ALTER SYSTEM SWITCH LOG',
50, 'EXPLAIN',
51, 'CREATE USER',
52, 'CREATE ROLE',
53, 'DROP USER',
54, 'DROP ROLE',
55, 'SET ROLE',
56, 'CREATE SCHEMA',
57, 'CREATE CONTROL FILE',
58, 'ALTER TRACING',
59, 'CREATE TRIGGER',
60, 'ALTER TRIGGER',
61, 'DROP TRIGGER',
62, 'ANALYZE TABLE',
63, 'ANALYZE INDEX',
64, 'ANALYZE CLUSTER',
65, 'CREATE PROFILE',
67, 'DROP PROFILE',
68, 'ALTER PROFILE',
69, 'DROP PROCEDURE',
70, 'ALTER RESOURCE COST',
71, 'CREATE SNAPSHOT LOG',
72, 'ALTER SNAPSHOT LOG',
73, 'DROP SNAPSHOT LOG',
74, 'CREATE SNAPSHOT',
75, 'ALTER SNAPSHOT',
76, 'DROP SNAPSHOT',
79, 'ALTER ROLE',
85, 'TRUNCATE TABLE',
86, 'TRUNCATE CLUSTER',
88, 'ALTER VIEW',
91, 'CREATE FUNCTION',
92, 'ALTER FUNCTION',
93, 'DROP FUNCTION',
94, 'CREATE PACKAGE',
95, 'ALTER PACKAGE',
96, 'DROP PACKAGE',
97, 'CREATE PACKAGE BODY',
98, 'ALTER PACKAGE BODY',
99, 'DROP PACKAGE BODY',
TO_CHAR(se.command) ) command,
DECODE(lo.type,
'MR', 'Media Recovery',
'RT', 'Redo Thread',
'UN', 'User Name',
'TX', 'Transaction',
'TM', 'DML',
'UL', 'PL/SQL User Lock',
'DX', 'Distributed Xaction',
'CF', 'Control File',
'IS', 'Instance State',
'FS', 'File Set',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'TS', 'Temp Segment',
'IV', 'Library Cache Invalidation',
'LS', 'Log Start or Switch',
'RW', 'Row Wait',
'SQ', 'Sequence Number',
'TE', 'Extend Table',
'TT', 'Temp Table',
'JQ', 'Job Queue',
lo.type) ltype,
DECODE( lo.lmode,
0, 'NONE', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share (S)', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Excl (X)', /* X */
TO_CHAR(lo.lmode)) lmode,
DECODE( lo.request,
0, 'NONE', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share (S)', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Excl (X)', /* X */
TO_CHAR(lo.request)) request,
lo.ctime ctime,
DECODE(lo.block,
0, 'No Block',
1, 'Blocking',
2, 'Global',
TO_CHAR(lo.block)) blkothr,
us.name owner,
ob.name image
FROM v$lock lo,
v$resource re,
v$session se,
sys.obj$ ob,
sys.user$ us,
( SELECT usr.user_name,
vsess.sid
FROM applsys.fnd_logins l,
applsys.fnd_user usr,
v$process vproc,
v$session vsess
WHERE l.pid = vproc.pid
AND l.user_id = usr.user_id
AND vproc.addr = vsess.paddr
AND l.spid = vsess.process
AND ( l.pid, l.start_time ) IN ( SELECT pid, MAX(start_time)
FROM fnd_logins
WHERE end_time IS NULL
GROUP BY pid ) ) fndu
WHERE se.sid = lo.sid
AND lo.id1 = re.id1
AND re.id1 = ob.obj#
AND ob.owner# = us.user#
AND se.type != 'BACKGROUND'
AND lo.id2 = 0
AND se.sid = fndu.sid(+)
UNION ALL
SELECT se.username,
NULL,
se.sid,
DECODE( se.command,
0, 'No command',
1, 'CREATE TABLE',
2, 'INSERT',
3, 'SELECT',
4, 'CREATE CLUSTER',
5, 'ALTER CLUSTER',
6, 'UPDATE',
7, 'DELETE',
8, 'DROP CLUSTER',
9, 'CREATE INDEX',
10, 'DROP INDEX',
11, 'ALTER INDEX',
12, 'DROP TABLE',
13, 'CREATE SEQUENCE',
14, 'ALTER SEQUENCE',
15, 'ALTER TABLE',
16, 'DROP SEQUENCE',
17, 'GRANT',
18, 'REVOKE',
19, 'CREATE SYNONYM',
20, 'DROP SYNONYM',
21, 'CREATE VIEW',
22, 'DROP VIEW',
23, 'VALIDATE INDEX',
24, 'CREATE PROCEDURE',
25, 'ALTER PROCEDURE',
26, 'LOCK TABLE',
27, 'NO OPERATION',
28, 'RENAME',
29, 'COMMENT',
30, 'AUDIT',
31, 'NOAUDIT',
32, 'CREATE DATABASE LINK',
33, 'DROP DATABASE LINK',
34, 'CREATE DATABASE',
35, 'ALTER DATABASE',
36, 'CREATE ROLLBACK SEGMENT',
37, 'ALTER ROLLBACK SEGMENT',
38, 'DROP ROLLBACK SEGMENT',
39, 'CREATE TABLESPACE',
40, 'ALTER TABLESPACE',
41, 'DROP TABLESPACE',
42, 'ALTER SESSION',
43, 'ALTER USER',
44, 'COMMIT',
45, 'ROLLBACK',
46, 'SAVEPOINT',
47, 'PL/SQL EXECUTE',
48, 'SET TRANSACTION',
49, 'ALTER SYSTEM SWITCH LOG',
50, 'EXPLAIN',
51, 'CREATE USER',
52, 'CREATE ROLE',
53, 'DROP USER',
54, 'DROP ROLE',
55, 'SET ROLE',
56, 'CREATE SCHEMA',
57, 'CREATE CONTROL FILE',
58, 'ALTER TRACING',
59, 'CREATE TRIGGER',
60, 'ALTER TRIGGER',
61, 'DROP TRIGGER',
62, 'ANALYZE TABLE',
63, 'ANALYZE INDEX',
64, 'ANALYZE CLUSTER',
65, 'CREATE PROFILE',
67, 'DROP PROFILE',
68, 'ALTER PROFILE',
69, 'DROP PROCEDURE',
70, 'ALTER RESOURCE COST',
71, 'CREATE SNAPSHOT LOG',
72, 'ALTER SNAPSHOT LOG',
73, 'DROP SNAPSHOT LOG',
74, 'CREATE SNAPSHOT',
75, 'ALTER SNAPSHOT',
76, 'DROP SNAPSHOT',
79, 'ALTER ROLE',
85, 'TRUNCATE TABLE',
86, 'TRUNCATE CLUSTER',
88, 'ALTER VIEW',
91, 'CREATE FUNCTION',
92, 'ALTER FUNCTION',
93, 'DROP FUNCTION',
94, 'CREATE PACKAGE',
95, 'ALTER PACKAGE',
96, 'DROP PACKAGE',
97, 'CREATE PACKAGE BODY',
98, 'ALTER PACKAGE BODY',
99, 'DROP PACKAGE BODY',
TO_CHAR(se.command) ) command,
DECODE(lo.type,
'MR', 'Media Recovery',
'RT', 'Redo Thread',
'UN', 'User Name',
'TX', 'Transaction',
'TM', 'DML',
'UL', 'PL/SQL User Lock',
'DX', 'Distributed Xaction',
'CF', 'Control File',
'IS', 'Instance State',
'FS', 'File Set',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'TS', 'Temp Segment',
'IV', 'Library Cache Invalidation',
'LS', 'Log Start or Switch',
'RW', 'Row Wait',
'SQ', 'Sequence Number',
'TE', 'Extend Table',
'TT', 'Temp Table',
'JQ', 'Job Queue',
lo.type) ltype,
DECODE( lo.lmode,
0, 'NONE', /* Mon Lock equivalent */
1, 'Null Mode', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share (S)', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Excl (X)', /* X */
lo.lmode) lmode,
DECODE( lo.request,
0, 'NONE', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share (S)', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Excl (X)', /* X */
TO_CHAR(lo.request)) request,
lo.ctime ctime,
DECODE(lo.block,
0, 'No Block',
1, 'Blocking',
2, 'Global',
TO_CHAR(lo.block)) blkothr,
'SYS' owner,
ro.name image
FROM v$lock lo,
v$session se,
v$transaction tr,
v$rollname ro
WHERE se.taddr IS NOT NULL
AND se.sid = lo.sid
AND lo.id2 != 0
AND se.taddr = tr.addr(+)
AND tr.xidusn = ro.usn(+)
ORDER BY sid
/
-- Sign-On Auditing has been enabled at the User level or
-- higher.
The map between FND_LOGINS and V$PROCESS and V$SESSION is not 100%
-- accurate. The problem is end_time may not get populated. The query
-- now gets a unique pid from fnd_logins by using the MAX(start_time),pid
-- combination.
_________________________________________________________________________________
SET LINESIZE 150;
SET PAGESIZE 60;
--
COLUMN username HEADING 'ORACLE
User' FORMAT A7 TRUNCATE;
COLUMN oanam HEADING 'OA User' FORMAT A10 WORD_WRAPPED;
COLUMN sid HEADING 'SID' FORMAT 9999;
COLUMN command HEADING 'SQL
Command' FORMAT A10 WORD_WRAPPED;
COLUMN ltype HEADING 'Lock
Type' FORMAT A11 WORD_WRAPPED;
COLUMN lmode HEADING 'Mode
Held' FORMAT A10 WORD_WRAPPED;
COLUMN request HEADING 'Mode
Request' FORMAT A10 WORD_WRAPPED;
COLUMN ctime HEADING 'Last
Cnvrt
Time' FORMAT 999999;
COLUMN blkothr HEADING 'Blocking' FORMAT A8;
COLUMN owner HEADING 'Owner' FORMAT A7 WORD_WRAPPED;
COLUMN image HEADING 'Object' FORMAT A30 WORD_WRAPPED;
--
ALTER SESSION SET OPTIMIZER_GOAL = RULE;
--
SELECT se.username,
fndu.user_name oanam,
se.sid,
DECODE( se.command,
0, 'No command',
1, 'CREATE TABLE',
2, 'INSERT',
3, 'SELECT',
4, 'CREATE CLUSTER',
5, 'ALTER CLUSTER',
6, 'UPDATE',
7, 'DELETE',
8, 'DROP CLUSTER',
9, 'CREATE INDEX',
10, 'DROP INDEX',
11, 'ALTER INDEX',
12, 'DROP TABLE',
13, 'CREATE SEQUENCE',
14, 'ALTER SEQUENCE',
15, 'ALTER TABLE',
16, 'DROP SEQUENCE',
17, 'GRANT',
18, 'REVOKE',
19, 'CREATE SYNONYM',
20, 'DROP SYNONYM',
21, 'CREATE VIEW',
22, 'DROP VIEW',
23, 'VALIDATE INDEX',
24, 'CREATE PROCEDURE',
25, 'ALTER PROCEDURE',
26, 'LOCK TABLE',
27, 'NO OPERATION',
28, 'RENAME',
29, 'COMMENT',
30, 'AUDIT',
31, 'NOAUDIT',
32, 'CREATE DATABASE LINK',
33, 'DROP DATABASE LINK',
34, 'CREATE DATABASE',
35, 'ALTER DATABASE',
36, 'CREATE ROLLBACK SEGMENT',
37, 'ALTER ROLLBACK SEGMENT',
38, 'DROP ROLLBACK SEGMENT',
39, 'CREATE TABLESPACE',
40, 'ALTER TABLESPACE',
41, 'DROP TABLESPACE',
42, 'ALTER SESSION',
43, 'ALTER USER',
44, 'COMMIT',
45, 'ROLLBACK',
46, 'SAVEPOINT',
47, 'PL/SQL EXECUTE',
48, 'SET TRANSACTION',
49, 'ALTER SYSTEM SWITCH LOG',
50, 'EXPLAIN',
51, 'CREATE USER',
52, 'CREATE ROLE',
53, 'DROP USER',
54, 'DROP ROLE',
55, 'SET ROLE',
56, 'CREATE SCHEMA',
57, 'CREATE CONTROL FILE',
58, 'ALTER TRACING',
59, 'CREATE TRIGGER',
60, 'ALTER TRIGGER',
61, 'DROP TRIGGER',
62, 'ANALYZE TABLE',
63, 'ANALYZE INDEX',
64, 'ANALYZE CLUSTER',
65, 'CREATE PROFILE',
67, 'DROP PROFILE',
68, 'ALTER PROFILE',
69, 'DROP PROCEDURE',
70, 'ALTER RESOURCE COST',
71, 'CREATE SNAPSHOT LOG',
72, 'ALTER SNAPSHOT LOG',
73, 'DROP SNAPSHOT LOG',
74, 'CREATE SNAPSHOT',
75, 'ALTER SNAPSHOT',
76, 'DROP SNAPSHOT',
79, 'ALTER ROLE',
85, 'TRUNCATE TABLE',
86, 'TRUNCATE CLUSTER',
88, 'ALTER VIEW',
91, 'CREATE FUNCTION',
92, 'ALTER FUNCTION',
93, 'DROP FUNCTION',
94, 'CREATE PACKAGE',
95, 'ALTER PACKAGE',
96, 'DROP PACKAGE',
97, 'CREATE PACKAGE BODY',
98, 'ALTER PACKAGE BODY',
99, 'DROP PACKAGE BODY',
TO_CHAR(se.command) ) command,
DECODE(lo.type,
'MR', 'Media Recovery',
'RT', 'Redo Thread',
'UN', 'User Name',
'TX', 'Transaction',
'TM', 'DML',
'UL', 'PL/SQL User Lock',
'DX', 'Distributed Xaction',
'CF', 'Control File',
'IS', 'Instance State',
'FS', 'File Set',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'TS', 'Temp Segment',
'IV', 'Library Cache Invalidation',
'LS', 'Log Start or Switch',
'RW', 'Row Wait',
'SQ', 'Sequence Number',
'TE', 'Extend Table',
'TT', 'Temp Table',
'JQ', 'Job Queue',
lo.type) ltype,
DECODE( lo.lmode,
0, 'NONE', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share (S)', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Excl (X)', /* X */
TO_CHAR(lo.lmode)) lmode,
DECODE( lo.request,
0, 'NONE', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share (S)', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Excl (X)', /* X */
TO_CHAR(lo.request)) request,
lo.ctime ctime,
DECODE(lo.block,
0, 'No Block',
1, 'Blocking',
2, 'Global',
TO_CHAR(lo.block)) blkothr,
us.name owner,
ob.name image
FROM v$lock lo,
v$resource re,
v$session se,
sys.obj$ ob,
sys.user$ us,
( SELECT usr.user_name,
vsess.sid
FROM applsys.fnd_logins l,
applsys.fnd_user usr,
v$process vproc,
v$session vsess
WHERE l.pid = vproc.pid
AND l.user_id = usr.user_id
AND vproc.addr = vsess.paddr
AND l.spid = vsess.process
AND ( l.pid, l.start_time ) IN ( SELECT pid, MAX(start_time)
FROM fnd_logins
WHERE end_time IS NULL
GROUP BY pid ) ) fndu
WHERE se.sid = lo.sid
AND lo.id1 = re.id1
AND re.id1 = ob.obj#
AND ob.owner# = us.user#
AND se.type != 'BACKGROUND'
AND lo.id2 = 0
AND se.sid = fndu.sid(+)
UNION ALL
SELECT se.username,
NULL,
se.sid,
DECODE( se.command,
0, 'No command',
1, 'CREATE TABLE',
2, 'INSERT',
3, 'SELECT',
4, 'CREATE CLUSTER',
5, 'ALTER CLUSTER',
6, 'UPDATE',
7, 'DELETE',
8, 'DROP CLUSTER',
9, 'CREATE INDEX',
10, 'DROP INDEX',
11, 'ALTER INDEX',
12, 'DROP TABLE',
13, 'CREATE SEQUENCE',
14, 'ALTER SEQUENCE',
15, 'ALTER TABLE',
16, 'DROP SEQUENCE',
17, 'GRANT',
18, 'REVOKE',
19, 'CREATE SYNONYM',
20, 'DROP SYNONYM',
21, 'CREATE VIEW',
22, 'DROP VIEW',
23, 'VALIDATE INDEX',
24, 'CREATE PROCEDURE',
25, 'ALTER PROCEDURE',
26, 'LOCK TABLE',
27, 'NO OPERATION',
28, 'RENAME',
29, 'COMMENT',
30, 'AUDIT',
31, 'NOAUDIT',
32, 'CREATE DATABASE LINK',
33, 'DROP DATABASE LINK',
34, 'CREATE DATABASE',
35, 'ALTER DATABASE',
36, 'CREATE ROLLBACK SEGMENT',
37, 'ALTER ROLLBACK SEGMENT',
38, 'DROP ROLLBACK SEGMENT',
39, 'CREATE TABLESPACE',
40, 'ALTER TABLESPACE',
41, 'DROP TABLESPACE',
42, 'ALTER SESSION',
43, 'ALTER USER',
44, 'COMMIT',
45, 'ROLLBACK',
46, 'SAVEPOINT',
47, 'PL/SQL EXECUTE',
48, 'SET TRANSACTION',
49, 'ALTER SYSTEM SWITCH LOG',
50, 'EXPLAIN',
51, 'CREATE USER',
52, 'CREATE ROLE',
53, 'DROP USER',
54, 'DROP ROLE',
55, 'SET ROLE',
56, 'CREATE SCHEMA',
57, 'CREATE CONTROL FILE',
58, 'ALTER TRACING',
59, 'CREATE TRIGGER',
60, 'ALTER TRIGGER',
61, 'DROP TRIGGER',
62, 'ANALYZE TABLE',
63, 'ANALYZE INDEX',
64, 'ANALYZE CLUSTER',
65, 'CREATE PROFILE',
67, 'DROP PROFILE',
68, 'ALTER PROFILE',
69, 'DROP PROCEDURE',
70, 'ALTER RESOURCE COST',
71, 'CREATE SNAPSHOT LOG',
72, 'ALTER SNAPSHOT LOG',
73, 'DROP SNAPSHOT LOG',
74, 'CREATE SNAPSHOT',
75, 'ALTER SNAPSHOT',
76, 'DROP SNAPSHOT',
79, 'ALTER ROLE',
85, 'TRUNCATE TABLE',
86, 'TRUNCATE CLUSTER',
88, 'ALTER VIEW',
91, 'CREATE FUNCTION',
92, 'ALTER FUNCTION',
93, 'DROP FUNCTION',
94, 'CREATE PACKAGE',
95, 'ALTER PACKAGE',
96, 'DROP PACKAGE',
97, 'CREATE PACKAGE BODY',
98, 'ALTER PACKAGE BODY',
99, 'DROP PACKAGE BODY',
TO_CHAR(se.command) ) command,
DECODE(lo.type,
'MR', 'Media Recovery',
'RT', 'Redo Thread',
'UN', 'User Name',
'TX', 'Transaction',
'TM', 'DML',
'UL', 'PL/SQL User Lock',
'DX', 'Distributed Xaction',
'CF', 'Control File',
'IS', 'Instance State',
'FS', 'File Set',
'IR', 'Instance Recovery',
'ST', 'Disk Space Transaction',
'TS', 'Temp Segment',
'IV', 'Library Cache Invalidation',
'LS', 'Log Start or Switch',
'RW', 'Row Wait',
'SQ', 'Sequence Number',
'TE', 'Extend Table',
'TT', 'Temp Table',
'JQ', 'Job Queue',
lo.type) ltype,
DECODE( lo.lmode,
0, 'NONE', /* Mon Lock equivalent */
1, 'Null Mode', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share (S)', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Excl (X)', /* X */
lo.lmode) lmode,
DECODE( lo.request,
0, 'NONE', /* Mon Lock equivalent */
1, 'Null', /* N */
2, 'Row-S (SS)', /* L */
3, 'Row-X (SX)', /* R */
4, 'Share (S)', /* S */
5, 'S/Row-X (SSX)', /* C */
6, 'Excl (X)', /* X */
TO_CHAR(lo.request)) request,
lo.ctime ctime,
DECODE(lo.block,
0, 'No Block',
1, 'Blocking',
2, 'Global',
TO_CHAR(lo.block)) blkothr,
'SYS' owner,
ro.name image
FROM v$lock lo,
v$session se,
v$transaction tr,
v$rollname ro
WHERE se.taddr IS NOT NULL
AND se.sid = lo.sid
AND lo.id2 != 0
AND se.taddr = tr.addr(+)
AND tr.xidusn = ro.usn(+)
ORDER BY sid
/
Wednesday, March 10, 2010
Where can one find I/O statistics per table?
The STATSPACK and UTLESTAT reports show I/O per tablespace. However, they do not show which tables in the tablespace has the most I/O operations.
The $ORACLE_HOME/rdbms/admin/catio.sql script creates a sample_io procedure and table to gather the required information. After executing the procedure, one can do a simple SELECT * FROM io_per_object; to extract the required information.
For more details, look at the header comments in the catio.sql script.
The $ORACLE_HOME/rdbms/admin/catio.sql script creates a sample_io procedure and table to gather the required information. After executing the procedure, one can do a simple SELECT * FROM io_per_object; to extract the required information.
For more details, look at the header comments in the catio.sql script.
Tuesday, March 2, 2010
How to Replace Oracle Logo with Company Logo on Applications 11i Sign-On
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.
There are 4 main logos screens in the sign-on 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 ||{1}|| 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. .
Saturday, January 30, 2010
Install DB10gR2 on RHEL5
Installation requirements:
1. Installing required packages
The minimum required packages given here are sufficient only if Linux has been installed without customizing the package selection. This list is based upon a "default-RPMs" installation of RHEL AS/ES 5. Additional RPMs may be needed if a "less-than-default-RPMs" installation of RHEL AS/ES 5 is performed. For more information, please refer to Note 376183.1 "Defining a "default RPMs" installation of the RHEL OS".
The version numbers for these packages given below are the minimum version required. If you have the packages with higher versions than the versions mentioned in below example, you can install the higher version packages.
(i) gcc-c++-4.1.1-52.el5.i386.rpm and all its dependent packages. The dependent packages are
gcc-4.1.1-52.el5.i386.rpm
libstdc++-devel-4.1.1-52.el5.i386.rpm
glibc-devel-2.5-12.i386.rpm
glibc-headers-2.5-12.i386.rpm
libgomp-4.1.1-52.el5.i386.rpm
(ii) libXp-1.0.0-8.i386.rpm
(iii) compat-libstdc++-296-2.96-138.i386.rpm
(iv) compat-libstdc++-33-3.2.3-61.i386.rpm
Install all these packages from the directory Server in CD#2 of RHEL 5 by the single command.
# rpm -ivh gcc-c++-4.1.1-52.el5.i386.rpm gcc-4.1.1-52.el5.i386.rpm
libstdc++-devel-4.1.1-52.el5.i386.rpm glibc-devel-2.5-12.i386.rpm
glibc-headers-2.5-12.i386.rpm libgomp-4.1.1-52.el5.i386.rpm
libXp-1.0.0-8.i386.rpm compat-libstdc++-296-2.96-138.i386.rpm
compat-libstdc++-33-3.2.3-61.i386.rpm
(v) compat-db-4.2.52-5.1.i386.rpm
This package is available in the directory Server in CD#3 of RHEL 5. Install this package by the command
# rpm -ivh compat-db-4.2.52-5.1.i386.rpm
2. Set the kernel parameters
Add the following the lines in the file /etc/sysctl.conf
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
To place these changes into effect, execute the command
# sysctl -p
3. Create Oracle user and groups
# groupadd oinstall
# groupadd dba
# useradd -g oinstall -G dba oracle
# passwd oracle
4. Create the required directories for Oracle Base and change the ownership
For example
# mkdir -p /u01/app/oracle
# chown -R oracle:oinstall /u01/app/oracle
5. Set the session limits for Oracle user
Add the following lines to the /etc/security/limits.conf file
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
Add the following line in the /etc/pam.d/login file
session required pam_limits.so
Add the following lines to the /etc/profile.
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
6. Configure the Oracle user's environment
Configuring the oracle User's Environment, using the appropriate section of "Oracle® Database Quick Installation Guide 10g Release 2 (10.2) for Linux x86". Note that setting $ORACLE_BASE (not $ORACLE_HOME) in the environment will ease a couple of entries in the Oracle Universal Installer.
For example, if oracle user is using bash shell, and has the home directory as /home/oracle,
The following lines to be added to /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
unset ORACLE_HOME
7. Invoking OUI
Log in as Oracle user and start installation by any one of the following methods. This is required because Oracle 10.2 expects the OS to be RHEL 3 or RHEL 4.
Method 1:
$ ./runInstaller -ignoreSysPrereqs
Method 2:
Copy the oraparam.ini from the installation source install/oraparam.ini to /tmp directory.
Edit the file /tmp/oraparam.ini
Change the following section :
Before
[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2
After
[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,UnitedLinux-1.0,asianux-1,asianux-2,redhat-5
Now invoke the runInstaller as follows :
$ ./runInstaller -paramFile /tmp/oraparam.ini
Monday, January 11, 2010
Step by step, EBS R12 Installation on Sparc
Operating System Required Maintenance Tools
Solaris (SPARC) ar, ld, make, X Display Server
Use the following command to check the operating system version:
$ uname -r
Use the following command to check the maintenance update level:
$ cat /etc/release
Required Patches
Operating System R Required Patches
Solaris 10 (5.10) 125100-04 or higher:
120473-05 or higher:
Use the following command to retrieve the list of operating system patches already applied:
$ showrev -p | sort > patchList
Use the following command to check for a specific patch:
$ /usr/sbin/patchadd -p | grep patch_number (without version number)
For example, to check for patch 123456-01, enter::
$ /usr/sbin/patchadd -p | grep 123456
The following table lists the required packages for Solaris 8 (5.8), 9 (5.9), 10 (5.10).
Operating System Required Packages
Solaris 8 (5.8), 9 (5.9) • SUNWsprox
Solaris 8 (5.8), 9 (5.9), 10 (5.10) • SUNWarc
• SUNWbtool
• SUNWhea
• SUNWlibm
• SUNWlibms
• SUNWsprot
• SUNWtoo
• SUNWi1of
• SUNWi1cs
• SUNWi15cs
• SUNWxwfnt
Use the following command to check for existing packages:
$ pkginfo
Software Requirements
The following maintenance tools must be installed on all machines, and their locations specified both in the PATH of the account that runs Rapid Install and in the PATH of the accounts that will own the database tier and application tier file systems.
• ar
• ld
• make
• X Display Server
Other Requirements
The following are other requirements for Solaris Operating System (SPARC).
ulimit Value Settings
Verify that the owner of the Oracle Application Server and Oracle Database server file systems have the following 'ulimit' values:
• time (seconds) = unlimited
• file (blocks) = unlimited
• data (kbytes) = unlimited
• stack (kbytes) = unlimited
• memory (kbytes) = unlimited
• coredump (blocks) = unlimited
• nofiles (descriptors) = 65536
Use the following command to check the ulimit settings:
$ ulimit –a
Operating System Parameter Value
Solaris 10 (5.10) rlim_fd_max 65536
noexec_user_stack 1
semsys:seminfo_semmni 100
semsys:seminfo_semmsl 256
shmsys:shminfo_shmmax 4294967295
shmsys:shminfo_shmmni 100
Check the /etc/system file to verify the kernel settings.
Host Names Settings
Verify that the /etc/hosts file is formatted as follows:
127.0.0.1 localhost.localdomain localhost
.
Disk Space Requirements
Node: Space Required:
Applications node file system (includes AS 28 GB
10.1.2 ORACLE_HOME, AS 10.1.3
ORACLE_HOME, COMMON_TOP,
APPL_TOP, and INST_TOP)
Database node file system (Fresh install) 45 GB
Database node file system (Vision Demo 133 GB
database)
Stage area
For a production database install, running Rapid Install from a stage area requires at
least 33 GB to accommodate the file system and database files in the stage area.
Temporary directories and files
For installation time temporary disk space, Rapid Install uses the temporary directory
defined by the TMPDIR variable (on UNIX)
Important: You should ensure there is at least 500 MB of free temporary
space when carrying out an installation.
For UNIX users
The operating system user that owns the database node file system and starts the
database node services is called the oracle user.
The operating system user that owns the
Applications node file system and starts the Applications node services is called the
applmgr user.
Single-user UNIX installations
In order to prepare for a single-user installation, you must first create an oracle user
account and log in as the oracle user to run Rapid Install. The account should be created
with a default shell that is compatible with the Bourne shell.
Multi-user UNIX installations
In order to prepare for a multi-user installation, you must first create an oracle user
account and an applmgr user account. Both should be created with a default shell that is
compatible with the Bourne shell. Log in as root to run Rapid Install. Then specify the
oracle user as the Oracle OS user, and the applmgr user as the Apps OS user.
The oracle user is the account that owns the database node technology stack (10g R2
ORACLE_HOME) and the database files. The default name for the oracle user is
ora. For example, for a production (PROD) environment, the default Oracle OS
username might be oraprod.
The applmgr user is the account that owns the Applications node technology stack
(APPL_TOP, COMMON_TOP, 10.1.2 ORACLE_HOME, and 10.1.3 ORACLE HOME).
The default name is appl. For example, for a Vision Demo (VIS) environment, the
default Apps OS username might be applvis.
On machines containing multiple nodes, you can assign one user account to be the
owner of the database node file system, and another to be the owner of the Applications
node file system. For this type of install, Rapid Install can install both nodes in one run
if the install is started by the root user. If you are installing on a machine with only one
node to install, or with all nodes sharing the same user, you can run the install as either
the root user or the specific user for those nodes.
Creating the Stage Area Directory
To create the stage area directory, run the adautostg.pl script.
Follow these steps to set up a stage area installation:
1. Log in as the operating system user with sufficient privileges to mount, unmount,
and eject the DVD. This user must also have write privileges to the stage area that
you set up.
2. Insert the Start Here disk in the DVD-ROM drive.
3. Mount the DVD (conditional).
If your system runs on a UNIX platform, and if you do not use AutoMount, you
must mount the Start Here disk now.
4. Verify software version (perl).
You must have perl 5.0053 or higher installed, and it must be in your PATH. Use
the following commands to identify the perl version and its location. The command
is the same for both UNIX and Windows platforms:
perl –v
If perl is not installed, you may download it from http://www.perl.com.
5. On UNIX, set the environment variable DISPLAY to an active and authorized
display.
6. Run the adautostg.pl script.
UNIX:
$ cd
$ perl /mnt/cdrom/Disk1/rapidwiz/adautostg.pl
7. Set up the stage area directory.
At the prompt for the stage directory, enter the name of the system top-level
directory. The Rapid wizard stage12 directory will be created in this path. For
example, if you enter /u01 as the top-level directory, the resulting directory path
will be /u01/stage12.
8. Indicate the components to be staged.
The script prompts you to choose the components that you want to stage:
1. Oracle Applications
2. Oracle Database technology stack (RDBMS)
3. Oracle Applications database (Databases)
4. Oracle Applications technology stack (Tools)
5. APPL_TOP
Enter one or more components, separating each one with a space. You can indicate
that you want to stage only the database technology stack, only the APPL_TOP, and
so on.
If you choose 1 (the default), all the main components will be staged.
9. Insert the Rapid Install DVD.
Insert the relevant DVD, as required in the prompt. The system message lists the
files it has copied and their location in the stage area directory.
Stage Area Directory Structure
The stage area created by adautostg.pl looks like this: a top-level directory,
with subdirectories startCD, oraApps, oraDB, oraAS, and oraAppDB.
Starting Rapid Install
Once the stage directory is created, start Rapid Install as described in the following
section.
UNIX:
Example
$ cd /u01/Stage12/startCD/Disk1/rapidwiz
$ ./rapidwiz
Using an Alias For the Host Machine
If you want to use an alias (not the actual name of the host machine), use the
-servername parameter when you start Rapid Install.
UNIX:
Example
$ rapidwiz -servername
Restarting the Installation
If the installation process terminates before completion, you can use the -restart
parameter to run Rapid Install again.
UNIX:
Example
$ rapidwiz –restart
Installing a New Technology Stack
Rapid Install can a install new technology stack for the database tier (Oracle10g R2) or
the Applications node (Oracle Application Server 10g) in an existing system. To access
the Rapid Install screen flow for a technology stack installation, use the -techstack
parameter when you start Rapid Install.
UNIX:
Example
$ rapidwiz –techstack
Note: The scripts for these services are located in $INST_TOP/admin/scripts.
Set Up Printers
To register printers in the Printers form of Oracle Applications, the system
administrator must know each printer's operating system name. To determine the
names, do the following:
UNIX:
At the command prompt, enter:
Example
$ lpstat -p
Post Installation Steps:
Perform the following steps after installing or upgrading to Release 12 and before allowing users to access the system.
LD_LIBRARY_PATH Environment Variable
Dynamic libraries are used as part of the relinking and execution processes. The LD_LIBRARY_PATH environment variable is used by Oracle Applications to locate the required dynamic libraries at runtime. Rapid Install sets LD_LIBRARY_PATH as follows:
On each application tier server node:
LD_LIBRARY_PATH is set in three places:
• $APPL_TOP/admin/adovars.env
• $ORA_CONFIG_HOME/10.1.2/.env, in the 10.1.2 Oracle home directory
• $ORA_CONFIG_HOME/10.1.3/.env, in the 10.1.3 Oracle home directory
To change the value in any of the application tier locations, use the Edit Parameters function of the OAM AutoConfig tool to update the following fields (as required). Then, run AutoConfig (adautocfg.sh) to implement the changes.
Location Parameter
adovars LD_LIBRARY_PATH
10.1.3 Oracle Home LD_LIBRARY_PATH
Tools Oracle Home LD_LIBRARY_PATH
On the database server node:
LD_LIBRARY_PATH is set in $ORACLE_HOME/.env.
Net Service Listeners in Multi-user Installations
Net Service Listeners use the /var/tmp/.oracle directory to store temporary files. To give all users in a multi-user installation write privileges, update /var/tmp/.oracle with 777 permissions:
$ chmod 777 /var/tmp/.oracle
Create DQM Indexes
If you installed the Release 12 Vision Demo Database, create DQM indexes using the following steps:
1. Log on to Oracle Applications with the "Trading Community Manager" responsibility.
2. Click Control > Request > Run.
3. Select the Single Request option.
4. Enter "DQM Staging Program" name.
5. Enter the following parameters:
o Number of Parallel Staging Workers: 4
o Staging Command: CREATE_INDEXES
o Continue Previous Execution: NO
o Index Creation: SERIAL
6. Click Submit.
Solaris (SPARC) ar, ld, make, X Display Server
Use the following command to check the operating system version:
$ uname -r
Use the following command to check the maintenance update level:
$ cat /etc/release
Required Patches
Operating System R Required Patches
Solaris 10 (5.10) 125100-04 or higher:
120473-05 or higher:
Use the following command to retrieve the list of operating system patches already applied:
$ showrev -p | sort > patchList
Use the following command to check for a specific patch:
$ /usr/sbin/patchadd -p | grep patch_number (without version number)
For example, to check for patch 123456-01, enter::
$ /usr/sbin/patchadd -p | grep 123456
The following table lists the required packages for Solaris 8 (5.8), 9 (5.9), 10 (5.10).
Operating System Required Packages
Solaris 8 (5.8), 9 (5.9) • SUNWsprox
Solaris 8 (5.8), 9 (5.9), 10 (5.10) • SUNWarc
• SUNWbtool
• SUNWhea
• SUNWlibm
• SUNWlibms
• SUNWsprot
• SUNWtoo
• SUNWi1of
• SUNWi1cs
• SUNWi15cs
• SUNWxwfnt
Use the following command to check for existing packages:
$ pkginfo
Software Requirements
The following maintenance tools must be installed on all machines, and their locations specified both in the PATH of the account that runs Rapid Install and in the PATH of the accounts that will own the database tier and application tier file systems.
• ar
• ld
• make
• X Display Server
Other Requirements
The following are other requirements for Solaris Operating System (SPARC).
ulimit Value Settings
Verify that the owner of the Oracle Application Server and Oracle Database server file systems have the following 'ulimit' values:
• time (seconds) = unlimited
• file (blocks) = unlimited
• data (kbytes) = unlimited
• stack (kbytes) = unlimited
• memory (kbytes) = unlimited
• coredump (blocks) = unlimited
• nofiles (descriptors) = 65536
Use the following command to check the ulimit settings:
$ ulimit –a
Operating System Parameter Value
Solaris 10 (5.10) rlim_fd_max 65536
noexec_user_stack 1
semsys:seminfo_semmni 100
semsys:seminfo_semmsl 256
shmsys:shminfo_shmmax 4294967295
shmsys:shminfo_shmmni 100
Check the /etc/system file to verify the kernel settings.
Host Names Settings
Verify that the /etc/hosts file is formatted as follows:
127.0.0.1 localhost.localdomain localhost
Disk Space Requirements
Node: Space Required:
Applications node file system (includes AS 28 GB
10.1.2 ORACLE_HOME, AS 10.1.3
ORACLE_HOME, COMMON_TOP,
APPL_TOP, and INST_TOP)
Database node file system (Fresh install) 45 GB
Database node file system (Vision Demo 133 GB
database)
Stage area
For a production database install, running Rapid Install from a stage area requires at
least 33 GB to accommodate the file system and database files in the stage area.
Temporary directories and files
For installation time temporary disk space, Rapid Install uses the temporary directory
defined by the TMPDIR variable (on UNIX)
Important: You should ensure there is at least 500 MB of free temporary
space when carrying out an installation.
For UNIX users
The operating system user that owns the database node file system and starts the
database node services is called the oracle user.
The operating system user that owns the
Applications node file system and starts the Applications node services is called the
applmgr user.
Single-user UNIX installations
In order to prepare for a single-user installation, you must first create an oracle user
account and log in as the oracle user to run Rapid Install. The account should be created
with a default shell that is compatible with the Bourne shell.
Multi-user UNIX installations
In order to prepare for a multi-user installation, you must first create an oracle user
account and an applmgr user account. Both should be created with a default shell that is
compatible with the Bourne shell. Log in as root to run Rapid Install. Then specify the
oracle user as the Oracle OS user, and the applmgr user as the Apps OS user.
The oracle user is the account that owns the database node technology stack (10g R2
ORACLE_HOME) and the database files. The default name for the oracle user is
ora
username might be oraprod.
The applmgr user is the account that owns the Applications node technology stack
(APPL_TOP, COMMON_TOP, 10.1.2 ORACLE_HOME, and 10.1.3 ORACLE HOME).
The default name is appl
default Apps OS username might be applvis.
On machines containing multiple nodes, you can assign one user account to be the
owner of the database node file system, and another to be the owner of the Applications
node file system. For this type of install, Rapid Install can install both nodes in one run
if the install is started by the root user. If you are installing on a machine with only one
node to install, or with all nodes sharing the same user, you can run the install as either
the root user or the specific user for those nodes.
Creating the Stage Area Directory
To create the stage area directory, run the adautostg.pl script.
Follow these steps to set up a stage area installation:
1. Log in as the operating system user with sufficient privileges to mount, unmount,
and eject the DVD. This user must also have write privileges to the stage area that
you set up.
2. Insert the Start Here disk in the DVD-ROM drive.
3. Mount the DVD (conditional).
If your system runs on a UNIX platform, and if you do not use AutoMount, you
must mount the Start Here disk now.
4. Verify software version (perl).
You must have perl 5.0053 or higher installed, and it must be in your PATH. Use
the following commands to identify the perl version and its location. The command
is the same for both UNIX and Windows platforms:
perl –v
If perl is not installed, you may download it from http://www.perl.com.
5. On UNIX, set the environment variable DISPLAY to an active and authorized
display.
6. Run the adautostg.pl script.
UNIX:
$ cd
$ perl /mnt/cdrom/Disk1/rapidwiz/adautostg.pl
7. Set up the stage area directory.
At the prompt for the stage directory, enter the name of the system top-level
directory. The Rapid wizard stage12 directory will be created in this path. For
example, if you enter /u01 as the top-level directory, the resulting directory path
will be /u01/stage12.
8. Indicate the components to be staged.
The script prompts you to choose the components that you want to stage:
1. Oracle Applications
2. Oracle Database technology stack (RDBMS)
3. Oracle Applications database (Databases)
4. Oracle Applications technology stack (Tools)
5. APPL_TOP
Enter one or more components, separating each one with a space. You can indicate
that you want to stage only the database technology stack, only the APPL_TOP, and
so on.
If you choose 1 (the default), all the main components will be staged.
9. Insert the Rapid Install DVD.
Insert the relevant DVD, as required in the prompt. The system message lists the
files it has copied and their location in the stage area directory.
Stage Area Directory Structure
The stage area created by adautostg.pl looks like this: a top-level directory
with subdirectories startCD, oraApps, oraDB, oraAS, and oraAppDB.
Starting Rapid Install
Once the stage directory is created, start Rapid Install as described in the following
section.
UNIX:
Example
$ cd /u01/Stage12/startCD/Disk1/rapidwiz
$ ./rapidwiz
Using an Alias For the Host Machine
If you want to use an alias (not the actual name of the host machine), use the
-servername parameter when you start Rapid Install.
UNIX:
Example
$ rapidwiz -servername
Restarting the Installation
If the installation process terminates before completion, you can use the -restart
parameter to run Rapid Install again.
UNIX:
Example
$ rapidwiz –restart
Installing a New Technology Stack
Rapid Install can a install new technology stack for the database tier (Oracle10g R2) or
the Applications node (Oracle Application Server 10g) in an existing system. To access
the Rapid Install screen flow for a technology stack installation, use the -techstack
parameter when you start Rapid Install.
UNIX:
Example
$ rapidwiz –techstack
Note: The scripts for these services are located in $INST_TOP/admin/scripts.
Set Up Printers
To register printers in the Printers form of Oracle Applications, the system
administrator must know each printer's operating system name. To determine the
names, do the following:
UNIX:
At the command prompt, enter:
Example
$ lpstat -p
Post Installation Steps:
Perform the following steps after installing or upgrading to Release 12 and before allowing users to access the system.
LD_LIBRARY_PATH Environment Variable
Dynamic libraries are used as part of the relinking and execution processes. The LD_LIBRARY_PATH environment variable is used by Oracle Applications to locate the required dynamic libraries at runtime. Rapid Install sets LD_LIBRARY_PATH as follows:
On each application tier server node:
LD_LIBRARY_PATH is set in three places:
• $APPL_TOP/admin/adovars.env
• $ORA_CONFIG_HOME/10.1.2/
• $ORA_CONFIG_HOME/10.1.3/
To change the value in any of the application tier locations, use the Edit Parameters function of the OAM AutoConfig tool to update the following fields (as required). Then, run AutoConfig (adautocfg.sh) to implement the changes.
Location Parameter
adovars LD_LIBRARY_PATH
10.1.3 Oracle Home LD_LIBRARY_PATH
Tools Oracle Home LD_LIBRARY_PATH
On the database server node:
LD_LIBRARY_PATH is set in $ORACLE_HOME/
Net Service Listeners in Multi-user Installations
Net Service Listeners use the /var/tmp/.oracle directory to store temporary files. To give all users in a multi-user installation write privileges, update /var/tmp/.oracle with 777 permissions:
$ chmod 777 /var/tmp/.oracle
Create DQM Indexes
If you installed the Release 12 Vision Demo Database, create DQM indexes using the following steps:
1. Log on to Oracle Applications with the "Trading Community Manager" responsibility.
2. Click Control > Request > Run.
3. Select the Single Request option.
4. Enter "DQM Staging Program" name.
5. Enter the following parameters:
o Number of Parallel Staging Workers: 4
o Staging Command: CREATE_INDEXES
o Continue Previous Execution: NO
o Index Creation: SERIAL
6. Click Submit.
Friday, January 1, 2010
Steps to Schedule a Concurrent Request
1. In the Navigator window, select the Run function in the requests menu item and click the Open button or press Alt+ O
2. Ensure that the Single Request option button is selected and click the OK button or press Alt+ O
3. Select the name of the request you want to run from the list of available requests.
4. Optionally, define the parameter values for the request in the Parameter dialog box.
5. Click the schedule button or press Alt +D to define the submission schedule for the request.
6. Select a type of schedule in the Schedule dialog box, specify the schedule details, and click the OK button or press Alt +O.
7. Optionally, select the Options button to define completion options for the request.
8. Click the submit button or press Alt +M to submit the request.
9. Select the Yes button in the Decision dialog box to submit another request.
Subscribe to:
Posts (Atom)