Tutorial on installing and starting or disabling Oracle databases in Linux, linuxoracle
1. preparation:
df -H
Check space remaining. Generally, prepare at least 5 GB
2. view the swap partition size
du -sh /tmp/
Minimum 400 M
3. Create a user
groupadd dba -g 111groupadd oinstall -g 110useradd oracle -u -110 -g 110 -G 111passwd oracle --stdin
4. Set Parameters
su - oraclevi .bash_profile
export ORACLE_BASE=/u01/oracleexport ORACLE_HOME=$ORACLE_BASE/10gexport ORACLE_SID=orclPATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
5. Permissions
sumkdir /u01/oraclechown oracle:oinstall /u01/oracle/ -R
6. Modify system parameters
sysctl -a|grep sem|sed 's/32/100/2' >> /etc/sysctl.confsysctl -a|grep ip_local|sed -e 's/32768/1024' -e 's/61/65/' >> /etc/sysctl.confsysctl -a|grep rmem_d|sed 's/109568/262144' >> /etc/sysctl.confsysctl -a|grep rmem_ma|sed 's/131071/262144' >> /etc/sysctl.confsysctl -a|grep wmem_ma|sed 's/131071/262144' >> /etc/sysctl.confsysctl -a|grep wmem_de|sed 's/109568/262144' >> /etc/sysctl.confsysctl -a|grep file-m|sed 's/83702/65536' >> /etc/sysctl.confsysctl -p
7. Install
xhost +su - oracleruninstall
8. Problem Solving
Installation interface garbled
Orcale User:
[oracle@~]$ export LC_CTYPE="en_US.UTF-8"
Version Problems
Modify the version in/etc/redhat-release to a lower version (Redhat 4.X)
Xhost + error
The simplest method is to log out of the current user and use the oracle user for logon and installation.
9. Start and close
Query the current status of the database:
>select OPEN_MODE from v$database;
Oracle not available ------- oracle does not start the instance oracle not mounted ------- oracle in nomount stage oracle mounted ------- oracle in mount stage oracle read write ------- oracle in open stage
9.1.sqlplus
Nomount --------------
>startup [force] [pfile=xxx] nomount;
Error Checking parameter file spfilesid. ora --- spfile. ora --- initsid. ora
View the used parameter file> show parameter spfile is started with spfile if it is not empty; otherwise, it is pfile.
Allocate memory
Record information to alert files and tracking files
#tail -f /u01/oracle/admin/orcl/bdump/alert_orcl.log
Start background processes
Check whether the database is started # ps-ef | grep ora _
[Set parameters for this phase]
[Startup restrict starts a restricted session and does not allow others to connect to the database]
Database loading stage
db mount ------------------ >alter database mount;
Associated database and current instance
Locate and open the specified control file in the parameter file
Control File
>show parameter control_file;
The read control file obtains the name and status of the data file and redo log file, but does not check whether the file exists.
[Physical database operations can be performed in this phase: alter database, create a database, delete a database, restore a database, name a data file, and enable disabled logs]
Open Database stage ---------------
>alter database open;
Check whether data files and log files exist, whether to open them, and check Database Consistency.
Open Online data files and log files
[Perform operations on database data in this phase]
Database shutdown stage ---------------
>shutdown [normal|transactional|immediate|abort]
Write changes in the buffer zone to the cache and redo log entries in the buffer zone into the data file and online redo log files.
Disable data files and redo log files
Detach a database
Close Control File
Disable an instance
Close the alter file and tracking File
Sga recovery and background Process Termination
shutdown [normal|transactional|immediate|abort]
Abort is not disabled for consistency.
9.2.dbstart & dbshut
In vi/etc/oratab, the last field of the database is Y, which can be controlled through dbstart and dbshut.
When the value of ORACLE_HOME_LISTNER in vi $ ORACLE_HOME/bin/dbstart is $ ORACLE_HOME, the listener is started.
Appendix: oracle startup
head -n 6 /etc/init.d/network >/etc/init.d/oracle10gvi /etc/init.d/oracle10g
ORACLE_HOME=/u01/oracle/10gif [ !-f $ORACLE_HOME/bin/dbstart ]thenecho "oracle cannot start"exitfiif [ ! -f $ORACLE_HOME/bin/lsnrctl ]thenecho "lsnrctl cannot start"exitficase "$1" in'start')echo "starting oracle 10g ...."su - oracle -c "$ORACLE_HOME/bin/dbstart"#su - oracle -c "$ORACLE_HOME/bin/emctl start dbconsole" ------>start oem;;'stop')echo "stopping oracle 10g ...."#su - oracle -c "$ORACLE_HOME/bin/emctl stop dbconsole" ------>stop oemsu - oracle -c "$ORACLE_HOME/bin/dbshut";;*)echo "usage $0: start|stop";;esac
chmod a+x /etc/init.d/oracle10gchkconfig oracle10g on
Articles you may be interested in:
- How to move Oracle tablespace data files
- How to execute an SQL job in an oracle session deadlock
- Detailed description of basic database creation operations in Oracle databases