Hi,
One of a client site I have saw a scenario where App dba is purging the log file of oracle application report server by stopping the service and renaming the file on daily basis because of performance issue.
he did the same by early morning before the client start working.
If a day he'll be on leave or could not reach on time, then there will be a issue.
So I have make a batch file (because the app is running on windows environment) and schedule the same at the time when he wants to do the purging...
Here the steps for creating the batch file:
Step 1: In my case the oracle apps home was in E:\OracleAS\Oracle_Mid\. So I start the batch file by entering into E Drive.
open the notepad or any editor and type...
e:
Step 2: Going to the opmn\bin directory in batch file...
cd OracleAS\Oracle_Mid\opmn\bin
Step 3: Stop the process to which you want to perform the purging.
opmnctl stopproc ias-component=<Process_name> process-type=<Process_type>
(In my case it is ias-component=OC4J process-type=FIN1 )
Step 4: now move to the Log directory which is actually contain the logfile that you want to purge..
cd ..\logs
Step 5: Rename the file by adding the current date at the end of the file...
(There is a small script in MSDOS which will return you the current date in (DDMMYY) format)
rename OC4J~FIN1~1 OC4J~FIN1_%Date:~-7,2%%Date:~-10,2%%Date:~-2,4%
Step 6: Now the move the file to some other backup folder (This step can b neglect). I made a directory named bkp in the logs folder and move the renamed file to that one. so that i can easily removed or find the appropriate file whenever require.
move OC4J~FIN1_%Date:~-7,2%%Date:~-10,2%%Date:~-2,4% bkp\
Step 7: Now start the process by going either bin directory or simply specified the full path in command prompt. (I used the first method )
cd ..\bin
opmnctl startproc ias-component=<Process_name> process-type=<Process_type>
Stpe 8: save it as <name>.bat
Step 9: Schedule it on window scheduler at whatever time you want to perform the purging.
One of a client site I have saw a scenario where App dba is purging the log file of oracle application report server by stopping the service and renaming the file on daily basis because of performance issue.
he did the same by early morning before the client start working.
If a day he'll be on leave or could not reach on time, then there will be a issue.
So I have make a batch file (because the app is running on windows environment) and schedule the same at the time when he wants to do the purging...
Here the steps for creating the batch file:
Step 1: In my case the oracle apps home was in E:\OracleAS\Oracle_Mid\. So I start the batch file by entering into E Drive.
open the notepad or any editor and type...
e:
Step 2: Going to the opmn\bin directory in batch file...
cd OracleAS\Oracle_Mid\opmn\bin
Step 3: Stop the process to which you want to perform the purging.
opmnctl stopproc ias-component=<Process_name> process-type=<Process_type>
(In my case it is ias-component=OC4J process-type=FIN1 )
Step 4: now move to the Log directory which is actually contain the logfile that you want to purge..
cd ..\logs
Step 5: Rename the file by adding the current date at the end of the file...
(There is a small script in MSDOS which will return you the current date in (DDMMYY) format)
rename OC4J~FIN1~1 OC4J~FIN1_%Date:~-7,2%%Date:~-10,2%%Date:~-2,4%
Step 6: Now the move the file to some other backup folder (This step can b neglect). I made a directory named bkp in the logs folder and move the renamed file to that one. so that i can easily removed or find the appropriate file whenever require.
move OC4J~FIN1_%Date:~-7,2%%Date:~-10,2%%Date:~-2,4% bkp\
Step 7: Now start the process by going either bin directory or simply specified the full path in command prompt. (I used the first method )
cd ..\bin
opmnctl startproc ias-component=<Process_name> process-type=<Process_type>
Stpe 8: save it as <name>.bat
Step 9: Schedule it on window scheduler at whatever time you want to perform the purging.
No comments:
Post a Comment