Oracle 軟體及資料庫複寫

來源:互聯網
上載者:User

條件:在同版本作業系統上,複製資料庫採用拷貝軟體及資料庫檔案方式進行複製具體過程如下:
1.在源庫所在Oracle安裝目錄下打包檔案:
js_znjh_1./app/oracle$tar cvf oracle.tar admin product utils

2、FTP傳輸打好的包
js_znjh_2./app/oracle$ftp 134.96.14.39
Connected to 134.96.14.39.
220 js_znjh_1 FTP server (Version 4.2 Sat Sep 8 09:49:58 CDT 2007) ready.
Name (134.96.14.39:oracle): oracle
331 Password required for oracle.
Password:
230-Last unsuccessful login: Tue Dec 29 14:36:56 BEIST 2009 on ftp from ::ffff:134.98.103.55
230-Last login: Thu Jan  7 15:06:50 BEIST 2010 on /dev/pts/2 from 134.98.83.38
230 User oracle logged in.
ftp> cd /app/oracle
250 CWD command successful.
ftp> bin          
200 Type set to I.
ftp> dir
200 PORT command successful.
150 Opening data connection for /bin/ls.
total 1408
drwxrwxr-x   16 oracle   dba            4096 Jan 12 2009  7592346
drwxr-x---    3 oracle   dba             256 Oct 15 11:00 admin
drwxr-xr-x    2 root     system          256 Oct 12 14:21 lost+found
drwxr-x---    5 oracle   dba             256 Oct 15 15:06 oraInventory
drwxrwx---    6 oracle   dba             256 Oct 14 11:58 oraInventory_bak
-rw-r-----    1 oracle   dba          713899 Oct 14 09:10 p7592346_10204_CPU.zip
drwxrwxr-x    3 oracle   dba             256 Oct 13 09:26 product
drwxr-xr-x    2 oracle   dba             256 Oct 13 09:09 utils
drwxr-xr-x    2 oracle   dba             256 Jan 07 10:24 oracle.tar
226 Transfer complete.
ftp> get oracle.tar

3、解壓:
ftp> quit
221 Goodbye.
js_znjh_2./app/oracle$ls
lost+found  oracle.tar
js_znjh_2./app/oracle$tar xvf oracle.tar

4、在源庫上備份控制檔案並拷貝到目標庫

5、在源庫上根據spfile檔案產生pfile檔案並拷貝到目標庫

6、源庫先停應用,再停庫,後拷貝源庫的資料庫檔案(停機拷貝)

7、啟源庫

8、目標庫做更改

 

SQL/PLUS登入報錯:
js_znjh_2./app/oracle$export ORACLE_SID=idep2
js_znjh_2./app/oracle$sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jan 7 13:21:18 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

exec(): 0509-036 Cannot load program oracleidep2 because of the following errors:
        0509-130 Symbol resolution failed for /usr/lib/libc.a[aio_64.o] because:
        0509-136   Symbol kaio_rdwr64 (number 1) is not exported from
                   dependent module /unix.
        0509-136   Symbol listio64 (number 2) is not exported from
                   dependent module /unix.
        0509-136   Symbol acancel64 (number 3) is not exported from
                   dependent module /unix.
        0509-136   Symbol iosuspend64 (number 4) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait (number 5) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait64 (number 6) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout (number 7) is not exported from
                   dependent module /unix.
        0509-136   Symbol aio_nwait_timeout64 (number 8) is not exported from
                   dependent module /unix.
        0509-026 System error: Error 0
        0509-192 Examine .loader section symbols with the
                 'dump -Tv' command.
ERROR:
ORA-12547: TNS:lost contact

網上搜尋提示說:AIO有問題,或沒開放,命令查看:
js_znjh_2./dev$lsattr -El aio0
autoconfig defined STATE to be configured at system restart True
fastpath   enable  State of fast path                       True
kprocprio  39      Server PRIORITY                          True
maxreqs    4096    Maximum number of REQUESTS               True
maxservers 10      MAXIMUM number of servers per cpu        True
minservers 1       MINIMUM number of servers                True

發現沒問題,求助SA,也說AIO沒問題,那這問題出在哪?繼續網上搜尋,有人提到 run rootpre.sh,開始RELINK ALL 的時候只是看到日誌裡面有很多的警示,內容比較多
沒有仔細看,但是末尾有提示說要執行root.sh檔案,但是沒有提醒要執行rootpre.sh檔案,

