SqlServer 2005数据库远程异地备份
欢迎进入Windows社区论坛,与300万技术人员互动交流 >>进入 一、条件 1、A为数据库服务器 2、B为备份数据库 3、B服务器建立的共享文件夹可以被A访问 二、测试环境 主机A 主机B IP 192.168.2.190 192.168.2.16 数据库 SqlServer2005 Developer Edition 无 备
欢迎进入Windows社区论坛,与300万技术人员互动交流 >>进入
一、条件
1、A为数据库服务器
2、B为备份数据库
3、B服务器建立的共享文件夹可以被A访问
二、测试环境
|
主机A |
主机B |
IP |
192.168.2.190 |
192.168.2.16 |
数据库 |
SqlServer2005 Developer Edition |
无 |
备注 |
可以访问文件夹Remote_backup |
共享文件夹Remote_backup (即数据库备份文件夹) |
三、数据库备份步骤
1、在主机B上建立共享文件夹“Remote_backup”,并将该文件夹设置账号权限为“完全控制”;
2、在主机A上,打开sqlserver configuration manager,打开sqlserver agent 的属性,将启动模式改为“自动”;
3、在主机A上,使用sqlserver工具“外围应用配置器”,并打开其中的“功能的外围应用配置器”,启用xp_cmdshell;
4、点击数据库的SQLServer代理下的“作业”,新建作业“RemoteBAK”;
5、点击“步骤”,新建作业步骤,选定需备份数据库,在命令框中输入如下命令,
命令如下:
exec master..xp_cmdshell 'netuse \\备份服务器IP\备份服务器上共享文件夹 "备份服务器登录密码" /user:备份服务器IP\备份服务器登录名'
EXECUTEmaster.dbo.xp_create_subdir '\\备份服务器IP\备份服务器上共享文件夹\数据库名称'
declare @strdirnameDvarchar(100)
declare @strdirnameT varchar(100)
declare @RemotePathstrvarchar(200)
set@strdirnameD=replace(substring(convert(varchar(20),getdate(),120),1,10),'-','')
set@strdirnameT=replace(substring(convert(varchar(20),getdate(),120),12,8),':','')
set @RemotePathstr = '\\备份服务器IP\备份服务器上共享文件夹\数据库名称\备份数据库名称_'+@strdirnameD+@strdirnameT+'.bak'
backup database stu_cou todisk=@RemotePathstr
6、点击“计划”,新建作业计划,设定作业启动时间;
7、结束上面操作后,点击“确定”,保存后,启动作业!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Backing up and restoring a MySQL database in PHP can be achieved by following these steps: Back up the database: Use the mysqldump command to dump the database into a SQL file. Restore database: Use the mysql command to restore the database from SQL files.

The syntax differences between MySQL and SQL Server are mainly reflected in database objects, data types, SQL statements and other aspects. Database object differences include the storage engine and how filegroups are specified, and the creation of indexes and constraints. Data type differences involve differences in numeric types, character types, and date and time types. SQL statement differences are reflected in result set limitations, data insertion, update and delete operations, etc. Other differences include how identity columns, views, and stored procedures are created. Understanding these differences is important to avoid errors when using different database systems.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

The location where the Navicat database configuration files are stored varies by operating system: Windows: The user-specific path is %APPDATA%\PremiumSoft\Navicat\macOS: The user-specific path is ~/Library/Application Support/Navicat\Linux: The user-specific path is ~/ .config/navicat\The configuration file name contains the connection type, such as navicat_mysql.ini. These configuration files store database connection information, query history, and SSH settings.

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.
