Logged in as oracle user this works :
Make sure ORACLE_HOME, ORACLE_SID and PATH are all set :
# echo $ORACLE_HOME
/export/home/database/11g/app/oracle/product/11.2.0/dbhome_1
# echo $ORACLE_SID
orcl
# echo $PATH
/usr/bin:/export/home/database/11g/app/oracle/product/11.2.0/dbhome_1/bin:
# $ORACLE_HOME/bin/sqlplus -s "/ as sysdba"<<! >
/tmp/check_$ORACLE_SID.tom.ora
> select * from v\$database;
> exit
> !
# cat /tmp/check_$ORACLE_SID.tom.ora
DBID NAME CREATED RESETLOGS_CHANGE# RESETLOGS
---------- --------- --------- ----------------- ---------
PRIOR_RESETLOGS_CHANGE# PRIOR_RES LOG_MODE CHECKPOINT_CHANGE#
----------------------- --------- ------------ ------------------
ARCHIVE_CHANGE# CONTROL CONTROLFI CONTROLFILE_SEQUENCE# CONTROLFILE_CHANGE#
--------------- ------- --------- --------------------- -------------------
CONTROLFI OPEN_RESETL VERSION_T OPEN_MODE PR
Command :
/bin/su - oracle -c
"ORACLE_HOME=/export/home/database/11g/app/oracle/product/11.2.0/dbhome_1;export
ORACLE_HOME;ORACLE_SID=orcl;export ORACLE_SID;$ORACLE_HOME/bin/sqlplus
-s '/ as sysdba'<<! > /tmp/check_$ORACLE_SID.ora
select * from dual;
exit
!"
No comments:
Post a Comment