root用户执行以下脚本
#!/bin/bash
su - oracle -c "sqlplus / as sysdba <
select * from tab;
#!/bin/bash
su - oracle -c "sqlplus / as sysdba <
exit
EOF" > /home/oracle/111.txt 2>&1
开机自启动ORACLE
vi /home/oracle/start_db.sh
#!/bin/bash
su - oracle <
lsnrctl start
sqlplus / as sysdba
spool /home/oracle/start.log
startup
spool off
exit
EO
sh /home/oracle/start_db.sh
测试:
在oracle用户下
sqlplus -s scott/tiger@oracle < SELECT TABLESPACE_NAME,
TABLESPACE_SIZE/1024/1024/1024 as "TABLESPACE_SIZE(G)",
ALLOCATED_SPACE/1024/1024/1024 as "ALLOCATED_SPACE (G)",
FREE_SPACE/1024/1024/1024 as "FREE_SPACE(G)"
from DBA_TEMP_FREE_SPACE
exit
EOF>> /home/oracle/TEMP_FREE_SPACE_CHECK.txt
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28371090/viewspace-765949/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28371090/viewspace-765949/