手動建庫過程錯誤
模擬手動建庫的過程,往往在中間建立引數檔案的過程容易出錯,
最容易出錯的地方是審計目錄的設定,容易被忽略,其次就是控制檔案目錄
的設定,往往在啟動例項的時候報錯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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 建庫的過程中DBCA報錯,錯誤號為ORA-12547
- 手動建立資料庫過程資料庫
- 手動建庫時一個錯誤:Error accessing PRODUCT_USER_PROFILEError
- 【問題處理】dbca建庫過程中報 ORA-04031錯誤的排查
- 手工建庫完成過程
- sql server資料庫附加錯誤的解決過程SQLServer資料庫
- oracle手動建庫Oracle
- oracle建庫過程詳解Oracle
- 恢復MySQL資料庫建立儲存過程是遇到錯誤MySql資料庫儲存過程
- oracle 之 手動建庫Oracle
- ORACLE RAC 手動建庫Oracle
- 手動建庫備註
- ORACLE建庫過程與操作(轉)Oracle
- DBCA建庫出現CHMOD NOT FOUND錯誤
- 走了一遍手動建立資料庫的過程資料庫
- 一個 ExpressionChangedAfterItHasBeenCheckedError 錯誤的解決過程ExpressError
- 在使用Kafka過程中遇到的錯誤Kafka
- ORA-2049錯誤解決過程
- nvidia驅動安裝過程中報已有nouveau驅動錯誤解決
- oracle 手動建庫詳解Oracle
- Tigase手動安裝過程
- 動態庫載入過程
- 資料庫啟動過程資料庫
- lv擴充套件過程中遇到的錯誤套件
- MySQL過程報 Parameter number N is not an OUT parameter錯誤MySql
- OGG 配置過程中的錯誤處理
- ORACLE監控系統錯誤日誌過程Oracle
- 遷移過程中出現的open failed錯誤AI
- 儲存過程中DDL錯誤一例儲存過程
- 透過oracle的指令碼研究其建庫過程Oracle指令碼
- 通過oracle的指令碼研究其建庫過程Oracle指令碼
- windows 上的手工建庫過程 (原創)Windows
- 靜默安裝and手動建庫
- oracle11g 手動建庫Oracle
- oracle 9i 手動建庫Oracle
- Sample Schemas建庫後手動建立
- 手動建庫時一個小錯誤:ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
- ORACLE建庫過程中自動生成的跟鎖相關的VIEWOracleView