ステップ5 - データベースの削除および再作成
CLIを使用して、データベースを削除することもできます。 odacli delete-database
を実行して、データベースdb2
を削除します。 必ずdb2
データベースのIDを使用してください。これは、このワークブックのIDとは異なる可能性があります。 IDのかわりにデータベース名を使用することもできます。
$ odacli delete-database -i d1e615c3-5855-4b19-9ad0-40b620ac5f13
{
"jobId" : "ccde4700-3c1e-423a-8079-477f49f8cd5f",
"status" : "Running",
"message" : null,
"reports" : [ {
"taskId" : "TaskZJsonRpcExt_10048",
"taskName" : "Validate db d1e615c3-5855-4b19-9ad0-40b620ac5f13 for deletion",
"taskResult" : "OK",
"startTime" : " September 26, 2022 01:49:40 AM UTC",
"endTime" : " September 26, 2022 01:49:40 AM UTC",
"status" : "Success",
"taskDescription" : null,
"parentTaskId" : "TaskSequential_10046",
"jobId" : "ccde4700-3c1e-423a-8079-477f49f8cd5f",
"tags" : [ ],
"reportLevel" : "Info",
$ odacli list-databases
ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID
---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ------------ ----------------------------------------
324a42ea-bba2-477d-8bca-5a26af159f1c db3 SI 19.16.0.0.220719 false OLTP odb1 ASM CONFIGURED ecfa440e-2482-40c1-8ccd-67316cd48ba2
$ odacli delete-database -i d1e615c3-5855-4b19-9ad0-40b620ac5f13
{
"jobId" : "ccde4700-3c1e-423a-8079-477f49f8cd5f",
"status" : "Running",
"message" : null,
"reports" : [ {
"taskId" : "TaskZJsonRpcExt_10048",
"taskName" : "Validate db d1e615c3-5855-4b19-9ad0-40b620ac5f13 for deletion",
"taskResult" : "OK",
"startTime" : " September 26, 2022 01:49:40 AM UTC",
"endTime" : " September 26, 2022 01:49:40 AM UTC",
"status" : "Success",
"taskDescription" : null,
"parentTaskId" : "TaskSequential_10046",
"jobId" : "ccde4700-3c1e-423a-8079-477f49f8cd5f",
"tags" : [ ],
"reportLevel" : "Info",
$ odacli list-databases
ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID
---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ------------ ----------------------------------------
324a42ea-bba2-477d-8bca-5a26af159f1c db3 SI 19.16.0.0.220719 false OLTP odb1 ASM CONFIGURED ecfa440e-2482-40c1-8ccd-67316cd48ba2
CLIを使用して、新しいデータベースdb4
を作成します。
$ odacli create-database -n db4 -v 19.16.0.0
Enter SYS, SYSTEM and PDB Admin user password:
Retype SYS, SYSTEM and PDB Admin user password:
Job details
----------------------------------------------------------------
ID: aa259376-4ac0-474a-8730-8c8e1c8ac504
Description: Database service creation with db name: db4
Status: Created
Created: September 26, 2022 1:51:50 AM UTC
Message:
Task Name Start Time End Time Status
---------------------------------------- ----------------------------------- ----------------------------------- ----------
# odacli list-databases
ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID
ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID
---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ------------ ----------------------------------------
324a42ea-bba2-477d-8bca-5a26af159f1c db3 SI 19.17.0.0.221016 false OLTP odb1 ASM CONFIGURED ecfa440e-2482-40c1-8ccd-67316cd48ba2
deac01db-eaa8-4f4e-a511-aea042be3a18 db4 SI 19.16.0.0.220719 false OLTP odb1 ASM CONFIGURED c3c63738-703e-4c1d-98de-95b551b67468