如何将Oracle数据库数据文件迁移到其它目录
一、实验环境 平台:VMware Server 1.0.6 Linux 2.6.18-164 el5 DB Version: Oracle 10g 10.2.0.1 Oracle SID: orcl 数据库运行在
一、实验环境
平台:VMware Server 1.0.6 Linux 2.6.18-164 el5
DB Version: Oracle 10g 10.2.0.1
Oracle SID: orcl
数据库运行在归档模式
sys@ORCL> select log_mode from v$database;
LOG_MODE
------------
ARCHIVELOG
或者:
sys@ORCL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch_orcl
Oldest online log sequence 28
Next log sequence to archive 30
Current log sequence 30
二、操作步骤:
源数据库数据文件位置:
sys@ORCL> select file_name from dba_data_files;
FILE_NAME
----------------------------------------
/u01/oradata/orcl/system01.dbf
/u01/oradata/orcl/undotbs01.dbf
/u01/oradata/orcl/sysaux01.dbf
/u01/oradata/orcl/users01.dbf
sys@ORCL> select file_name from dba_temp_files;
FILE_NAME
----------------------------------------
/u01/oradata/orcl/temp01.dbf
sys@select member from v$logfile ;
MEMBER
------------------------------
/u01/oradata/orcl/redo01.log
/u01/oradata/orcl/redo02.log
/u01/oradata/orcl/redo03.log
需要移动所有的数据文件,采用alter database 方法
1、关闭数据库
sys@ORCL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
2、移动数据文件到/u01/oradata/orcl_test目录
[oracle@ora10gserv orcl]$ pwd
/u01/oradata/orcl
[oracle@ora10gserv orcl]$ mv * /u01/oradata/orcl_test/
[oracle@ora10gserv orcl]$ ls
[oracle@ora10gserv orcl]$ cd /u01/oradata/orcl_test/
[oracle@ora10gserv orcl_test]$ ls
control01.ctl control03.ctl redo02.log sysaux01.dbf temp01.dbf users01.dbf
control02.ctl redo01.log redo03.log system01.dbf undotbs01.dbf
3、修改控制文件位置
[oracle@ora10gserv /]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Aug 2 00:05:27 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 465567744 bytes
Fixed Size 1220024 bytes
Variable Size 146801224 bytes
Database Buffers 314572800 bytes
Redo Buffers 2973696 bytes
SQL> create pfile='/u01/initorcl.ora' from spfile;
File created.
SQL> host vi /u01/initorcl.ora
orcl.__db_cache_size=314572800
orcl.__java_pool_size=4194304
orcl.__large_pool_size=4194304
orcl.__shared_pool_size=138412032
orcl.__streams_pool_size=0
*.audit_file_dest='/dba/admin/orcl/adump'
*.background_dump_dest='/dba/admin/orcl/bdump'
*.compatible='10.2.0.1.0'
*.control_file_record_keep_time=14
*.control_files='/u01/oradata/orcl_test/control01.ctl','/u01/oradata/orcl_test/control02.ctl','/u01/oradata/orcl_test/control03.ctl'
*.core_dump_dest='/dba/admin/orcl/cdump'
*.db_block_size=8192
*.db_domain='lsf.com.cn'
*.db_file_multiblock_read_count=16
*.db_name='orcl'
*.db_recovery_file_dest='/dba/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.job_queue_processes=10
*.log_archive_dest_1='location=/u01/arch_orcl'
*.open_cursors=300
*.pga_aggregate_target=154140672
*.processes=1000
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=2000
*.sga_target=463470592
*.undo_management='AUTO'
*.undo_retention=10800
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/dba/admin/orcl/udump'
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> create spfile from pfile='/u01/initorcl.ora';
File created.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]
