In forms 10g to execute any thing on the client side we have to use client_host().
But now the question arises how to use client_host() to execute .exe on the client.
See below for the solution:
Client_Host('cmd /c START "" ' "your .exe");
Now one more thing is there,if you want to execute the .exe and want that it should wait for the .exe to complete execution before doing anything else.
Execute the .exe as shown below
client_host('cmd /c start "" /wait ' "your .exe");
Hope this helps.....
Monday, December 29, 2008
How to use Client_Host to execute .exe???
call_form not working in Oracle Forms???
When you are migrating the Oracle Forms Application to 10g, you may come accross a problem that call_form in the form code may not work.
Cause:
The problem is caused by the windows named ROOT_WINDOW.
Solution:
Rename the windows which have the ROOT_WINDOW name.
Sunday, December 28, 2008
Oracle Log files
Redo log files record all changes made on the database
Used for recovery
Require at least
2 Groups
1 member
Should try and divide up I/O
Try and keep data file and log files on seperat drives.
Min size 50k
Max size OS dependant
Make larger for many changes
You must enable arch in pfile before you can use the archiver.
LOG_ARCHIVE_DEST_1='location=pathToArchiveFolder'
LOG_ARCHIVE_START=true
Then you must shutdown the database and startup in mount mode and run:
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
Switch log file online
ALTER SYSTEM SWITCH LOGFILE;
Forced check points
FAST_START_MTTR_TARGET = 600 -- 10min range
Alter system checkpoint
ALTER SYSTEM CHECKPOINT;
Adding online redo log file groups
ALTER DATABASE ADD LOGFILE GROUP 4
('PATH\log3a.rdo', 'PATH\log3b.rdo')SIZE 1M;
Adding online redo log file members
ALTER DATABASE ADD LOGFILE MEMBER
'PATH\log1c.rdo' TO GROUP 1,
'PATH\log2c.rdo' TO GROUP 2,
'PATH\log3c.rdo' TO GROUP 3;
Dropping redo log file groups
ALTER DATABASE DROP LOGFILE GROUP 4;
Dropping redo log file members
ALTER DATABASE DROP LOGFILE MEMBER
'PATH\log4c.rdo';
Relocate or rename redo log files
-Shutdown the database
-move the file to the new location
-Startup database in mount mode
-run script to rename file
ALTER DATABASE RENAME FILE
'PATH\log2a.rdo'
TO 'PATH\log3b.rdo';
Clearing online redo log files
ALTER DATABASE CLEAR LOGFILE GROUP 3;
-- might be used to reinitalize log file
ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP3;
-- used to avoid archiving corupt log file.
Data Dictionary views
V$LOG -- more for group info
Status types
-unused
-current
-active
-clearing
-clearing current
-inactive
V$LOGFILE -- more for member info
Status types
-invalid
-stale
-deleted"blank"
V$instance (archive) -- what mode is the archive in
archive log list -- gives info about log archive mode
Oracle ORADIM
ORADIM is a Windows only utility used for the creation, modification and deletion of the Windows Service
Definitions:-
ASMSID:- ASM instance name
ASMSRVC (service_name):- ASM service name
NEW:- Indicates that a new instance is being created
PFILE (file_name):- Parameter File Path and Name
RUNAS:- Options are OSUSR and OSPASS
SHUTMODE:- How the Windows Service should shutdown the database. Options are ABORT, NORMAL, and IMMEDIATE
SID:- Name of the Oracle instance
SPFILE:- Indicates that a server parameter file (SPFILE) be used during startup instead of a PFILE
SRVC (service_name):- Name of the Oracle service
SRVCSTART:- Options are SYSTEM and DEMAND
STARTMODE:- Should Windows start the instance when the Database service is started.Options are AUTO and MANUAL
SYSPWD (password):- System password
TIMEOUT (seconds):- Sets the maximum time to wait (in seconds) before the service for a particular SID stops
DROP:-
ORADIM -DELETE sid -ASMSID sid -SRVC srvc -ASMSRVC srvc
Example:-
$ORACLE_HOME\bin\oradim -DELETE -SID orabase
HELP:-
ORADIM -h $ORACLE_HOME\bin\oradim -?
Example:-
$ORACLE_HOME\bin\oradim -h
$ORACLE_HOME\bin\oradim -help
MODIFY Shutmode:-
ORADIM -EDIT -SID sid -ASMSID sid
[-SYSPWD pass]
[-STARTMODE auto manual]
[SRVCSTART systemdemand]
[-PFILE file -SPFILE]
[-SHUTMODE normal immediate abort]
[-SHUTTYPE srvc inst]
--RUNAS osusr/ospass]
Example:-
$ORACLE_HOME\bin\oradim -EDIT -SID orabase -SHUTMODE immediate
NEW:-
ORADIM -NEW -SID sid -SRVC srvc -ASMSID sid -ASMSRVC srvc
[-SYSPWD pass]
[-STARTMODE auto manual]
[SRVCSTART system demand]
[-PFILE file -SPFILE]
[-SHUTMODE normal immediate abort]
[-TIMEOUT secs]
--RUNAS osusr/ospass]
Example:-
$ORACLE_HOME\bin\oradim -NEW -SID orabase -SRVC orabase
-SYSPWD uwpwd -STARTMODE manual -SRVCSTART system
-PFILE c:\oracle\product\ora102\database\initorabase.ora
-SHUTMODE immediate
SPFILE Selection:-
ORADIM -STARTUP sid -ASMSID sid [-SYSPWD pass]
[STARTTYPE srvc inst srvc,inst]
[-PFILE filename -SPFILE]
Example:-
$ORACLE_HOME\bin\oradim -EDIT -SID orabase -SPFILE
STARTUP:-
ORADIM -STARTUP sid -ASMSID sid [-SYSPWD pass]
[STARTTYPE srvc inst srvc,inst]
[-PFILE filename -SPFILE]
Example:-
$ORACLE_HOME/bin/oradim -STARTUP -SID orabase
-STARTTYPE tstc -SPFILE
SHUTDOWN:-
ORADIM -SHUTDOWN sid -ASMSID sid [-SYSPWD pass]
[-SHUTTYPE srvc inst srvc,inst]
[-SHUTMODE normal immediate abort]
Example:-
$ORACLE_HOME\bin\oradim -SHUTDOWN -SID orabase -SHUTMODE abort
More Examples and General Information about ORADIM
oradim is a tool that can be used to create Oracle specific windows services and to start an instance.
oradim can be given the option -sid which identifies the system identifier.
Creating a service
c:\>oradim -new -sid SOME_SID -intpwd PASSWORD -startmode MODE -pfile PFILE
PASSWORD is the password that is used to connect / as sysdba.
MODE indicates how the service is started. It must either be auto or manual. auto tells Windows to automatically start the service when Windows is booted. manual, on the other hand, requires someone to manually start the service.
Starting things with oradim
Starting the service
c:\some\arbitrary\path> oradim -startup -sid
Starting the instance
c:\some\arbitrary\path> oradim -startup -sid
Starting both the service and the instance
c:\some\arbitrary\path> oradim -startup -sid
Logging
ORADIM messages are not printed to the command prompt, instead, they're logged to %ORACLE_HOME%\database\oradim.log. It is possible to change the directory where the log file is stored by adding the ORA_CWD registry parameter.
How to uninstall a Windows Service???
Now the question comes....
How do I uninstall a Windows Service when there is no executable for it left on the system?
You should be able to uninstall it using sc.exe (I think it is included in the Windows Resource Kit) by calling
sc.exe delete service_ name
where service_name is the name of the service itself as you see it in the service management console, not of the exe.
Steps to re-name the database
The follwing are the steps to re-name the Database....
1. First of all take the database to the "Mount" stage.
-->Alter database close;
2. Trace the control file.
The Trace file will be created in the "udump" directory.
-->Alter database backup controlfile to trace;
Note:-Trace the control file in "Mount" stage only.
3. Now shutdown the database gracefully and exit from sql.
-->shutdown immediate.
-->exit
4. Go to "udump" directory and pick the lastest trace file created.
-->You can use the following command to get the latest trace file in linux.
Issue this command in the "udump" directory.
-->ls -lrt
5. Open the lastest trace file.
-->vi latest_trace_file.trc
Note: In this trace file there will be two scripts.
1st one is used create the control file(which i have told i the previous post)
2nd one is used to rename the database(while i'm telling in this post)
6. Remove everything in the trace file except the 2nd script.
In the 2nd script change "REUSE" to "SET" and database name which will be in the starting of the script.
For Example:-
Create controlfile "SET" database "ORCLXYZ"
7. Save the trace file.
8. Copy the trace file to the home directory.
-->cp ~/rename.sql
9. Change the name of the database in the paramater file.
10. Remove the old control file.
11. Connect to datbase as sysdba.
-->sqlplus / as sysdba
12. Start the database to "nomont" stage.
-->startup nomont
13. Run the script file that we have created from the trace file.
-->@rename.sql
14. Now open the database with resetlogs option.
-->Alter database open resetlogs;
15. Now check the name of the database to confirm.
-->select name from v$database;
Hope it helps....
Steps to Re-Create the Control File
The follwing are the steps to re-create the control file....
1. First of all take the database to the "Mount" stage.
-->Alter database close;
2. Trace the control file.
The Trace file will be created in the "udump" directory.
-->Alter database backup controlfile to trace;
Note:-Trace the control file in "Mount" stage only.
3. Now shutdown the database gracefully and exit from sql.
-->shutdown immediate.
-->exit
4. Go to "udump" directory and pick the lastest trace file created.
-->You can use the following command to get the latest trace file in linux.
Issue this command in the "udump" directory.
-->ls -lrt
5. Open the lastest trace file.
-->vi latest_trace_file.trc
Note: In this trace file there will be two scripts.
1st one is used create the control file(which i'm telling in this post)
2nd one is used to rename the database(while i will be telling in the next post)
6. Remove everything in the trace file except the 1st script.
7. Save the trace file.
8. Copy the trace file to the home directory.
-->cp
9. Remove any old control file if it is there.
10. Connect to datbase as sysdba.
-->sqlplus / as sysdba
11. Start the database to "nomont" stage.
-->startup nomont.
12. Run the script file that we have created from the trace file.
-->@cont.sql
13. Now open the database.
-->Alter database open.
Now the crotrol file has been created, you can go to the control file diretory and check.