user11236651 Asked: 2020-07-03 22:33:48 +0800 CST2020-07-03 22:33:48 +0800 CST 2020-07-03 22:33:48 +0800 CST 如何在 bash 脚本中引用 SQL*Plus 标识符? 772 无论我如何尝试在以下命令中引用标识符,我都会得到 "ORA-00904: "MEMORY_TARGET": invalid identifier": MEMORY_TARGET=$(su - orat01 -c " echo 'select VALUE from V\$PARAMETER where name = 'memory_target';'| sqlplus / as sysdba ") 任何关于如何做到这一点的想法将不胜感激。 oracle scripting 1 个回答 Voted Best Answer Balazs Papp 2020-07-03T23:42:29+08:002020-07-03T23:42:29+08:00 [root@o73 ~]# SGA_TARGET=$(su - oracle -c "export ORACLE_SID=RYMIN19; export ORAENV_ASK=NO; . oraenv >/dev/null; echo \"set pages 0 select value from v\\\$parameter where name = 'sga_target';\" | sqlplus -s / as sysdba") [root@o73 ~]# echo $SGA_TARGET 2147483648 [root@o73 ~]#
1 个回答