Friday, October 23, 2015

Scripts to check Rollback Segments information

Scripts to check Rollback Segments information


Rollback segment Information

SELECT segment_name, tablespace_name, status
        FROM sys.dba_rollback_segs;
SELECT segment_name, tablespace_name, (bytes)/1024/1024, blocks, extents
        FROM sys.dba_segments
   WHERE segment_type = 'ROLLBACK';

SELECT name, xacts "ACTIVE TRANSACTIONS" FROM v$rollname, v$rollstat WHERE status = 'PENDING OFFLINE' AND v$rollname.usn = v$rollstat.usn;

SELECT segment_name, tablespace_name, owner
       FROM sys.dba_rollback_segs;

SELECT segment_name, segment_type, tablespace_name
     FROM sys.dba_segments
WHERE segment_type = 'DEFERRED ROLLBACK';

Shrinking Rollback segment command

ALTER ROLLBACK SEGMENT rbs1 SHRINK TO 100K;

select count(*) from dba_extents where tablespace_name='RBSTS';

Shrinking all rollback Segments

spool shrink_em.sql
select 'alter rollback segment '||segment_name||' shrink to 2;' from dba_rollback_segs where tablespace_name='RBSTS';
spool off
@shrink_em.sql

Number of rollback extents

select count(*) from dba_extents where tablespace_name='RBSTS';

Finding Rollback Segment Size

SQL> select segment_name,sum(bytes) from dba_segments where
> tablespace_name
> = 'RBS' and segment_name
> = 'RBS17' group by segment_name;
>
> SEGMENT_NAME SUM(BYTES)
> ------------------------ ----------
> RBS17 22364160

Finding Rollback Segment Optimal Size

> SQL> select rs.optsize, rs.extents
> 2 from dba_rollback_segs drs,
> 3 v$rollstat rs
> 4 where drs.segment_name = 'RBS17'
> 5 and drs.segment_id = rs.usn;
>
> OPTSIZE EXTENTS
> ---------- ----------
> 22020096 21

Shrinking Rollback Segment

> SQL> alter rollback segment RBS17 shrink to 10M;
>
> Rollback segment altered.
Script to shrink all rollback Segments
-- Script: shrink_rollback_segs.sql
-- Purpose:            to shrink all online rollback segments back to optimal
-------------------------------------------------------------------------------
@save_sqlplus_settings

set pagesize 0
set termout off

spool shrink_rollback_segs.tmp
select
  'alter rollback segment ' || segment_name || ' shrink;'
from
  sys.dba_rollback_segs
where
  status = 'ONLINE'
/
spool off

@shrink_rollback_segs.tmp

host rm -f shrink_rollback_segs.tmp                -- for Unix
host del shrink_rollback_segs.tmp   -- for others

Finding Current Optimal and Suggested Optimal

column name format a30 heading "Rollback Segment"
column optsize format 99999999999 heading "Current Optimal"
column new_opt format 99999999999 heading "Suggested Optimal"

select
  n.name,
  s.optsize,
  ( ceil(s.extents * (s.optsize + s.aveshrink)/(s.rssize + p.value))
    * (s.rssize + p.value)
    / s.extents
  ) - p.value  new_opt
from
  ( select
      optsize,
      avg(rssize)     rssize,
      avg(extents)    extents,
      max(wraps)      wraps,
      max(shrinks)    shrinks,
      avg(aveshrink)  aveshrink
    from
      sys.v_$rollstat
    where
      optsize is not null and
      status = 'ONLINE'
    group by
      optsize
  )  s,
  ( select
      kvisval  value
    from
      sys.x_$kvis
    where
      kvistag = 'kcbbkl' )  p,
  sys.v_$rollstat  r,
  sys.v_$rollname  n
where
  s.shrinks > 1 and
  s.shrinks > s.wraps / ceil(s.optsize / ((s.rssize + p.value) / s.extents)) and
  r.optsize = s.optsize and
  r.status = 'ONLINE' and
  n.usn = r.usn
/

Generating Shrink commands (Examples)

select b.segment_name,b.tablespace_name,a.extents,a.rssize,a.xacts,a.optsize,a.shrinks,a.wraps,a.status from v$rollstat a, dba_rollback_segs b where b.segment_id = a.usn;

select 'alter rollback segment ' || segment_name || ' shrink;' from sys.dba_rollback_segs where status = 'ONLINE';

