on 05-21-2015 5:36 PM
What is the process for changing dbfile names? For example, if we have dbfiles defined on the o/s
as follows:
lrwxrwxrwx .........main1a-> /dev/zvol/rdsk/M_ANCHOR/m1
lrwxrwxrwx .........main2a-> /dev/zvol/rdsk/M_ANCHOR/m2
which are stored in the iq_main (user dbspace) as main1a and main2a
We want to rename them to main1, main2 (drop th 'a') in the file system and in the database.
I think this could be done with a restore (even a virtual restore). But is there a way to do this using
alter <dbspace> alter file main1a rename to main1?
What would the order be in this case?
We're on IQ 15.4, Solaris 10, do not have VLDB.
Thanks
Hi Steve,
The order of changing the path is as follows.
1. Create the new symbolic links
ln -s /dev/zvol/rdsk/M_ANCHOR/m1 main1
ln -s /dev/zvol/rdsk/M_ANCHOR/m2 main2
2. Change the property of the dbspace to readonly and offline using "alter dbspace .." command.
Connect to the IQ server with DBA account.
Let's say that the directory path of the symbolic links is '/SAPIQ/DEV/'.
alter dbspace iq_main readonly;
alter dbspace iq_main offline;
3. Run the "alter dbspace ...alter file .. rename path..." command
alter dbspace iq_main alter file main1a rename path '/SAPIQ/DEV/main1';
alter dbspace iq_main alter file main2a rename path '/SAPIQ/DEV/main2';
4. Revert the property of the dbspace back to readwrite and online.
alter dbspace iq_main online;
alter dbspace iq_main readwrite;
HTH
Jerry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steve,
As per Alter DBSPACE syntax, you should be able to change logical as well as physical path/name of a dbfile.
Sybase IQ 15.4 > Reference: Statements and Options > SQL Statements
RENAME PATH is to provide new physical path and RENAME TO is for changing logical name.
HTH
ALTER DBSPACE dbspace-name { ADD new-file-spec [, new-file-spec ... ] | DROP FILE logical-file-name [, FILE logical-file-name ... ] | RENAME TO newname | RENAME 'new-file-pathname' | READONLY | READWRITE | ONLINE | OFFLINE | STRIPING{ ON | OFF } | STRIPESIZEKB size-in-KB ALTER FILE file-name { READONLY | [ FORCE ] READWRITE } | SIZE file-size [ KB | MB | GB | TB | PAGES ] | ADD file-size [ KB | MB | GB | TB | PAGES ] } RENAME PATH 'new-file-pathname' RENAME TO newname
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.