更换Oracle dataflies目录:
原目录:/u01/Oracle/oradata/ora9i
变更录:/u01/Oracle/oradata/md
[oracle@test ubackup]$ cp /www/ubackup/* /u01/Oracle/oradata/md/
[oracle@test dbs]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.8.0 - Production on 6 23 12:19:01 2012
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> create pfile from spfile;
File created.
修改pfile中原来datafile路径
[oracle@test dbs]$ more initora9i.ora
*.aq_tm_processes=1
*.background_dump_dest='/u01/Oracle/admin/ora9i/bdump'
*.compatible='9.2.0.0.0'
*.control_files='/u01/Oracle/oradata/md/control01.ctl','/u01/Oracle/oradata/md/c
ontrol02.ctl','/u01/Oracle/oradata/md/control03.ctl'
*.core_dump_dest='/u01/Oracle/admin/ora9i/cdump'
*.db_block_size=8192
*.db_cache_size=33554432
*.db_domain='gzgi.com'
*.db_file_multiblock_read_count=16
*.db_name='ora9i'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora9iXDB)'
*.fast_start_mttr_target=300
*.hash_join_enabled=TRUE
*.instance_name='ora9i'
*.java_pool_size=83886080
*.job_queue_processes=10
*.large_pool_size=16777216
*.log_archive_dest_1='LOCATION=/u01/Oracle/oradata/md/arch'
*.log_archive_start=TRUE
*.open_cursors=300
*.pga_aggregate_target=25165824
*.processes=150
*.query_rewrite_enabled='FALSE'
*.remote_login_passwordfile='EXCLUSIVE'
*.shared_pool_size=83886080
*.sort_area_size=524288
*.star_transformation_enabled='FALSE'
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_retention=10800
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/Oracle/admin/ora9i/udump'
[oracle@test dbs]$
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> create spfile from pfile;
File created.
SQL>
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 235999648 bytes
Fixed Size 450976 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
SQL> desc v$datafile;
Name Null? Type
----------------------------------------- -------- ----------------------------
FILE# NUMBER
CREATION_CHANGE# NUMBER
CREATION_TIME DATE
TS# NUMBER
RFILE# NUMBER
STATUS VARCHAR2(7)
ENABLED VARCHAR2(10)
CHECKPOINT_CHANGE# NUMBER
CHECKPOINT_TIME DATE
UNRECOVERABLE_CHANGE# NUMBER
UNRECOVERABLE_TIME DATE
LAST_CHANGE# NUMBER
LAST_TIME DATE
OFFLINE_CHANGE# NUMBER
ONLINE_CHANGE# NUMBER
ONLINE_TIME DATE
BYTES NUMBER
BLOCKS NUMBER
CREATE_BYTES NUMBER
BLOCK_SIZE NUMBER
NAME VARCHAR2(513)
PLUGGED_IN NUMBER
BLOCK1_OFFSET NUMBER
AUX_NAME VARCHAR2(513)
SQL> col name format a40;
SQL> select file#,name from v$datafile;
FILE# NAME
---------- ----------------------------------------
1 /u01/Oracle/oradata/ora9i/system01.dbf
2 /u01/Oracle/oradata/ora9i/undotbs01.dbf
3 /u01/Oracle/oradata/ora9i/cwmlite01.dbf
4 /u01/Oracle/oradata/ora9i/drsys01.dbf
5 /u01/Oracle/oradata/ora9i/example01.dbf
6 /u01/Oracle/oradata/ora9i/indx01.dbf
7 /u01/Oracle/oradata/ora9i/odm01.dbf
8 /u01/Oracle/oradata/ora9i/tools01.dbf
9 /u01/Oracle/oradata/ora9i/users01.dbf
10 /u01/Oracle/oradata/ora9i/xdb01.dbf
11 /u01/Oracle/oradata/ora9i/gree.dbf
11 rows selected.
SQL>
注意一个个修数据库文件目录 datafile controfile redologfile 位置
SQL> alter database rename file '/u01/Oracle/oradata/ora9i/system01.dbf' to '/u01/Oracle/oradata/md/system01.dbf';
Database altered.
SQL>
阅读(1588) | 评论(0) | 转发(1) |