Controlm/EM 6.4 PostgreSQL consideration

Tools and several solutions to manage Control-M products
Post Reply
User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Controlm/EM 6.4 PostgreSQL consideration

Post by philmalmaison » 17 Nov 2008 2:17

does anybody still know how the sybase SQL command is replaced by using the psql in batch mode ?
tia
Philmalmaison

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 17 Nov 2008 2:27

Hi

No special changes.
All sql scripts running with Sybase or Oracle, run correctly with PostgreSQL.

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

i dont think so ...

Post by philmalmaison » 17 Nov 2008 3:36

%scripts> cd
%ctmem64> SQL
/var/ctmem64/scripts/SQL: //bin/isql: not found
%ctmem64> psql
Password:
Welcome to psql 8.2.4, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

em640=>

how do you call SQL command in batch mode and automaticly give user and password of the database to get information about control-m/em database ?

in sybase using isql -U <> -P <>
in pgsql using psql ??


regards
philmalmaison

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 18 Nov 2008 6:50

this is not true, try to use check_db in em 6.4 postgre ...
some utilities are still here but just working in sybase or oracle environement ?

regards
Philou

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 18 Nov 2008 8:14

Hi philmalmaison

You asked about sql command. So SQL syntax is the same.

If you speak about utilities, that's true.
You will find database utilities for all database engine in the same directory.

It's exactly the same with ctmreindex used only with sybase.

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 19 Nov 2008 9:35

in sybase using isql -U <> -P <>
in pgsql using psql ??

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 17 Dec 2008 10:22

here is the commad syntax:

-----------------------
Synopsis
psql [option...] [dbname [username]]

Description
psql is a terminal-based front-end to PostgreSQL. It enables you to type in queries interactively, issue them to
PostgreSQL, and see the query results. Alternatively, input can be from a file. In addition, it provides a number of
meta-commands and various shell-like features to facilitate writing scripts and automating a wide variety of tasks.

Options

-d dbname
--dbname dbname
Specifies the name of the database to connect to.
This is equivalent to specifying dbname as the first non-option argument on the command line.

-e
--echo-queries
Copy all SQL commands sent to the server to standard output as well.
This is equivalent to setting the variable ECHO to queries.

-f filename
--file filename
Use the file filename as the source of commands instead of reading commands interactively.
After the file is processed, psql terminates.
This is in many ways equivalent to the internal command \i.

If filename is - (hyphen), then standard input is read.
Using this option is subtly different from writing psql < filename.
In general, both will do what you expect, but using -f enables some nice features such as error messages with line numbers.
There is also a slight chance that using this option will reduce the start-up overhead.
On the other hand, the variant using the shell's input redirection is (in theory) guaranteed to yield exactly
the same output that you would have gotten had you entered everything by hand.

-h hostname
--host hostname
Specifies the host name of the machine on which the server is running.
If the value begins with a slash, it is used as the directory for the Unix-domain socket.

-L filename
--log-file filename
Write all query output into file filename, in addition to the normal output destination.

-o filename
--output filename
Put all query output into file filename. This is equivalent to the command \o.

-p port
--port port
Specifies the TCP port or the local Unix-domain socket file extension on which the server
is listening for connections.
Defaults to the value of the PGPORT environment variable or, if not set,
to the port specified at compile time, usually 5432.

-P assignment
--pset assignment
Allows you to specify printing options in the style of \pset on the command line.
Note that here you have to separate name and value with an equal sign instead of a space.
Thus to set the output format to LaTeX, you could write -P format=latex.

-q
--quiet
Specifies that psql should do its work quietly.
By default, it prints welcome messages and various informational output.
If this option is used, none of this happens.
This is useful with the -c option. Within psql you can also set the QUIET variable to achieve the same effect.


-U username
--username username
Connect to the database as the user username instead of the default.
(You must have permission to do so, of course.)

-?
--help
Show help about psql command line arguments, and exit
---------------------
Last edited by mauriziog on 13 Jan 2009 7:33, edited 1 time in total.

User avatar
philmalmaison
Nouveau
Nouveau
Posts: 1148
Joined: 08 Jun 2007 12:00
Location: Ile de France

Post by philmalmaison » 17 Dec 2008 5:40

many thanks veru usefull
regards
philmalmaison

User avatar
bassman
Nouveau
Nouveau
Posts: 5
Joined: 02 Nov 2009 12:00

Post by bassman » 05 Mar 2013 1:16

Bonjour,

je ne vois toujours pas comment s'affranchir de la saisie du passwd en mode batch.

Une idée ?

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 06 Mar 2013 9:47

In english please....

So if you try to work directly from the control-m server, no need to use password.

SQL utility will provide a way to work with the database directly.

User avatar
livcyxingfoe
Nouveau
Nouveau
Posts: 3
Joined: 08 Apr 2013 12:00
Contact:

Post by livcyxingfoe » 08 Apr 2013 8:25

This is equivalent to specifying dbname as the first non-option argument on the command line.



_________________
Runescape Gold|cheap runescape gold|Diablo 3 Gold

Post Reply