通過DBCA新建一個數據庫后,執行以下命令報錯:
SQL> shutdown immediate;
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3701
Additional information: -1816206177
Process ID: 0
Session ID: 0 Serial number: 0
問題解決:
確認當前實例是否正確
export ORACLE_SID=xxxx --設置
echo $ORACLE_SID=xxxx --查看
查看監聽狀態
lsnrctl status
注意當我們新建數據庫之后需要修改oracle用戶下的.bash_profile的ORACLE_SID實例名一致,並且運行source .bash_profile 使其生效
export PATH export ORACLE_BASE=/usr/local/oracle export ORACLE_HOME=/usr/local/oracle/product/12201 export ORACLE_SID=zhaj export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
有三個地方的SID需要保持一致:
1、$ORACLE_BASE/admin/SID_NAME/pfile文件夾下的init文件中的SID;
2、/etc/oratab中的最后一行第一個“:”前,如“zhaj:/usr/local/oracle/product/12201:N”中的“zhaj”;
3、.bash_profile中的SID;