Skip to main content

Posts

Showing posts from October, 2016

DBCC CHECKDB

Checks the logical and physical integrity of all the objects in the specified database . DBCC CHECKDB( 'Galaxy' ); Message Results: DBCC results for 'Galaxy' . Service Broker Msg 9675 , State 1 : Message Types analyzed: 14 . Service Broker Msg 9676 , State 1 : Service Contracts analyzed: 6 . Service Broker Msg 9667 , State 1 : Services analyzed: 3 . Service Broker Msg 9668 , State 1 : Service Queues analyzed: 3 . Service Broker Msg 9669 , State 1 : Conversation Endpoints analyzed: 0 . Service Broker Msg 9674 , State 1 : Conversation Groups analyzed: 0 . Service Broker Msg 9670 , State 1 : Remote Service Bindings analyzed: 0 . Service Broker Msg 9605 , State 1 : Conversation Priorities analyzed: 0 . DBCC results for 'sys.sysrscols' . There are 1309 rows in 23 pages for object "sys.sysrscols" . DBCC results for 'sys.sysrowsets' . There are 135 rows in 2 pages for object "sys.sysrowsets" . DBCC results

How to get all connected DBLINK information -SP_LINKEDSERVERS

I am working several remote server those are connected with DB link. I need create a DB link (remote server oracle db) with my SQL Server, but don't know the required server is connected or not.  at this moment used SQL server default procedure   EXEC SP_LINKEDSERVERS Found below results: all link server name, provider name, DataSource IP those are connected with DBLINK MSDN Column name Data type Description SRV_NAME sysname Name of the linked server. SRV_PROVIDERNAME nvarchar( 128 ) Friendly name of the OLE DB provider managing access to the specified linked server. SRV_PRODUCT nvarchar( 128 ) Product name of the linked server. SRV_DATASOURCE nvarchar( 4000 ) OLE DB data source property corresponding to the specified linked server. SRV_PROVIDERSTRING nvarchar( 4000 ) OLE DB provider string property corresponding to the linked server. SRV

How to get first day and last day Of the current and Previous year on Oracle

Get current year : SELECT TO_CHAR(SYSDATE, 'YYYY' ) AS Current_Year FROM DUAL; First Day of Current Year: SELECT TO_CHAR(TRUNC (SYSDATE , 'YEAR' ) , 'DD/MM/YYYY' ) FROM DUAL; Last Day of Current Year: SELECT TO_CHAR(ADD_MONTHS(TRUNC (SYSDATE , 'YEAR' ), 12 )- 1 , 'DD/MM/YYYY' ) AS LastDay_Current_Year FROM DUAL; First Day of Previous Year: SELECT TO_CHAR(ADD_MONTHS (TRUNC (SYSDATE, 'YEAR' ), - 12 ), 'DD/MM/YYYY' ) AS FirstDay_ Previous_Year FROM DUAL;  Last Day of Previous Year: SELECT TO_CHAR(ADD_MONTHS (TRUNC (SYSDATE, 'YEAR' ), - 1 ) + 30 , 'DD/MM/YYYY' ) AS LastDay_PreviousYear FROM DUAL;

Repair statement not processed. Database needs to be in single user mode.

When I try to run DBCC repair I get the below the errors .Database needs to DBCC CHECKTABLE( 'Person.Address' , REPAIR_REBUILD ) Msg 7919, Level 16, State 3, Line 1 Repair statement not processed. Database needs to be in single user mode. The correct way to run a DBCC CHECKDB or DBCC CHECKTABLE statement with valid REPAIR options is to start SQL Server normally and then explicitly set the database in single user mode. You can do this from either the Enterprise Manager or the Query Analyzer. When single user mode set to true only one user can connect to the server. From Enterprise Manager: Right-click the database name, and then click  Properties . In the  Properties  dialog box, click  Options . Select the  single user  option, and then click  OK .        From Query Analyzer: SP_DBOPTION 'AdventureWorks' , SINGLE, TRUE Run DBCC command CHECKDB: DBCC CHECKTABLE( 'Person.Address' , REPAIR_REBUILD )