Showing posts with label multiple. Show all posts
Showing posts with label multiple. Show all posts

Monday, March 12, 2012

Recover database with multiple filegroups?

Hi,
I'm running SQL2000 Standard on W2K Server.
I have a large database that spreads multiple physical drives and file
groups. The database failed earlier today because one of the filegroups is
bad. This filegroup is located on a bad drive and the database is now in
(suspect) mode, complaining about torn page I/O error.
I'm wondering if it's possible to DELETE this one filegroup from the
database and bring the database back online with other remaining filegroups.
Because this filegroup is bad and is causing the entire database to be in
Suspect Mode. Or is it possible to re-create a new database by attaching all
good filegroups back?
What are my options for bringing this database back online without having to
trash all the data and reload them? It'd be nice if I only lose this one
filegroup.
Thanks!
HHHi
If I understood you correctly you need to use DBCC SHRINKFILE with EMPTYFILE
argument.
For more details please refer to BOL.
"Hung Huynh" <hungh@.wi.rr.com> wrote in message
news:er8g2TSjDHA.360@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I'm running SQL2000 Standard on W2K Server.
> I have a large database that spreads multiple physical drives and file
> groups. The database failed earlier today because one of the filegroups is
> bad. This filegroup is located on a bad drive and the database is now in
> (suspect) mode, complaining about torn page I/O error.
> I'm wondering if it's possible to DELETE this one filegroup from the
> database and bring the database back online with other remaining
filegroups.
> Because this filegroup is bad and is causing the entire database to be in
> Suspect Mode. Or is it possible to re-create a new database by attaching
all
> good filegroups back?
> What are my options for bringing this database back online without having
to
> trash all the data and reload them? It'd be nice if I only lose this one
> filegroup.
> Thanks!
> HH
>|||No. The database is not functional right now. It's in Suspect Mode and need
to be restored/recovered.
Thanks!
HH
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:ufLhsQWjDHA.2652@.TK2MSFTNGP09.phx.gbl...
> Hi
> If I understood you correctly you need to use DBCC SHRINKFILE with
EMPTYFILE
> argument.
> For more details please refer to BOL.
>
>
> "Hung Huynh" <hungh@.wi.rr.com> wrote in message
> news:er8g2TSjDHA.360@.TK2MSFTNGP10.phx.gbl...
> > Hi,
> >
> > I'm running SQL2000 Standard on W2K Server.
> >
> > I have a large database that spreads multiple physical drives and file
> > groups. The database failed earlier today because one of the filegroups
is
> > bad. This filegroup is located on a bad drive and the database is now in
> > (suspect) mode, complaining about torn page I/O error.
> >
> > I'm wondering if it's possible to DELETE this one filegroup from the
> > database and bring the database back online with other remaining
> filegroups.
> > Because this filegroup is bad and is causing the entire database to be
in
> > Suspect Mode. Or is it possible to re-create a new database by attaching
> all
> > good filegroups back?
> >
> > What are my options for bringing this database back online without
having
> to
> > trash all the data and reload them? It'd be nice if I only lose this one
> > filegroup.
> >
> > Thanks!
> >
> > HH
> >
> >
>

Wednesday, March 7, 2012

recordset

hi
I have 3 tables:Article,Source and File.
Each article can have multiple filenames.
The fields of table Article are:ArticleID,SourceID,ArticleDate,ArticleCategory
The fields of table Source are:SourceID,SourceName
the fields of Table File:ID,ArticleID,Filename
Select*from Article inner join Source on Article.SourceID=source.SourceID order by ArticleDate
I obtain a number of recordsets from the above query.
Then for each recordset(Rs1),Let's say for the first recordset
Rs1.MoveFirst
I want to apply this query:
Rs2.Open"Select SourceName,ArticleDate,File.Filename from [RS1] inner Join File on Article.ArticleID=File.ArticleID
I want from the above query to have the Filenames corresponding to each Article because in my VB
form I have 2 command buttons:one gives me the article's definition(Date,Source)
and the other gives me the Filename of the current recordset(Article)
The above SQL syntax is it correct?why not just join all 3 tables in your 1st query
select a.ArticleID, a.SourceID, s.SourceName, a.ArticleDate, a.ArticleCategory, f.ID, f.Filename
from Article a inner join Source s
on a.SourceID = s.SourceID
inner join File f
on a.ArticleID = f.ArticleID
order by a.ArticleDate|||KH is correct with the best solution.

