After installing oracle, you need to create an oracle system user and add several environment variables in. bash_profile under/home/oracle: ORACLE_SID, ORACLE_BASE, ORACLE_HOME. For example, exportORACLE_SIDtestexportORACLE_BASEoracle_insta...
After installing oracle, you need to create an oracle system user and 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!
Frequently encountered problems:
1) permission issues, solution, switch to oracle user;
2) the listener is not closed. Solution: disable the listener.
3) If an oracle instance is not closed, the solution is to close the oracle instance.
4) the environment variable settings are incomplete. Solution: modify the environment variable.
Oracle Database startup and shutdown methods
I. several startup methods:
1. startup nomount
Non-installation startup. In this mode, you can execute: re-build the control file and re-build the database.
Start the instance, that is, start the SGA and background processes. to start the instance, you only need the init. ora file.
2. startup mount dbname
Install and start. In this mode, you can execute: database log archiving, database recovery, and renaming some database files.
For example, system tablespace or log files.
Execute "nomount" and open the control file.
3. startup open dbname
Run "nomount" first, then "mount", and then open all database files including the Redo log file,
In this way, you can access data in the database.
4. startup, which is equal to the following three commands
Startup nomount
Alter database mount
Alter database open
5. startup restrict
Constraint-based startup
This method can start the database, but only allow access by users with certain privileges
When a non-authorized user accesses the service, the following prompt is displayed:
ERROR:
ORA-01035: ORACLE only allows users with restricted session permissions
6. startup force
Force start mode
When the database cannot be closed, you can use startup force to close the database.
Shut down the database first, and then execute the normal database startup command
7. startup pfile = parameter file name
Startup method with initialization parameter file
Read the parameter file first, and then start the database according to the settings in the parameter file.
Example: startup pfile = E: \ Oracle \ admin \ oradb \ pfile \ init. ora
8. startup EXCLUSIVE
II. closing methods:
1. shutdown normal
Close the database normally.
2. shutdown immediate
Close the database immediately.
Run shutdown immediate in SVRMGRL, and the database is not closed immediately,
However, it is disabled only after Oracle executes some cleanup tasks (terminating sessions and releasing session resources ),
When you use shutdown to close a database, shutdown immediate can be used to close the database.
3. shutdown abort
Directly shut down the database, and the session accessing the database will be suddenly terminated,
If a large number of operations are being performed in the database, it takes a long time to restart the database after the shutdown abort command is executed.