Monday, 20 July 2015

To Register As Versioned with the option to move edits to base – or Not?

I’m sure you’ve seen this option when choosing to “Register As Versioned”, and if you have wondered…”What does this option do?”…let me explain.

Checking this option, will still create the (A)dds and (D)eletes tables to track versioned edit operations performed on the data; however, edit operations that are saved to the Default version, or merged from other child versions, are immediately saved to the business table (rather than stored in the A and D tables).

Thus, the advantage is that edits are stored in the A and D tables while editing; giving you the undo and redo ability while editing in ArcMap – but then pushing the edits into the business table, upon Save.

This is great for 3rd party applications that query the business table and requires edits through ArcGIS to be seen immediately.

However there are some limitations:
• Available for simple features only – those that do not participate in a topology, network dataset, or geometric network.
• Cannot specify this option if the data you are planning to register as versioned, will be participating in geodatabase replication; or/and the data has geodatabase archiving enabled.

If you decide to make use of this option:
For 10.0:
• In the Catalog tree, right-click the feature dataset, stand-alone feature class, or table.
• Click Register As Versioned to open the ‘Register As Versioned’ dialog box.
• Check ‘Register the selected objects with the option to move edits to base.’

For 10.1:
• In the Catalog tree, right-click the feature dataset, stand-alone feature class, or table.
• Click Manage, and then click Register As Versioned to open the ‘Register As Versioned’ dialog box.
• Check ‘Register the selected objects with the option to move edits to base.’
FAQ: Can you rename the ArcSDE geodatabase in SQL Server?

Unfortunately, the ArcSDE geodatabase cannot be renamed in SQL Server.

This also applies to moving or copying an ArcSDE geodatabase from one server to another using SQL Tools such as Detach and Attach, Backup and Restore, or the Copy Database wizard.

No matter which of the methods you use to move your SQL Server database, you cannot rename the database. When you are restoring a database, for example, you are given the opportunity to restore it with a different name. Don’t do this with a geodatabase; you won’t be able to connect to it.

All object names in the geodatabase system tables are fully qualified with the database name. In addition, many stored procedures use a three-part naming syntax in their code, which follows the format <database>.<owner>.<object>. If the database name changes, you will not be able to execute these procedures.

This is further reiterated in the ArcGIS Resource documentation referenced from: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002q00000087000000
FAQ: What will take the place of the SDE Command line tools?

With the release of 10.2 and plans to deprecate the ArcSDE command line tools, there has been lots of talk about how all these tools will be replaced.

The following technical blog and forum addresses some of the questions you may have regarding the deprecation of the SDE command line tools:

Do This, Not That! – Alternatives to using SDE command line tools
http://blogs.esri.com/esri/supportcenter/2013/10/04/do-this-not-that-alternatives-to-using-sde-command-line-tools/

Alternatives to using SDE command line tools – Blog Discussion
http://forums.arcgis.com/threads/95154-Alternatives-to-using-SDE-command-line-tools-Blog-Discussion

As you can see, even though there are plenty of alternatives in place already, Esri is still currently looking into users requests to have more SDE command line functionality replaced via GP tools or the GUI.

Friday, 10 July 2015

HowTo:  Install ArcSDE on a machine that is remote from the Oracle RDBMS
Article ID:     23753
Software:      ArcSDE 8.2, 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10
Platforms:     N/A
Summary
Sometimes it is necessary to install ArcSDE on a machine that is remote from the Oracle instance. Instructions provided describe how to install ArcSDE on a machine that is remote from the Oracle RDBMS.

 Installation directions for later versions of the product contain details for distributed setups and can be found in the 9.3 Installation Guide and the 10 Web help, which are referenced in the Related Information section of this article.