SQL> select 'alter rollback segment ' || segment_name || ' shrink;' from sys.dba_rollback_segs where status = 'ONLINE';

'ALTERROLLBACKSEGMENT'||SEGMENT_NAME||'SHRINK;'
-------------------------------------------------------------
alter rollback segment SYSTEM shrink;
alter rollback segment R01 shrink;
alter rollback segment R02 shrink;
alter rollback segment R03 shrink;
alter rollback segment R04 shrink;

SQL> alter rollback segment R01 shrink;

Rollback segment altered.

SQL> alter rollback segment R02 shrink;

Rollback segment altered.

SQL> alter rollback segment R03 shrink;

Rollback segment altered.

SQL> alter rollback segment R04 shrink;

Rollback segment altered.

Enter value for tbs: RBS1
old  11:                                      dba_data_files where tablespace_name in ('&tbs')) where
new  11:                                      dba_data_files where tablespace_name in ('RBS1')) where
Enter value for tbs: RBS1
old  12:                                      tablespace_name in ('&tbs')
new  12:                                      tablespace_name in ('RBS1')

Used Space(MB) allocated size(MB) maximum allowable (MB) effectivefree(MB)     % FREE
-------------- ------------------ ---------------------- ----------------- ----------
           200                500                    500               300         60



SQL> SELECT segment_name, tablespace_name, (bytes)/1024/1024, blocks, extents
        FROM sys.dba_segments
   WHERE segment_type = 'ROLLBACK';  2    3

SEGMENT_NAME                                                                      TABLESPACE_NAME           (BYTES)/1024/1024     BLOCKS    EXTENTS
--------------------------------------------------------------------------------- ------------------------- ----------------- ---------- ----------
SYSTEM                                                                            SYSTEM                             1.328125        170         17
R0                                                                                                                          2        256          2
R01                                                                               RBS1                                     50       6400         10
R02                                                                                                                        50       6400         10
R03                                                                                                                        50       6400         10
R04                                                                                                                        50       6400         10

6 rows selected.

SQL> SELECT segment_name, tablespace_name, status
        FROM sys.dba_rollback_segs;  2

SEGMENT_NAME                   TABLESPACE_NAME           STATUS
------------------------------ ------------------------- ----------------
SYSTEM                         SYSTEM                    ONLINE
R0                                                       OFFLINE
R01                            RBS1                      ONLINE
R02                                                      ONLINE
R03                                                      ONLINE
R04                                                      ONLINE

SQL> SELECT segment_name, tablespace_name, (bytes)/1024/1024, blocks, extents
        FROM sys.dba_segments
   WHERE segment_type = 'ROLLBACK';  2    3

SEGMENT_NAME                                                                      TABLESPACE_NAME           (BYTES)/1024/1024     BLOCKS    EXTENTS
--------------------------------------------------------------------------------- ------------------------- ----------------- ---------- ----------
SYSTEM                                                                            SYSTEM                             1.328125        170         17
R0                                                                                                                          2        256          2
R01                                                                               RBS1                                     50       6400         10
R02                                                                                                                       345      44160         69
R03                                                                                                                        50       6400         10
R04                                                                                                                        50       6400         10

6 rows selected.
SQL> SELECT name, xacts "ACTIVE TRANSACTIONS" FROM v$rollname, v$rollstat WHERE status = 'PENDING OFFLINE' AND v$rollname.usn = v$rollstat.usn;

no rows selected

SQL> SELECT segment_name, segment_type, tablespace_name
     FROM sys.dba_segments
WHERE segment_type = 'DEFERRED ROLLBACK';  2    3

no rows selected

SQL> select b.segment_name,b.tablespace_name,a.extents,a.rssize,a.xacts,a.optsize,a.shrinks,a.wraps,a.status from v$rollstat a, dba_rollback_segs b where b.segment_id = a.usn;

SEGMENT_NAME                   TABLESPACE_NAME              EXTENTS     RSSIZE      XACTS Current Optimal    SHRINKS      WRAPS STATUS
------------------------------ ------------------------- ---------- ---------- ---------- --------------- ---------- ---------- ---------------
SYSTEM                         SYSTEM                            17    1384448          0                          0          0 ONLINE
R01                            RBS1                              10   52420608          0                          0        360 ONLINE
R02                                                              69  361750528          0                          0        703 ONLINE
R03                                                              10   52420608          0                          0        710 ONLINE
R04                                                              10   52420608          0                          0        356 ONLINE

