Using Oracle with Unix Cron
Folks, hows everyone?.
I am trying to go beyond SQL*Plus queries and teach myself some automation. Turned out to be a litle challenging. Can some one educate me on how to finish this task:
I wish to automate the following report with crontab: pull data from HR account in Oracle and email it to [email protected] everyday at 6am.
So, first, i wrote the following script, myqueryscript.sql, containing the query:
spool /home/myname/myautoreport
select * from hr;
exit;
/home/myname is my unix path and myautoreport directory to store a copy of results.
Second, i wrote the following shell script, myshellscript, to execute myqueryscript.sql:
/home/myname/sqlplus hr/psswd @/home/myname/myqueryscript
third, I wrote the following crontab, mycronscript, to run the shell script:
00 06 * * * "/home/myname/myshellscript"
Finally, i submitted to crontab as:
crontab mycronscript
I didnt work. Am i missing something?.
pls note: i am not the root in unix.
Thanks,
-a
> Would you recommend this book on the basis of its contents table or any other
books on the subject?
Sorry - I'm not familiar with that author or that book. The most valuable Oracle "books" in my opinion are found at http://tahiti.oracle.com - the complete sets of all Oracle manuals from 8i to 10G.
Many authors seem to only regurgitate Oracle manuals. The only Oracle book I've bought and considered as a worth every single cent, is Tom Kyte's Oracle Expert one-on-one.
This goes into the very fundamental concepts of how to use Oracle correctly. It is a real eye opener.
I am new to automation and wish to study it.What aspects of automation? It covers a very broad range of topics.
Does automation in the way you described it, i.e. DBMS_JOB, depend on PL/SQL?Extensively. PL/SQL is a formal procedural language. It is as capable as Pascal, C or Java. Many seem to think in terms of PL/SQL as SQL plus some basic programming control structures. PL/SQL is not SQL. These are two different very languages.
What makes it unique are:
- it is a server side language running inside the Oracle database
- it integrates so tightly with SQL that you can write SQL language statements in PL/SQL as if these are native to PL/SQL (which leads to the confusion thinking that PL/SQL is SQL)
99% of all Oracle related code I write is PL/SQL. There is very little that you cannot do using PL/SQL. And Oracle is not just a capable database tier, it is just as capable as an application tier.
When using Oracle, there is no need for a separate application tier like Weblogic, JBoss, etc. PL/SQL is in fact a lot more capable language for the application tier than Java or .NET.
Simple example. One of the automation processes we have is to supply another system with delta changes from one of our databases. They wanted it in XML. They wanted it FTP'ed to their server. 100% of the code written for this is PL/SQL. From creating XML CLOBs in the database, to using FTP to transfer the contents of these CLOBs to their FTP server. With an APEX (Oracle Application Express) web application (also entirely PL/SQL) that provides for maintenance and administration of this automation.
With less moving parts (not dealing with external processes and additional programming languages), Oracle PL/SQL applications are a lot quicker to develop, a lot easier to maintain, performant (it is very close to the data), and more robust.
PL/SQL is a very critical core component in any automation and any application that uses the Oracle database.
Similar Messages
-
Advantages of using Oracle with Unix over Windows server
Hi there,
I want some article/document which depicts the advantages of using Oracle with Unix (say HP-UX or Solaris backend). Actually the plan is to use some Data Warehousing applications using Cognos Poweplay, ReportNet and either Decision Stream of Cognos or Oracle Warehouse builder may be used as ETL tool. For Data mining applications we are planning to use SPSS Clementine. The Data volume will be substantial one. At present we are developing some prototype in Windows 2003 advanced environment. We are plaiing to use Risc server and RAID-5. Pl. advice some ideal architecture for us, as you know, it's typically a Govt. level application data (mostly archival data). The reports will be published using Report Net, Adhoc query etc, OLAP analysis will be done using Powerplay.
Regards,
Anupam BasuHi there,
I want some article/document which depicts the advantages of using Oracle with Unix (say HP-UX or Solaris backend). Actually the plan is to use some Data Warehousing applications using Cognos Poweplay, ReportNet and either Decision Stream of Cognos or Oracle Warehouse builder may be used as ETL tool. For Data mining applications we are planning to use SPSS Clementine. The Data volume will be substantial one. At present we are developing some prototype in Windows 2003 advanced environment. We are plaiing to use Risc server and RAID-5. Pl. advice some ideal architecture for us, as you know, it's typically a Govt. level application data (mostly archival data). The reports will be published using Report Net, Adhoc query etc, OLAP analysis will be done using Powerplay.
Regards,
Anupam Basu -
Question for using ORACLE with SOLARIS
Hi Experts,
I have worked Oracle with Linux in one of my projects 2yrs back and i was just a developer, used to write SQL Query, Creating Table and Objects.
Now i got a question from TL which is
Tell me about consequences for using Oracle with Solaris?
I am not worked ORACLE with SOLARIS, Can some one give me the answer for this question with
1. Difference between ORACLE with LINUX and ORACLE with SOLARIS.
2. Advantages and Disadvantages Between ORACLE with LINUX and ORACLE with SOLARIS.
Thanks,
MuraliDharan VHi MuraliDharan V,
It would had been better if you had searched first;
Here is one
Advantage for Linux64-bit Versus Solaris-x86_64 OS in RAC
And beside that your question is incomplete:
-What Oracle? Database, etc
-Which Version? 9i, 10g, etc
Aside from that a simple search on google might have answered your question as well.
But I think there is some new trend of dumping questions here before searching.
Ex Senior DBA -
Trouble using Oracle with WLCS
Hi,
I am trying to use Oracle 8.1.7 with WLCS 3.5 on Linux.
I am getting the error:
java.sql.SQLException: System.loadLibrary threw java.lang.UnsatisfiedLinkError
with the message 'no weblogicoci37 in java.library.path'.
Any help?
Thanks,
- Sougataif you still want to use the OCI driver, make sure the library in your error
message is in the LD_LIBRARY_PATH,
otherwise, switch to the thin driver from Oracle and it will work without
any libraries
Filip
~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[email protected]
www.filip.net
"Sougata Mukherjea" <[email protected]> wrote in message
news:3baa34b8$[email protected]..
>
Hi,
I am trying to use Oracle 8.1.7 with WLCS 3.5 on Linux.
I am getting the error:
java.sql.SQLException: System.loadLibrary threwjava.lang.UnsatisfiedLinkError
with the message 'no weblogicoci37 in java.library.path'.
Any help?
Thanks,
- Sougata -
Hi
I want to use Oracle as database for EJB. I would like to know how do I configure so that it will read from Oracle database rather than Cloudscape? Where do I specify url, username, password, database name etc?
ThanksIn WebLogic:
-Include the dir containing the dll driver;=%WL_HOME%\bin\oci817_8 in your Path variable.
-Add %ORACLE_HOME%\bin to your Path.
-Create a new Jdbc Connection pool.
Set url=jdbc:weblogic:oracle
Set driver Class= weblogic.jdbc.oci.Driver
In the Properties text box specify
user=<user>
password=<password>
server=<Oracle Database> -
Asociation of oracle with unix
hi all,
if i have unix shell script for oracle, i want to run that script ,is there any necessary for oracle shoud exist on unix operating system ?
can we use another operating system?
thanks
pavaniIf you have a script for ksh or bash it will not work for sure on Windows
(some exceptions are possible :) ). Please post your script and try to be more
specific, because I cannot understand if you want to port your Unix shell script
to for example Windows, or you want to use for example SQL*Plus to connect to
db located on suppose Windows machine and execute the query.
Best Regards
Krystian Zieja / mob -
Using Oralce with Unix (AIX)
My firm have now started to give me exposure to administering the 9i database using Unix (AIX).
I have no prior understanding and I know this will take time.
I need to get up to speed.. I have 9i installed on my machine at home - can I somehow download AIX at home and simply practice there?
Yes, its a newb question!
Thanks.
DADan,
As someone said before in an earlier posting, if you are just trying to get to know Oracle then you can pretty much do everything using any version of Oracle it could be Windows or Unix or Linux. The differences come into play for the setup and other similar things you have to do from a OS command line. However, if you are looking to use sqlplus to access the database and just concentrating on commands in sql then you don't need to worry about Unix vs Windows vs Linux so much.
You can connect to any database that you have network connectivity to and that has the correct PORTs open. However, this will take some setup to accomplish.
I would advise working through the 2-Day DBA guide that you can find here:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14196.pdf
I would also look at the Oracle By Examples found here:
http://www.oracle.com/technology/obe/10gr2_2day_dba/index.html
which compliments the other guide.
The reason that sqlplus can not be found is that it is not in your PATH. The easiest way I have found to setup an environment on a Unix system, is basically find someone's who's environment works (usually oracle) and then go through their .profile and .kshrc files and see what they are calling. Usually they reset their PATH variable at some point to include the Oracle bin directory.
Someone in your organization should have the knowledge to setup the system to access sqlplus and other things you need. Again, if I had to do it myself I take a few hours to understand how an account like (oracle) is setup and try to set mine up similarly if not exactly the same.
Regards
Tim
Good Luck, I know it is tough when you are just begining. -
Problem in Using Oracle with Thin Clients(Image) Technology
I am running Oracle on Server and mine clients are thin clients.I have image on Oracle Server from where I am booting thin clients.The Problem I am facing is when I use single Thin client then everything works but as I starts using more than one thin client mine I got the error rwrun60 and it gives the that close or ignore message.I am using run_product for running reports.Then I tried to use run_report_object but how can I pass paramater using run_report_objects
i m not getting much from what you are saying.... but i found something.i created a windows application and then was able to create a dataset from ODAC connection to oracle. then dragging the dataset on windows form... i was able to create a data grid containing the data. hittin F5 the app was running successfull. however when tryin to do same in asp.net...when configuring the data source using sql datasource it gave me following error ...
ORA-00942: table or view does not exist
help help -
Hi There,
SQL> declare
2 cursor c is
3 select EName from emp for update of sal;
4 record c%ROWTYPE;
5 begin
6 OPEN c ;
7 loop
8 FETCH c INTO record;
9 EXIT WHEN c%NOTFOUND;
10 begin
11 update emp set sal = sal * 1.5 where CURRENT OF c;
12 --commit;
13 EXCEPTION
14 when others then
15 rollback;
16 end;
17 end loop;
18 CLOSE c ;
19 end;
20 /
PL/SQL procedure successfully completed.
I want to know whether , when an error occurs while updating a bulk of records, can I get the details of the record that failed. If there is a way please let me know, how to do itI want to know whether , when an error occurs while updating a bulk of records, can I get the details of the record that failed. If there is a way please let me know, how to do itWhat type of errors do you expect? Is space issues? Data Issues or what?
If space issues, then you can youse oracle 9i new feature called resumable space allocation.
If data issues, you can handle it in the execption of pl/sql.
Jaffar
OCP DBA -
How to access oracle with any unix user (like root)?
I installed Oracle 10g on Redhat Enterprise Linux 3.
I created one oracle user, and installed oracle in oracle users home directory. In oracle user I can access oracle very well. But I can not use oracle with other unix users like root. What kind of permissions I need to set to do so?You should never try to connect to Oracle as root, but if you want to connect as any other OS user, you will need to run ChangePerm.sh in $ORACLE_HOME/install in order to do this. It may not be present until you upgrade above the base release (like 10.2.0.3).
Can not Logon To SQL*Plus as non-Oracle User: Libclntsh.So.10.1: Permission Denied
http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=420083.1 -
Need advice, sql server with asp or oracle with asp
hi !
i have been given a task to improve the design of a sql server database with more than 1 million records, front end is asp (code has to be written also, keeping user interface same). I would like to use oracle with asp, is it practical or should i go for sql server. i need your advice.
thanks in advance
lavinderDepends on your definition of "practical".
My guess is that most of the work will be porting your back-end code from SQL*Server to Oracle. The Migration Workbench can help here, but there are often things that you do in SQL*Server code that you really don't want to do in Oracle code (i.e. frequent commits).
There is a good chance that you'd be able to improve the scalability of the application faster by fixing the problems that exist in the SQL*Server implementation. I think Oracle is inherently a much more scalable platform than SQL*Server, however, so I'm not trying to dissuade you from moving. It really depends on the end state you need to achieve and the amount of time & effort you're willing to put forward.
Justin -
Hello,
I'm trying to set up a testing environment to use Oracle with SSL. I would like to connect to the database using SSL (local naming with SSL), and create a globally identified user.
I'm a beginner in this matter, so I am looking for some clues from more experienced people.
I have 10.2 Enterprise Edition database running on Linux.
I created a wallet in which I want to keep certificates. But for obvious reasons if I create a certificate, I can't register it in CA. Is Oracle offering any certificates for testing purposes? if yes, where could I find any?
Thanks in advance,
AliqHello, again.
I think I did what was to do using both German article and documentation and in the end:
I can connect on a server (Linux) to the instance
I can't connect to the instance from client(WinXP),
after sqlplus system/****@sorcl I get an error:
ORA-28860: Fatal SSL error
sqlnet.log says:
Fatal NI connect error 28860, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=192.168.122.60)(PORT=1562))(CONNECT_DATA=(SERVICE_NAME=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\sqlplus.exe)(HOST=myhost)(USER=aliq))))
Tns error struct:
ns main err code: 12560
TNS-12560: TNS:protocol adapter error
ns secondary err code: 0
nt main err code: 28860
TNS-28860: Message 28860 not found; product=NETWORK; facility=TNS
Oracle error 1: 28860
ORA-28860: Fatal SSL error
nt secondary err code: 542
nt OS err code: 0
Any help, please?
Aliq -
When i use oracle vwp give this error (java.lang.IllegalArgumentException:
sir i use oracle with vwp
sir see my code this code goto catch (Exception e) section and give this code in textfield
" java.lang.IllegalArgumentException: luser.username "
when i use mysql that give right result but when use oracel that give me this error
try {
RowKey userRowKey = luserDataProvider.findFirst
(new String[] { "luser.username" },
new Object[] { textField4.getText()});
if (userRowKey == null) {
textField3.setText("11111");
return null;
} else {
textField3.setText("22222");
return null;
catch (Exception e) {
log("Cannot perform login for userid " + textField3.getText(), e);
error("Cannot perform login for userid " + textField3.getText() + ": " + e);
textField3.setText(e);
return null;
please give me idea how i get right result
thank youplease check Article-ID "Positions Hierarchy Edittor Shows Error Your Userarea Applet Has Caused A Runtime Exception [ID 1151488.1]" in MOS...
HTH -
Can a dotnet application talk with unix os using Oracle SOA Suit?
how can a dotnet application talk with unix operating system using Oracle SOA Suite? I have to automate a process on unix server like create user through dotnet application.. is it possible?
My dotnet application is used for creating users, granting access on the servers. Some servers are 21C servers and some are legacy servers. In this dotnet application a user make certain request for the rights on those servers e.g. create user, give access rights, change password. This application is treated as user interface and maintaining tool of all this information and later on the basis of that request it generates the job-sheet. This job sheet is forwarded to responsible engineer who further provisions the request manually by going to that specific server in the request. So I want to automate this process that when user put any access or create user request then the moment he puts the request, that request should be provisioned without any human intervention i.e. automatically users must be created or password must be changed. I believe you will get an enough idea about my problem from all above information. So please help me.Post your query at "SOA Suite Discussion Forum"
SOA Suite -
Issues with using utl_http with Oracle Wallet
Hello Everyone,
We are experimenting with Oracle wallet and utl_http and are attempting to do an https transfer and we are facing some problems. I will appreciate your help greatly if you can advise on what could be wrong. We are on db version 10.2.0.1 and Unix HP-UX. The intention ping an https url and get a simple 200 response. Future development would include get/post XML documents from that url and other interesting stuff. I understand that utl_http with Oracle wallet can be used for this purpose.
The wallet has been created and the ewallet.p12 exists. We downloaded the SSL certificate from the url's website and uploaded into the wallet.
Everything works if I put in a url with plain http. However, it does not work with an HTTP*S* url.
With HTTPS when I run the below code I get the following error. Again, greatly appreciate your time and help because this is the first time we are using Oracle wallet manager and do not know where to go from here.
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1029
ORA-29268: HTTP client error
declare
url varchar2(225);
req utl_http.req;
resp utl_http.resp;
my_proxy BOOLEAN;
name varchar2(2000);
value varchar2(2000);
V_proxy VARCHAR2(2000);
v_n_proxy varchar2(2000);
v_msg varchar2(100);
v_len PLS_INTEGER := 1000;
BEGIN
-- Turn off checking of status code.
utl_http.set_response_error_check(FALSE);
--Set proxy server
utl_http.set_proxy('my-proxy');
utl_http.set_wallet('file:<full Unix path to the wallet on DB server>','wallet998');
req := utl_http.begin_request('https://service.ariba.com/service/transaction/cxml.asp');
--Set proxy authentication
utl_http.set_authentication(req, 'myproxyid', 'myproxypswd','Basic',TRUE); -- Use HTTP Basic
resp := utl_http.get_response(req);
FOR i IN 1..utl_http.get_header_count(resp) LOOP
utl_http.get_header(resp, i, name, value);
dbms_output.put_line(name || ': ' || value);
END LOOP;
utl_http.end_response(resp);
exception
when others then
dbms_output.put_line(sqlerrm);
END;I tried this using plsql ...
declare
SOAP_URL constant varchar2(1000) := 'http://125.21.166.27/cordys/com.eibus.web.soap.Gateway.wcp?organization=o=WIPRO,cn=cordys,o=itgi.co.in';
request UTL_HTTP.req;
begin
dbms_output.put_line('Begin Request');
request := UTL_HTTP.begin_request(SOAP_URL,'POST',UTL_HTTP.HTTP_VERSION_1_1);
dbms_output.put_line('After Request');
exception
when others then
dbms_output.put_line('Error : '||sqlerrm);
end;The output was ...
Begin Request
Error : ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1029
ORA-12535: TNS:operation timed outIt seems to be an issue with the webservice, plz check if its available & allowing requests.
Maybe you are looking for
-
Boot camp disaster - need help
I followed the proceedure exactly as required, including starting with OS X version 10.4.6, downloading and upgrading firmware, printing the pdf manual for Boot Camp etc. But when it came to partitioning the drive I selected 10 GB Windows XP the rest
-
Hi All When I run the FBL1n report for a vendor who has a PO which has a WBS element - I dont see the WBS element coming up on the line item report(s). Although the field is there on the layout - it is not picking the WBS Element into the report - ca
-
Hyperion Reporting and Analysis Framework
Hi Everyone, In the services, the Hyperion Reporting and Analysis Framework is not STARTED. When I start it manually, it starts but again after a minute the START status goes away, meaning it stops by itself. What could have happened? Any input would
-
HT204394 how can i hide sheets in iCloud Numbers file?
I have several files with multiple sheets. Some of the sheets are old revisions to a specific analysis that I do not want to delete but do not need to see them. In EXCEL you can hide sheets. Is there a way to hide sheets in my Numbers files save i
-
I upgraded to firefox 5 and now cannot use my keyboard to move around in the web - how do i fix this
I cannot use any of the keyboard shortcuts or arrow keys to navigate around. My mouse works fine but this is a pain when you know how to use the shortcuts. How do i fix this problem