Wednesday 21 October 2015

EXPORT WITH COMPRESS SCRIPT




                   EXPORT WITH COMPRESS SCRIPT

               
# BEFORE RUNNING THIS SCRIPT, USE the mknod command to create a named pipe
# called /dev/PIPE.dmp (mknod is Unix command, PIPE.dmp is an arbitrary name).
# Then set environment variables for ORACLE_HOME, ORACLE_SID, and DUMPDIR, as
# well as PATH if needed.
# If you save the script as, say, exp_comp.sh, type
#             % exp_comp.sh & 
# at the Unix prompt to run it.
# WARNING: You must have unique names for each pipe if you have
# multiple concurrent executions of this script.

trap '' 1 # nohup

# Set these to appropriate values
ORACLE_HOME=
ORACLE_SID=
DUMPDIR=

# Customize PATH if needed
PATH=/bin:/usr/bin:${ORACLE_HOME}/bin:/usr/local/bin:/usr/lbin

export ORACLE_HOME ORACLE_SID PATH
LOGFILE=$DUMPDIR/exp${ORACLE_SID}.log
exec >$LOGFILE 2>&1

echo "Exporting $ORACLE_SID database. start `date`"

# Customize this as needed
exp system/manager GRANTS=Y FULL=Y INDEXES=Y COMPRESS=Y FILE=/dev/PIPE.dmp &

compress </dev/PIPE.dmp > $DUMPDIR/exp$ORACLE_SID.dmp.Z &

Create a shell script to run export/import utilities.



You want to create a shell script to run export/import utilities. 


# SCRIPT 
# ---------
# 
# Set environment variables for ORACLE_HOME, ORACLE_SID, 
# and DUMPDIR -- in case of datapump --, as well as PATH if needed.
#
#

trap '' 1 # to use nohup in a shell script 

# Set these to appropriate values if needed:
#
#ORACLE_HOME=
#ORACLE_SID= 
#DUMPDIR= 

# Customize PATH if needed 
#
#PATH=/bin:/usr/bin:${ORACLE_HOME}/bin:/usr/local/bin:/usr/lbin 

#export ORACLE_HOME ORACLE_SID PATH 

echo "Exporting $ORACLE_SID database. start `date`" 
# 
expdp system/password dumpfile=scott.dmp directory=DUMPDIR schemas=scott logfile=scott.log
#
echo "Export of $ORACLE_SID database completed at `date`" 

#End of Script

Tuesday 6 October 2015

Before killing an active session---precheck

Before killing an active session---precheck.





SELECT O.OBJECT_NAME, S.SID, S.SERIAL#, P.SPID, S.PROGRAM,SQ.SQL_FULLTEXT, S.LOGON_TIME FROM V$LOCKED_OBJECT L, DBA_OBJECTS O, V$SESSION S, V$PROCESS P, V$SQL SQ WHERE L.OBJECT_ID = O.OBJECT_ID AND L.SESSION_ID = S.SID AND S.PADDR = P.ADDR AND S.SQL_ADDRESS = SQ.ADDRESS;
select   c.owner,  c.object_name,  c.object_type,  b.sid,  b.serial,
   b.status, b.osuser, b.machine
from
   v$locked_object a , v$session b, dba_objects c
where
   b.sid = a.session_id
and a.object_id = c.object_id;

SELECT 'ALTER SYSTEM KILL SESSION ' ||''''||SID||','||SERIAL#||'''' ||' ;' FROM v$session WHERE USERNAME NOT IN ('SYS') and username is not null and status='ACTIVE';

             


SELECT * FROM V$SESSION WHERE STATUS = 'ACTIVE';

select username, sid, serial from v$session where username='XXXXXX';

select addr,pid,spid,username,pga_used_mem from v$process where addr = 'XXXX';
 




Tuesday 22 September 2015

To get the directory Path

To get the directory Path


select directory_path from dba_directories where directory_name='XXXXXX_EXP' and owner='SYS';

SQR Report stuck at status "Posting"

SQR Report stuck at status "Posting":


Things to Check before Troubleshooting:
================================================

1. Web domain must be up and running(for PSA 9.1).

2. Application Messaging server must be up and running.

Troubleshooting steps:
=================================================

1. Run the below SQL on the particular environment (XXDEV,XXTST,XXACT,XXPRD).

select * from ps_cdm_list where prcsinstance=xxxxxxx; -- modify the xxxxx with process instance number

2. check for OUTPUTDIR from the above query results, showing something like

For PSA 9.1: XXDEV/20140307/262044

For PSA 8: 03190701123F6B2B703362A9140A301269AEB9CF98950C51B28153CB9B35AFF47A44E5875699FAB8B4DFC1197E9E33

3. Go to report repository and check for the above directories.

4. If the file present in the directory,please go ahead and update the status to posted( in PSA 9.1) or Success (in PSA 8).

SQL to update from backend:
----------------------------
PSA 9.1:
============

To update distribution status to posted from posting:

update psprcsque set DISTSTATUS='5' where prcsinstance=418387;
update psprcsrqst set DISTSTATUS='5' where prcsinstance=418387;
update psprcsque set DISTSTATUS='5' where prcsinstance=418387;

COMMIT;


PSA 8:
===========

For PSNT:
----------
update psprcsrqst  set  runstatus= '14' , servernamerun =  'PSNT6'  where prcsinstance in  ('7086041');
update psprcsque   set  runstatus= '14' , servernamerun =  'PSNT6'   where prcsinstance in  ('7086041');
update ps_cdm_list set  diststatus='3', transferinstance= 0   where prcsinstance in  ('7086041');

For PSUNX:
-----------
update psprcsrqst  set  runstatus= '14' , servernamerun =  'PSUNX'  where prcsinstance in  ('8065483');
update psprcsque   set  runstatus= '14' , servernamerun =  'PSUNX'   where prcsinstance in  ('8065483');
update ps_cdm_list set  diststatus='3', transferinstance= 0   where prcsinstance in  ('8065483');

COMMIT;

Tuesday 11 August 2015

Installing VirtualBox


Installing VirtualBox


  1. Goto www.virtualbox.org and click on “Downloads” link.
  2. Select the appropriate VirtualBox platform packages. For Windows hosts, click on x86/amd64 and save the Binary into a temp location.
  3. Click the binary and start the VirtualBox installation
VirtualBox Setup Wizard is launched
Virtual Box Welcome
 Virtual Box Setup
If the default Location is acceptable, click Next. Else, click Browse and change the location and click Next.
 Virtual Box Setup
Click Next
 Virtual Box Network
Click Yes
 Virtual Box Ready
Click Install
 Virtual Box Wait
Once the Install is complete, click Finish.
 Virtual Box Finish
4. Configure BIOS for Virtualization Technology (VT) for your PC/Laptop
       a. Boot your machine and press the function key to access BIOS setup (usually F8).
       b. Go into either the Processor or Security menus, depending on your machine.
       c.  Enable the hardware virtualization settings, save, and exit to continue booting.

Thursday 9 July 2015



ORA-00245: control file backup failed; target is likely on a local file system 



Solution :-


 Add it to refresh script.



rman target /  << EOF
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+DATA/snapcf_${DBUNIQUENAME}.f'; EOF
 

The purge process did not run because the Oprid configured to start the Process Scheduler did not have the required permissions to run the purge process.

  Purge process - Required permissions The PeopleSoft Oprid used to start the Process Scheduler, as defined in the Scheduler's psprcs.cf...