I need to Retirve the following Details using Sybase SQL Query.
开发者_JAVA技巧1) Database Data File Path
2) Database Transaction Log File Path
3) Path where SybaseSoftware Installed
4) Patch Installed on Sybase
Thanks.
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.
Devices ("Data File Paths"):
sp_helpdevice
goThere 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
goLog Devices ("Database Transaction Log File Path")
(same as (1) )
"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.
.
- 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.
- via host system
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
精彩评论