Procedure

    Ensure Oracle is installed and running on the remote server.
    Install Oracle Net Software on the server where ArcSDE is to be installed. Ensure SQL operates from this remote machine to the Oracle server.

     If ArcSDE is on a machine that is remote to Oracle, ArcSDE is effectively a client to Oracle and uses the Oracle Net communication software. The Oracle Instant Client may not be used

    Perform pre-installation requirements, as described in the ArcSDE for Oracle Installation Guide. The installation guide can be found on the installation CD/DVD as an HTML document.
    Install ArcSDE, as per the installation guide for the operating system (OS) being used.

    Windows:
    Perform the ArcSDE Post Installation setup using the 'Custom' option, and uncheck 'Create ArcSDE Service' from the four components/steps of the installation. See Steps 5 and 6 below for information on creating the service manually.

     When using the Post Installation Wizard, use the Oracle Net Service Name created with the Oracle Client Software in all the places that the Installation Wizard asks for the Net Service Name.

     If creating the geodatabase repository tables manually with the sdesetup command, it may require a password of -p password@<Oracle_Net_Service_Name>.

    Create the ArcSDE Service (Windows only):
    The ArcSDE Windows service must be created manually when installing ArcSDE and Oracle on remote servers.

    Use 'sdeservice -o create' to create the Windows service, since the Post Installation Wizard is not designed to create a service for ArcSDE setups that are on a remote server. At a command prompt, type 'sdeservice -h' for syntax information or refer to the ArcSDE Developer Guide for syntax and an explanation of the command.

    ArcSDE 8.x setups do not use the sdeservice '-d' option for dependency. It is not possible for a Windows service to have a dependency on a service that is on a remote server.

    For ArcSDE 9.x and later version setups, the '-d' option for the sdeservice is required and the name of the Oracle Instance (SID) must be entered. However, as it is not possible for a Windows service to have a dependency on a service that is on a remote server, the sdeservice syntax or the '-n' parameter must be added to negate the dependency.

    For example: sdeservice -o create -p sdepasswd -d ORACLE9I,<ORACLE_SID> -n -i esri_sde.
    Add matching service name and port number into both SDEHOME and OS services files:
    ArcSDE connections to the database are managed by the application server process known as the 'giomgr'. Add a line to the following files on the ArcSDE server to assign a port for the service/process to run on:

    WINDOWS:
    %SDEHOME%\etc\services.sde
    %WINDIR%\system32\drivers\etc\services

    UNIX:
    $SDEHOME/etc/services.sde
    /etc/services

    For Oracle to connect to a remote instance, Oracle has defined an environment variable to identify the remote Oracle instance through the Net service name.
    Windows
    If the ArcSDE server is on Windows, set LOCAL to the Oracle Net service name in the SDEHOME\etc\dbinit.sde file.
    For example, set LOCAL=netservicename.

     The dbinit.sde file should have the LOCAL setting added after the ArcSDE service has been created with the sdeservice command. If the ArcSDE service is created after the dbinit.sde file is updated, it overwrites it with an ORACLE_SID setting. The SDEHOME\etc\dbinit.sde file should not contain the following line - set ORACLE_SID=<SID>.

    UNIX
    If the ArcSDE server is on UNIX, set TWO_TASK to the Oracle Net service name. The ORACLE_HOME variable must also be set.

     TWO_TASK (for UNIX/Linux) and LOCAL (for Windows) are Oracle environment variables. Refer to Oracle documentation for further information.


    The TNS_ADMIN variable must be set if the default location of the tnsnames.ora file is not used.

     If Oracle connection errors are received, check if the TNS_ADMIN variable has been set and to where it points. Set the TNS_ADMIN variable to see if it resolves the problem. Check that the tnsnames.ora file is accurate. Check that the ORACLE_HOME variable has been set. When the ArcSDE server is started, the giomgr process reads the variable settings in the $SDEHOME/etc/dbinit.sde file. These variable settings override the variables set by .cshrc or .profile files. The role of the dbinit.sde file is further explained in the book titled, 'Managing ArcSDE Services (prior to 9.1)' or within the ArcGIS 9.2 Desktop Web Help topic link in the Related Information section of this article.
    Start ArcSDE, as per the installation guide. Also see 'Starting a remote ArcSDE service on Windows' in the Related Information section of this article.

Source : http://support.esri.com/ja/knowledgebase/techarticles/detail/23753


Thanks.
Technical Articles

FAQ:  How can ArcSDE performance be improved?
Article ID:     24518
Software:      ArcSDE 8.3, 9.0, 9.1, 9.2, 9.3, 9.3.1, 10, 10.1
Platforms:     N/A
Question
How can ArcSDE performance be improved?

Answer
ArcSDE performance can be improved by analyzing the spatial data and rebuilding their indexes. Analysis of tables and rebuilding of indexes are extremely important for regular maintenance of versioned Geodatabases. Performed regularly, these two functions can help keep performance of the versioned Geodatabase at a maximum.

Below are scripts (for Oracle and SQL Server) that perform the following:

1) Rebuild every index by any user that owns SDE data.
2) Analyzes the schema of each user that owns SDE data.

 If any tables are owned by users who don't own any actual layers, then this script will need to be modified.

These scripts are not a solution for every performance related ArcSDE issue,
but are something that should be done on a regular basis as scheduled maintenance.

 Analyzing the data should be done regularly on a dataset that is changing. This updates the statistics that are used by the Oracle Cost Based Optimizer, to work out the best execution plan for SQL. ArcSDE contains features in the underlying SQL that rely on the Oracle Cost Based Optimizer, and rely on the statistics being up-to-date. Also, be advised there are other scripts and tools for these types of operations. For example, Oracle tools can be used to update the stats and rebuild the other indexes when appropriate.



Oracle 8i/9i/10G (needs to be run as the 'SYS' user) :

SET SERVEROUTPUT ON

