Unix Command Run Successfully Through PL/SQL But Showing No Impact In UNIX?
May 19, 2007
I am using Oracle 9i and Unix on my system and trying to execute a UNIX shell command through external procedure in C.I created a shared lib (libextproc.so) for the following function.
int sysrun(char *command)
{
return system(command);
}
This function runs fine when caled through a driver function in C, meaning that the shared lib is fine.In PL/SQL, I have used the following method to invoke a UNIX command:-
create or replace library shell_lib as '/home/ECETRAonsite/oracle/OraHome1/lib/libextproc.so';
/
create or replace function sysrun (syscomm in varchar2)
return binary_integer
as language C
name "sysrun"
library shell_lib
parameters(syscomm string);
/
Now when I call this PL/SQL function to invoke the command, it is run succesfully but does not create the file.
SQL>
1 declare
2 rc number;
3 begin
4 rc := sysrun('/bin/touch /home/ECETRAonsite/oracle/OraHome1/test/sach');
5 dbms_output.put_line('Return Code='||rc);
6* end;
SQL> /
Return Code=0
PL/SQL procedure successfully completed.I have verified that the path for 'touch' is correct.Following are my configuration files.
listener.ora
-------------
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
[code]...
View 1 Replies
ADVERTISEMENT
Oct 17, 2013
I'm on Oracle 11g R1. I've a requirement where user will be putting CSV files on Unix server and I've to create a job which runs periodically to check if any new file is added by user in the folder. If it finds a new file (s), then it needs to identify it and insert its name in an Oracle table. Once file's name is noted, it has to move file from that directory to another one.
View 2 Replies
View Related
Aug 27, 2007
i am trying to run DBCA from unix command line. but it gives me error like this:
dbca[158]: /home/oracle/product/10.2.0/jdk/jre/bin/java: not found.
Also i tried to open some other utilites too. like netca it gives me same error.
View 5 Replies
View Related
Oct 12, 2010
I have to pick a text file created in UNIX server directory and send it as an mail attachment.The problem here is, when the file size exceeding more than 10 MB. I think there is a way to zip a file in UNIX with some .gz extension or something like that.
how to zip a file in unix server using PL/SQL code. So that I will pick the zipped file and send it as an attachment.
View 4 Replies
View Related
Sep 20, 2013
I want to pass a variable in unix to oracle exp command
I have a file with owner and password
I did
export user=$(head -$riga $file | tail -1)
echo $user
let riga+=1
export psw=$(head -$riga $file | tail -1)
echo $psw
exp $user/$psw file=exp_$current.dmp
but this doesn't work.
View 4 Replies
View Related
Jan 21, 2011
Iam planning to upgrade my Oracle Database from 10G to 11G .
Its on HP Unix Environment 11.23 and
Oracle CRS 10.2.0.4
Oracle ASM 10.2.0.4
Oracle RDBMS 10.2.0.4
Its in RAC env...and Active-Active DB running controlled by tnsnames.ora .
View 8 Replies
View Related
Sep 26, 2011
how to edit profile on unix [x86-32] during 1og oracle installation. edit /export/home/oracle/.profile
View 3 Replies
View Related
Feb 22, 2012
create or replace procedure log_file
(
odsm_profile IN VARCHAR2
)
AS
handle utl_file.file_type;
begin
[code].....
i have error when executing this pl/sql procedure in timesten in UNIX
this is the excution error:
Command> exec log_file('hi');
8507: ORA-29280: invalid directory path
8507: ORA-06512: at "SYS.UTL_FILE", line 41
8507: ORA-06512: at "SYS.UTL_FILE", line 478
8507: ORA-06512: at "SIUA.LOG_FILE", line 8
8507: ORA-06512: at line 1
The command failed.
View 6 Replies
View Related
Dec 17, 2008
how to convert date into UNIX time in oracle ?
View 1 Replies
View Related
Feb 23, 2010
I am trying to produce results in pivot format. I want to know how many entries per day per month. In other words how many entries on a Monday for each month, how many on a Tuesday for each month and so on.
The main problem I have is that the date column in the database uses UNIX time stamp. I have managed to get the results I want for a particular month. This code selects the entries for last month.
select
max(decode(pdayno, 1, cnt, null)) Sunday,
max(decode(pdayno, 2, cnt, null)) Monday,
max(decode(pdayno, 3, cnt, null)) Tuesday,
max(decode(pdayno, 4, cnt, null)) Wednesday,
[code].......
This code produces the result:
What I need is for another column at the start of the results to give the month so I end up with 12 rows, 1 for each month.
I did try to group by PENTERED(which is the unix time stamp column)
select pentered,
max(decode(pdayno, 1, cnt, null)) Sunday,
max(decode(pdayno, 2, cnt, null)) Monday,
max(decode(pdayno, 3, cnt, null)) Tuesday,
max(decode(pdayno, 4, cnt, null)) Wednesday,
[code]......
This gave me thousands of rows as each UNIX time stamp is unique. Is there a way of grouping on UNIX time stamp.
View 4 Replies
View Related
Aug 8, 2011
I'm trying to install Oracle 11gR2 RAC on AIX, do we need to turn on Multicasting, can we install without multicasting? Also can I have the ASM disk with external redundancy for OCR and Voting Disk?
View 3 Replies
View Related
Mar 23, 2010
Below is my code for calling a report from form in windows environment. I want to use the same report to be called from Unix environment . When m using application server tbanner@.... instead of 'repsrv@ahad-pc' is throwing error its in UNIX environment
REP-51002: Bind to Reports Server tbannerdb.kfupm.edu.sa failed
Declare
v_show_documentVARCHAR2 (2000) := '/reports/rwservlet?';
v_connectVARCHAR2 (200) := 'userid=abdulahad/inshalla@test';
v_report_serverVARCHAR2 (30) := 'repsrv@ahad-pc';
v_report_nameVARCHAR2(100) := 'test3.rdf';
[code].......
View 6 Replies
View Related
Jun 14, 2010
I have a UNIX shell script as following,
#runs the selected process
${ORACLE_HOME}/bin/sqlplus -s ${USER_PASS} >${TMP_FILE} <<EOF
set pause off
set verify off
set pagesize 0
set linesize 2000
set timing off
[code].........
I am passing a Date to the Oracle Procedure in `date +'%b_%d-%H:%M:%S'` format.
rmsqa813.2 /home/ashlaksh> echo `date +'%b_%d-%H:%M:%S'`
Jun_14-02:26:37
The oracle Procedure's SQL is as following,
SELECT ffdh.fiscal_doc_id INVOICE_ID,
ffdh.location_id LOCATION_ID
FROM fm_fiscal_doc_header ffdh,
fm_schedule fs
[code]........
The above SQL is not getting the data as the Date format "AND ffdh.last_update_datetime <=i_last_update_datetime " is not matching..
Do I need to convert the Date ? ( But i_last_update_datetime is DATE)
View 1 Replies
View Related
Apr 27, 2012
I have a requirement where i need to execute a unix shell script "a.sh" having permissions user1,group1 and no access to public. This should be executed from Oracle function.
So i wrote a routine in Java and it works fine when i execute a command like Date etc.
But when i execute "a.sh" from oracle client, its returning error that "could not be executed-permission denied". This is because once login happened through the "sqlplus" the shell takes user as "oracle" and group as "dba" but the script "a.sh" having only permissions user1,group1. Unfortunately we are not allowed to change the permission for "a.sh" to give execute permission to all(public).
After searching in internet, i understand that one way is to make the password (/etc/passwd) for the user "user1" as no password and can use "su" command so that it wont ask password while invoking it.
Is there any other way apart from this doing changes in password file at UNIX level when executing a script from oracle client?
if further information is required.
Oracle: version: 11.2.0.1
UNIX : AIX -5.9
View 3 Replies
View Related
Mar 25, 2010
I installed a printer(HP Laserjet 3390) in UNIX(Solaris).Followed the instructions while installing as to the path it should be present for Reports to read it etc.,Also modified the uiprint.txt file with the desired .hpd file.Logging on to the UNIX machine, I am using the below command
rwrun.sh report=xyz.rdf userid=XXXX/XXX@xxx paramform=no p_orig_org='0825' desformat=pdf destype=printer desname=xxxx batch=yes
This command invokes the printer and
^[%12345X@PJL
@PJL SET RESOLUTION=300
@PJL SET PAGEPROTECT=OFF
@PJL SET ENTER LANGUAGE=PCL
^[%1A^[E^
@PJL RESET
^[%12345X
is what it prints.Realizing that this is because of the missing parameter,tried to change paramform=yes but I am not sure how to pass the parameter.
View 11 Replies
View Related
Apr 14, 2010
I have text file with data in UNIX. I want to clear only records(make empty the file) using UTL_FILE..
I know we can remove the text file from UNIX and create file again with same name...
Is there any other way??
View 5 Replies
View Related
Jul 1, 2010
my problem is this. I created the java classes using itext to create a document library. Rtf, or. Odt. I integrated classes in Oralce form and everything works. I created a file. Odt application server on a folder and now only remains for me to open the file. The roads are two:
1. Directly from the server, you can?
2. From the client using the API or openoffice launching the executable with cmd?
Oracle Forms is a command to transfer files on the client and run the executable swriter of openoffice?
View 4 Replies
View Related
Jul 16, 2013
In my DB there are special characters are stored like "Świętochłowice". So in Unix script while extracting these characters, I have used
export LANG="universal.UTF-8" in order to make it English. which works fine.
But my question is how to retain this special character intact as, it is in DB?
So in UNIX script
export LANG="universal.UTF-8"
sqlplus -s uname/pwd@hostname/schema << ENDSQL | sed -e "s/Connected.//" -e "/^$/d"
set pagesize 0 feedback off verify off heading off echo off serveroutput on size 10000
spool /path/out.txt
Select name from tablename where is=12;
spool off;
exit
ENDSQL
Output is "Swietochlowice" (makes sense),but how to get the output as "Świętochłowice" which is in DB? I have tried different NLS_LANG option, but no success.
View 5 Replies
View Related
Feb 7, 2011
I am trying to create a DB manually.
1) How to create a UNIX services as we use oradim in windows.
2) While trying to use DBCA command it shows the below message.
SET DISPLAY ENVIRONMENT THEN RE-RUN.
My login is already in admin group only.
View 7 Replies
View Related
May 25, 2011
An application uses one user as a container of objects(this user is stripped of ALL privileges), and other users that can access objects in this unique schema depending on their privileges.
There can be multiple installations of the application in one database, therefore many such schemes. An environment variable APP_UNIQUE_SCHEMA points to a current unique schema.
So instead of typing
select * from my_unique_schema.my_table I want to set a current schema for sqlplus session in glogin.sql.
It would have been nice if I could have entered in glogon.sql the following line
alter session set current_schema=$APP_UNIQUE_SCHEMA;
BUT it does not work. sqlplus does not resolve the reference to an environment variable. I cannot figure out how to get the value of an environment variable in sqlplus.
View 2 Replies
View Related
Feb 19, 2011
Am tring to export a data from oracle forms to excel. I use ole2 option. it is working perfectly in my desktop. But when i move the same to our application server, it is not working. I belive OLE is related to Microsoft office and our server is unix based.
View 1 Replies
View Related
Jul 30, 2010
We have recently migrated from IAS 9.0 to IAS 10.1.2 in one of our development Server hosted in UNIX B.11.11. We are using Oracle forms as front end. We have re-compiled all the existing forms and libraries using IAS 10. There were no changes in the forms and libraries. We deployed the forms in our development box and configured it, since we are using our own environment specific copy of default.env file. With few of forms we are facing the FRM-92100 error mentioning the "Connection to Server was interrupted". Most of the forms are running fine but with few forms we are facing this error. Some of details are:-
Oracle 10.1.0.4
UNIX B.11.11
IAS 10.1.2
NLS_LANG parameter in default.env is set to "american_america.WE8ISO8859P1"..We have even tried copying the libraries in our local system and then opening and saving them and ftp'ng them back in to UNIX server and then recompiling there with full permissions but still unable to resolve this error.
View 2 Replies
View Related
Jun 28, 2013
What is the script for creating SQL directory in UNIX.
Create or replace directory CONFIG as 'c:Config'
View 13 Replies
View Related
Jun 13, 2013
i need a connectivity code to connect oracle DB in UNIX.pls send me a code exactly.
View 2 Replies
View Related
Apr 18, 2013
I am new to Oracle and my requirement below.
Environment:
Oracle DB Version 11.2.0.3.0
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production with 2 nodes RAC.
Requirement :
Daily at morning 5:00, Flashback the database to the yesterday restore point.It has to be scheduled to be done automatically. Now it being performed manually.
Psuedo code:
1. Shutdown the RAC database
2. Bring up the RAC database with mount mode
3. Flashback the database to yesterday restore point
4. Create new restore point to be used on next day
5. Bring up other instance of the RAC database.
#!/bin/ksh
#######################################################################
# Shutdown databases and bring up one instance in NOMOUNT mode.
#
#######################################################################
[code]...
eofQuestions:
1. How can i get the laterst restore point for the database and pass it on the RMAN FLASHBACK command?
2. How can I create new restore point with todays date suffixed with lable like BEFORE_TEST_20130417_5AM, with in RMAN ?
View 3 Replies
View Related
May 22, 2013
I'm running a sql file in Unix (using SQLPLUS command) and i want the file output to be sent to local windows directory. I specified the windows directory name in my Spool command (Spool C:/<Directory Name> ) , But it is not working
Our Unix server is a FTP server but i don't want to FTP the spool file from unix to Windows as the spool file is Huge and it takes hours for the transfer to complete (and we have to run the script multiple times).
Is there a way i can have the spool file created in Local windows directory when i run my sql script in Unix?
View 5 Replies
View Related
Apr 15, 2010
I need to develop a form which has to read and display the contents of a text file that is stored in the Unix system where the Oracle data base is installed. So basically its the database server and not the forms application server.
1. Create an external table for the file everytime when the form is loaded by dropping and re creating the table and base the data block in the form on that table and execute_query and display the contents.
2. I am confused whether to use webutil or utlfile packages to read from the file and display on the screen as the file resides in the database or Oracle server and not forms application server or client machine.
View 5 Replies
View Related
Jun 4, 2012
> id -a
uid=56088(appadm) gid=50120(dba) groups=50120(dba)
> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 4 09:26:23 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12545: Connect failed because target host or object does not exist
Enter user-name: ^C
our UNIX user in group "dba" but can't connect as SYS
why?
View 9 Replies
View Related
Jun 24, 2013
How I can connect database on unix OS and windows what is the deference.
View 7 Replies
View Related
Jun 6, 2013
I would like to ask you if you know which built-in can I use for transferring a excel file from our Unix box to a table in oracle database, right now we are using webutil_file_transfer.Client_To_DB_with_progress using forms developer, but I need to run as an automatic process uploading form unix into oracle directly without using forms.
View 22 Replies
View Related