135.In which situation would you use static database registration for a listener?
A.when multiple databases are to be registered with the listener
B.when DBAs need to connect remotely to start up the database instance
C.when users need to connect the database instance using the host naming method
D.when the database instance that is to be registered with the listener is configured in shared server mode
答案:B
解析:
1.netmgr –通过这个工具可以实现静态注册
2.netca –这个工具 可以实现动态注册,不能实现静态注册
3.静态注册可以远程管理数据库,比如数据库的起停,而动态注册必须数据库启动才可以
动态注册为ready从字面的意思理解为准备好,而静态注册为unknow也就是不知道数据库状态
--这里是静态注册,启动停止数据库
[oracle@wahaha3 admin]$ sqlplus sys/oracle@wahaha3 as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 28 14:30:33 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2232920 bytes
Variable Size 629149096 bytes
Database Buffers 197132288 bytes
Redo Buffers 2416640 bytes
Database mounted.
Database opened.
--下面是监听文件
[oracle@wahaha3 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/oracle/11g/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME = hrtest)
(SID_NAME=hrtest)
(ORACLE_HOME=/u01/oracle/11g)
)
(SID_DESC=
(GLOBAL_DBNAME = wahaha3)
(SID_NAME=wahaha3)
(ORACLE_HOME=/u01/oracle/11g)
)
)
--我们修改为动态注册
[oracle@wahaha3 admin]$ sqlplus sys/oracle@wahaha3 as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 28 14:37:30 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name:
--本地登录
[oracle@wahaha3 admin]$ sqlplus / as sysdba
SQL> startup
--远程登陆
[oracle@wahaha3 admin]$ sqlplus sys/oracle@wahaha3 as sysdba
SQL> --可以正常登录了
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
--可以关闭,但是不能启动
--查看监听文件
[oracle@wahaha3 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/oracle/11g/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = wahaha3.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
A.when multiple databases are to be registered with the listener
B.when DBAs need to connect remotely to start up the database instance
C.when users need to connect the database instance using the host naming method
D.when the database instance that is to be registered with the listener is configured in shared server mode
答案:B
解析:
1.netmgr –通过这个工具可以实现静态注册
2.netca –这个工具 可以实现动态注册,不能实现静态注册
3.静态注册可以远程管理数据库,比如数据库的起停,而动态注册必须数据库启动才可以
动态注册为ready从字面的意思理解为准备好,而静态注册为unknow也就是不知道数据库状态
--这里是静态注册,启动停止数据库
[oracle@wahaha3 admin]$ sqlplus sys/oracle@wahaha3 as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 28 14:30:33 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2232920 bytes
Variable Size 629149096 bytes
Database Buffers 197132288 bytes
Redo Buffers 2416640 bytes
Database mounted.
Database opened.
--下面是监听文件
[oracle@wahaha3 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/oracle/11g/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME = hrtest)
(SID_NAME=hrtest)
(ORACLE_HOME=/u01/oracle/11g)
)
(SID_DESC=
(GLOBAL_DBNAME = wahaha3)
(SID_NAME=wahaha3)
(ORACLE_HOME=/u01/oracle/11g)
)
)
--我们修改为动态注册
[oracle@wahaha3 admin]$ sqlplus sys/oracle@wahaha3 as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 28 14:37:30 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Enter user-name:
--本地登录
[oracle@wahaha3 admin]$ sqlplus / as sysdba
SQL> startup
--远程登陆
[oracle@wahaha3 admin]$ sqlplus sys/oracle@wahaha3 as sysdba
SQL> --可以正常登录了
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
--可以关闭,但是不能启动
--查看监听文件
[oracle@wahaha3 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/oracle/11g/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = wahaha3.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)