最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Oracle數(shù)據(jù)庫遷移所有文件到新掛載磁盤路徑

 更新時間:2024年01月05日 08:34:32   作者:福娃筱歡  
根據(jù)實(shí)際須要,有時安裝了oracle以后須要擴(kuò)展磁盤空間時,每每是新增一個單獨(dú)的文件路徑并掛載存儲,這時便須要總體遷移數(shù)據(jù)庫文件數(shù)據(jù)庫,本文就來介紹一下Oracle數(shù)據(jù)庫遷移所有文件到新掛載磁盤路徑

主要步驟:

1、停掉服務(wù),

2、關(guān)閉數(shù)據(jù)庫shutdown immediate

3、移動數(shù)據(jù)文件到新的位置。

4、啟動到mount狀態(tài),如果也移動了ctl,需要啟動到nomount下,生成參數(shù)文件。

5、alter database rename '文件名' to '新位置',逐個文件處理。

6、startup。(alter database open)

遷移前準(zhǔn)備

查看當(dāng)前數(shù)據(jù)庫所有文件信息

查看當(dāng)前數(shù)據(jù)庫所有文件信息,含數(shù)據(jù)文件、日志文件、臨時文件、控制文件、參數(shù)文件

export ORACLE_SID=topicisxc
sqlplus / as sysdba

SQL> startup
ORACLE 例程已經(jīng)啟動。

Total System Global Area 4977278976 bytes
Fixed Size                  2261768 bytes
Variable Size            1610616056 bytes
Database Buffers         3355443200 bytes
Redo Buffers                8957952 bytes
數(shù)據(jù)庫裝載完畢。
數(shù)據(jù)庫已經(jīng)打開。
SQL> archive log lis;t
SP2-0718: 非法的  ARCHIVE LOG 選項(xiàng)
SQL> archive log list;         
數(shù)據(jù)庫日志模式             非存檔模式
自動存檔             禁用
存檔終點(diǎn)            USE_DB_RECOVERY_FILE_DEST
最早的聯(lián)機(jī)日志序列     1
當(dāng)前日志序列           3
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/data/oradata/topicisxc/system01.dbf
/data/oradata/topicisxc/sysaux01.dbf
/data/oradata/topicisxc/undotbs01.dbf
/data/oradata/topicisxc/users01.dbf

SQL> select name from v$tempfile;

NAME
--------------------------------------------------------------------------------
/data/oradata/topicisxc/temp01.dbf

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/data/oradata/topicisxc/redo03.log
/data/oradata/topicisxc/redo02.log
/data/oradata/topicisxc/redo01.log

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/data/oradata/topicisxc/control01.ctl
/opt/u01/app/oracle/fast_recovery_area/topicisxc/control02.ctl

SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /opt/u01/app/oracle/product/11
                                                 .2.0/db_1/dbs/spfiletopicisxc.
                                                 ora

遷移步驟

創(chuàng)建pfile文件

export ORACLE_SID=topicisxc
sqlplus / as sysdba
SQL> create pfile='/home/oracle/pfiletopicisxc0104.ora' from spfile;
File created.

關(guān)閉數(shù)據(jù)庫

export ORACLE_SID=topicisxc
sqlplus / as sysdba
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit

--查看進(jìn)程
[oracle@cxdb gs]# ps -ef | grep ora_pmon
root     12919 12862  0 17:43 pts/7    00:00:00 grep --color=auto ora_pmon
[oracle@cxdb gs]# 

移動數(shù)據(jù)庫文件到新路徑

--創(chuàng)建目錄
[root@cxdb ~]# cd /gs
[root@cxdb gs]# ls -l
總用量 20
drwxr-xr-x. 2 root root  4096 1月   4 15:55 back
drwx------  2 root root 16384 1月   3 20:24 lost+found
[root@cxdb gs]# mkdir -p oradatanew
[root@cxdb gs]# chown -R oracle:oinstall oradatanew/
[root@cxdb gs]# ls -ld oradatanew/
drwxr-xr-x 2 oracle oinstall 4096 1月   4 17:41 oradatanew/
[root@cxdb gs]# chmod -R 755 oradatanew/

