Which two statements are true about service creation for pluggable databases (PDBs)?

Which two statements are true about service creation for pluggable databases (PDBs)?

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.



Leave a Reply 18

Your email address will not be published. Required fields are marked *


Vonpire

Vonpire

Right answer should be C and E

A not sure

B and D are not right

Vonpire

Vonpire

A and C probably are better option. Can anyone confirm?

Steve

Steve

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.

Vonpire

Vonpire

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

Tri

Tri

Thanks Vonpire!

Tri

Tri

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 ~]$

Steve

Steve

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.

readyplayerone

readyplayerone

‘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.

goszczu

goszczu

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?

tk

tk

ans C,E

tk

tk

instance name = cdb
service name = pdb

arean82

arean82

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