Just as an FYI - you cannot use a recordset in a SQL statement. There are, I believe, 3rd party utilities that allow you to join recordsets and query them a little like you are trying to do but I don't know how well these perform (quite badly I would imagine) and I have never come accross a situation where they are necessary.

HTH

Saturday, February 25, 2012

Records drilled through multiple times due to Partitions

Hi,

I have created a cube for a telephony database. In this database there are two fields that point to the same table named tblPhonebook. These fields are FromPhonebookID and ToPhonebookID, which respectively contain the Person in the phonebook who placed the call and the Person in the phonebook who received the call. (the latter could both be an internal person and an external person).

I created one dimension. The Phonebook dimension which points to the table tblPhonebook.

When I select a person in this dimension I want to see all the calls this person placed and also all the calls this person received. So I created two "views" in SQL Server.

view1: SELECT ToID as UseID, * FROM tblData

view2: SELECT FromID as UseID, * FROM tblData

With the Cube I created two partitions. The first partition takes view1 as data table, the second partition takes view2 as data table. My Phonebook dimension is related to the UseID in these views.

So far so good. When I select a person in the Phonebook dimension, I get a neat result of his ingoing and outgoing phonecalls. However, when I select "All Phonebook", so not a specific user in the phonebook list, and instead select a date for instance, there occurs a problem. Because no Phonebook entry is specified there are always two entries per phonecall. One from view1 and one from view2. So my calls are counted double.

For counting the calls this is also not a problem, because I can perform a Distinct Count on the tblData.ID. I also measure the Average of the Conversation Time. This is also not a problem, because every value is counted double, not one excluded, so the average stays the same (isn't it? conversations lasting 1, 8 and 12 seconds average on 7 seconds. If those are counted twice then it would be 1,1,8,8,12,12 which also average on 7).

But when I select a drillthrough (with "All Phonebook" selected) the problem arrises. All entries are showed double in my drillthrough. First all the From Data ordered by date, then all the To Data ordered by date.

Ofcourse I don't want that. I want them only to be listed once. How do I filter this drillthrough that when no phonebook entry is selected, they still only appear once in my list?

(Sorry for the long introduction to a one line question ;))

Greets,

Edward

For one, Analysis Server in this case delivers exactly to the promise : in the result of the drillrhough it returns you all the data you selected to perform the drillthrough into.

Now about your situation. To solve your problem, you might decide to model your cube a bit different. You can create another dimension with only a single non-aggregatable attribute and 2 values "From" and "To". Then your user will choose to drill through into which part of the data.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hmmm... so no filter possible? that was what I was afraid for ;)

Thanks for looking into my problem....

Greets,

Edward

Monday, February 20, 2012

Record set to file

Any tips on how to get a recordset into a file. I want the result of a stored procedure (multiple rows) written to a flat file. I've tried a data flow task with an OLE DB Source linked to Raw File destination but that produces gibberish in the file - I need the raw rows returned from the s/p

Any tips much appreciated.

Greg.You can use DTS (Data Transformation Service) to accomplish this.|||I understood SSIS was the new DTS. Any pointers on how I can go about this Mike?

Greg.
|||Yes, in v2005. I haven't used it extensively, but you can get the information on how to here: http://msdn2.microsoft.com/ms141823(en-US,SQL.90).aspx|||

What do you mean by raw rows? The raw dest produces a binary file that is for use by the dataflow. If you want a readable file then use the flat file destination, which will create a text file.

HTH,

Matt

|||Thanks guys. Got it figured out using the flat file destination.

Greg.