?? ???? ?? ????????? ?????, ?? ?????-??? ?????? ????????? ?? ??????? ?? ????? ???? ?? ??? ???? ????

???? ?????? ???? ??????
???? ID: 240867 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

??????

?????-??? ?????? ?? ??????????? ???? ???????? ??? ???? SQL Server ???????? ?????-??? ?????? ?? ??????????? Microsoft ??? ???? ?? ?????? ???? ?? ?? ??? ??????? ??? ???????? ???? ???? ?????-??? ?????? ??????? ?? ???? Microsoft SQL Server ????????????? ?? ????? ???????????? ???? ???? ??? ??, ?? ????? ???? ?? ???? ????? ?? ???????????? Transact SQL ??? ?? ??? ?? ???? ?? ??? ?? ?????-??? ?? ???????????? ???? ?? ??? ??????? ?? ?????? ?????? ??? ?? ????????????? ?? ???????????? ????????, ?? ??? ???? ?????? ???-??? ?????????? ?????-??? ??????? ???? Microsoft Windows NT ?????? ?????????? ?? ???? Microsoft ?? ??? ?? ???? ??? ?????-??? ?????? ??????? ?? ??????

????? ?????-??? ???????? ???? ?? ??? ?? SQL Server ??????? ?? ????? ???? ???? ?? ????, ?????? ?? ??????? ?? ?????-??? ??? ?? ??? ???????? ?? ??? ???-????? ??????? ?? ????? ?? ????? ??? ?? ??? ????, ?? ?? ???? ?? ?? ????, ?? ??? ?? ???? ?? ??? ??, ?? ?? ?????-??? ?????? ?? ???? ??????? ??????? ???????????? ????? ??? ?????-??? ?????? ?? ??? ????? ??? ???????? ?? resynchronization ?? ???? ??????? ?????? ????? ?? ???? ??? ?? ???? ?? ??????? ???????? initiating ???? ?????? ?? ????????? ????? ?? ?? ???? ?? ??? ????? ?? ???? ??? ?? ???? ???? ?? ????? ???? ??? ?? ???? ?? ?? ?????????? ???????? avoids.

?? ???? ??? ?? ??????? ?? ????????? ?????, ?? ????, ?? ??? ?? ???? ?? ?????-??? ?????? ????????? ?? ??????? ??? ??? ???????? ?? ???????????? ???? ?? ??? ????? ?? ???? ??? ?? ?????????:
  • SQL ????? ??????? ?? ????? ?? ??? ??? ?? ???? ????
  • ?????-??? ?????? ????????? ?? ??????? ???? ??????? ?????? ?? ???? ??????
  • ?????-??? ?????? ????????? ?? ??????? ?????? ??? ???? ??? ??? ?? ??????? ?? ????????
  • ?????????? ?? ?????-??? ????? ??????? ?? ?????? ?????????? ???? ??????? ????? ?? ???? ?? ?? ?? ???? ?? ????? ?? ??? ?????? ?? ?????-??? ?? ????????? ??????
???????:?? ???????????? ?? SQL Server ?????? ??????? ?????????? ?? ??????? ???? ????

?????-??? ?????? ?? ????????? ?? ??????? ?? ?????? ?? ??? ??? ???? ??? ?????-??? ?????? ?? ??????? ????? ?? ??? ???:

Microsoft SQL Server 7.0:
\Mssql7\FTDATA

Microsoft SQL Server 2000:
??????? ??????: ????????? Files\Microsoft SQL Server\MSSQL\FTDATA
??????? ???: ????????? Files\Microsoft SQL Server\MSSQL $ instancename\FTDATA

?????-??? ?????? ???????? ?? ???? ?????? ??????? ????? ?????? ????? ?? ????? ???? ?? ?? ???? ??????? ?? ??????? ???? ??? ????dbid??????? ??????? ?????????? ?? ?? ????ftcatid?????-??? ?????? ?????????? ??:

"SQLxxxxx (dbid) yyyyy (ftcatid)"

????????ftcatid??????? ??????? ??? ??????? ???

