Backup and recovery of SDE data

Source: Internet
Author: User

Backup and recovery of spatial data in ArcSDE:

With the increasing requirements of GIS application systems in terms of complexity, integration, and concurrency, the amount of space data required by the system is rapidly increasing. At the same time, users' demands for concurrent access to spatial data are becoming increasingly prominent. The traditional file storage and representation of spatial data methods obviously cannot meet these needs. Because of the powerful advantages of ArcSDE, such as massive data storage, multi-user concurrent access, version management, and long transaction processing, ArcSDE is introduced into the GIS application system as a space data storage and management engine, it is becoming more and more common. As a space database engine, ArcSDE is a server-side product in the ArcGis 8.1 series of software and plays an important role in the data center in the entire product framework, it uses Oracle, DB2, SQL Server, Informix, and other relational databases in data storage, data integrity, and other advanced technical means, massive space data (including vector data and grid data) organically organized and managed to provide efficient and concurrent access to spatial data through its internal asynchronous buffering, Spatial indexing, and other advanced mechanisms.

In addition to storage space data and access, backup and recovery of space data is one of the most important tasks in space data management and an important way to ensure the security of space data. First, the spatial data itself is constantly updated and changed during the application process. Therefore, it is often necessary to back up different spatial data versions in different periods. Second, accidental damage to storage media can lead to serious space data loss. Therefore, you need to regularly back up the entire space data object completely. Third, sometimes necessary for adjustment, it is necessary to port and convert spatial data between different servers or even different database management systems.
In the era of file-based spatial data, the backup of spatial data is only the process of copying, backing up, and archiving files in the operating system. The restoration of spatial data is only a copy and overwriting operation; in the era of spatial databases based on ArcSDE and relational databases, the backup of spatial data is more dependent on the backup and recovery technologies of relational databases. Of course, the backup tools provided by ArcSDE cannot be lacking. According to the backup method and object, the backup and recovery of space data in ArcSDE can be divided into the following two types: backup and recovery of space data objects and backup and recovery of the overall space database.

1. backup and recovery of data objects in a specified space
This method is mainly used to back up specified spatial data objects, such as a layer and element class, some records that meet specific conditions, and even specific versions. The main method to implement this backup mode is to use the management tools provided by ArcSDE: sdeexport and sdeimport commands. They are located in % arcsdehome % \ bin. Sdeexport is used to back up space data from the ArcSDE server as a separate data file, and sdeimport is used to restore the data files backed up by sdeexport to the ArcSDE server.

