手動建庫過程錯誤
模擬手動建庫的過程,往往在中間建立引數檔案的過程容易出錯,
最容易出錯的地方是審計目錄的設定,容易被忽略,其次就是控制檔案目錄
的設定,往往在啟動例項的時候報錯ORA-09925:。以下是模擬一些錯誤並糾正的過程。
1、確定例項名:
[oracle@enmo ~]$ export ORACLE_SID=PROD
[oracle@enmo ~]$ cd $ORACLE_HOME/dbs
[oracle@enmo dbs]$
[oracle@enmo dbs]$ ls
hc_OCMU.dat initOCMU.ora init.ora.bck lkORA11GR2 orapwPROD spfileOCMU.ora
hc_PROD.dat init.ora initPROD.ora lkPROD snapcf_OCMU.f spfilePROD.ora
[oracle@enmo dbs]$
2、從spfile檔案建立pfile檔案:
[oracle@enmo dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 13 13:54:17 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
3、開啟例項到nomount狀態:
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 541068368 bytes
Database Buffers 289406976 bytes
Redo Buffers 2371584 bytes
SQL> select status fron v$instance;
select status fron v$instance
*
SQL> select status from v$instance ;
STATUS
------------
STARTED
這個狀態下,還沒有開啟spfile引數檔案:
4、建立引數pfile檔案:
SQL> create pfile from spfile;
File created.
檔案已經建立。
[oracle@enmo dbs]$ ls
hc_OCMU.dat initOCMU.ora init.ora.bck lkORA11GR2 orapwPROD spfileOCMU.ora
hc_PROD.dat init.ora initPROD.ora lkPROD snapcf_OCMU.f spfilePROD.ora
[oracle@enmo dbs]$
5、修改pfile引數檔案並模擬設定audit_file_dest目錄錯誤情況:
修改前:
[oracle@enmo dbs]$ vi initPROD.ora
PROD.__db_cache_size=289406976
PROD.__java_pool_size=4194304
PROD.__large_pool_size=71303168
PROD.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
PROD.__pga_aggregate_target=335544320
PROD.__sga_target=503316480
PROD.__shared_io_pool_size=0
PROD.__shared_pool_size=130023424
PROD.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/prod/adump'
*.compatible='11.2.0'
*.control_files='/u01/app/oracle/oradata/PROD/ora_control1.ctl','/u01/app/oracle/oradata/PROD/ora_control2.ctl',
'/u01/app/oracle/fast_recovery_area/ora_control3.ctl','/u01/app/FRA/ora_control4.ctl'
*.db_block_size=8192
*.db_domain='oracle.com'
*.db_name='PROD'
*.db_recovery_file_dest_size=3221225472
*.db_recovery_file_dest='/u01/app/FRA/'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.memory_target=800M
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
修改後:
[oracle@enmo dbs]$ vi initPROD.ora
PROD.__db_cache_size=289406976
PROD.__java_pool_size=4194304
PROD.__large_pool_size=71303168
PROD.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
PROD.__pga_aggregate_target=335544320
PROD.__sga_target=503316480
PROD.__shared_io_pool_size=0
PROD.__shared_pool_size=130023424
PROD.__streams_pool_size=0
*.audit_file_dest='<ORACLE_BASE>/admin/prod/adump'
*.compatible='11.2.0'
*.control_files='/u01/app/oracle/oradata/PROD/ora_control1.ctl','/u01/app/oracle/oradata/PROD/ora_control2.ctl',
'/u01/app/oracle/fast_recovery_area/ora_control3.ctl','/u01/app/FRA/ora_control4.ctl'
*.db_block_size=8192
*.db_domain='oracle.com'
*.db_name='PROD'
*.db_recovery_file_dest_size=3221225472
*.db_recovery_file_dest='/u01/app/FRA/'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.memory_target=800M
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
6、生成spfile檔案:
SQL> create spfile from pfile;
File created.
7、開啟例項:
[oracle@enmo dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 13 14:16:27 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
發現報錯,是由於Unable to create audit trail file系統沒有相應的目錄。
8、檢視系統層的目錄/路徑:
[oracle@enmo prod]$ pwd
/u01/app/oracle/admin/prod
[oracle@enmo prod]$ cd adump
[oracle@enmo adump]$
9、去修改pfile檔案,重新生成spfile檔案:
[oracle@enmo dbs]$ vi initPROD.ora
PROD.__db_cache_size=289406976
PROD.__java_pool_size=4194304
PROD.__large_pool_size=71303168
PROD.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
PROD.__pga_aggregate_target=335544320
PROD.__sga_target=503316480
PROD.__shared_io_pool_size=0
PROD.__shared_pool_size=130023424
PROD.__streams_pool_size=0
*.audit_file_dest='<ORACLE_BASE>/admin/prod/adump' ----糾正後
*.compatible='11.2.0'
... ...
10、從 pfile生成spfile:
SQL> create spfile from pfile;
File created.
11、修改過後,啟動資料庫到nomount狀態:
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 541068368 bytes
Database Buffers 289406976 bytes
Redo Buffers 2371584 bytes
SQL>
12、到這裡,直接執行建庫指令碼。
由於我的已經建好,所以直接修改到mount狀態。
SQL> alter database mount;
Database altered.
最容易出錯的地方是審計目錄的設定,容易被忽略,其次就是控制檔案目錄
的設定,往往在啟動例項的時候報錯ORA-09925:。以下是模擬一些錯誤並糾正的過程。
1、確定例項名:
[oracle@enmo ~]$ export ORACLE_SID=PROD
[oracle@enmo ~]$ cd $ORACLE_HOME/dbs
[oracle@enmo dbs]$
[oracle@enmo dbs]$ ls
hc_OCMU.dat initOCMU.ora init.ora.bck lkORA11GR2 orapwPROD spfileOCMU.ora
hc_PROD.dat init.ora initPROD.ora lkPROD snapcf_OCMU.f spfilePROD.ora
[oracle@enmo dbs]$
2、從spfile檔案建立pfile檔案:
[oracle@enmo dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 13 13:54:17 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
3、開啟例項到nomount狀態:
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 541068368 bytes
Database Buffers 289406976 bytes
Redo Buffers 2371584 bytes
SQL> select status fron v$instance;
select status fron v$instance
*
SQL> select status from v$instance ;
STATUS
------------
STARTED
這個狀態下,還沒有開啟spfile引數檔案:
4、建立引數pfile檔案:
SQL> create pfile from spfile;
File created.
檔案已經建立。
[oracle@enmo dbs]$ ls
hc_OCMU.dat initOCMU.ora init.ora.bck lkORA11GR2 orapwPROD spfileOCMU.ora
hc_PROD.dat init.ora initPROD.ora lkPROD snapcf_OCMU.f spfilePROD.ora
[oracle@enmo dbs]$
5、修改pfile引數檔案並模擬設定audit_file_dest目錄錯誤情況:
修改前:
[oracle@enmo dbs]$ vi initPROD.ora
PROD.__db_cache_size=289406976
PROD.__java_pool_size=4194304
PROD.__large_pool_size=71303168
PROD.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
PROD.__pga_aggregate_target=335544320
PROD.__sga_target=503316480
PROD.__shared_io_pool_size=0
PROD.__shared_pool_size=130023424
PROD.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/prod/adump'
*.compatible='11.2.0'
*.control_files='/u01/app/oracle/oradata/PROD/ora_control1.ctl','/u01/app/oracle/oradata/PROD/ora_control2.ctl',
'/u01/app/oracle/fast_recovery_area/ora_control3.ctl','/u01/app/FRA/ora_control4.ctl'
*.db_block_size=8192
*.db_domain='oracle.com'
*.db_name='PROD'
*.db_recovery_file_dest_size=3221225472
*.db_recovery_file_dest='/u01/app/FRA/'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.memory_target=800M
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
修改後:
[oracle@enmo dbs]$ vi initPROD.ora
PROD.__db_cache_size=289406976
PROD.__java_pool_size=4194304
PROD.__large_pool_size=71303168
PROD.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
PROD.__pga_aggregate_target=335544320
PROD.__sga_target=503316480
PROD.__shared_io_pool_size=0
PROD.__shared_pool_size=130023424
PROD.__streams_pool_size=0
*.audit_file_dest='<ORACLE_BASE>/admin/prod/adump'
*.compatible='11.2.0'
*.control_files='/u01/app/oracle/oradata/PROD/ora_control1.ctl','/u01/app/oracle/oradata/PROD/ora_control2.ctl',
'/u01/app/oracle/fast_recovery_area/ora_control3.ctl','/u01/app/FRA/ora_control4.ctl'
*.db_block_size=8192
*.db_domain='oracle.com'
*.db_name='PROD'
*.db_recovery_file_dest_size=3221225472
*.db_recovery_file_dest='/u01/app/FRA/'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.memory_target=800M
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
6、生成spfile檔案:
SQL> create spfile from pfile;
File created.
7、開啟例項:
[oracle@enmo dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 13 14:16:27 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount;
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
發現報錯,是由於Unable to create audit trail file系統沒有相應的目錄。
8、檢視系統層的目錄/路徑:
[oracle@enmo prod]$ pwd
/u01/app/oracle/admin/prod
[oracle@enmo prod]$ cd adump
[oracle@enmo adump]$
9、去修改pfile檔案,重新生成spfile檔案:
[oracle@enmo dbs]$ vi initPROD.ora
PROD.__db_cache_size=289406976
PROD.__java_pool_size=4194304
PROD.__large_pool_size=71303168
PROD.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
PROD.__pga_aggregate_target=335544320
PROD.__sga_target=503316480
PROD.__shared_io_pool_size=0
PROD.__shared_pool_size=130023424
PROD.__streams_pool_size=0
*.audit_file_dest='<ORACLE_BASE>/admin/prod/adump' ----糾正後
*.compatible='11.2.0'
... ...
10、從 pfile生成spfile:
SQL> create spfile from pfile;
File created.
11、修改過後,啟動資料庫到nomount狀態:
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 541068368 bytes
Database Buffers 289406976 bytes
Redo Buffers 2371584 bytes
SQL>
12、到這裡,直接執行建庫指令碼。
由於我的已經建好,所以直接修改到mount狀態。
SQL> alter database mount;
Database altered.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31392094/viewspace-2126306/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- sql server資料庫附加錯誤的解決過程SQLServer資料庫
- 恢復MySQL資料庫建立儲存過程是遇到錯誤MySql資料庫儲存過程
- 一個 ExpressionChangedAfterItHasBeenCheckedError 錯誤的解決過程ExpressError
- nvidia驅動安裝過程中報已有nouveau驅動錯誤解決
- Tigase手動安裝過程
- tensorflow安裝使用過程錯誤及解決方法
- Cypress 本身啟動過程的除錯除錯
- ORACLE建庫過程中自動生成的跟鎖相關的VIEWOracleView
- 多年客戶金幣計算錯誤解決過程
- 使用者研究過程中常犯的10個錯誤
- C語言程式碼區錯誤以及編譯過程C語言編譯
- 靜默安裝and手動建庫
- 關於tsup工具構建專案庫使用過程
- ng-template 使用過程中引數傳遞錯誤的單步除錯除錯
- 拋開dbca,手動建庫步驟
- centos下caffe用GPU編譯搭建過程以及錯誤總結CentOSGPU編譯
- MySQL 跳過同步錯誤MySql
- 解決遷移資料庫錯誤,索引長度過長資料庫索引
- IT職場:PFMEA是如何減少製造過程中的錯誤的?
- Adobe 系列安裝過程中出現錯誤程式碼107解決方法
- Adobe 2022安裝過程中出現錯誤程式碼107解決方法
- 攜程小程式生態之自動化錯誤預警方案
- db2執行建立存貯過程報錯SQL0104N,即語法錯誤DB2SQL
- 錯誤處理:如何通過 error、deferred、panic 等處理錯誤?Error
- ORA-01653錯誤是Oracle資料庫中常見的錯誤Oracle資料庫
- webpack打包過程如何除錯?Web除錯
- 簡單介紹Oracle 19c RAC 手工建庫的過程Oracle
- redis cluster + sentinel詳細過程和錯誤處理三主三備三哨兵Redis
- Windows 下 Laravel Mix 資源編譯過程以及產生的錯誤解決WindowsLaravel編譯
- 關於JDBC學習過程中的注意事項(分享自己犯過的錯誤,寫給初學JDBC的小夥伴的八條建議)JDBC
- Oracle資料庫啟動過程及狀態詳解Oracle資料庫
- Service啟動過程
- SpringBoot啟動過程Spring Boot
- Windows 啟動過程Windows
- openGauss 支援儲存過程除錯儲存過程除錯
- plsqlDevloper 儲存過程的除錯SQLdev儲存過程除錯
- 手寫IOC實現過程
- 手寫AOP實現過程
- Idea開發JAVA過程中遇到的錯誤集合以及解決方法,持續更新IdeaJava