???????????? ???, ????, ?? ????? ?? ????????? ?? ??????? ???? ?? ??? ????? ????? ??? ???? ???????, ??? ?? ????????? ?? ??? ??? ?? ??????? ???? ??? ?? ????? ???????? ??????? ?? ???? ???.. ?????, ????????? ???? ?? ?? ?? ????? ?? ??????????? ???? ???? ???.. ?????? ??????? ?? ???, ????????? ?? ??????? ???? ?? ???? ???? ??? ?? ???.. ???, ??? ??? ?????? ??????? ???? ?? ?? ?? ????????? ?? ???????????? ?? ???? ???.. ????????? ?? ??? ?? ???? ?? ???????????? ???? ?? ????? ?? ???? ??? ???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
322756??? ?? ???? ?? Windows ??? ????????? ?? ???????????? ???? ????

??????-???? ???????? ?? ???? ??????? ?? ??? ?????-??? ?????? ?? ????? ?? ???

  1. ??????-???? ???????? ?? Microsoft ??? ???? ?? ??? ????? ??? ????? SQL ????? ???????????, ?? ??? ?????-??? ?????? ?????? ???? ???? ?? Microsoft ??? ???? ?????, ?? ??? ?? ?????-??? ?????? predicates CONTAINS ?? FREETEXT, ?? ????? ???? ???? ??? ???? ???? ?? rowset valued ?????? CONTAINSTABLE ?? FREETEXTTABLE ??????? ?? ???? ??? ??, ?????-??? ??? ???????? ??? ? ???, ?? ???? ????? ?????? ????? ??????? ???? ??:
    ?????: ????? 7602, ???? 16, ?????? 1, ?????? 2 ?????-??? ???? (Microsoft ???) ?????? ???? ??? ?????? ?????????? ?? ???? ?? ??????? ???? ?????? ???
  2. ?? Microsoft Windows NT ????? ?????? ????? ?????? ?? ?????, ???? Exec ????? ??, ?? ??? ?????? ?? ?????-???, ?????????, ?? files.The ?????-??? ?????? (???? ?? ??? ?????? ???? ?? ????? ???sysfulltextcatalogs) SQL Server ??????? ?? ???? ???
  3. ????? ????????? ???????????? ?? ????? ???? ??? ???? ?????? ????? ?????? ???-???:
    \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Applications\SQLServer\Catalogs\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\CatalogNames\SQLServer\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gather\SQLServer\[FT_Catalog_Folder] [FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gathering Manager\Applications\SQLServer\Projects\ \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Indexer\SQLServer\[FT_Catalog_Folder]
    [FT_Catalog_Folder] ?? ?????? ??????? ??? "SQLxxxxx (dbid) yyyyy (ftcatid)"
    SQL ????? ?? ??? ??????, ?? ??? ????????? ????????? ?? \SQLServer$InstanceName\.
  4. 2. ???? ????? ????????? ???????????? ?? ??? ?? ??? ?????? ???? ?? ???: (?? backs ??? ?????-??? ?????? ?? ????? ??.)
    \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Applications\SQLServer\Catalogs \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\CatalogNames\SQLServer \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gather\SQLServer \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gathering...
    SQL ????? ?? ??? ??????, ?? ??? ????????? ????????? ?? \SQLServer$InstanceName\.

?? ?? ??????? ?????? ?? ?? ?? ???? ????? ?? ?????-??? ?????? ?? ???????????? ???? ?? ???

  1. Microsoft ??? ???? ?????????:??? 2 ????? ???? ??? ??????? ????? ?? ?? ??? ??????, ??? 3 ?? ?????
  2. ???????????? ???? ?? ??????? ??? ???? ?? ?????-??? ????? ??????? ????? ??????? ???????????? ???? ?? ??? ????????? ???? ?? ??????? ID (dbid) ?? ?? ???? ?? ?? ?? ?? ????? ??? ??????
    ???:??? ??????? ?? ????? ???? ?? ??????? ???? ???sp_attach_db????, ????????? ???? ?? ?? ?????exec sp_fulltext_database'?????' ?????-??? ?? ??? ??????? ?? ????? ???? ?? ??? ???? ????
  3. Dbid ????????? ????, ????? ??? ?????:
    Use dbname
    go
    select db_id()
    ???:???-??? ?????? ?? ???????????? ???? ?? ??? 4 ??? ?? ???? ????? ??? ?????? ?? ???????????? ???? ?? ??? ??? 5 ?? ?????
  4. ???????????? ????????? ???????????? ?? ????? ???? ????? ????????? ?? ?????? ??? ?? ?? ??? ?? ?????? ???? ?? ???? ???? ????????? ?? ????? ???? ?? ??? ?? ?????
    \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Applications\SQLServer\Catalogs\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\CatalogNames\SQLServer\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gather\SQLServer\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gathering Manager\Applications\SQLServer\Projects\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Indexer\SQLServer\[FT_Catalog_Folder]
    [FT_Catalog_Folder] is the catalog folder name "SQLxxxxx(dbid)yyyyy(ftcatid)"
    For a named instance of SQL Server, the registry entry is \SQLServer$InstanceName\.
  5. To restore all catalogs on the server, restore the following registry entries. You may want to back up your registry before you try this step.
    \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Applications\SQLServer\Catalogs \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\CatalogNames\SQLServer \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gather\SQLServer \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gathering Manager\Applications\SQLServer\Projects \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Indexer\SQLServer
    For a named instance of SQL Server, the registry entry is \SQLServer$InstanceName\.
  6. Restore the catalogs from backup to the default location that you backed it up from.
  7. Restart the Microsoft Search service.
  8. Confirm that the new full-text catalogs folders and files are functional by using a Transact-SQL SELECT statement and use a CONTAINS or FREETEXT predicate in the WHERE clause.

To move or copy full-text catalogs between local drives or paths on the same computer that is running SQL Server

  1. Confirm the full-text catalog name and local drive or path by using sp_help_fulltext_catalogs 'FT_Catalog_Name'. Record the full-text catalog drive letter and fully qualified path to use later.
  2. Stop the Microsoft Search service. Perform step 3 and 4 only if the database was dropped or if the catalog was deleted, otherwise, go to step 5.
  3. ???????????? ???? ?? ??????? ??? ???? ?? ?????-??? ????? ??????? ????? ??????? ???????????? ???? ?? ??? ????????? ???? ?? ??????? ID (dbid) ?? ?? ???? ?? ?? ?? ?? ????? ??? ??????

    ???:??? ??????? ?? ????? ???? ?? ??????? ???? ???sp_attach_db????, ????????? ???? ?? ?? ?????exec sp_fulltext_database'?????' ?????-??? ?? ??? ??????? ?? ????? ???? ?? ??? ???? ????

    Dbid ????????? ????, ????? ??? ?????:
    Use dbname
    go
    select db_id()
  4. ????? ????????? ???????????? ?? ???????????? ????? ?? ?? ??? ?? ?????? ???? ?? ???? ???? ????????? ?? ????? ???? ?? ??? ?? ?????
    \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Applications\SQLServer\Catalogs\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\CatalogNames\SQLServer\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gather\SQLServer\[FT_Catalog_Folder] [FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gathering Manager\Applications\SQLServer\Projects\ \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Indexer\SQLServer\[FT_Catalog_Folder]
    [FT_Catalog_Folder] ?? ?????? ??????? ??? "SQLxxxxx (dbid) yyyyy (ftcatid)"
    SQL ????? ?? ??? ??????, ?? ??? ????????? ????????? ?? \SQLServer$InstanceName\.
  5. ??? ?????? ?? ?????-??? ??????? ?????? ?? ?? ?? ????????? ?????-??? ?????? ?? ?? ????? ?? ????????? ?????
  6. ?????? ?????? ?????? ?????? ?????? ???????? ????????? ?? ????? ??sp_configure?? ??????? ?? ??? ???: ???????? ????, ?? ???? ??? ?????? ????[database_name]. dbo.sysfulltextcatalogs?? ??????? ?????? ?? ?? ?????? ?????-??? ?????? ???????? ??????? ?? ???, ???? d:\FTData ???? ?? ??? ?? ??????
  7. Windows NT 4.0 ?????? ??? ?? ????? ????regfind(?????? ?? ???, SQL0000500005) ?????? ??????? (FT_Catalog_Folder) ?????? ?? ?????? ?? ????? HKLM ????????? ????? ??? ???????? ?????-??? ?? ??? ??? ???? ?? ???:
    \SOFTWARE\Microsoft\Search\1.0\Gather\SQLServer\[FT_Catalog_Folder] [FT_Catalog_Folder] \SOFTWARE\Microsoft\Search\1.0\Gathering Manager\Applications\SQLServer\Projects\ \SOFTWARE\Microsoft\Search\1.0\Indexer\SQLServer\[FT_Catalog_Folder]
    ??? ??, ???? ?????? ????? ?? ????? ???? ?? ??? ????????? ???? ?? ("") ????? ?? ??? ????????? ???????? ?? ??? ???? ?? ???-p, ??-r????????? ?????? ?? ???::
    -m \\server_2 -p "<Key Name>" <Old_FT_Catalog_Path_and_Folder> -r <New_FT_Catalog_Path_and_Folder>

    ???: ????? <key name="">, <old_ft_catalog_path_and_folder>, ?? <new_ft_catalog_path_and_folder>???? ???. ?? ???</new_ft_catalog_path_and_folder></old_ft_catalog_path_and_folder></key>
    ?????? ?? ???::-m \\server_2 -p "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Indexer\sqlserver$SQL2k\SQL0000500005" d:\programme\Microsoft SQL Server\MSSQL $ SQL2K\FTDATA\SQL0000500005 - r d:\programme\Microsoft SQL Server\MSSQL $ SQL2K\FTDATA\New Location\SQL0000500005

    ????? ???? ?? ??? ???????? ?? ???? ??? ???? ??????? ?? ???regfind??????, DOS ????? ????????? ?? ????? ???????? ???? ????:regfind /?
  8. Microsoft ??? ???? ?? ???????? ?????
  9. ?? ?????? ???? ?? ??? ?????-??? catalogs ????????? ?? ??????? Transact SQL SELECT ??? ?? ????? ???? ???????? ??? ?? ???? ??? ??? CONTAINS ?? FREETEXT predicate ?? ????? ?????

?????? ?? ?? ?? ??????? ?????? ?? ?? ?? ?????????? SQL ????? ?? ??? ?????-??? ?? ????????? ????? ?? ???

????? ????? ??? ?? ???? ?? SQL ????? ?? ??? ?? ?? ?? ???????? ?? ??? ?????-??? ?????? ??????? ?? ??????? ????????? ???? ?? ??? ???? demonstrate (server_1) ?? ???? ???? ???????? ?? ??? SQL Server (server_2) ?? ??? ??? ?? ???? ????? ?? SQL ????? ?????-??? ??? ??????? ?? ?? ?? ???? ??????? ?? ?????? ?????????? ????? ????? ?? ????? ??? ????? SQL ????? ?? ?? ?????? ?? ?????-??? ?????? ?? ??? ?????????, ?? ??? ??????? IDs ???? ?? ?????? ?????, ??? ?? server_2 (????????? ?????? ?? ??? ??? ??? ??????) ?? ??? ??????????? ?? ???? replica (clone) server_1.Confirm ?? server_1 ?? server_2 ?? dbids ??? ?? ?? ?? ????? ??? ???? ?? ???, ????? ????? ?? ????? ???? ?????:
Use dbname
go
select db_id()
"????" dbids server_2 ?? ??? dbid ??????? ???? ?? ???, ?? ?????sp_detach_db, ??sp_attach_db??? ???? ?? ??? ?? ??? ??????? re-attach ???? ?? ???? ?????? ?? ???, ??? ???? ??? ?? ???????, ????TestDB(dbid = 7) ??PerfDB(dbid = 8), ???????, ????? ??? ???? ?? ?????? ???.re-attachPerfDB???????, ?? ???TestDB???????:. ?? dbids swaps: dbid ?? ???TestDB8 ?? ?? ??? dbid ?? ???? ??PerfDB7 ?? ???? ??? ?????? dbids ?? ??? ??? ??????? dbid ???? ????? ????? ???? ???? ???

?????????? ???? ?? ???:?????? ???? ??????? ?? ???, ????????? ???? ?? ????? ??????? ??? ?????-??? ?????? ???? ??? ???? ?? ?? ?? ?? ?? ?????-??? ????? ???? ???? ?? ????? ??? ? ?? ??????? ? "clean-?? ????????????" ?????? ?????-??? ?????? ???? ?? ???? ??????? ?? ??? ?????-??? ?? ????? ???? ?? ??? ????? ?? ????
  1. ?? ?? ?????? ????master.dbo.sysdatabases?????-??? ????? ??????? ?? ??? dbid ??? ??????? ????? ?? ???? ????
  2. ?? ?? ?????? ????[database_name]. dbo.sysobjectsID ??? ?? ?????-??? ????? ???????? ?? ??? ??????? ????? ?? ???? ???? ???? ?????? ID ??? ??????? ???? ?? ??? ???? ???? ?? ???? ??? ???? ??????? ?? ??? SQL Server ???????? ??? "object_id" ???? ?? ??????
  3. ?????? ???? ?? ?????-??? ?????? ??? ?? ??????? ?????? ?? ?? ??? ??????? ????? ?? ???? ?? ????? ??sp_help_fulltext_catalogs'FT_Catalog_Name'.
  4. Server_1 ?? server_2 ?? Microsoft ??? ???? ?? ??? ?????
  5. ??????? ?????? ?? server_2 ?? ?? server_1 ?? ?? ?????? ????? ?? ??? ?????
  6. ?????-??? ?????? ??????? ?? ??????? ?????? ?????? ??? 3 ??? ?? ????????? server_1 server_2 ???? ?? ??? DOS ???? ?? ????? ??xcopy. ?????? ????? ?? ??? ??? ????? ????? ?? ?? ?????-??? ?????? ?? ??? ??? ?? ?????? ?? ?? ?? ??????? ??? ?? ??? ??? ???? ??? ??????????? ?????-??? ?????? ?????? ?? ?? ?? ??????? ??? ?? ????? ????? ??? server_2 ?? ?????? ?????? ????? ???? ??, ?? ?????xcopy????? ???? ??/I, ??/E??? ?????? ??????? ?????? ??? ?????? ?? ???????????? ???? ?? ??? server_2 ???? ?? ??? ?????? ?? ??? ???????? ?? ????????? ??????
  7. DOS ???? ?? ????? ?? ???? ???RMDIR /S /Q [FT_Catalog_drive/??]?? server_1 server_1 ?? ?????-??? ?????? ??????? ?? ??????? ?? ??? ???

    ???:???-??? ?????? ?? ???????????? ???? ?? ??? ??? 8 ?? ???? ????? ??? ?????? ?? ???????????? ???? ?? ??? ??? 9 ?? ?????
  8. ????????? ????????????, ?? ?????? ????????? ?? ?????? ????? ???????????? ????? ?? ?? ??? ?? ?????? ???? ?? ???? ???? ????????? ?? ????? ???? ?? ??? ?? ?????
    \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Applications\SQLServer\Catalogs\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\CatalogNames\SQLServer\[FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gather\SQLServer\[FT_Catalog_Folder] [FT_Catalog_Folder] \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gathering Manager\Applications\SQLServer\Projects\ \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Indexer\SQLServer [FT_Catalog_Folder]
    [FT_Catalog_Folder] ?? ?????? ??????? ??? "SQLxxxxx (dbid) yyyyy (ftcatid)"
    SQL ????? ?? ??? ??????, ?? ??? ????????? ????????? ?? \SQLServer$InstanceName\.
  9. ????? ?? ??? ?????? ?? ???????????? ???? ?? ??? ????? ????????? ???????????? ?? ???????????? ????? ???????, ??? ?? ??? ????, ?? ?? server_2 ?? ??? ?????? ?????? ?? ??? ?? ???? ???? ?? ???? ?? ?? ??? ?? ?????? ???? ?? ???? ???? ????????? ?? ????? ???? ?? ??? ?? ?????
    \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Applications\SQLServer\Catalogs \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\CatalogNames\SQLServer \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gather\SQLServer \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Gathering...
    ???:By default, the locations of full-text binaries are:
    SQL Server 7.0: \Mssql7\FTDATA
    Microsoft. SQL Server 2000 default instance: \Program Files\Microsoft SQL Server\MSSQL\FTDATA
    SQL Server 2000 named instance: MSSQL$InstanceName\FTDATA
    These locations and folder paths may vary for different computers. In this case, you must change two registry entries so the paths point to the correct location of the full-text binaries after you complete the restore on server_2.
    \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\CatalogNames\SQLServer \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search\1.0\Indexer\SQLServer
    ?? ????? ?? ???? ???regfind?????? ????????? ???????????? ?? ?????? ?? ?????-??? ????????? ?? ?????? ????????? ???? ?? ??? ???
  10. ????? ????? ?? Microsoft ??? ???? ?? ???????? ?????
  11. ?? ?????? ???? ?? ??? ?????-??? catalogs ????????? ?? ??????? Transact SQL SELECT ??? ?? ????? ???? ???????? ??? ?? ???? ??? ??? CONTAINS ?? FREETEXT predicate ?? ????? ?????

???? ???????

????????? ???? ?? ????? SQL Server ????????? ?? ???? ?? ???? ?? "" ??? ?????-??? ?????? ??????? ?? ???????? SQL Server 7.0 (server_1) ?? ???? ???? ???????? ?? SQL Server 7.0 (server_2) ?? ??? ?? ?? ???? ???? ??????? ?????? ?? server_2 ?? ?? ????? ?? ???? ?? ???? ????? ?? SQL Server 7.0 ?? ??? ?????-??? ??? Windows NT 4.0-?????? ???????? ?? ??????? ??, ?? ?? ?? ??? ??????? ?? ?????? ?????????? ????? ????? ?? ????? ???

?? illustration ?? ????????? ?? ???Pubs(dbid = 5) ??????? ?? ??????pub_info(id = 645577338) ????? ???? ??? ?? ????? ????? ?? ????????? ?????-??? ???? Server_2 ?? ???? ????? ??? ?? ?????, ?? ???? ?????-??? ?????? ??????? ?? ??? ?? ?????? ?? ?? ?? ??? ?????-??? ?????? ??????? ?? ??? ?? ?????? ?? ?? ??????

?? ????? ?? ??????? ?????????? ???? ?? ????? ?? ??? ??? ??? ?? ?? SQL ????? ?? ????? ???? ?????sysadmin????? ??? (?? "sa" ?? ??? ??? ??? ??)? ??? ??, ?? ???? ??????? ?????? (DBO) ????? SQL ????? ?? ????? ?? ??? ??????? ?? ??????????

????? ????? ?? ?? SQL Server ????????? ?????:
use pubs
go
sp_fulltext_service 'clean_up'
go
sp_fulltext_database 'enable'
go

-- Creates and activates the full-text catalog: PubInfo, if it does not exist.
-- Drops, re-creates and activates the full-text catalog: PubInfo, if it does
-- exist.
IF OBJECTPROPERTY ( object_id('pub_info'),
                    'TableHasActiveFulltextIndex') = 1
BEGIN
    print 'Table pub_info is Full-Text Enabled, dropping Full-Text Index
& Catalog...'
    EXEC sp_fulltext_table 'pub_info', 'drop'
    EXEC sp_fulltext_catalog 'PubInfo', 'drop'
    print 'Table pub_info is NOT Full-Text Enabled, creating FT Catalog,
Index & Activating...'
    EXEC sp_fulltext_catalog 'PubInfo', 'create'
    EXEC sp_fulltext_table 'pub_info', 'create', 'PubInfo', 'UPKCL_pubinfo'
    EXEC sp_fulltext_column 'pub_info', 'pub_id', 'add'
    EXEC sp_fulltext_column 'pub_info', 'pr_info', 'add'
    EXEC sp_fulltext_table 'pub_info', 'activate'
END
ELSE IF OBJECTPROPERTY ( object_id('pub_info'),'TableHasActiveFulltextIndex') = 0
BEGIN
    print 'Table pub_info is NOT Full-Text Enabled, creating FT Catalog,
Index & Activating...'
    EXEC sp_fulltext_catalog 'PubInfo', 'create'
    EXEC sp_fulltext_table 'pub_info', 'create', 'PubInfo', 'UPKCL_pubinfo'
    EXEC sp_fulltext_column 'pub_info', 'pub_id', 'add'
    EXEC sp_fulltext_column 'pub_info', 'pr_info', 'add'
    EXEC sp_fulltext_table 'pub_info', 'activate'
END
go -- Confirm Database ID, Object ID, FT Catalog ID and FT folder(default)
   -- location.
select dbid, name from master.dbo.sysdatabases where dbid = DB_ID('pubs')
-- dbid = 5
go
select id, name from pubs.dbo.sysobjects where id = object_id('pub_info') 
go
sp_help_fulltext_catalogs 'PubInfo' 
go
sp_help_fulltext_tables 'PubInfo', 'pub_info' 
go
sp_help_fulltext_columns 'pub_info' 
go
exec master..xp_cmdshell 'dir d:\MSSQL70\FTDATA'
go

--- After full-text is enabled and activated, start full crawl/population
BEGIN
SET NOCOUNT ON
EXEC sp_fulltext_catalog 'PubInfo', 'start_full'
--
--  Wait for crawl to complete
--  NOTE: Forlarger tables, increase the WAITFOR DELAY time appropriately
--
DECLARE @status int, @itemCount int, @keyCount int, @indexSize int
SELECT @status = FullTextCatalogProperty('PubInfo', 'populatestatus')
WHILE (@status <> 0)
BEGIN
  WAITFOR DELAY '00:00:01' -- wait for 1 second before checking FT
                           -- Populatestatus...
  SELECT @status = FullTextCatalogProperty('PubInfo', 'populatestatus')
END
WAITFOR DELAY '00:00:05' -- wait for 5 seconds to receive correct FT Property
                         -- info (add more time for larger tables)...
SET @itemCount = FullTextCatalogProperty('PubInfo', 'itemcount')
SET @keyCount = FullTextCatalogProperty('PubInfo', 'uniquekeycount')
SET @indexSize = FullTextCatalogProperty('PubInfo', 'indexsize')
PRINT 'Nbr. of Rows FT Indexed = ' + CAST((CONVERT(varchar(10), @itemCount)
- 1) as varchar(12)) + char(09) + 'Nbr. of Unique FT Words = '
+  CONVERT(varchar(10), @keyCount) + char(09)
SET NOCOUNT OFF
END
go

-- Confirm FT population, 1 row should be returned (pub_id = 0736). 
SELECT pub_id, pr_info FROM pub_info WHERE CONTAINS(pr_info, 'moon')
go

-- Stop the Microsoft Search service on both servers
exec master..xp_cmdshell 'net stop "Microsoft Search"'
go
????? ????? (server_1) ?? ?? SQL Server ????????? ?????:
use pubs
go
-- Map a Drive letter to the destination server.
exec master..xp_cmdshell 'NET USE K: \\server_2\[drive]$'
go
-- Copy the destination server's FT catalog folder and files as a backup.
exec master..xp_cmdshell 'ROBOCOPY K:\MSSQL70\FTDATA\SQL0000500005
K:\MSSQL70\BACKUP\SQL0000500005 /E /NP'
go
-- Remove the destination server's full-text catalog folder and files.
exec master..xp_cmdshell 'RMDIR /S /Q K:\MSSQL70\FTDATA\SQL0000500005'
go
-- Copy the SOURCE full-text catalog folder and files to the destination server's
NEW full-text catalog location.
exec master..xp_cmdshell 'ROBOCOPY D:\MSSQL70\FTDATA\SQL0000500005
K:\FTData\SQL0000500005 /E /NP'
go
-- Restart the Microsoft Search service.
exec master..xp_cmdshell 'net start "Microsoft Search"'
go
-- Remove the mapped drive letter to the destination server, for example
-- K:\.
exec master..xp_cmdshell 'NET USE K: /delete'
go
????? SQL ????????? ????? ????????????????? (server_2):
use master
go
-- Enable system table updates.
sp_configure allow,1
go
reconfigure with override
go

use pubs
go
-- Record full-text catalog information (Note: path = NULL)
select * from sysfulltextcatalogs
go
-- Update the full-text catalog information with the new full-text catalog location
UPDATE sysfulltextcatalogs set path = 'E:\FTData'
   WHERE ftcatid = 5
go
-- Record full-text catalog info. (Note: path = E:\FTData)
select * from sysfulltextcatalogs
go

use master
go
-- Disable system table updates.
sp_configure allow,0
go
reconfigure with override
go

-- CAUTION: Back up your registry hive before you contine!

-- Search and replace HKLM "Gather" registry keys with new full-text catalog
-- folder location [10 row(s) affected]:
exec master..xp_cmdshell 'REGFIND -m \\server_2 -p
\Registry\Machine\SOFTWARE\Microsoft\Search\1.0\Gather\SQLServer\SQL0000500005
"E:\MSSQL70\FTDATA\SQL0000500005" -r "E:\FTData\SQL0000500005"'
go
-- Search and replace HKLM "Gatherer Manager" registry keys with new FT
-- catalog folder location [6 row(s) affected]:
exec master..xp_cmdshell 'REGFIND -m \\server_2 -p
"\Registry\Machine\SOFTWARE\Microsoft\Search\1.0\Gathering
Manager\Applications\SQLServer\Projects\SQL0000500005"
"E:\MSSQL70\FTDATA\SQL0000500005" -r "E:\FTData\SQL0000500005"'
go
-- Search and replace HKLM indexer registry keys with new FT catalog folder
-- location [6 row(s) affected]:
exec master..xp_cmdshell 'REGFIND -m \\server_2 -p
"\Registry\Machine\SOFTWARE\Microsoft\Search\1.0\Indexer\SQLServer\SQL0000500005"
"E:\MSSQL70\FTDATA\SQL0000500005" -r "E:\FTData\SQL0000500005"'
go

-- Restart the Microsoft Search service
exec master..xp_cmdshell 'net start "Microsoft Search"'
go

-- Confirm FT population, 1 row should be returned (pub_id = 0736). 
use pubs
go
SELECT pub_id, pr_info FROM pub_info WHERE CONTAINS(pr_info, 'moon')
go
?? ?? ???? ??? "???" ?????? ??? ??? ?????-??? ???????? ????? SQL Server ??? ?? ??? ??:

??????????? ?????? ???? ?? ??? ????????? ?? ?????? ?? ????? ?? ?????-??? ?????????? ???? ?? ????????, ?????? ?? ?????-??? ?? ???? ?? ???? ?? ?? ???? ??!
-- Run the following code after starting full crawl/population through another connection.
use pubs
go
BEGIN
SET NOCOUNT ON
EXEC sp_fulltext_catalog 'PubInfo', 'stop'

-- Wait for crawl to stop

--  NOTE: For larger tables, increase the WAITFOR DELAY time appropriately

DECLARE @status int, @itemCount int, @keyCount int, @indexSize int
SELECT @status = FullTextCatalogProperty('PubInfo', 'populatestatus')
WHILE (@status <> 0)
BEGIN
  WAITFOR DELAY '00:00:01' -- wait for 1 second before checking FT
                           -- Populatestatus...
  SELECT @status = FullTextCatalogProperty('PubInfo', 'populatestatus')
END
WAITFOR DELAY '00:00:05' -- wait for 5 seconds to receive correct FT Property
                         -- info (add more time for larger tables)...
SET @itemCount = FullTextCatalogProperty('PubInfo', 'itemcount')
SET @keyCount = FullTextCatalogProperty('PubInfo', 'uniquekeycount')
SET @indexSize = FullTextCatalogProperty('PubInfo', 'indexsize')
PRINT 'Nbr. of Rows FT Indexed = ' + CAST((CONVERT(varchar(10), @itemCount) - 1)
as varchar(12)) + char(09) + 'Nbr. of Unique FT Words = ' +
CONVERT(varchar(10), @keyCount) + char(09)
SET NOCOUNT OFF
END
go
-- Can return: Nbr. of Rows FT Indexed = -1 Nbr. of Unique FT Words = 0 
-- (depending upon when the crawl/population stopped)
?????-?? ????????????

????? ????? ?? ?? ????? SQL ????????? ?????:

?????-??? ???????????, ?????-??? ?????? ?????, ?? ???? ??? ??? ?????-??? ??? ?? ????? ????pubs???????::
use pubs
go
sp_fulltext_table 'pub_info', 'drop'
go
sp_fulltext_catalog 'PubInfo', 'drop'
go
sp_fulltext_database 'disable'
go
sp_fulltext_service 'clean_up'
go
-- end SQL Script !

??????

??? ??????? ?? ??? dbid ??????? ???? ?? ??? ???? ???? ?? ???? ??? ???? ??????? ?? ??? SQL Server ???????? ?????? ??? "DB_ID" ???? ?? ??????

??? ???? ??????? ?????-??? ????? ???? ??? ?? ?? ????????, SQL Server ???????? ?????? ??? "DATABASEPROPERTY" ?? "IsFulltextEnabled" ???? ?? ??????

Ftcatid ?? ???? ??? ???? ??????? ?? ??? ????? "sp_help_fulltext_catalogs", "OBJECTPROPERTY" ?? "TableFulltextCatalogId" ???? ?? SQL Server ???????? ?????? ????

???

???? ID: 240867 - ????? ???????: 02 ?????? 2010 - ??????: 2.0
???? ???? ???? ??:
  • Microsoft SQL Server 2000 Standard Edition, ?? ???? ??? ?????? ???? ???:
    • Microsoft SQL Server 2000 Developer Edition
    • Microsoft SQL Server 2000 Enterprise Edition
??????: 
kbinfo kbmt KB240867 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:240867

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com