Wednesday, October 21, 2015

Queries for Oracle Stream administration

handy queries for Stream administration (Propagation process)

Basically in propagation, two views are important : DBA_QUEUE_SCHEDULES and
DBA_PROPAGATION.
The followings are handy statements for propagation administration of stream

--- Disable propagation
begin 
dbms_aqadm.disable_propagation_schedule('STRMADMIN.STREAMS_QUEUE', 'OEMREP.US.ORACLE.COM');
end;
/
--- Enable propagation
begin 
dbms_aqadm.enable_propagation_schedule('&source_queue_name_with_owner', '&database_link'); 
end;
/
-- Info about propagation
select * from dba_propagation;

-- Find out source and destination propagation
SELECT p.SOURCE_QUEUE_OWNER '.'p.SOURCE_QUEUE_NAME 
'@'g.GLOBAL_NAME "Source Queue",p.DESTINATION_QUEUE_OWNER '.'p.DESTINATION_QUEUE_NAME '@'p.DESTINATION_DBLINK "Destination Queue"FROM DBA_PROPAGATION p, GLOBAL_NAME g;
-- Find propagation parameters
SELECT s.*FROM DBA_QUEUE_SCHEDULES s, DBA_PROPAGATION pWHERE p.PROPAGATION_NAME = 'STRMADMIN_PROPAGATE'AND p.DESTINATION_DBLINK = s.DESTINATIONAND s.SCHEMA = p.SOURCE_QUEUE_OWNERAND s.QNAME = p.SOURCE_QUEUE_NAME;

---- How to change parameters-- Propagation job sets to 15min to propagates events every 15 minutes
-- Each propagation lasting max 300 second
-- 25 second wait before new events in a completely propagated queue are propagated
BEGIN
DBMS_AQADM.ALTER_PROPAGATION_SCHEDULE(queue_name => '&source_queue_name',destination => '&database_link_name',duration => 300,next_time => 'SYSDATE + 900/86400',latency => 25);
END;
/

-- Find out progpagation rule set
SELECT RULE_SET_OWNER, RULE_SET_NAMEFROM DBA_PROPAGATIONWHERE PROPAGATION_NAME = '&propagation_name';

select STREAMS_NAME,STREAMS_TYPE,RULE_TYPE,RULE_NAME,TABLE_OWNER'.'TABLE_NAME,RULE_OWNER,RULE_CONDITION 
from "DBA_STREAMS_TABLE_RULES" 
where streams_type='PROPAGATION' and rule_name in (select rule_name from DBA_RULE_SET_RULES a, dba_propagation b where a.rule_set_name=b.rule_set_name)union all
select STREAMS_NAME,STREAMS_TYPE,RULE_TYPE,RULE_NAME,
SCHEMA_NAME,RULE_OWNER,RULE_CONDITION 
from "DBA_STREAMS_SCHEMA_RULES" 
where streams_type='PROPAGATION' and rule_name in (select rule_name from DBA_RULE_SET_RULES a, dba_propagation b where a.rule_set_name=b.rule_set_name)union all
select STREAMS_NAME,STREAMS_TYPE,RULE_TYPE,RULE_NAME,
null,RULE_OWNER,RULE_CONDITION 
from "DBA_STREAMS_GLOBAL_RULES" 
where streams_type='PROPAGATION' and rule_name in (select rule_name from DBA_RULE_SET_RULES a, dba_propagation b where a.rule_set_name=b.rule_set_name);

-- Which DML/DDL rules the capture process is capturing
select * from "DBA_STREAMS_TABLE_RULES" 
where streams_type='PROPAGATION' and rule_name in (select rule_name from DBA_RULE_SET_RULES a, dba_propagation b where a.rule_set_name=b.rule_set_name and capture_name='&propagation_name');

-- Which schame rules the capture process is capturing
select * from "DBA_STREAMS_SCHEMA_RULES" where streams_type='PROPAGATION' and rule_name in (select rule_name from DBA_RULE_SET_RULES a, dba_propagation b where a.rule_set_name=b.rule_set_name and capture_name='&propagation_name');

-- Which global rules the capture process is capturing
select * 

