[oracle@oracle_db ~]$
[oracle@oracle_db ~]$ sqlplus /NOLOG
SQL*Plus: Release 12.1.0.2.0 Production on 火 2月 7 11:22:02 2023
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SQL> connect as sysdba
ユーザー名を入力してください: sys
パスワードを入力してください:
アイドル・インスタンスに接続しました。
SQL>
SQL> select sysdate from dual;
select sysdate from dual
*
行1でエラーが発生しました。:
ORA-01034: ORACLE not available
プロセスID: 0
セッションID: 0、シリアル番号: 0
[oracle@oracle_db bin]$
[oracle@oracle_db bin]$ echo $ORACLE_HOME
/u01/app/oracle//product/12.1.0/dbhome_1
[oracle@oracle_db bin]$
[oracle@oracle_db bin]$ echo $ORACLE_SID
xxx
[oracle@oracle_db bin]$
[oracle@oracle_db bin]$ cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/u01/app/oracle/
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export NLS_LANG=Japanese_Japan.AL32UTF8
export ORACLE_SID=xxx
PATH=$PATH:$HOME/.local/bin:$HOME/bin
#export PATH
export PATH=$ORACLE_HOME/bin:$PATH
[oracle@oracle_db bin]$
[oracle@oracle_db bin]$ vi ~/.bash_profile
[oracle@oracle_db bin]$
[oracle@oracle_db bin]$ cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export NLS_LANG=Japanese_Japan.AL32UTF8
export ORACLE_SID=sis
PATH=$PATH:$HOME/.local/bin:$HOME/bin
#export PATH
export PATH=$ORACLE_HOME/bin:$PATH
[oracle@oracle_db bin]$
[oracle@oracle_db bin]$ echo $ORACLE_HOME
/u01/app/oracle//product/12.1.0/dbhome_1
[oracle@oracle_db bin]$
[oracle@oracle_db bin]$ source ~/.bash_profile
[oracle@oracle_db bin]$
[oracle@oracle_db bin]$ echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0/dbhome_1
[oracle@oracle_db bin]$
[oracle@oracle_db bin]$ sqlplus /NOLOG
SQL*Plus: Release 12.1.0.2.0 Production on 火 2月 7 11:31:17 2023
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SQL> connect as sysdba
ユーザー名を入力してください: sys
パスワードを入力してください:
接続されました。
SQL>
SQL>
SQL> select systimestamp from dual;
SYSTIMESTAMP
---------------------------------------------------------------------------
23-02-07 11:34:26.157777 +08:00
SQL>