DECLARE

    CURSOR Owner_Cur IS
        SELECT DISTINCT(OWNER) owner
    FROM sde.table_registry
    ORDER BY owner;

    CURSOR Index_Cur IS
        SELECT owner, index_name
        FROM dba_indexes
        WHERE owner IN
             (SELECT DISTINCT(owner)
          FROM sde.table_registry)
        AND INDEX_TYPE = 'NORMAL'
        ORDER BY owner, index_name;

    SQL_STMT VARCHAR2(200);

BEGIN

    DBMS_OUTPUT.ENABLE (100000);

    FOR IndexRec IN Index_Cur LOOP
        SQL_STMT := ('ALTER INDEX ' || IndexRec.owner || '.' || IndexRec.index_name || ' REBUILD');
    DBMS_OUTPUT.PUT_LINE(SQL_STMT);
        EXECUTE IMMEDIATE SQL_STMT;
        DBMS_OUTPUT.NEW_LINE;
    END LOOP;

    FOR OwnerRec IN Owner_Cur LOOP
        DBMS_OUTPUT.PUT_LINE('Analyzing schema : ' || OwnerRec.owner);
        DBMS_STATS.GATHER_SCHEMA_STATS(OwnerRec.owner);
        DBMS_OUTPUT.NEW_LINE;
    END LOOP;

END;

/





SQL Server 2000/2005 - Single Database Model (needs to be run as the 'SA' user or as a 'DBO' user - depending on how the SDE
Respository has been created) :

-- Rebuild indexes on tables for all owners in the table registry.
-- ***************************************************************
--  Run under the Database that contains the SDE Repository tables.
--  If the SDE schema is owned by 'DBO', change:
--  select distinct owner from SDE.sde_table_registry
--  to
--  select distinct owner from DBO.sde_table_registry

use <Admin_Database>

Declare @OwnerName varchar(50)
Declare @TableName varchar(50)
Declare @QualifiedName varchar(100)

Declare OwnerCursor cursor for
select distinct owner from SDE.sde_table_registry

open OwnerCursor
Fetch OwnerCursor into @OwnerName
while (@@fetch_status=0)
begin
 Declare TableCursor cursor for
 -- Get all the tables for this user
 select so.name from sysobjects so join sysusers su on so.uid = su.uid  where type = 'U' and su.name = @OwnerName
 open TableCursor
 Fetch TableCursor into @TableName
 while (@@fetch_status=0)
 begin
  set @QualifiedName = @OwnerName + '.' + @TableName
  print 'Rebilding indexes on  : ' + @QualifiedName
  dbcc dbreindex(@QualifiedName) WITH NO_INFOMSGS
  print 'Updating Statistics on: ' + @QualifiedName
  EXEC ('UPDATE STATISTICS ' + @QualifiedName )
  print ''
  Fetch TableCursor into @TableName
 end
 Fetch OwnerCursor into @OwnerName
 close TableCursor
 Deallocate TableCursor
end
close OwnerCursor
Deallocate OwnerCursor




 To obtain the <Admin_Database>, execute the 'sdeservice -o list ...' command directly on the SDE Server.



SQL Server 2000/2005 - Multiple Database Model (needs to be run as the 'SA' user or as a 'DBO' user - depending on how the SDE
Respository has been created) :

-- Rebuild indexes on tables for all owners in the table registry.
-- ***************************************************************
--  Run under the Database that contains the SDE Repository tables.
--  If the SDE schema is owned by 'DBO', change:
--  select distinct owner from SDE.sde_table_registry
--  to
--  select distinct owner from DBO.sde_table_registry

--  In a Multiple Database Model, you need to run this script in
--  every database that contains data registered with ArcSDE.

use <Database_where_spatial_data_resides>

Declare @OwnerName varchar(50)
Declare @TableName varchar(50)
Declare @QualifiedName varchar(100)

Declare OwnerCursor cursor for
select distinct owner from SDE.SDE.sde_table_registry
open OwnerCursor
Fetch OwnerCursor into @OwnerName
while (@@fetch_status=0)
begin
 Declare TableCursor cursor for
 -- Get all the tables for this user
 select so.name from sysobjects so join sysusers su on so.uid = su.uid  where type = 'U' and su.name = @OwnerName
 open TableCursor
 Fetch TableCursor into @TableName
 while (@@fetch_status=0)
 begin
  set @QualifiedName = @OwnerName + '.' + @TableName
  print 'Rebilding indexes on  : ' + @QualifiedName
  dbcc dbreindex(@QualifiedName) WITH NO_INFOMSGS
  print 'Updating Statistics on: ' + @QualifiedName
  EXEC ('UPDATE STATISTICS ' + @QualifiedName )
  print ''
  Fetch TableCursor into @TableName
 end
 Fetch OwnerCursor into @OwnerName
 close TableCursor
 Deallocate TableCursor
end
close OwnerCursor
Deallocate OwnerCursor





 To obtain a list of all the databases that contain data registered with ArcSDE, execute the following query:

select distinct(database_name) from SDE.SDE.sde_table_registry;
go

Source :

http://support.esri.com/de/knowledgebase/techarticles/detail/24518


Thanks.