Can I set any parameter(SHARED_POOL_SIZE) to fixed this error?There actually is a parameter, but in 11g XE it's not effective by default because Automatic Memory Management (AMM) is activated. AMM tries to tune the different memory parameters to achieve best performance for all activities in the database.
The parameters for AMM would be memory_target and memory_max_target where memory_target is the effecitve maximum amount of memory used by XE. If it's not enabled (set to 0), the other three might be effecitve.
select * from v$parameter where name in ('memory_target', 'sga_target','sga_max_size','pga_aggregate_target');
where +<size>M+ would be the amount of memory in megabytes. As mentioned before, you can assign a maximum of 1 GB and not more than you've defined in the memory_max_target parameter. To increase that value, you need to run
alter system set memory_target=<size>M;
and restart your database before you can alter memory_target to a higher value.
alter system set memory_max_target=<size>M scope=spfile;
If this all doesn't help, I'd recommend to dig in deeper into memory management of the Oracle Database. But let's start with first steps first.
alter system flush shared_pool;
I already have 1G memory_target.You mean you have 1G without setting that value manually? That sounds awkward, but anyway, since your query shows that the value is effective, it doesn't really matter how it was set.
And never to tune any parameter,It's mean my DB had setting default.
Sometimes I also get ora-12518,so I need restart DB.This is probably due to the shared pool issue as well, but you could take a look into the database listener's log and the alert log of the database to make sure that this is the actual reason.