--移動數(shù)據(jù)庫文件到新路徑  盡可能用oracle用戶移動
[oracle@cxdb data]$ cd oradata/
[oracle@cxdb oradata]$ ls -l
total 0
drwxr-x---. 2 oracle oinstall 179 Jan  3 19:43 topicisxc
[oracle@cxdb oradata]$ cp -r topicisxc /gs/oradatanew/
[oracle@cxdb oradata]$ ls -l /gs/oradatanew/
total 4
drwxr-x--- 2 oracle oinstall 4096 Jan  4 17:43 topicisxc
[oracle@cxdb oradata]$ ls -l /gs/oradatanew/topicisxc/
total 2919424
-rw-r----- 1 oracle oinstall   9748480 Jan  4 17:43 control01.ctl
-rw-r----- 1 oracle oinstall 524288512 Jan  4 17:43 redo01.log
-rw-r----- 1 oracle oinstall 524288512 Jan  4 17:43 redo02.log
-rw-r----- 1 oracle oinstall 524288512 Jan  4 17:43 redo03.log
-rw-r----- 1 oracle oinstall 545267712 Jan  4 17:43 sysaux01.dbf
-rw-r----- 1 oracle oinstall 775954432 Jan  4 17:43 system01.dbf
-rw-r----- 1 oracle oinstall  30416896 Jan  4 17:43 temp01.dbf
-rw-r----- 1 oracle oinstall  78651392 Jan  4 17:43 undotbs01.dbf
-rw-r----- 1 oracle oinstall   5251072 Jan  4 17:43 users01.dbf

--移動控制文件到新路徑   盡可能用oracle用戶移動
[oracle@cxdb ~]$ cp /opt/u01/app/oracle/fast_recovery_area/topicisxc/control02.ctl /gs/oradatanew/topicisxc/control02.ctl

--復(fù)制完成后查看
[oracle@cxdb ~]$ ls -l /gs/oradatanew/topicisxc
total 2928944
-rw-r----- 1 oracle oinstall   9748480 Jan  4 17:43 control01.ctl
-rw-r----- 1 oracle oinstall   9748480 Jan  4 17:51 control02.ctl
-rw-r----- 1 oracle oinstall 524288512 Jan  4 17:43 redo01.log
-rw-r----- 1 oracle oinstall 524288512 Jan  4 17:43 redo02.log
-rw-r----- 1 oracle oinstall 524288512 Jan  4 17:43 redo03.log
-rw-r----- 1 oracle oinstall 545267712 Jan  4 17:43 sysaux01.dbf
-rw-r----- 1 oracle oinstall 775954432 Jan  4 17:43 system01.dbf
-rw-r----- 1 oracle oinstall  30416896 Jan  4 17:43 temp01.dbf
-rw-r----- 1 oracle oinstall  78651392 Jan  4 17:43 undotbs01.dbf
-rw-r----- 1 oracle oinstall   5251072 Jan  4 17:43 users01.dbf

更改生成的參數(shù)文件中的控制文件路徑

--更改pfile中的控制文件路徑
[oracle@cxdb oradata]$ cd
[oracle@cxdb ~]$ ls -l
total 4
-rw-r--r-- 1 oracle oinstall 1188 Jan  4 17:38 pfiletopicisxc0104.ora
[oracle@cxdb ~]$ vi pfiletopicisxc0104.ora
topicisxc.__db_cache_size=4110417920
topicisxc.__java_pool_size=33554432
topicisxc.__large_pool_size=50331648
topicisxc.__oracle_base='/opt/u01/app/oracle/'#ORACLE_BASE set from environment
topicisxc.__pga_aggregate_target=1677721600
topicisxc.__sga_target=4999610368
topicisxc.__shared_io_pool_size=0
topicisxc.__shared_pool_size=771751936
topicisxc.__streams_pool_size=0
*.audit_file_dest='/opt/u01/app/oracle/admin/topicisxc/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/gs/oradatanew/topicisxc/control01.ctl','/gs/oradatanew/topicisxc/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='topicisx'
*.db_recovery_file_dest='/opt/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=214748364800
*.db_unique_name='topicisxc'
*.diagnostic_dest='/opt/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=topicisxcXDB)'
*.filesystemio_options='setall'
*.job_queue_processes=1000
*.nls_language='SIMPLIFIED CHINESE'
*.nls_territory='CHINA'
*.open_cursors=1000
*.pga_aggregate_target=1665138688
*.processes=2000
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=2450
*.sga_target=4995416064
*.undo_tablespace='UNDOTBS1'

更改控制文件路徑 *.control_files='/gs/oradatanew/topicisxc/control01.ctl','/gs/oradatanew/topicisxc/control02.ctl'

用改好的pfile文件啟動數(shù)據(jù)庫到mount狀態(tài)

--用改好的pfile文件啟動數(shù)據(jù)庫到nomount狀態(tài)
export ORACLE_SID=topicisxc
sqlplus / as sysdba
SQL> startup pfile='/home/oracle/pfiletopicisxc0104.ora' nomount
ORACLE instance started.
 
Total System Global Area 1778384896 bytes
Fixed Size                  8621712 bytes
Variable Size             687866224 bytes
Database Buffers         1073741824 bytes
Redo Buffers                8155136 bytes

--啟動數(shù)據(jù)庫到mount狀態(tài)
SQL> alter database mount;                               
Database altered.

重定向數(shù)據(jù)庫控制文件中的所有數(shù)據(jù)文件和日志文件路徑

export ORACLE_SID=topicisxc
sqlplus / as sysdba
SQL> alter database rename file '/data/oradata/topicisxc/system01.dbf' to '/gs/oradatanew/topicisxc/system01.dbf';

數(shù)據(jù)庫已更改。

SQL> alter database rename file '/data/oradata/topicisxc/sysaux01.dbf' to '/gs/oradatanew/topicisxc/sysaux01.dbf';

數(shù)據(jù)庫已更改。

SQL> alter database rename file '/data/oradata/topicisxc/undotbs01.dbf' to '/gs/oradatanew/topicisxc/undotbs01.dbf';

數(shù)據(jù)庫已更改。

SQL> alter database rename file '/data/oradata/topicisxc/users01.dbf' to '/gs/oradatanew/topicisxc/users01.dbf';

數(shù)據(jù)庫已更改。

SQL> alter database rename file '/data/oradata/topicisxc/temp01.dbf' to '/gs/oradatanew/topicisxc/temp01.dbf';

數(shù)據(jù)庫已更改。

SQL> alter database rename file '/data/oradata/topicisxc/redo01.log' to '/gs/oradatanew/topicisxc/redo01.log';

數(shù)據(jù)庫已更改。

SQL> alter database rename file '/data/oradata/topicisxc/redo02.log' to '/gs/oradatanew/topicisxc/redo02.log';

數(shù)據(jù)庫已更改。

SQL> alter database rename file '/data/oradata/topicisxc/redo03.log' to '/gs/oradatanew/topicisxc/redo03.log';

數(shù)據(jù)庫已更改。

打開數(shù)據(jù)庫

export ORACLE_SID=topicisxc
sqlplus / as sysdba
SQL> alter database open;
數(shù)據(jù)庫已更改。

檢查各文件路徑

export ORACLE_SID=topicisxc
sqlplus / as sysdba
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/gs/oradatanew/topicisxc/system01.dbf
/gs/oradatanew/topicisxc/sysaux01.dbf
/gs/oradatanew/topicisxc/undotbs01.dbf
/gs/oradatanew/topicisxc/users01.dbf

SQL> select name from v$tempfile; 