試試這個檔案吧,源地址上也沒有了,只好去安裝軟體的壓縮包裡面重新解壓取這個檔案,需要ROOT許可權才能運行,SA協助,解決了!!

 

又碰到一個問題,
建控制檔案不起來,怪了第一、二個可以建起來,第三個提示路徑不對,怪吧,要麼一個都建不起來啊,後來發現時initSID.ora這個檔案是源庫拷貝內容過來的,有換行,暈!
CREATE CONTROLFILE REUSE SET DATABASE "idep2" RESETLOGS FORCE LOGGING  NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-00200: control file could not be created
ORA-00202: control file: '/DataExchange2/oradata/id
ep2/control03.ctl'
ORA-27040: file create error, unable to create file
IBM AIX RISC System/6000 Error: 2: No such file or directory

 

具體語句如下:
create pfile='/app/oracle/product/10.2.0/db_1/dbs/init_idep2.ora' from spfile;


idep2.__db_cache_size=4261412864                                                
idep2.__java_pool_size=16777216                                                 
idep2.__large_pool_size=16777216                                                
idep2.__shared_pool_size=1023410176                                             
idep2.__streams_pool_size=33554432                                              
*.audit_file_dest='/app/oracle/admin/idep2/adump'                               
*.background_dump_dest='/app/oracle/admin/idep2/bdump'                          
*.compatible='10.2.0.3.0'                                                       
*.control_files='/DataExchange2/oradata/idep2/control01.ctl','/DataExchange2/oradata/idep2/control02.ctl','/DataExchange2/oradata/idep2/control03.ctl'                                                              
*.core_dump_dest='/app/oracle/admin/idep2/cdump'                                
*.db_block_size=8192                                                            
*.db_domain=''                                                                  
*.db_file_multiblock_read_count=16                                              
*.db_name='idep2'                                                               
*.job_queue_processes=10                                                        
*.open_cursors=300                                                              
*.pga_aggregate_target=1174405120                                               
*.processes=1000                                                                
*.remote_login_passwordfile='EXCLUSIVE'                                         
*.sessions=1105                                                                 
*.sga_max_size=5368709120                                                       
*.sga_target=5368709120                                                         
*.undo_management='AUTO'                                                        
*.undo_tablespace='UNDOTBS1'                                                    
*.user_dump_dest='/app/oracle/admin/idep2/udump' 


orapwd file=/app/oracle/product/10.2.0/db_1/dbs/orapwidep2 password=idep240 entries=10;   

alter database backup controlfile to trace;       


STARTUP NOMOUNT

CREATE CONTROLFILE REUSE SET DATABASE "idep2" RESETLOGS FORCE LOGGING  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/DataExchange2/oradata/idep2/redo01.log'  SIZE 1024M,
  GROUP 2 '/DataExchange2/oradata/idep2/redo02.log'  SIZE 1024M,
  GROUP 3 '/DataExchange2/oradata/idep2/redo03.log'  SIZE 1024M
-- STANDBY LOGFILE
DATAFILE
  '/DataExchange2/oradata/idep2/system01.dbf',
  '/DataExchange2/oradata/idep2/undotbs01.dbf',
  '/DataExchange2/oradata/idep2/sysaux01.dbf',
  '/DataExchange2/oradata/idep2/zhjs_index01.dbf',
  '/DataExchange2/oradata/idep2/zhjs_acc01.dbf',
  '/DataExchange2/oradata/idep2/zhjs_param01.dbf',
  '/DataExchange2/oradata/idep2/zhjs_log01.dbf',
  '/DataExchange2/oradata/idep2/zhjs_log02.dbf'
CHARACTER SET ZHS16GBK;


alter database open resetlogs;


ALTER TABLESPACE TEMP ADD TEMPFILE '/DataExchange2/oradata/idep2/temp01.dbf'
     SIZE 2048M REUSE AUTOEXTEND OFF;
    
ALTER TABLESPACE ZHJS_TEMP ADD TEMPFILE '/DataExchange2/oradata/idep2/zhjs_temp01.dbf'
     SIZE 5120M REUSE AUTOEXTEND OFF;
    
alter database rename global_name to idep2;    

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.