当前位置:   article > 正文

ORACLE 切换个实例,启动多个实例_centos oracle切换实例

centos oracle切换实例
  1. //切换用户
  2. [root@CentosDB ~]# su - oracle
  3. 上一次登录:五 716 10:05:08 CST 2021pts/0
  4. //切换实例
  5. [oracle@CentosDB ~]$ export ORACLE_SID=orcl
  6. [oracle@CentosDB ~]$ sqlplus /nolog
  7. SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 16 11:33:44 2021
  8. Copyright (c) 1982, 2009, Oracle. All rights reserved.
  9. SQL> conn / as sysdba
  10. Connected.
  11. SQL> show parameter name
  12. NAME TYPE VALUE
  13. ------------------------------------ ----------- ------------------------------
  14. db_file_name_convert string
  15. db_name string orcl
  16. db_unique_name string orcl
  17. global_names boolean FALSE
  18. instance_name string orcl
  19. lock_name_space string
  20. log_file_name_convert string
  21. service_names string orcl
  22. SQL>
  23. //切换到另一个实例
  24. [oracle@CentosDB ~]$ export ORACLE_SID=orcl
  25. [oracle@CentosDB ~]$ sqlplus /nolog
  26. SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 16 11:33:44 2021
  27. Copyright (c) 1982, 2009, Oracle. All rights reserved.
  28. SQL> show parameter name
  29. SP2-0640: Not connected
  30. SQL> conn / as sysdba
  31. Connected.
  32. SQL> show parameter name
  33. NAME TYPE VALUE
  34. ------------------------------------ ----------- ------------------------------
  35. db_file_name_convert string
  36. db_name string orcl
  37. db_unique_name string orcl
  38. global_names boolean FALSE
  39. instance_name string orcl
  40. lock_name_space string
  41. log_file_name_convert string
  42. service_names string orcl
  43. SQL> exit
  44. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64
  45. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  46. [oracle@CentosDB ~]$ clear
  47. [oracle@CentosDB ~]$ export ORACLE_SID=zsny
  48. [oracle@CentosDB ~]$ sqlplus /nolog
  49. SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 16 11:38:12 2021
  50. Copyright (c) 1982, 2009, Oracle. All rights reserved.
  51. SQL> conn / as sysdba
  52. Connected to an idle instance.
  53. SQL> show parameter name
  54. ORA-01034: ORACLE not available
  55. Process ID: 0
  56. Session ID: 0 Serial number: 0
  57. //启动另一个实例
  58. SQL> startup
  59. ORACLE instance started.
  60. Total System Global Area 1302769664 bytes
  61. Fixed Size 2213056 bytes
  62. Variable Size 805309248 bytes
  63. Database Buffers 486539264 bytes
  64. Redo Buffers 8708096 bytes
  65. Database mounted.
  66. Database opened.
  67. SQL>
  68. //启动监听
  69. [oracle@CentosDB ~]$ lsnrctl start
  1. [root@CentosDB ~]# su - oracle
  2. 上一次登录:三 1020 09:53:30 CST 2021pts/0
  3. //关闭监听器
  4. [oracle@CentosDB ~]$ lsnrctl stop
  5. LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-OCT-2021 10:20:00
  6. Copyright (c) 1991, 2009, Oracle. All rights reserved.
  7. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
  8. The command completed successfully
  9. [oracle@CentosDB ~]$ sqlplus /nolog
  10. SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 20 10:20:53 2021
  11. Copyright (c) 1982, 2009, Oracle. All rights reserved.
  12. SQL> conn / as sysdba
  13. Connected to an idle instance.
  14. SQL> shutdown immediate
  15. ORA-01034: ORACLE not available
  16. ORA-27101: shared memory realm does not exist
  17. Linux-x86_64 Error: 2: No such file or directory
  18. //关闭数据库
  19. SQL> shutdown immediate
  20. Database closed.
  21. Database dismounted.
  22. ORACLE instance shut down.
  23. //启动数据库
  24. SQL> startup
  25. ORACLE instance started.
  26. Total System Global Area 1904054272 bytes
  27. Fixed Size 2214496 bytes
  28. Variable Size 1442842016 bytes
  29. Database Buffers 452984832 bytes
  30. Redo Buffers 6012928 bytes
  31. Database mounted.
  32. Database opened.
  33. SQL> exit
  34. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
  35. With the Partitioning, OLAP, Data Mining and Real Application Testing options
  36. //启动监听器
  37. [oracle@CentosDB ~]$ lsnrctl start
  38. LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-OCT-2021 10:22:43
  39. Copyright (c) 1991, 2009, Oracle. All rights reserved.
  40. Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
  41. TNSLSNR for Linux: Version 11.2.0.1.0 - Production
  42. System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/liste ner.ora
  43. Log messages written to /u01/app/oracle/diag/tnslsnr/CentosDB/listener/alert/log .xml
  44. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
  45. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
  46. STATUS of the LISTENER
  47. ------------------------
  48. Alias LISTENER
  49. Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
  50. Start Date 20-OCT-2021 10:22:43
  51. Uptime 0 days 0 hr. 0 min. 0 sec
  52. Trace Level off
  53. Security ON: Local OS Authentication
  54. SNMP OFF
  55. Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/list ener.ora
  56. Listener Log File /u01/app/oracle/diag/tnslsnr/CentosDB/listener/alert/l og.xml
  57. Listening Endpoints Summary...
  58. (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
  59. The listener supports no services
  60. The command completed successfully
  61. [oracle@CentosDB ~]$

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/115097
推荐阅读
相关标签
  

闽ICP备14008679号