It is currently 24 Aug 2017 8:33


Post new topic  Reply to topic  [ 12 posts ] 
Author Message
PostPosted: 25 Aug 2008 3:44 
Offline
Nouveau
Nouveau
User avatar

Joined: 25 Aug 2008 12:00
Posts: 3
hi,

i am new here.

anybody can help to provide me with the sql on how to extract the list of jobs that is in the db?

Thanks :)


Top
   
 Post subject:
PostPosted: 25 Aug 2008 7:58 
Offline
Nouveau
Nouveau
User avatar

Joined: 11 Apr 2008 12:00
Posts: 13
Location: Belgium
Hi, you can use :

select distinct
substr (application,1,4) OScycle,
' ', substr (application,5,20) Description_cycle,
' ', (job_name) Jobname,
' ', substr (description,1,40) description_job
from
ecs.def_job
ORDER by
1;

With this query you can also request for example the DAYS_CAL or WEEKS_CAL, DAY_STR or W_DAY_STR from the database.


Top
   
 Post subject:
PostPosted: 25 Aug 2008 8:10 
Offline
Nouveau
Nouveau
User avatar

Joined: 25 Aug 2008 12:00
Posts: 3
This is great! thanks

also, is there any restriction on accessing the Control-M DB?
I heard from somewhere that this is not advisable.

Also, by doing so, will it cause any issues in the daily operations?


Top
   
 Post subject:
PostPosted: 25 Aug 2008 8:17 
Offline
Nouveau
Nouveau
User avatar

Joined: 11 Apr 2008 12:00
Posts: 13
Location: Belgium
These are 'SELECT' statements, so there's no problem.

From the moment you try to do an UPDATE it get's tricky ...
It's advisable to do your updates via control/m-desktop & write & upload them from there to the db.

Robbie.


Top
   
 Post subject:
PostPosted: 25 Aug 2008 9:53 
Offline
Nouveau
Nouveau
User avatar

Joined: 25 Aug 2008 12:00
Posts: 3
thanks! you have been a great help, now there should be no more such taboos ;)


Top
   
 Post subject:
PostPosted: 05 Sep 2008 10:15 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 Aug 2008 12:00
Posts: 24
RoHoe wrote:
Hi, you can use :

select distinct
substr (application,1,4) OScycle,
' ', substr (application,5,20) Description_cycle,
' ', (job_name) Jobname,
' ', substr (description,1,40) description_job
from
ecs.def_job
ORDER by
1;

With this query you can also request for example the DAYS_CAL or WEEKS_CAL, DAY_STR or W_DAY_STR from the database.


hello,

how do you execute this script? must i connect to the EM server before?

thanks


Top
   
 Post subject:
PostPosted: 05 Sep 2008 2:52 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Apr 2005 12:00
Posts: 695
Location: PARIS
RoHoe wrote:
These are 'SELECT' statements, so there's no problem.
Robbie.


That's not totally true.
If you execute a very important SELECT, you can decrease database performance, and even stop database.

It could be a very important issue for all your environnement.

The best way is to duplicate database content and try SELECT on duplicated database.


Top
   
 Post subject:
PostPosted: 05 Sep 2008 2:54 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Apr 2005 12:00
Posts: 695
Location: PARIS
arno76 wrote:
hello,

how do you execute this script? must i connect to the EM server before?

thanks


You must use database client to be connected to the EM database, it your administrator give you access to do it.


Top
   
 Post subject:
PostPosted: 09 Sep 2008 9:03 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 Aug 2008 12:00
Posts: 24
hello,

thanks for answers, i can now extract data from Orcale n my serveur, by CTM_MENU or just in command by typing SQL in DOS, but i want to send my script by Ctrlm. When i create my batch, sql.bat, i've "select' command not found .... How can i make sql by batch?

thanks


Top
   
 Post subject:
PostPosted: 09 Sep 2008 10:45 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Apr 2005 12:00
Posts: 695
Location: PARIS
arno76 wrote:
When i create my batch, sql.bat, i've "select' command not found ....
thanks


Verify, giving all the path to acces of your SQL client, as :

C:\sql\...\isql.exe
C:\sql\...\sqlplus.exe
...

Depends on the type of the dataserver


Top
   
 Post subject:
PostPosted: 09 Sep 2008 10:55 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 Aug 2008 12:00
Posts: 24
hello,
database = Oracle
here is my test.bat

cd E:\Program Files\BMC Software\CONTROL-M Server\Ctm_server\Exe\
sql.exe
select DATA_CNTR_NAME from CMS_CMNPRM;
go

and here my result

C:\Documents and Settings\MonUSER>E:\TEMP\extorac.bat

C:\Documents and Settings\MonUSER>cd E:\Program Files\BMC Software\CONTROL-M Serv
er\Ctm_server\Exe\

C:\Documents and Settings\MonUSER>sql.exe
1>

here i tape exit, because the scipt wait for command SQL

C:\Documents and Settings\MonUSER>select DATA_CNTR_NAME from CMS_CMNPRM;
'select' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

C:\Documents and Settings\MonUSER>go
'go' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
C:\Documents and Settings\MonUSER>

thanks for help ;-))


Top
   
 Post subject:
PostPosted: 09 Sep 2008 1:48 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Apr 2005 12:00
Posts: 695
Location: PARIS
Here is an example :


Echo set nocount on >> %SQLTEMP%
Echo select select DATA_CNTR_NAME from CMS_CMNPRM >> %SQLTEMP%
Echo go>> %SQLTEMP%
Echo quit>> %SQLTEMP%

isql -S%EMSERVER% -U%EMUSER% -P%EMPWD% -i %SQLTEMP% -b


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 12 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved