Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle data file migration

Shulou Source: shulou.com Published: 2022-06-01 06:43:44 10月02日 Update

Environment: win 2008 oracle 11g

At the request of the developer, migrate the local automap data file to the magnetic array.

Database non-archiving mode

Data file migration:

SQL > select name from v$datafile

D:\ app\ oradata\ orcl\ automap01.dbf

D:\ app\ oradata\ orcl\ automap02.dbf

.

SQL > shutdown immediate

(the following $move command should be equivalent to the operating system's cut-and-paste command)

SQL > $move D:\ app\ oradata\ orcl\ automap01.dbf E:\ app\ oradata\ orcl\ automap01.db'

SQL > $move D:\ app\ oradata\ orcl\ automap02.dbf E:\ app\ oradata\ orcl\ automap02.db'

The SQL > startup mount ORACLE routine has been started. The Total System Global Area 209715200 bytes Fixed Size 1248140 bytes Variable Size 92275828 bytes Database Buffers 113246208 bytes Redo Buffers 2945024 bytes database has been loaded. SQL > alter database rename file'D:\ app\ oradata\ orcl\ automap01.dbf' to'E:\ app\ oradata\ orcl\ automap01.db'; SQL > alter database rename file'D:\ app\ oradata\ orcl\ automap02.dbf' to'E:\ app\ oradata\ orcl\ automap02.db'

The SQL > alter database open; database has changed. SQL > select name,status from v$datafile

In addition, other ways to move data files (when the database starts archiving, you can start migration): move Oracle database tablespace files purpose: to move oracle tablespace files from one place to another. Detailed operation steps: first, enable media recovery mode: a, Shutdown immdiate; B, Startup mount; C, Alter database archivelog; D, Alter database open; second, uninstall tablespace: a, Alter tablespace tablespace name offline; (note: add Drop after non-archive mode); third, move files to a new location under the operating system. Fourth, tell the tablespace data file has been moved: a, Alter database rename file 'original file path' to 'new file path'; fifth, load tablespace: a, Alter tablespace tablespace name online; sixth, close database: a, Shutdown; seventh, start database: a, Startup force; Oracle database tablespace file moved successfully.

Tags: Data file database space mobile mode operating system name command place system path load success person media location situation method step Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Redmi Shulou Information Microsoft Xiaomi