Skip to content

Commit

Permalink
chore(docs): Add separate examples for CDB and non-CDB databases. (#379)
Browse files Browse the repository at this point in the history
Add separate examples for CDB and non-CDB databases.
  • Loading branch information
wpuziewicz authored Mar 20, 2024
1 parent 8b3e961 commit b76ffdc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
20 changes: 17 additions & 3 deletions docs/user_guide/oracle/collection_scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,37 @@ as a user with SYSDBA privileges and create the user if needed. If this is a mul
create the user as a common user in the root container. The Dma_collector does not currently support
running in individual pluggable databases.

For non-CDB databases:
```shell
sqlplus "sys/password@//hostname:port/dbservicename"
sqlplus "sys/password@//hostname:port/dbservicename as sysdba"
SQL> create user DMA_COLLECTOR identified by password;
SQL> grant connect, create session to DMA_COLLECTOR;
```

Execute grants_wrapper.sql. You will be prompted for the name of a database user
For multitenant databases:
```shell
sqlplus "sys/password@//hostname:port/dbservicename as sysdba"
SQL> create user C##DMA_COLLECTOR identified by password;
SQL> grant connect, create session to C##DMA_COLLECTOR;
```
Navigate to the sql/setup directory and execute grants_wrapper.sql as a user with SYSDBA privileges.
You will be prompted for the name of a database user
(Note that input is case-sensitive and must match the username created above) to be granted
privileges on the objects required for data collection.
You will also be prompted whether or not to allow access to the AWR data.
Access will be granted to Statspack tables if they are present.

For non-CDB databases:
```shell
SQL> @grants_wrapper.sql
SQL> Please enter the DB Local Username(Or CDB Username) to receive all required grants: DMA_COLLECTOR
SQL> Please enter Y or N to allow or disallow use of the Tuning and Diagnostic Pack (AWR) data (Y) Y
```
For multitenant databases:
```shell
SQL> @grants_wrapper.sql
SQL> Please enter the DB Local Username(Or CDB Username) to receive all required grants: C##DMA_COLLECTOR
SQL> Please enter Y or N to allow or disallow use of the Tuning and Diagnostic Pack (AWR) data (Y) Y
```

The grant_wrapper script will grant privileges required and will output a list of what has been granted.

Expand Down
25 changes: 19 additions & 6 deletions scripts/collector/oracle/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,34 @@ for analysis by Database Migration Assessment.
create the user as a common user in the root container. The Dma_collector does not currently support
running in individual pluggable databases.

sqlplus "sys/password@//hostname:port/dbservicename"
SQL> create user c##DMA_COLLECTOR identified by password;
SQL> grant connect, create session to c##DMA_COLLECTOR;

d) Execute grants_wrapper.sql. You will be prompted for the name of a database user
For non-CDB databases:
sqlplus "sys/password@//hostname:port/dbservicename as sysdba"
SQL> create user DMA_COLLECTOR identified by password;
SQL> grant connect, create session to DMA_COLLECTOR;

For multitenant databases:
sqlplus "sys/password@//hostname:port/dbservicename as sysdba"
SQL> create user C##DMA_COLLECTOR identified by password;
SQL> grant connect, create session to C##DMA_COLLECTOR;

d) Navigate to the sql/setup directory and execute grants_wrapper.sql as a user with SYSDBA privileges.
You will be prompted for the name of a database user
(Note that input is case-sensitive and must match the username created above) to be granted
privileges on the objects required for data collection.
You will also be prompted whether or not to allow access to the AWR/ASH data.

Ex:
Example for non-CDB databases:
SQL> @grants_wrapper.sql

SQL> Please enter the DB Local Username(Or CDB Username) to receive all required grants: DMA_COLLECTOR
SQL> Please enter Y or N to allow or disallow use of the Tuning and Diagnostic Pack (AWR/ASH) data (Y) Y

Example for multitenant databases:
SQL> @grants_wrapper.sql

SQL> Please enter the DB Local Username(Or CDB Username) to receive all required grants: C##DMA_COLLECTOR
SQL> Please enter Y or N to allow or disallow use of the Tuning and Diagnostic Pack (AWR/ASH) data (Y) Y

e) The grant_wrapper script will grant privileges required and will output a list of what has been granted.

3. Execution
Expand Down

0 comments on commit b76ffdc

Please sign in to comment.