cancel
Showing results for 
Search instead for 
Did you mean: 

Restore ASE - sp_dropdevice

Private_Member_19084
Active Contributor
0 Kudos


Hi experts,

in case of a device is crashing or gone, do I have to drop the complete DB or is there a way to only drop the device?

I know db-load is required.

But my question is, what is recommended...???

1. dropping db

2. dropping devices

3. deleting devices

4. init disk

5. restore

Is this procedure correct?

Accepted Solutions (1)

Accepted Solutions (1)

former_member187136
Contributor
0 Kudos

Christian,

The process is correct I will add some more more elaborated soon

Regards

Kiran K Adharapuram

Answers (1)

Answers (1)

former_member207908
Participant
0 Kudos

Hi Christian,

Adding to what Kiran said..

-- I don't think "3. deleting devices" is required

Use the following command

load database <database name> with listonly=(create_sql, load_sql)

It will generate the following commands

--disk init commands used when creating the devices

--alter database commands used when adding space to the database

--create database command used when creating the database

--commands used to set database options

--load command which you can use for restoring the "latest" dump files

I've attached an example for you..

HTH,

Rajesh

former_member187136
Contributor
0 Kudos

Rajesh,

Good explanation dude 🙂

Cheers

Kiran K Adharapuram

former_member188958
Active Contributor
0 Kudos

Deleting the device may or may not be needed after using sp_dropdevice.   sp_dropdevice just removes the entry in the sysdevices system catalog.  If the device was a file system device and the file system still exists and the file itself still exists, the file should also be deleted at the OS level (typically by using the UNIX "rm" command).  If the failure was due to some user deleting the file while ASE was using it, or massive destruction of the file system, there may indeed already not be any device file left around to delete.

Private_Member_19084
Active Contributor
0 Kudos

Hello Rajesh,

thx for the example.
I need to find some time to study all the commands in there.


So does it mean, load database with list only gives me a kind of template whith current environment.

So that I have to fill out all data like, where are devices, which size, ....?

Is that correct?

I did everything manually.

I've done it on another way.

And you are right, I also did in my test not removing all devices.

see below and feel free to comment.

1. stopping SAP-System (stopsap r3)

2. dumping last log-transaction (to store it 100%)

3. unlock sa

4. dropping db

5. dropping all corrupt/damaged/gone devices

6. disk init all dropped devices

7. create database (with 001 device)

8. extend/alter db by all other devices (excepting 001)
From your example I got the possibility now to include this also in create database

9. load database

former_member207908
Participant
0 Kudos

Dear Christian,

So does it mean, load database with list only gives me a kind of template whith current environment. 

Yes

So that I have to fill out all data like, where are devices, which size, ....?

Is that correct?

Yes

I did everything manually.

I've done it on another way.

Let us know your way, so that we can review it.

A small correction I feel is step 2.

Instead of taking tran dump, I prefer to take full dump. Rest all steps looks good for me

Cheers,

Rajesh

Private_Member_19084
Active Contributor
0 Kudos

Hello Rajesh,

so you try to make a full-dump in case of a device is gone or not any longer existing?
I mean for security-cases it makes sense.


But how can it work when the data is not any longer existing?