Rename/Move datafile - Tested in our Test ENV
Tested in our Test ENV
Example: Rename the datafile
(Here i have test by creating the new tablespace with datafile / We can use it for existing datafile to Rename/Move)
SQL> create tablespace newrename datafile '/u01/app/oracle/oradata/prim/newrename.dbf' size 10m;
Tablespace created.
SQL> select name from V$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/prim/system01.dbf
/u01/app/oracle/oradata/prim/sysaux01.dbf
/u01/app/oracle/oradata/prim/undotbs01.dbf
/u01/app/oracle/oradata/prim/users01.dbf
/u01/app/oracle/oradata/prim/example01.dbf
/u01/app/oracle/oradata/prim/PAP_DATA.dbf
/u01/app/renametest/renametest.dbf
/u01/app/oracle/oradata/prim/newrename.dbf
Make the Tablespace Offline:
SQL> alter tablespace newrename offline;
Tablespace altered.
Rename the File by OS Level (Safer side copy the datafile then rename by using the mv command)
$ cp newrename.dbf newrename.dbf.bck
$ mv newrename.dbf to nrename.dbf
Rename by Sql command:
SQL> alter tablespace newrename rename datafile '/u01/app/oracle/oradata/prim/newrename.dbf' to '/u01/app/oracle/oradata/prim/nrename.dbf';
Tablespace altered.
Make the tablespace online
SQL> alter tablespace NEWRENAME online;
Tablespace altered.
Verify:
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/prim/system01.dbf
/u01/app/oracle/oradata/prim/sysaux01.dbf
/u01/app/oracle/oradata/prim/undotbs01.dbf
/u01/app/oracle/oradata/prim/users01.dbf
/u01/app/oracle/oradata/prim/example01.dbf
/u01/app/oracle/oradata/prim/PAP_DATA.dbf
/u01/app/renametest/renametest.dbf
/u01/app/oracle/oradata/prim/nrename.dbf
Move the datafile into different location:
Create on tablespace with datafile or you can use the existing datafile to perform the operation
Create tablespace renametest datafile ‘/u01/app/oracle/oradata/prim/renametest.dbf’ size 10m;
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/prim/system01.dbf
/u01/app/oracle/oradata/prim/sysaux01.dbf
/u01/app/oracle/oradata/prim/undotbs01.dbf
/u01/app/oracle/oradata/prim/users01.dbf
/u01/app/oracle/oradata/prim/example01.dbf
/u01/app/oracle/oradata/prim/PAP_DATA.dbf
/u01/app/oracle/oradata/prim/renametest.dbf
Make the Tablespace Offline:
SQL> alter tablespace renametest offline;
Tablespace altered.
Move/rename the File by OS Level (Safer side copy the datafile then rename by using the mv command)
$ cp renametest.dbf renametest.dbf.bck
$ mv renametest.dbf /u01/app/renametest/
$ cd /u01/app/renametest/
[oracle@oracledbtest renametest]$ ls
renametest.dbf
Rename by Sql command:
SQL> alter tablespace renametest rename datafile '//u01/app/oracle/oradata/prim/renametest.dbf' to '/u01/app/renametest/renametest.dbf';
Tablespace altered.
Make the tablespace online
SQL> alter tablespace renametest online;
Tablespace altered.
Verify:
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/prim/system01.dbf
/u01/app/oracle/oradata/prim/sysaux01.dbf
/u01/app/oracle/oradata/prim/undotbs01.dbf
/u01/app/oracle/oradata/prim/users01.dbf
/u01/app/oracle/oradata/prim/example01.dbf
/u01/app/oracle/oradata/prim/PAP_DATA.dbf
/u01/app/renametest/renametest.dbf - Move the datafile into the different location
Example: Rename the datafile
(Here i have test by creating the new tablespace with datafile / We can use it for existing datafile to Rename/Move)
SQL> create tablespace newrename datafile '/u01/app/oracle/oradata/prim/newrename.dbf' size 10m;
Tablespace created.
SQL> select name from V$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/prim/system01.dbf
/u01/app/oracle/oradata/prim/sysaux01.dbf
/u01/app/oracle/oradata/prim/undotbs01.dbf
/u01/app/oracle/oradata/prim/users01.dbf
/u01/app/oracle/oradata/prim/example01.dbf
/u01/app/oracle/oradata/prim/PAP_DATA.dbf
/u01/app/renametest/renametest.dbf
/u01/app/oracle/oradata/prim/newrename.dbf
Make the Tablespace Offline:
SQL> alter tablespace newrename offline;
Tablespace altered.
Rename the File by OS Level (Safer side copy the datafile then rename by using the mv command)
$ cp newrename.dbf newrename.dbf.bck
$ mv newrename.dbf to nrename.dbf
Rename by Sql command:
SQL> alter tablespace newrename rename datafile '/u01/app/oracle/oradata/prim/newrename.dbf' to '/u01/app/oracle/oradata/prim/nrename.dbf';
Tablespace altered.
Make the tablespace online
SQL> alter tablespace NEWRENAME online;
Tablespace altered.
Verify:
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/prim/system01.dbf
/u01/app/oracle/oradata/prim/sysaux01.dbf
/u01/app/oracle/oradata/prim/undotbs01.dbf
/u01/app/oracle/oradata/prim/users01.dbf
/u01/app/oracle/oradata/prim/example01.dbf
/u01/app/oracle/oradata/prim/PAP_DATA.dbf
/u01/app/renametest/renametest.dbf
/u01/app/oracle/oradata/prim/nrename.dbf
Hence it has been rename into the same location of the datafile
Move the datafile into different location:
Create on tablespace with datafile or you can use the existing datafile to perform the operation
Create tablespace renametest datafile ‘/u01/app/oracle/oradata/prim/renametest.dbf’ size 10m;
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/prim/system01.dbf
/u01/app/oracle/oradata/prim/sysaux01.dbf
/u01/app/oracle/oradata/prim/undotbs01.dbf
/u01/app/oracle/oradata/prim/users01.dbf
/u01/app/oracle/oradata/prim/example01.dbf
/u01/app/oracle/oradata/prim/PAP_DATA.dbf
/u01/app/oracle/oradata/prim/renametest.dbf
Make the Tablespace Offline:
SQL> alter tablespace renametest offline;
Tablespace altered.
Move/rename the File by OS Level (Safer side copy the datafile then rename by using the mv command)
$ cp renametest.dbf renametest.dbf.bck
$ mv renametest.dbf /u01/app/renametest/
$ cd /u01/app/renametest/
[oracle@oracledbtest renametest]$ ls
renametest.dbf
Rename by Sql command:
SQL> alter tablespace renametest rename datafile '//u01/app/oracle/oradata/prim/renametest.dbf' to '/u01/app/renametest/renametest.dbf';
Tablespace altered.
Make the tablespace online
SQL> alter tablespace renametest online;
Tablespace altered.
Verify:
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/prim/system01.dbf
/u01/app/oracle/oradata/prim/sysaux01.dbf
/u01/app/oracle/oradata/prim/undotbs01.dbf
/u01/app/oracle/oradata/prim/users01.dbf
/u01/app/oracle/oradata/prim/example01.dbf
/u01/app/oracle/oradata/prim/PAP_DATA.dbf
/u01/app/renametest/renametest.dbf - Move the datafile into the different location
Hence we move the datafile into the different location
yurtdışı kargo
ReplyDeleteresimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
O5PRBQ
Hollanda yurtdışı kargo
ReplyDeleteİrlanda yurtdışı kargo
İspanya yurtdışı kargo
İtalya yurtdışı kargo
Letonya yurtdışı kargo
5YRSRK
Angila yurtdışı kargo
ReplyDeleteAndora yurtdışı kargo
Arnavutluk yurtdışı kargo
Arjantin yurtdışı kargo
Antigua ve Barbuda yurtdışı kargo
CE33
Azerbaycan yurtdışı kargo
ReplyDeleteAruba yurtdışı kargo
Avustralya yurtdışı kargo
Azor Adaları yurtdışı kargo
Bahamalar yurtdışı kargo
DZ2V