I have a query that takes hours to run and extract. I am looking to get that query run by Oracle Developer automatically (e.g. overnight), extracted and saved in a designated folder.
I was not able to find any clear instructions online - I am quite new to this and was wondering if anyone could share a link or some instructions on how to achieve that, please?
Thank you in advance!
or you can schedule a job using sql developer(assuming you have admin right)
Related
I am using Oracle SQL developer 4.1.3.20.
I want an automated mechanism to open the Oracle SQL developer in my desktop -- every monday Morning at 01:00 am , connect to a DB and run an sql query in it.
I don't have the privilege to create a scheduler job in the oracle DB. I only have privilege to execute a read only query.
The Query takes long time to execute (more than 2 hours due to the size of the DB). I want the Query results to be ready in my desktop, when i come to office on Monday morning.
Please let me know how to do that. Please let me know if you need additional information.
You cannot do this. There is no way to tell SQL Developer to start, connect, and run a query from the CLI.
However, you could use the SQL program in your SQL Developer / bin directory, and script SQLcl to connect and run your query. You could have it spool the results to a CSV or formatted text report.
You can get a newer version of SQL Developer that ships with SQLcl, or go download it separately.
You on Windows, Mac, or Linux? I can try to share a bash/bat script as an example.
In Windows you you can open the “scheduled tasks” or “task scheduler” depending on what OS version you have and define a new task there. Must you use SQL Developer or can you use a Sql*Plus client and just run a predefined query and spool the results to a file?
I have tried to read up on this topic and I am still a bit unclear how to proceed. This seemed like a fairly basic task but it has been nowhere as simple as I had assumed. I have several SQL queries written and I want to be able to schedule them to run on a certain day each month and then automatically be exported to a .csv file in a selected folder. This will then allow them to be automatically uploaded into a BI and reporting tool that our firm uses (this part I know how to take care of).
I am fairly well versed in the writing of SQL queries, but everything beyond that I am pretty lost on. Right now I am using Microsoft SQL Management Studio 17. I thought that maybe scheduling jobs using the SQL Server Agent would be the solution, but the more I read about that and go down that path, the less I am convinced that it will allow me to export the query results into the .csv file that I need for it to be picked up. It is also important that these results are exported without headers.
Does anyone have any solutions for this? I am happy to answer any follow up questions if I am at all unclear.
You can create a job within the SQL server management studio to handle the whole thing.
http://social.msdn.microsoft.com/Forums/en/transactsql/thread/7d2280cf-3b33-46f7-ba82-4131e8a841c0
We have some old reports which are not being used anymore by the business and wish to remove/archive these.
I have 2 queries related to this:
a) What is the best way to find if a report has not been used for the past 12+ months?
b) Is there any simple way of moving the reports no longer being used (not used for > 12 months) to a different location (i.e. new folder), while keeping the folder structure intact?
We have searched for solutions on the web, but have not been able to find an automated solution for this. as the number of reports which we have figured out is in the range of ~5000, we are searching for an automated way to work this out.
Would running an SQL query on the server (physical machine) be advisable? If we run this query on the content store, we wish to figure out the column/field on which the actual report lies (in the below query have used , but not sure if such a field or query can be used):
update <table> set <report_path>='/content/folder[#name='Home']/folder[#name='Report']/report[#name='ABC012 - My Report']' where <report_path>='/content/folder[#name='Home']/folder[#name='Archive_test']/report[#name='ABC012 - My Report']'
Would this kind of a query work?
If not, can anyone suggest a way on which we can move reports to a single folder on the same Cognos box? (we are using Cognos 10, with DB2 and Netezza)
I can help you with a)
http://pic.dhe.ibm.com/infocenter/cfpm/v10r1m0/index.jsp?topic=%2Fcom.ibm.swg.im.cognos.ug_cra.10.1.0.doc%2Fug_cra_id4425SampleAuditReports.html
You can use provided package and sample reports to find information you need.
And for b) you should look in Cognos SDK. I don't think that update tables directly is a good idea.
I have looked at a few stackoverflow forum posts but nothing fits (or atleast I dont think so) what I need help with.
I'm looking for general advise, my company has 'tasked' me to look at moving some data from tables stored in our parent companies databases into a database of our own that has all the information we need in one place.
For instance if we want information that related to one thing, we may have to pull data from several different databases. I think I can get my head around the moving of the data and create a sql query to do it, however we're currently using SQL express as our SQL db (the company is more than happy to buy/create a SQL server but as far as we can see SQL express does what we need it too (feel free to correct me)).
I need to look at scheduling the data move for every hour or few hours to keep the data 'up to date' for when reports are generated using the data.
I have looked at a few programs but the as the queries and the database is on a server 2008 r2 system some of the 'programs' don't like it as they were last updated pre 2010 etc. I have also installed SQL management suite 2012 due to SQL server agent but I cant even get that worked (Service is enabled and I have restarted the DB just still nothing within suite).
I'm not looking (however happy to take the help) for a 'Do this and that and that' type reply but more than happy to accept that amount of help but if you guys / gals can point me in the right direction.
Summary:
-Combining data already on databases from our parent company into a table / DB of our own making
-Currently using SQL Express but willing to upgrade to something else that does the job
-Schedule the data moves for every X hours (Windows scheduling?)
-automating the entire thing so don't have to manually do the moves.
Help on any of the points above would be greatly appreciated and I would 'love you long time' for the help.
JB
There are a bunch of limitations for SQL Express. One of them is that SQL Agent is not supported. SSIS like SQL Agent is not supported.
http://msdn.microsoft.com/en-us/library/cc645993.aspx
Do not fret, you can always schedule a job with Windows Scheduler.
http://windows.microsoft.com/en-US/windows/schedule-task#1TC=windows-7
As for moving the data, it is up to you to select a solution.
1 - Write a PowerShell application to perform the Extract, Translate, and Load (ETL).
http://technet.microsoft.com/en-us/library/cc281945(v=sql.105).aspx
2 - Use the SQLCMD to perform logic like calling stored procedures.
http://technet.microsoft.com/en-us/library/ms162773.aspx
3 - Use BCP to dump and load data.
http://craftydba.com/?p=1245
http://craftydba.com/?p=1255
http://craftydba.com/?p=1584
http://craftydba.com/?p=1690
It is funny how youngsters think they need to spend a-lot of $ to create a solution for a business.
However, Microsoft does supply you with a-lot of free tools.
You just have to put them together for a solution.
PS: I remember about 10 years ago I created a custom ETL solution using VBSCRIPT. Unlike power shell, it is installed on old and new programs.
Good luck!
You can create a console application which executes that particular stored procedure which handles your logic. ( http://dotnet.dzone.com/articles/basics-stored-procedures-net )
Of course using SSIS is much easier but it's not available in SQL Server Express Edition.
I think you should have a look at Integartion Services, which is not available for Express Edition. Have a look at this article to get started with SSIS.
I am trying to provide a consolidated method of retrieving the results of the last scan for each project in HP Fortify Security Center.
I have gone the route of querying the fortifySSC database and am falling a little short. Has anyone ever attempted to do this by way of a SQL query?
I would be happy to provide the query that I have thus far, if needed.
Or if anyone has an idea on how to accomplish this via the command line, I'd be in interested in that, too.
Thanks in advance for your help!
i´ve never done this in the CLI via SQL commands. But there is a utility called fortifyclient that is able to download the latest FPRs from a project. if you want to automate things, fortifyclient can handle token-based authentication. works for us perfectly in our CI environment.
I did get the query I needed via the SQL Profiler, so that's how I resolved this.