-
Oracle databases are heavyweight, and their management is very complicated. Sort out the steps for starting and disabling Oracle databases on the linux platform.
After installing oracle, you must create an oracle system user,
Add several environment variables in. bash_PRofile under/home/oracle:
ORACLE_SID, ORACLE_BASE, ORACLE_HOME.
For example:
Export ORACLE_SID = test export ORACLE_BASE = oracle_install_dir export ORACLE_HOME = xxx
Start step: Pay attention to $ representing the shell command prompt. Here, oracle is version 9.0 or later.
$ Su-oracle
$ Sqlplus/nolog
SQL> conn/as sysdba
SQL> startup (generally, you do not need to add parameters. You only need to set environment variables)
SQL> quit (exit SQL Mode)
$ Lsnrctl start (start listener) Close oracle
$ Lsnrctl stop (close the listener. Close the application before that)
$ Sqlplus/nolog
SQL> shutdown: the shutdown parameter has four parameters. The meanings of the four parameters are as follows:
Normal: wait until all users are disconnected.
Immediate waits for the user to complete the current statement
Transactional waits for the user to complete the current transaction
Abort closes the database without waiting.
Normal requires that you close the database only after all connected users are disconnected. Sometimes it seems that the command is not running! New connections are not allowed after this command is executed.
Immediate disconnects the user after the user executes the statement being executed, and does not allow new users to connect.
Transactional disconnects after it supports executing the current transaction and does not allow new users to connect to the database.
Abort forcibly disconnects and closes the database.
The first three methods do not return lost user data. The fourth option is not recommended if it is no longer available!
SGA settings
Oracle sometimes encounters the following error and cannot connect to the database.
Such as: ORA-04031: unable to allocate 2216 bytes of shared memory ("shared pool "......
This indicates that the memory of a pool in oracle SGA (system global zone [including cache buffer, Shared Pool, java pool, large pool, and redo log buffer]) is insufficient,
Therefore, we need to reasonably configure the size of each SGA and SGA pool. The configuration can be performed through EM ....
Oracle10g provides the EM management tool to set database parameters through web access without installing the oracle client...
Start EM: emctl start dbconsole;
Stop EM: emctl stop dbconsole;
View status: emctl status dbconsole;
Then you can observe the web path and access and perform corresponding operations through the web.
You can also log on to oracle on the console to perform SGA operation settings.
View the size of each pool in SGA.
Select pool, sum (bytes)/1024/1024 from v $ sgastat group by pool
Get the current SGA size
Select sum (value)/1024/1024 from v $ sga;
Update SGA size
Alter system set sga_target = 200 m;
Set the size of the Shared Pool in SGA
Alter system set shared_pool_size = 32 m;
Set the size of medium and large SGA pools
Alter system set large_pool_size = 33 m;
Set JAVA pool size in SGA
Alter system set java_pool_size = 11 m;
Set the size of High-Speed Buffer Pool in SGA
Alter system set db_cache_size = 4 m;
Although SGA allows dba to set a fixed memory size, SGA is not fixed in running programs and databases,
Therefore, you need to refer to the actual memory size and system and database for specific settings.