Restart the oracle service under Linux with listener and example details
- 2020-05-13 04:14:34
- OfStack
1. Restart Oracle database and listener under Linux:
Method 1:
Log in to linux with root and ssh, open the terminal and enter the following command:
cd $ORACLE_HOME # enters the oracle installation directory
dbstart # restart the server
lsnrctl start # restart the listener
cd $ORACLE_HOME # enters the oracle installation directory
Restart the server with dbstart #
lsnrctl start # restart the listener
-----------------------------------
Method 2:
Sql code
cd $ORACLE_HOME/bin # go to the oracle installation directory
./dbstart # restart the server
./lsnrctl start # restart the listener
-----------------------------------
Method 3:
(1) log into the database as oracle, command: su-oracle
(2) enter the Sqlplus console, command: sqlplus /nolog
(3) log in as system administrator, command: connect/as sysdba
(4) start the database, command: startup
(5) if the database is closed, command: shutdown immediate
(6) exit the sqlplus console, command: exit
(7) enter the listener console, command: lsnrctl
(8) start the listener, command: start
(9) exit the listener console, command: exit
2. Restart instance:
(1) switch the database instance to be started: export ORACLE_SID=C1
(2) enter the Sqlplus console and command: sqlplus /nolog
(3) log in as system administrator, command: connect/as sysdba
(4) if it is to close the database, command: shutdown abort
(5) start the database, command: startup
(6) exit the sqlplus console, command: exit