NAME
--------------------------------------------------------------------------------
/gs/oradatanew/topicisxc/temp01.dbf

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/gs/oradatanew/topicisxc/redo03.log
/gs/oradatanew/topicisxc/redo02.log
/gs/oradatanew/topicisxc/redo01.log

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/gs/oradatanew/topicisxc/control01.ctl
/gs/oradatanew/topicisxc/control02.ctl

SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string

創(chuàng)建spfile

export ORACLE_SID=topicisxc
sqlplus / as sysdba
SQL> create spfile from pfile='/home/oracle/pfiletopicisxc0104.ora';

文件已創(chuàng)建。

重啟數(shù)據(jù)庫

export ORACLE_SID=topicisxc
sqlplus / as sysdba

--關(guān)閉數(shù)據(jù)庫
SQL> shutdown immediate
數(shù)據(jù)庫已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫。
ORACLE 例程已經(jīng)關(guān)閉。

--啟動數(shù)據(jù)庫
SQL> startup
ORACLE 例程已經(jīng)啟動。

Total System Global Area 4977278976 bytes
Fixed Size                  2261768 bytes
Variable Size            1610616056 bytes
Database Buffers         3355443200 bytes
Redo Buffers                8957952 bytes
數(shù)據(jù)庫裝載完畢。
數(shù)據(jù)庫已經(jīng)打開。

清理原文件(可選)

如果磁盤空間足夠,可省略該步驟。

--刪除原控制文件
[root@cxdb data]# cd /opt/u01/app/oracle/fast_recovery_area/topicisxc/
[root@cxdb topicisxc]# ls -l
總用量 9520
-rw-r-----. 1 oracle oinstall 9748480 1月   4 17:38 control02.ctl
[root@cxdb topicisxc]# rm -f control02.ctl


--刪除原數(shù)據(jù)文件  臨時文件 控制文件 日志文件
[root@cxdb ~]# cd /data/
[root@cxdb data]# ls -l
總用量 0
drwxrwxrwx. 3 root root 23 1月   3 19:36 oradata
[root@cxdb data]# ls -l oradata/
總用量 0
drwxr-x---. 2 oracle oinstall 179 1月   3 19:43 topicisxc
[root@cxdb data]# ls -l
總用量 0
drwxrwxrwx. 3 root root 23 1月   3 19:36 oradata
[root@cxdb data]# ls -l oradata/topicisxc/
總用量 2919404
-rw-r-----. 1 oracle oinstall   9748480 1月   4 17:38 control01.ctl
-rw-r-----. 1 oracle oinstall 524288512 1月   4 17:32 redo01.log
-rw-r-----. 1 oracle oinstall 524288512 1月   4 17:32 redo02.log
-rw-r-----. 1 oracle oinstall 524288512 1月   4 17:38 redo03.log
-rw-r-----. 1 oracle oinstall 545267712 1月   4 17:38 sysaux01.dbf
-rw-r-----. 1 oracle oinstall 775954432 1月   4 17:38 system01.dbf
-rw-r-----. 1 oracle oinstall  30416896 1月   3 22:00 temp01.dbf
-rw-r-----. 1 oracle oinstall  78651392 1月   4 17:38 undotbs01.dbf
-rw-r-----. 1 oracle oinstall   5251072 1月   4 17:38 users01.dbf
[root@cxdb data]# rm -rf oradata/

參考鏈接:Oracle數(shù)據(jù)庫遷移數(shù)據(jù)文件到新路徑_oracle數(shù)據(jù)文件遷移到其他目錄-CSDN博客

