views:

29

answers:

1

I need to Retirve the following Details using Sybase SQL Query.

1) Database Data File Path

2) Database Transaction Log File Path

3) Path where SybaseSoftware Installed

4) Patch Installed on Sybase

Thanks.

A: 

That info is easy for a DBA to obtain in 30 seconds; with a GUI Admin tool in a few clicks.

Why do you want to obtain the details of the server installation VIA SQL ? If you are a coder you do not need that info to do your job; that info is the domain of the DBA, and changes as they administer the server. More important, the changes are transparent to the coder. Even if you did know it, it will not help or hinder you in your work.

Online Sybase Manuals

The "data and log file paths" in particular, are protected from direct access by developers (it is a secured ANSI SQL RDBMS).

Update

Evidently you did not bother to look up the manuals.

Open a session with the server, so that you can execute SQL commnands via "Sybase SQL Query". From your PC, Run either isql (character) or DBISQL (GUI); they are both on the Sybase PC Installation CD, you can also download them free.

  1. Devices ("Data File Paths"):

    sp_helpdevice
    go

    There are many Databases per server. There are many Devices per server. You will have to figure out (a) which Devices contain the Database you are interested in (b) Data Devices vs Log Devices.

    sp_helpdb
    go

  2. Log Devices ("Database Transaction Log File Path")

    (same as (1) )

  3. "Sybase Installation" or $HOME directory (on the server). There are two methods, the first is much easier:

    • via host system
      .
      • Log into the host system of the server, as the sybase user
      • You are already located in the sybase $HOME directory
      • It is the installation directory
      • (the original installer may have created directory trees for each version or EBF ("patch level"), but that is easy to figure out using Unix/DOS commands)
        .
    • via islq/DBISQL
      .
      sp_configure "configuration file"
      go
      .
      • This will give you the path to the configuration file. It is almost always, the file path to the $SYBASE or sybase>$HOME directory. You can move up or sideways in the directory tree, using Unix/DOS commands, and figure it out from there.
        .
  4. The version of the Sybase ASE is the only item from your list that is relevant to coders. It (including current EBF ("patch level") is obtained via:

    SELECT @@VERSION
    go

PerformanceDBA
I want to do that because its a part of my work , is there any way to retrive using Sybase SQL Query Transaction Log file and data file is on which devices ?
John
Yes, of course, it is called SQL. The data manipulation commands allow you to query the databases which reside in the data files (the datafiles *are* the devices). The normal ANSI SQL security is enforced, so you can only get the data that has been explicitly GRANTed to you. There is no need to go to the datafiles/devices directly (and if you did that someone else, who purchased the licence) would be upset that the security provided as per the licence has been breached. The transaction log is inaccessible. What legal work requires breaching the security of a licensed server ?
PerformanceDBA