有时我们数据库需要进入限制模式,比如维护时。那么,如何才能让系统进入限制模式呢 ?
1.打开数据库直接进入限制模式
startup open restricted;
2.修改打开的数据库进行限制模式
alter system enable restricted session;
看监听服务的状态:
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbserver)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 01-DEC-2019 09:50:50
Uptime 0 days 5 hr. 16 min. 35 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dbserver/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dbserver.sztech.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=dbserver.sztech.com)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/emrep/xdb_wallet))(Presentation=HTTP)(Session=RAW))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=dbserver.sztech.com)(PORT=5501))(Security=(my_wallet_directory=/u01/app/oracle/admin/orcl/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "cdb1" has 1 instance(s).
Instance "cdb1", status RESTRICTED, has 1 handler(s) for this service...
Service "cdb1XDB" has 1 instance(s).
Instance "cdb1", status RESTRICTED, has 1 handler(s) for this service...
Service "emrep" has 1 instance(s).
Instance "emrep", status READY, has 1 handler(s) for this service...
Service "emrepXDB" has 1 instance(s).
Instance "emrep", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status RESTRICTED, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status RESTRICTED, has 1 handler(s) for this service...
Service "pdb1_1" has 1 instance(s).
Instance "cdb1", status RESTRICTED, has 1 handler(s) for this service...
Service "pdb2" has 1 instance(s).
Instance "cdb1", status RESTRICTED, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>