到此這篇關(guān)于Oracle數(shù)據(jù)庫遷移所有文件到新掛載磁盤路徑的文章就介紹到這了,更多相關(guān)Oracle遷移到新掛載磁盤內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Oracle數(shù)據(jù)庫查看鎖表語句和解鎖的方法示例

    Oracle數(shù)據(jù)庫查看鎖表語句和解鎖的方法示例

    在DBA的日常工作中,經(jīng)常遇到為Oracle用戶解鎖的操作,這篇文章主要給大家介紹了關(guān)于Oracle數(shù)據(jù)庫查看鎖表語句和解鎖的相關(guān)資料,文中通過代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-10-10
  • Oracle 12.2監(jiān)聽無法啟動解決方法

    Oracle 12.2監(jiān)聽無法啟動解決方法

    這篇文章主要介紹了Oracle 12.2監(jiān)聽無法啟動解決方法,需要的朋友可以參考下
    2017-11-11
  • ora-00119和ora-00132問題的解決方法

    ora-00119和ora-00132問題的解決方法

    這篇文章主要為大家詳細(xì)介紹了ora-00119和ora-00132問題的解決方法,感興趣的小伙伴們可以參考一下
    2016-07-07
  • Oracle表關(guān)聯(lián)更新幾種方法小結(jié)

    Oracle表關(guān)聯(lián)更新幾種方法小結(jié)

    這篇文章主要介紹了Oracle表關(guān)聯(lián)更新幾種方法,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,對大家的學(xué)習(xí)或工作有一定的幫助,需要的朋友可以參考下
    2024-05-05
  • oracle分區(qū)表之hash分區(qū)表的使用及擴(kuò)展

    oracle分區(qū)表之hash分區(qū)表的使用及擴(kuò)展

    Hash分區(qū)是Oracle實(shí)現(xiàn)表分區(qū)的三種基本分區(qū)方式之一。對于那些無法有效劃分分區(qū)范圍的大表,或者出于某些特殊考慮的設(shè)計(jì),需要使用Hash分區(qū),下面介紹使用方法
    2014-01-01
  • ORACLE查看并修改最大連接數(shù)的具體步驟

    ORACLE查看并修改最大連接數(shù)的具體步驟

    本節(jié)主要介紹了ORACLE查看并修改最大連接數(shù)的具體步驟,需要的朋友可以參考下
    2014-07-07
  • Oracle 11g中密碼過期問題詳解

    Oracle 11g中密碼過期問題詳解

    本文主要是對Oracle中產(chǎn)生密碼過期的2種情況進(jìn)行了詳細(xì)分析,并給出了解決方案,非常的簡單實(shí)用,有需要的朋友可以參考下
    2014-09-09
  • Oracle數(shù)據(jù)庫中SQL開窗函數(shù)的使用

    Oracle數(shù)據(jù)庫中SQL開窗函數(shù)的使用

    這篇文章主要介紹了Oracle數(shù)據(jù)庫中SQL開窗函數(shù)的使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-07-07
  • Oracle存儲過程新手入門教程(附學(xué)習(xí)用例)

    Oracle存儲過程新手入門教程(附學(xué)習(xí)用例)

    存儲過程就是作為可執(zhí)行對象存放在數(shù)據(jù)庫中的一個或多個SQL命令,下面這篇文章主要給大家介紹了關(guān)于Oracle存儲過程新手入門教程的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-03-03
  • Oracle中獲取會話信息的兩個函數(shù)分享

    Oracle中獲取會話信息的兩個函數(shù)分享

    這篇文章主要介紹了Oracle中獲取會話信息的兩個函數(shù)分享,本文分別講解了USERENV和兩個函數(shù)sys_context,并對可以獲取哪些信息作了介紹,需要的朋友可以參考下
    2014-12-12

最新評論

吉首市| 成都市| 喜德县| 军事| 电白县| 清苑县| 辛集市| 临清市| 宜黄县| 五家渠市| 雷山县| 临清市| 屏东县| 金阳县| 东丰县| 英吉沙县| 绩溪县| 曲靖市| 康平县| 水富县| 昌吉市| 如东县| 麻江县| 乌拉特中旗| 鸡西市| 道孚县| 正安县| 湖北省| 石屏县| 贵阳市| 浠水县| 东兴市| 崇信县| 柯坪县| 姚安县| 黑山县| 湘乡市| 淮安市| 林州市| 阳高县| 卫辉市|