The disadvantage of this method is that you cannot back up the complete spatial database at a time. However, the sdeexport and sdeimport tools can also be used to port spatial data between different relational database management systems (RDBMS.

1. Backup all records
Use the default sdeexport command, for example:
(1) back up the specified layer to the backup file
Sdeexport-o create-l dcxq, shape-f d: \ dcxq. exp-I jerry_oracle-u Sde-P SDE
That is, the specified layer "dcxq" in the ArcSDE for Oracle8i of jerry_oracle is backed up to the file D: \ dcxq. Exp by default.
(2) copy the backup file to the target server using the operating system command
(3) restore the backup file to the target RDBMS
Sdeimport-o create-l newdcxq, shape-f d: \ dcxq. exp-I jerry_sqlsvr-u Sde-P SDE
This operation restores the backup file to the SDE Service (ArcSDE for sqlserver) named jerry_sqlsvr with the layer name newdcxq.

2. Backup part of records
Add the-W parameter and a conditional selection expression to the sdeexport command, for example:
(1) Back up records that meet the conditions in the specified layer to the backup file
Sdeexport-o create-l dcxq, shape-f d: \ dcxq. exp-W xzqy = 'xuhui district '-I jerry_oracle-u Sde-P SDE
It is to back up all the "Xuhui District" demographics in the specified layer "dcxq" in the SDE Service (ArcSDE for Oracle8i) named jerry_oracle to the file D: \ dcxq. Exp.
(2) copy the backup file to the target server using the operating system command
(3) restore the backup file to the target RDBMS
Sdeimport-o create-l xhdcxq, shape-f d: \ dcxq. exp-I jerry_sqlsvr-u Sde-P SDE
This operation restores the backup file to the SDE Service (ArcSDE for sqlserver) named jerry_sqlsvr with the layer name xhdcxq.

3. Back up specific data versions
Add the-V parameter and a version name to the sdeexport command, for example:
(1) Back up a specific version of the specified layer to the backup file
Sdeexport-o create-l dcxq, shape-f d: \ dcxq. exp-V verapr-I jerry_oracle-u Sde-P SDE
This operation backs up the verapr version of the specified layer "dcxq" in the SDE Service (ArcSDE for Oracle8i) named jerry_oracle to the file D: \ dcxq. Exp.
(2) copy the backup file to the target server using the operating system command
(3) restore the backup file to the target RDBMS
Sdeimport-o create-l aprdcxq, shape-f d: \ dcxq. exp-I jerry_sqlsvr-u Sde-P SDE
This operation restores the backup file to the SDE Service (ArcSDE for sqlserver) named jerry_sqlsvr with the layer name aprdcxq.

Ii. backup and recovery of the overall spatial database
The overall backup and recovery of the ArcSDE space database is, to a large extent, the backup and recovery of the database or database object in which it is located. Of course, the complete ArcSDE data backup should also include files such as dbtune. SDE, giomgr. defs, dbinit. SDE, and services. Sde.

There are many types of database backup and recovery. In different database management systems, they are even more different. Generally, it can be divided into static dump and dynamic dump. Static dump is a dump operation performed when no transaction is processed in the system. Therefore, this method must be a copy of data consistency. The advantage of static dump is that it is easy to operate and ensures data consistency, but its disadvantage is obvious. The dump operation can only be performed after the user transaction ends, and the new transaction can only be executed after the dump operation ends, therefore, the database availability is reduced. A dynamic dump refers to a dump operation that is performed concurrently with user transactions. During the dump, the database is allowed to perform access and modification operations. It does not have to wait until all running transactions are completed, nor will it affect the operation of new transactions, however, the data in the copy cannot be correct, valid, and complete. Therefore, log files are often created during the dynamic dump. The backup file and log file can restore the database to the correct state.

1. Oracle Database
(1) Two archive Modes)
Oracle has two archive modes: No archivelog and archivelog. Online log redo files are not archived for database operations in no archivelog mode (this mode is the default mode. When the storage medium is damaged, databases in the no archivelog mode can only be restored to the last backup point. Databases in archivelog mode can be restored to the point before the media is damaged by combining the last backup with the archived log redo file.
Oracle databases created in no archivelog mode can be switched to archivelog mode.
(2) multiple backup and recovery methods
Data backup and recovery methods in Oracle include: offline backup and recovery, logical backup and recovery, hot backup and recovery.
* Offline backup and recovery: offline backup is a static dump technology. Backup is performed when the database is closed or not working. Offline backup can be implemented in two ways: backup/recover, a tool provided by Oracle, and cold backup.
* Logical backup and recovery: Logical backup and recovery refers to transferring the content of objects such as databases, users, and tables to a binary file, then, when necessary, the original form will be restored through the transfer. In this way, you can back up the entire database and specify the user and the content of the specified table.
* Hot backup and recovery: offline backup and logical backup are usually static backup operations when users do not access the database. These backups only ensure consistency and integrity before data backup, and do not guarantee data consistency during Backup. To ensure real-time data consistency, log files must be backed up while backing up data. The database runs in archivelog mode, and the backup of both data and log files is called Hot Backup.
(3) implementation steps
The backup mode is determined by the specific data backup requirements. For specific steps to implement Oracle database backup, refer to relevant Oracle documents, such as oracle8 backup and recovery guide. This instance uses the logical backup in Oracle and the exp and IMP tools to back up and restore the overall space data as SDE users.
* Back up a database: Use the exp command in Oracle to back up all relevant data in SDE mode.
* Recover Database: Use the IMP command in Oracle to restore backup data files as SDE users.
* Recover the ArcSDE System File: if necessary, restore the installation of the ArcSDE Program File. You also need to restore the dbtune, giomgr. defs, dbinit. SDE, and services. Sde files from the backup machine.

2. sqlserver Database
(1) backup and recovery methods
In ms SQL Server, ArcSDE uses a separate user database SDE (default name) to manage and organize spatial data.
Sqlserver can not only back up and restore databases on the same server, but also easily move databases between different servers through backup and recovery. Ms SQL server also allows you to restore Database backups on one server to another.
If you want to restore the database backup to another server, the code page and sorting method on the two servers must be the same. For example, you cannot restore a database created using binary sorting order (BSO) to a server configured with the default sorting method (dictionary order, dictionary. Of course, you can set the server sorting mode by running the 'SP _ helpsort 'stored procedure in the master database.
The database backup operation backs up the database's system tables, including sysusers. When backup and recovery operations are performed on different servers, the users in the backup database may be different from those in the sysxlogins table in the master database on the new server. In this way, you will not be able to log on to the recovered database, knowing the correct and unified logon ing between the sysxlogins table in the master database and the sysusers table in the recovered database. To synchronize the two tables, run the "sp_change_users_login" stored procedure.
(2) implementation steps
* Backing up an SDE database to a backup file: You can either back up the SDE and other spatial databases by using the backup statement in the T-SQL or the backup tool wizard in Enterprise Manager.
* Copy the backup file to the target server.
* Restore the backup file to the target server: You can use the restore and Restore Tool wizard in Enterprise Manager to restore the SDE and other spatial databases.
* Unified SDE User Login ing
A. Both servers have SDE users, but the SDE users have different identities.
After the SDE database is restored to the new server, the SDE user Sid in the SDE database is different from that in the DBO. sysxlogins table of the master database. For example:
Use SDE
Go
Select Sid from sysusers where name = 'sde'
Use master
Go
Select Sid from sysxlogins where name = 'sde'

Sid
-----------------------------------------------------------
0x76695419bfaed41184fd00c04f8d0451
(1 row (s) affected)

Sid
-----------------------------------------------------------
0xeddfca8e56b0d411850000c04f8d0451
(1 row (s) affected)
In this case, the SDE user Sid identifier must be unified in the two tables to run the "sp_change_users_login" stored procedure. The example is as follows:
Use SDE
Go
Sp_change_users_login 'Update _ one', 'sde', 'sde'
Run the preceding Sid query to verify the Modification result:
0xeddfca8e56b0d411850000c04f8d0451
0xeddfca8e56b0d411850000c04f8d0451
We can see that the SDE user Sid IDs of the modified two tables are exactly the same. Now we can start the ArcSDE for sqlserver service for use.
B. There are no SDE users on the target server
In this case, if no SDE user is logged on to the target server, the above Sid query is executed and the result is as follows:
Use SDE
Go
Select Sid from sysusers where name = 'sde'
Use master
Go
Select Sid from sysxlogins where name = 'sde'
Sid
-----------------------------------------------------------
0x76695419bfaed41184fd00c04f8d0451
(1 row (s) affected)
Sid
-----------------------------------------------------------
(0 row (s) affected)
To correct this situation, you must first add the SDE logon user to the target server, but do not grant the SDE database permission to the SDE user. Add a logon user, use the "sp_addlogin" stored procedure, and use the logon management tool in the Enterprise Manager. For example:
Sp_addlogin 'sde', 'Go', 'sde'
Then, run the "sp_change_users_login" Stored Procedure to unify the DBO. sysxlogins table in the master and the SDE user Sid ID in the sysusers table in the user database after recovery.
Use SDE
Go
Sp_change_users_login 'Update _ one', 'sde', 'sde'
Finally, you can run the SID query to verify the SID consistency:
Use SDE
Go
Select Sid from sysusers where name = 'sde'
Use master
Go
Select Sid from sysxlogins where name = 'sde'
Sid
-----------------------------------------------------------
0xf6dfca8e56b0d411850000c04f8d0451
(1 row (s) affected)
Sid
-----------------------------------------------------------
0xf6dfca8e56b0d411850000c04f8d0451
(1 row (s) affected)
After the SDE user Sid is unified, you can start the ArcSDE service or use the recovered space data in direct connection mode.

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/mark_gis/archive/2007/01/11/1479824.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.