Which two statements are true about service creation for pluggable databases (PDBs)?
A.
When a PDB is created, a service is automatically started in the instance with the same
name as the PDB.
B.
The default service that is automatically created by a database at the time of PDB creation
can be dropped, provided a new additional service is created.
C.
A database managed by Oracle Restart can have additional services created or existing
services modified by using the srvctl utility for each PDB.
D.
Only a common user can create additional services for a PDB.
E.
When a PDB is created, a service with the same name as the PDB is created in the PDB.
Right answer should be C and E
A not sure
B and D are not right
A and C probably are better option. Can anyone confirm?
CD
Not A or E: The PDB service name is the PDB name given at PDB creation concatenated with domain name. (Student Guide)
Not B: PDB default service name must not be dropped.(https://docs.oracle.com/database/121/CNCPT/cdblogic.htm#CNCPT89458)
Maybe D is correct?
Sheesh, I need a lawyer to figure these out.
Now I’m thinking it’s A & C. They’re just being inexact about the addition of the domain name.
It isn’t E because the service is created in the instance, not the PDB.
D is not!
Creating, Modifying, or Removing a Service for a PDB
You can create, modify, or remove a service with a PDB property in the following ways:
If your single-instance database is being managed by Oracle Restart or your Oracle RAC database is being managed by Oracle Clusterware, then use the Server Control (SRVCTL) utility to create, modify, or remove the service.
To create a service for a PDB using the SRVCTL utility, use the add service command and specify the PDB in the -pdb parameter. If you do not specify a PDB in the -pdb parameter when you create a service, then the service is associated with the root.
To modify the PDB property of a service using the SRVCTL utility, use the modify service command and specify the PDB in the -pdb parameter. To remove a service for a PDB using the SRVCTL utility, use the remove service command.
You can use other SRVCTL commands to manage the service, such as the start service and stop service commands, even if they do not include the -pdb parameter.
The PDB name is not validated when you create or modify a service with the SRVCTL utility. However, an attempt to start a service with invalid PDB name results in an error.
If your database is not being managed by Oracle Restart or Oracle Clusterware, then use the DBMS_SERVICE package to create or remove a database service.
When you create a service with the DBMS_SERVICE package, the PDB property of the service is set to the current container. Therefore, to create a service with a PDB property set to a specific PDB using the DBMS_SERVICE package, run the CREATE_SERVICE procedure when the current container is that PDB. If you create a service using the CREATE_SERVICE procedure when the current container is the root, then the service is associated with the root.
You cannot modify the PDB property of a service with the DBMS_SERVICE package. However, you can remove a service in one PDB and create a similar service in a different PDB. In this case, the new service has the PDB property of the PDB in which it was created.
You can also use other DBMS_SERVICE subprograms to manage the service, such as the START_SERVICE and STOP_SERVICE procedures. Use the DELETE_SERVICE procedure to remove a service.
Oracle recommends using the SRVCTL utility to create and modify services. However, if you do not use the SRVCTL utility, then you can use the DBMS_SERVICE package.
It’s A and C
Thanks Vonpire!
A is likely correct.
[oracle@host01 ~]$ lsnrctl services
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 03-MAR-2016 15:33:17
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host01.example.com)(PORT=1521)))
Services Summary…
Service “orcl.example.com” has 1 instance(s).
Instance “orcl”, status READY, has 1 handler(s) for this service…
Handler(s):
“DEDICATED” established:0 refused:0 state:ready
LOCAL SERVER
Service “orclXDB.example.com” has 1 instance(s).
Instance “orcl”, status READY, has 1 handler(s) for this service…
Handler(s):
“D000” established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=host01.example.com)(PORT=35725))
Service “pdborcl.example.com” has 1 instance(s).
Instance “orcl”, status READY, has 1 handler(s) for this service…
Handler(s):
“DEDICATED” established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
[oracle@host01 ~]$
Vonpire –
Does srvctl just use the O/S user permissions? We’re still using 11g so it’s hard to test some of this stuff. During the class I didn’t realize how detailed these questions would be and the student guide doesn’t even match most of the answers!
I also thought you would need to connect as a common user to a PDB to run DBMS_SERVICE.CREATE_SERVICE.
A and C?
AC
AC
CE
https://docs.oracle.com/cd/E57425_01/121/ADMIN/cdb_pdb_admin.htm#BAJGHDFD
‘D’ is WRONG. Local user can create services. Tested:
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
———- —————————— ———- ———-
2 PDB$SEED READ ONLY NO
3 PDB01 READ WRITE NO
4 PDB02 READ WRITE NO
SQL> alter session set container=pdb01;
Session altered.
SQL> create user srv_manager
2 identified by manager
3 default tablespace comun
4 quota unlimited on comun;
User created.
SQL> grant connect, create session to srv_manager;
Grant succeeded.
SQL> select username,common from dba_users where username = ‘SRV_MANAGER’
USERNAME COMMON
—————————————- ———
SRV_MANAGER NO
SQL> grant alter system to srv_manager;
Grant succeeded.
SQL> grant execute on DBMS_SERVICE to srv_manager;
Grant succeeded.
SQL> connect srv_manager/manager@localhost:1521/pdb01
Connected.
SQL> show user
USER is “SRV_MANAGER”
SQL> begin
2 dbms_service.create_service (
3 service_name => ‘pdb01_srv_test01’,
4 network_name => ‘test01’);
5 end;
6 /
PL/SQL procedure successfully completed.
SQL> exec dbms_service.start_service(‘pdb01_srv_test01’);
PL/SQL procedure successfully completed.
The answer ‘A’ is CORRECT. Tested:
SQL> create pluggable database pdb03
2 admin user admin identified by admin
3 file_name_convert = (‘/oradata/CDB1/pdbseed’, ‘/oradata/CDB1/pdb03’);
Pluggable database created.
$ lsnrctl service
LSNRCTL for Linux: Version 12.1.0.1.0 – Production on 19-AUG-2016 09:59:03
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary…
Service “CDB1” has 1 instance(s).
Instance “CDB1”, status READY, has 1 handler(s) for this service…
Handler(s):
“DEDICATED” established:0 refused:0 state:ready
LOCAL SERVER
Service “CDB1XDB” has 1 instance(s).
Instance “CDB1”, status READY, has 1 handler(s) for this service…
Handler(s):
“D000” established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=31991))
. . .
Service “pdb03” has 1 instance(s).
Instance “CDB1”, status READY, has 1 handler(s) for this service…
Handler(s):
“DEDICATED” established:0 refused:0 state:ready
LOCAL SERVER
If A is CORRECT, E is WRONG.
‘B’ is WRONG. I can drop the default service, without creating any one. Tested.
So, B, E and D are WRONG.
A and C are OK.
A,C
C
“ If your single-instance database is being managed by Oracle Restart or your Oracle RAC database is being managed by Oracle Clusterware,
then use the Server Control (SRVCTL) utility to create, modify, or remove the service.”
Can anyone confirm C?
ans C,E
instance name = cdb
service name = pdb
A is correct ,
In a windows PC if a pluggable database is created a service with the same name is created and started.
this is verified. We can find this in the Services.msc window
AC