from "DBA_STREAMS_GLOBAL_RULES" 
where streams_type='PROPAGATION' and rule_name in (select rule_name from DBA_RULE_SET_RULES a, dba_propagation b where a.rule_set_name=b.rule_set_name and capture_name='&propagation_name');
------ More about propagation job
SELECT TO_CHAR(s.START_DATE, 'HH24:MI:SS MM/DD/YY') START_DATE,s.PROPAGATION_WINDOW,s.NEXT_TIME,s.LATENCY,

DECODE(s.SCHEDULE_DISABLED,'Y', 'Disabled','N', 'Enabled') SCHEDULE_DISABLED,s.PROCESS_NAME,s.FAILURES
FROM DBA_QUEUE_SCHEDULES s, DBA_PROPAGATION p
WHERE p.PROPAGATION_NAME = '&propagation_name'
AND p.DESTINATION_DBLINK = s.DESTINATIONAND s.SCHEMA = p.SOURCE_QUEUE_OWNERAND s.QNAME = p.SOURCE_QUEUE_NAME;
-------- Total number of bytes which was propagated.
SELECT s.TOTAL_TIME_IN_sec, s.TOTAL_NUMBER, s.TOTAL_BYTES
FROM DBA_QUEUE_SCHEDULES s, DBA_PROPAGATION p
WHERE p.PROPAGATION_NAME = '&propagation_name'
AND p.DESTINATION_DBLINK = s.DESTINATIONAND s.SCHEMA = p.SOURCE_QUEUE_OWNERAND s.QNAME = p.SOURCE_QUEUE_NAME;

oracle queries

oracle

Audit invalid logon attempts

audit create session whenever not successful;
set linesize 120
column OS_USERNAME format a20
column USERHOST format a20
column TERMINAL format a20
column CLIENT_ID format a20
select * from dba_audit_session where returncode != 0;
noaudit create session whenever not successful;
more on auditing

logging table

CREATE TABLE log_messages (
id NUMBER NOT NULL
,message varchar2(255) not null
,logged_time date not null
,username varchar2(38) not null
,sid number not null
) TABLESPACE app_support;
CREATE SEQUENCE log_message_id;
CREATE OR REPLACE PROCEDURE log_msg (p_message IN VARCHAR2)
IS
PRAGMA AUTONOMOUS_TRANSACTION;
l_sid NUMBER;
BEGIN
SELECT sid INTO l_sid FROM v$mystat WHERE ROWNUM=1;
INSERT INTO log_messages (id, message, logged_time, username, sid) VALUES (log_message_id.nextval, p_message, SYSDATE, USER, l_sid);
COMMIT;
END;
/

AQ coalesce

Metalink note 271855.1 has a script aqcoalesce.sql
To quote from the note
The procedure performs the following operations relating to AQ objects
alter table AQ$_ < QUEUE_TABLE_NAME > _X coalesce;
where X=I (dequeue), T (time_manager), and H (history) IOTS for multi-consumer queue tables and
alter index AQ$_ < QUEUE_TABLE_NAME > _Y rebuild;
where Y=I (dequeue), and T (time-manager) indexes for single-consumer queue tables

oracle - tracing

