Subscribe to Posts by Email

Subscriber Count

    696

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Oracle Cloud : Using PSM CLI to Manage Databases

In previous post, you have seen the PSM utility installation and using PSM utility, In this post you will learn how to use CLI to effectively manage the databases using commands.

#Create Database using Json file

C:\Users\gandhi\Desktop>psm dbcs create-service -c 18cdatabase.json
Job ID : 1986734

# Check the Service aka database config

C:\Users\gandhi\Desktop>psm dbcs service -s db18c-se-si
Service:                    db18c-se-si
Status:                     In Progress
Version:                    18.0.0.0
Edition:                    SE
Shape:                      oc3
Connect String:             N/A
Backup Destination:         NONE
Cloud Storage Container:    N/A
PDB Name:                   pdb01
Created On:                 2018-03-15T03:37:45.884+0000

# Check the Database Health

C:\Users\gandhi\Desktop>psm dbcs check-health -s db18c-se-si -of  json
{
"summary":{
"status":"UP",
"status_time":"2018-03-15T03:56:47.220+00:00",
"status_message":"Running"
},
"identity_domain":"idcs-093b0defb99e433c9fb6aae82cfcb8d1",
"service_components":[
{
"component":"DB",
"vms":[
{
"vm":"db18c-se-si",
"servers":[]
}
],
"health_data":[
{
"unit":"%",
"name":"user_tablespace_usage",
"value":"2",
"type":"int",
"displayName":"Max Percentage for a User Tablespace Used"
}
]
}
],
"service_name":"db18c-se-si"
}

 

#Check the backups of Database,

C:\Users\gandhi\Desktop>psm dbcs view-backups -s db18c-se-si
Error: Internal Server Error. Backup / Recovery operations are not supported on this service instance.

# Stop Database , errored out with some job running, so looked at operation status as below with job id

C:\Users\gandhi\Desktop>psm dbcs stop -s db18c-se-si
Error:
{
"reason":"Resource Busy. Service idcs-093b0defb99e433c9fb6aae82cfcb8d1/db18c-se-si has active jobs.  active job: 1986734 when attempting to process request: idcs-093b0defb99e433c9fb6aae82cfcb8d1/db18c-se-si: serviceType = dbaas, namespace = dbaas, operation = stop-dbaas-service"
}

# Check Operations that currently running with Job Number

C:\Users\gandhi\Desktop>psm dbcs operation-status -j 1986734
Service:           db18c-se-si
Operation Type:    CREATE_SERVICE
Status:            RUNNING
Start Time:        2018-03-15T03:37:45.985+0000
End Time:          N/A

C:\Users\gandhi\Desktop>psm dbcs operation-status -j 1989704
Service:           db12c-se-si
Operation Type:    CREATE_SERVICE
Status:            RUNNING
Start Time:        2018-03-15T04:04:10.295+0000
End Time:          N/A

# Check Infrastructure activities on the database host

C:\Users\gandhi\Desktop>psm dbcs activities -s db18c-se-si
Operation Type  Status   Start Time                    End Time
CREATE_SERVICE  RUNNING  2018-03-15T03:37:45.985+0000  N/A
DELETE_SERVICE  SUCCEED  2018-03-14T16:00:48.245+0000  2018-03-14T16:06:35.774+0000
CREATE_SERVICE  SUCCEED  2018-03-14T14:54:19.049+0000  2018-03-14T15:24:37.529+0000

# Delete Database Instance and Service

C:\Users\gandhi\Desktop>psm dbcs delete-service -s db18c-se-si
Job ID:    1989723

# Check Any patches need for databases and available

C:\Users\gandhi\Desktop>psm dbcs available-patches -s db12c-se-si
Patch ID     Severity  Version          Release Date                  Requires Restart?
26710464-SE  Normal    12.2.0.1.171017  2017-10-17T01:40:00.000+0000  True

# Applying Patch, Errored out I need to check why

Ex: psm dbcs patch -s ExampleInstance -p es-20831110-EE -g NODE-SAFE -h REQUIRE_STATUS_HA -t 100 -n Applying JDK80 patch

C:\Users\gandhi\Desktop>psm dbcs patch -s db12c-se-si -p 26710464-SE -of json
Error: Unsupported Media Type

# Pre check Patch

C:\Users\gandhi\Desktop>psm dbcs precheck-patch -s db12c-se-si -p 26710464-SE
Error: Unsupported Media Type

# Take snapshot of Database

C:\Users\gandhi\Desktop>psm dbcs create-snapshot -s db12c-se-si -n snapshottestest12c
Job ID : 1987024

# Scale up your database host capacity

C:\Users\gandhi\Desktop> psm dbcs scale-up -s db12c-ee -p oc4 -a 10

Specifies scaling up the shape of the service instance.

Valid values for shape-name are as follows:

•oc4 — 2 OCPUs with 15 GB RAM
•oc5 — 4 OCPUs with 30 GB RAM
•oc6 — 8 OCPUs with 60 GB RAM
•oc7 — 16 OCPUs with 120 GB RAM
•oc1m — 1 OCPU with 15 GB RAM
•oc2m — 2 OCPUs with 30 GB RAM
•oc3m — 4 OCPUs with 60 GB RAM
•oc4m — 8 OCPUs with 120 GB RAM
•oc5m — 16 OCPUs with 240 GB RAM

# Scale down your database host capacity

C:\Users\gandhi\Desktop> psm dbcs scale-down -s db12c-ee -p oc4 -a oc5-a 10

-Thanks

Suresh

Comments are closed.