- 论坛徽章:
- 0
|
为什么sybase xp_server启动不了?
FAQs about XP Server
This TechNote answers frequently asked questions about XP Server.
Background
XP Server, introduced with Adaptive Server Enterprise 11.5, is an Open Server application which runs on the same machine as Adaptive Server and allows you to implement Extended Stored Procedures (ESPs). An extended stored procedure contains procedural language code to carry out functions and tasks external to the server in response to events occurring within the server. For example, the system ESP xp_cmdshell lets you issue an operating system command from within Adaptive Server.
This TechNote clarifies issues on the use and management of XP Server.
Frequently Asked Questions
What variables or path names do I need to define for XP Server?
You need to define the location where extended stored procedures and the associated DLL's reside:
Check the definitions of library variables such as LD_LIBRARY_PATH and SHLIB_PATH
On UNIX platforms, the $SYBASE/lib path must be defined. For additional information on how to do this, refer to Installing Sybase Adaptive Server Enterprise and OmniConnect on Unix Platforms.
On NT, include the DLL directory in the PATH.
Upon starting Adaptive Server, why don't I see XP Server running?
Starting Adaptive Server does not start XP Server, nor do you need to start it yourself. Adaptive Server starts XP Server automatically when the first extended stored procedure is run.
Note:
XP Server does not have a separate RUN_SERVER file of its own. However you can still start XP Server without a RUN_SERVER file, for troubleshooting purposes, as described later in this technote.
How Can I Ensure XP Server Starts After Adaptive Server is Started?
The only supported method for starting XP Server is with the execution of the first extended stored procedure. If you would like to ensure that XP Server starts immediately after Adaptive Server is started, set it up so that about 30 seconds after starting Adaptive Server (enough time for the master database to recover), you have a script that logs in to the server and runs xp_cmdshell "date" to bring up XP Server.
What XP Server Management Options are Available?
You can use the xpserver utility to help maintain XP Server:
Usage: xpserver <options>;
where options include:
-h
prints the options help screen
-I
specifies an alternative path for the interfaces file
-p
specifies the priority level for execution of ESPs
-s
specifies stack size for ESP execution
-S
starts XP Server with specified name
-u
specifies that DLLs are unloaded automatically
-v
prints the version of the XP Server
-C
determines whether XP Server is run as a service (NT)
-a
means that the server name in this field is used only by event logging (NT)
-e
determines whether event logging is enabled (NT)
-l
specifies event log computer name (NT)
-x
specifies client admin setting for xp_cmdshell (NT)
Why do I get Error Message 11018 ("XP Server must be up for ESP to execute", and what does it mean?
Error 11018 is raised when Adaptive Server is unable to contact XPServer to execute an ESP. Check that your interfaces file (UNIX) or sql.ini file (NT) has the correct entry for XP Server; the XP Server name must be in all upper case letters and have the format SERVER_NAME_XP. Check also that the server name appears in sysservers, using the isql command:
1>; select srvname from sysservers
2>; go
Retry the ESP after making any necessary corrections.
Sometimes XP Server is not started the first time you issue an ESP. To start XP Server, shut down and restart Adaptive Server, and reissue the ESP. This is only necessary after the initial installation of Adaptive Server.
Why do I get kernel error "XP Server failed to start. Try bringing up XP Server manually. Check SQL Server documentation on how to bring XP Server up"?
This kernel error means that XP Server is unable to start because the XP Server port is in use by another process. To investigate the port assignment:
Identify the port number assigned to XP Server by looking in the interfaces file (UNIX) or sql.ini file (NT).
Check if another XP Server process (or any other process) is using the same port number by entering:
netstat -a | grep <port number>; (UNIX)
netstat -a | more (NT)
If the port number is present as a local address from the netstat output, you may not use that port for the XP Server because the port is already in use by another process.
To determine whether the XP Server port is in use, try running XP Server manually using the following command:
xpserver -S<XP Server name>;
XP Server will not start if the XP Server port number is in use.
If you find processes using the same port number:
If a stale XP Server process was using the port number, terminate the process:
On UNIX, use the operating system kill command.
On NT, press ctrl+alt+delete and click the Task Manager button to open the Windows NT Task Manager window. Select the xpserver process you want to terminate and click the End Process button.
Otherwise, if a process other than XP Server was using the port, use another port number for XP Server by modifying the interfaces file (UNIX) or sql.ini file (NT).
Start XP Server manually to verify that it can start successfully:
xpserver -S<XP Server name>;
Terminate the XP Server you started manually.
If you find no processes using the same port number:
Restart Adaptive Server.
Return to executing the ESP. XP Server should start automatically.
When using xp_cmdshell, I get the message "User access denied. Failed to change the user context." What should I do?
This message means that you cannot execute the command because of the current setting of your xp_cmdshell security context. To verify your xp_cmdshell context issue the following isql command:
1>; sp_configure "xp_cmdshell context"
2>; go
The Run Value in the output is your current xp_cmdshell context. See the System Administration Guide for possible values of this configuration variable, then set the appropriate context and retry xp_cmdshell.
See also the -x flag for xpserver (NT specific) .
Where can I find the XP Server log file?
By default, the XP Server log file is located in the $SYBASE/install directory (UNIX) or %SYBASE\install (NT). The naming convention is .log. |
|