session
on: dbms_system.set_ev(sid,serial#,10046,level,'');
off: dbms_system.set_ev(sid,serial#,10046,0,'');
system wide
on: alter system set events '10046 trace name context forever, level ';
off: alter system set events '10046 trace name context off';
levels
4=binds
8=waits
12=binds and waits

oracle - High Water Mark

Metalink article 262353.1
essentially
select count (distinct dbms_rowid.rowid_block_number(r.rowid)) "used blocks", blocks "below hwm", empty_blocks "above hwm"
from r, dba_tables
where table_name = '&table_name'
group by blocks, empty_blocks;

Oracle enqueu useful links

Thursday, October 15, 2015

RMAN-03014: implicit resync of recovery catalog failed RMAN-06004: ORACLE error from recovery catalog database: RMAN-20035: invalid high RECID

RMAN-03014: implicit resync of recovery catalog failed
RMAN-06004: ORACLE error from recovery catalog database:
RMAN-20035: invalid high RECID

RMAN backup error 

Solution :

After the refresh this error is normal, because the catalog database could not identify the database because it holds the old information. So in order to let the catalog database identify the database we have to unregister and register the database once again to identify the database.

$rman target=/ catalog=rman/rman@rmancatalog

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Oct 13 09:20:30 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCLL (DBID=2353077066)
connected to recovery catalog database

RMAN> unregister database;

database name is "ORCL" and DBID is 2353077066

Do you really want to unregister the database (enter YES or NO)? YES
database unregistered from the recovery catalog

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN>

ORA-01008: not all variables bound while doing RMAN backup

ORA-01008: not all variables bound while doing RMAN backup

Recovery Manager: Release 11.2.0.2.0 - Production on Tue Jan 17 15:00:22 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
RMAN>
connected to target database: MADM (DBID=xvxvxvxv)
RMAN>
connected to recovery catalog database

RMAN> 2> 3> 4> 5> 6> 7> 8> 9>

DBGSQL:     TARGET> select  nvl(max(al.recid), '0'),nvl(max(al.recid), 0)   into  :txtparmvalue, :parmvalue   from  v$archived_log al  where  al.status in ('X', 'A')    and  al.is_recovery_dest_file = 'YES'    and  al.creator = 'RMAN'
DBGSQL:        sqlcode = 1008
allocated channel: t1
channel t1: SID=1726 device type=SBT_TAPE
channel t1: Veritas NetBackup for Oracle - Release 6.5 (2009050106)
DBGSQL:     TARGET> select  nvl(max(al.recid), '0'),nvl(max(al.recid), 0)   into  :txtparmvalue, :parmvalue   from  v$archived_log al  where  al.status in ('X', 'A')    and  al.is_recovery_dest_file = 'YES'    and  al.creator = 'RMAN'
DBGSQL:        sqlcode = 1008
released channel: t1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 01/17/2012 15:00:36
RMAN-03014: implicit resync of recovery catalog failed
ORA-01008: not all variables bound
RMAN>
Recovery Manager complete.

I noticed that resync catalog or crosscheck archivelog all did not help in this case and this error appears due to a BUG in 11.2.0.2. You can read more about this issue at Oracle Metalink doc ID: 1280447.1

Current fix is to flush shared_pool and you will be able to start rman backup again.
SQL> alter system flush shared_pool;

Tuesday, October 13, 2015

SQL SERVER - ERROR : 4214 BACKUP LOG cannot be performed because there is no current database backup

SQL SERVER – FIX : ERROR : 4214 BACKUP LOG cannot be performed because there is no current database backup

I recently got the below error.
Even thought my database is in full recovery mode when I try to take log backup I am getting following error.
BACKUP LOG cannot be performed because there is no current database backup. (Microsoft.SqlServer.Smo)
How to fix it?
backuperror SQL SERVER   FIX : ERROR : 4214 BACKUP LOG cannot be performed because there is no current database backup
Solution / Fix:
This error can happen when you have never taken full backup of your database and you try to attempt to take backup of the log only. Take full backup once and attempt to take log back up. If the name of your database is MyTestDB follow procedure as following.
BACKUP DATABASE [MyTestDB]TO DISK = N'C:\MyTestDB.bak'GOBACKUP LOG [MyTestDB]TO DISK = N'C:\MyTestDB.bak'GO

Monday, October 5, 2015

How to Uninstall a SQL Server Service Pack


Uninstalling a SQL Server Service Pack





Did you know that starting with service packs (Service Pack 1) in SQL Server 2008 you can uninstall them from Add/Remove Programs like any other update?


image
But as always, backup both your user and system databases before applying any update, hot fix, cumulative update, or service pack!


If you are still using SQL Server 2005 or older, you have to use the manual method detailed here:
HOW TO: Remove a SQL Server Service Pack http://support.microsoft.com/kb/314823


================================================================

HOW TO: Remove a SQL Server 2005 or older Service Pack



SUMMARY
This step-by-step article describes how to remove a SQL Server service pack and expands on the information contained in the Readme.txt file for each service pack. 

When you install a new service pack, the service pack makes changes to the system tables for maintenance reasons, and upgrades user and distribution databases that are members of a replication topology. Due to these changes, you cannot easily remove service packs. There is no automated way to remove a service pack, and the process of removing a service pack involves several manual steps and risks if not done correctly.

Backup of System Databases

To remove the new service pack and revert to the build you were running before, you must have a backup of themastermsdb, and model databases from the earlier build to which you want to revert. For example, to revert to the SQL Server 2000 pre-Service Pack 2 (SP2) version of SQL Server 2000 components, you must have a backup of themastermsdb, and model databases prior to the SQL Server 2000 Service Pack 2 installation. If you do not have backups of your system databases on the service pack version to which you want to revert, you must perform the following steps to save your scheduled tasks, Data Transformation Services (DTS) packages, logins and full-text catalogs:
  • Script all scheduled tasks (that is, jobs, alerts and operators).
  • Save DTS packages to a file. You must save each package one by one into separate files.
  • Script the logins and passwords.
  • Back up the full-text catalog folders.
For additional information about how to script scheduled tasks and how to save DTS packages, click the article number below to view the article in the Microsoft Knowledge Base:
314546 HOW TO: Move Databases Between Computers that are Running SQL Server
For additional information about how to script the logins and password, click the following article number to view the article in the Microsoft Knowledge Base:
246133 HOW TO: Transfer Logins and Passwords Between Instances of SQL Server
For additional information about backups of full-text catalogs, click the article number below to view the article in the Microsoft Knowledge Base:
240867 INF: How to Move, Copy, and Back Up Full-Text Catalog Folders and Files
NOTE: If you do not perform the preceding steps, you must manually re-create the scheduled tasks, DTS packages, logins and full-text catalogs.

back to the top

Use the following steps to remove the service pack and revert to a prior build:
  1. Detach all user databases. For more information, see the "Attaching and Detaching Databases" topic in Microsoft SQL Server 7.0 Books Online or the "How to attach and detach a database (Enterprise Manager)" topic in Microsoft SQL Server 2000 Books Online. 

    NOTE: If any of the databases are involved in replication, you must first disable publishing and distribution. For more information, see the "Disabling Publishing and Distribution" topic in SQL Server Books Online.
  2. Stop all SQL Server services (that is, MSSQLServer, SQLServerAgent, Microsoft Distributed Transaction Coordinator [MS-DTC], Microsoft Search).
  3. As a safety factor, copy the Data folder to a safe location. If you have data and log files in a separate folder other than the default Data folder, also copy those files.
  4. Uninstall SQL Server by using the Add/Remove Programs applet in Control Panel. After you remove SQL Server from the computer, Microsoft recommends that you restart your computer to remove files that were in use during the uninstall process.
  5. Install SQL Server with same character set, sort order, collation and destination folder for program and data files as that of the original installation.
  6. Apply any service pack that you might have been running before you installed the new service pack. For example, if you want to remove SQL Server 2000 SP2 and you were running SQL Server 2000 SP1 before you installed SQL Server 2000 SP2, then install SQL Server 2000 SP1.
  7. Restore the mastermsdb, and model databases from backup if you have backups that match the version of service pack to which you want to revert. This automatically attaches any user databases that were attached when you created the backup. Attach any user databases that were created after the last backup of the masterdatabase. 

    If you do not have backups of the mastermsdb and model databases then: 

    • Run the scripts that you created to re-create the logins and scheduled tasks (that is, jobs, alerts and operators). If you did not create the scripts before you uninstalled SQL Server, then re-create the logins and scheduled tasks manually.
    • Open the DTS packages you saved as files. Save the packages to SQL Server. For more information, see the "How to save a DTS package to SQL Server" topic in SQL Server 7.0 Books Online or the "Saving a DTS Package" topic in SQL Server 2000 Books Online.
    • Re-create any changes you want in the model database.
    • Attach all your user databases.
    NOTE: After you re-create the logins and passwords, your users may not be able to access the database because the users in the database may not be linked to the corresponding login. This problem is referred to as "Orphaned Users." To correct orphaned users, see step 3 in the following Microsoft Knowledge Base article:
    314546 HOW TO: Move Databases Between Computers that are Running SQL Server
  8. If you had full-text catalogs, restore the full-text catalogs and resynchronize the full-text catalogs. For more information, see the following article in the Microsoft Knowledge Base article:
    240867 INF: How to Move, Copy, and Back Up Full-Text Catalog Folders and Files
  9. If you use replication you must reconfigure replication manually.
  10. If you use SQL Mail, reconfigure SQL Mail. For more information, see the following article in the Microsoft Knowledge Base:
    263556 INF: How to Configure SQL Mail