Netezza - Schedule Stored Procedure - shell

How to schedule a stored procedure in Netezza to run in specific intervals? Looking for replacement of DBMS_JOB or DBMS_SCHEDULER in Oracle . Or is it possible to invoke Netezza stored procedure through shell script?
Thanks

in our project we are calling the stored proc using nzsql(in shell script) and shell script is scheduled using autosys. if you are using any ETL tools like informatica u can use stored procedure transformation to execute netezza procedures.

There is no direct equivalent to DBMS_SCHEDULER or DBMS_JOBS in Netazza. Stored procedures, just like any SQL, can be called through a shell script using the nzsql CLI utility. Those shell scripts can then be scheduled to run via cron, or any another myriad of scheduling mechanisms.

Related

Package or automating execution of Hive queries

In Oracle or other DBs, we have a concept of PL/SQL package where we can package multiple queries/procedures and call them inside a UNIX script. In case of Hive queries, what's the process used to package and automate the query processing in actual production environments.
If you are looking to automate the execution of numerous Hive queries, the hive or beeline CLI (think sqlplus with Oracle) allows you to pass a file containing one or more commands such as multiple inserts, select, create tables, etc. The contents of said file can be created programmatically using your favorite scripting language like python or shell.
See the "-i" option in this documentation: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli
In terms of a procedural language, please see:
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=59690156
HPL/SQL does have a Create Package option but if whatever you are trying to achieve is scripted outside of HPL/SQL (e.g. python, shell), you can 'package' your application in accordance with scripting best practices of your selected language.
To run mutilpe queries simply write it down one after another in a file (say 'hivescript.hql') and then it can be run from bash by simply calling it through beeline or hive shell
beeline -u "jdbc:hive2://HOST_NAME:10000/DB" -f hivescript.hql

Scheduling Oracle sql files using Unix based SAS enviornment

I have bunch of SQL queries that run against an Oracle database. Is there a way to schedule these .sql files using UNIX Based SAS, so they can execute one after another at certain time of day?
If they are .sql files, why do you want to schedule them using SAS? Are they SAS programs? If not, I would do one of three things, depending on my constraints:
1) Convert the .sql files to stored procedures and call them from DBMS_SCHEDULER within Oracle, since Oracle has a fantastic job scheduling subsystem (actually multiple variants) that protects against duplicate jobs among other issues, and you get transactional control, auditing and logging. http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_sched.htm
2) If converting them to stored procs is too much, then call the .sql scripts directly from DBMS_SCHEDULER with DBMS_SCHEDULER.CREATE_PROGRAM() and then schedule that program with DBMS_SCHEDULER.CREATE_JOB.
3) Use cron or atrun to schedule batch / shell script wrappers that call sqlplus to run .sql files.
If the question is specifically how to do this with SAS, then DBMS_SCHEDULER can still execute external SAS programs using option (2) above.

Teradata Jobs and KSH

I tried searching online but was unable to find anything pertaining to my requirements.
I am new to Teradata.
In our team Teradata jobs are used to call the ksh which in turn calls the procedure to run at a scheduled time.
I want to understand how exactly does this calling works? How does a job call a KSH and then how does a KSH call a procedure in turn.
Your help would be much appreciated.
At a very basic level UNIX has a scheduler mechanism called cron. Users with sufficient privilege on the UNIX server can use cron to run jobs at a scheduled time by defining a crontab. Your crontab can call UNIX commands or in many cases a shell script (ksh in your example) to perform a complex set of operations. In many production environments jobs may be scheduled using an enterprise platform instead of many independent crontab files across many users and many servers in the data center.
As this pertains to Teradata, the ksh is likely invoking a Teradata utility such as BTEQ to logon to the database and execute a stored procedure, macro, or set of SQL statements contained within the BTEQ script. Once the BTEQ script has completed a return code is sent to the ksh script to account for any error handling should an error occur within the BTEQ script or an unhandled/handled error within the stored procedure.
You can use your search engine of choice to read up on how to develop UNIX shell scripts (Korn, Bash, etc.) and how Teradata utilities such as BTEQ work. If you have a more discrete question about something in your environment feel free to post a separate question here with the appropriate tags in the question to target the audience who can best help you.

How to Take month wise dump in oracle 10G?

I have database. I need to take back up of table month wise. so how to take backup in month wise in oracle 10G?
You don't mean "backup". Backup implies recovery, and a monthly dump is no good for recovery purposes. That's why Nature gave us RMAN.
The Oracle export and import tool is called Data Pump. We can run this as an external command or with a PL/SQL API. Find out more.
Running a monthly export requires a scheduling tool. Use an OS command such as cron to run a shell script invoking the command line expdp or the built-in DBMS_SCHEDULER to run a stored proc using DBMS_DATAPUMP.

Invoke oracle stored procedure from shell script without SQLPLUS

Can anyone please suggest a way to invoke an Oracle stored procedure from a shell script without the use of SQL*Plus, or any such client for that matter. The inability to install clients is a limitation of the server that I work on.
I have to schedule an Autosys script to invoke the job which invokes the Oracle stored procedure. Can you please suggest in what direction should I proceed?
You could do this using Java and jdbc. If you can not even copy the thin jdbc driver, I see no other option than to schedule the job in Oracle Using Oracle Scheduler.
Without client software installed, you'll have a hard time getting to Oracle from a shell script; however, Oracle has it's own batch facility--see Database jobs here

Resources