DBCA Create Delete Database

 

DBCA Create Delete Database. 1

Uzorci (templates) 1

Primer brisanje baze korišćenjem dbca. 2

Primer kreiranja baze korišćenjem dbca. 2

Konfigurcija baze tj OEM... 3

Kreiranje uzorka (template)dbt  iz postojeće baze. 3

Kreiranje uzorka (template) dbc  iz postojeće baze. 3

Primer: Kreiranje uzorka (template), brisanje baze I rekreiranje pomoću uzorka (template) 3

Primer: Kreiranje skripta korišćenjem uzorka (template) i rekreiranje baze. 4

Crete db scripts in directory D:\oracle\product\10.2.0\db_1\assistants\dbca\templates\scr 4

Crete database using scripts. 4

dbca –help. 5

 

Uzorci (templates)

 

DBCA Database Configuration Assistant koristi uzorke (templates) da:

kreira nove baze od postojećih uzoraka ili

da kreira uzorke od postojećih baza

 

Tipovi Uzoraka (Templates)

 

dbcDataBase Clone (Seed Template)

dbt -  DataBase Template (Non Seed Template)

 

 

DBCA uzorci (templates) su XML datoteke koje sadrže informaciju o bazi uključujuči:

- database options

- init.ora parameters

- storage attributes (datafiles, tablespaces, controlfiles and redologs)

 

Demo template datoteke se nalaze se u direktorijumu %ORACLE_HOME%/assistants/dbca/templates

   directory. Npr.:

 

- Data_Warehouse.dbc         

- General_Purpose.dbc

- Transaction_Processing.dbc

- New_Database.dbt        

 

Primer brisanje baze korišćenjem dbca

 

REM delete database glob with the progress info

dbca -deleteDatabase -progressOnly -deleteDatabase -sourceDB GLOB -sysDBAUserName sys -sysDBAPassword my_password

 

 

REM delete database glob silently ... molim pažljivo!!

dbca -silent -deleteDatabase -sourceDB GLOB -sysDBAUserName sys -sysDBAPassword my_password

 

 

Primer kreiranja baze korišćenjem dbca

 

REM Create db glob – use template glob1.dbc

dbca -silent -createDatabase -templateName glob1.dbc -gdbname glob -sid glob -characterset AL32UTF8

 

REM Create db glob with the location od datafiles - kreiranje baze sa lokacijom gde se smeštaju datotekedatafiles

dbca -silent -createDatabase -templateName glob1.dbc -gdbname glob -sid glob -characterset AL32UTF8 -datafiledestination D:\oracle\product\10.2.0\oradata\glob

 

Konfigurcija baze tj OEM

 

-- from SQL*Plus as sysdba

SQL> alter user DBSNMP account unlock;

SQL> alter user dbsnmp identified by DBSNMP;

 

 

dbca -silent  -configureDatabase -sourceDB GLOB -emConfiguration LOCAL -dbsnmpPassword DBSNMP -sysmanPassword elcaro -smtpServer mail.saga-infotech.net -emailAddress darko@saga-infotech.net

 

(U slucaju problema sa EM konzolom ispratiti postupak iz Note: 738671.1 i njenih referencnih nota.

Za rekreiranje konfiguracionih datoteka obicno je dovoljno: emca -config dbcontrol db.

Novi document za probleme sa EM je How To Drop, Create And Recreate DB Control In A 10g Database [ID 278100.1] )

 

Kreiranje uzorka (template) dbt  iz postojeće baze

 

REM template dbt

dbca -silent -createTemplateFromDB -sourceDB GLOB -sysDBAUserName sys -sysDBAPassword change_on_install -templateName glob_template

 

 

Kreiranje uzorka (template) dbc  iz postojeće baze

 

REM template dbc

dbca -silent -createCloneTemplate  -sourceDB GLOB -sysDBAUserName sys -sysDBAPassword change_on_install -templateName glob_clone

 

 

Primer: Kreiranje uzorka (template), brisanje baze I rekreiranje pomoću uzorka (template)

 

REM Create a clone template glob_clone from an existing database by specifying the following parameters:

dbca -silent -createCloneTemplate  -sourceDB GLOB -sysDBAUserName sys -sysDBAPassword change_on_install -templateName glob_clone

 

REM delete database glob silently or copy glob_clone.dbc and GLOB_CLONE.DFB to other host !

dbca -silent -deleteDatabase -sourceDB GLOB -sysDBAUserName sys –sysDBAPassword change_on_install

 

REM Create database using database clone template

dbca -silent -createDatabase -templateName glob_clone.dbc -gdbname glob -sid glob -characterset AL32UTF8

 

--from SQL*Plus

alter user DBSNMP account unlock;

alter user dbsnmp identified by DBSNMP;

 

REM Create EM support emConfiguration

dbca -silent  -configureDatabase -sourceDB GLOB -emConfiguration LOCAL -dbsnmpPassword DBSNMP -sysmanPassword elcaro -smtpServer mail.saga-infotech.net -emailAddress darko@saga-infotech.net

 

 

Primer: Kreiranje skripta korišćenjem uzorka (template) i rekreiranje baze

 

Crete db scripts in directory D:\oracle\product\10.2.0\db_1\assistants\dbca\templates\scr

dbca -silent -generateScripts -templateName glob_clone.dbc -gdbName glob -scriptDest D:\oracle\product\10.2.0\db_1\assistants\dbca\templates\scr

 

Crete database using scripts

set ORACLE_SID=GLOB

glob.bat

dbca –help

 

dbca  [-silent | -progressOnly | -customCreate] {<command> <options> }  | { [<command> [options] ] -responseFile  <response file > } [-continueOnNonFatalErrors <true | false>]

Please refer to the manual for details.

You can enter one of the following command:

 

Create a database by specifying the following parameters:

      -createDatabase

            -templateName <name of an existing  template>

            [-cloneTemplate]

            -gdbName <global database name>

            [-sid <database system identifier>]

            [-sysPassword <SYS user password>]

            [-systemPassword <SYSTEM user password>]

            [-emConfiguration <CENTRAL|LOCAL|ALL|NOBACKUP|NOEMAIL|NONE>

                  -dbsnmpPassword <DBSNMP user password>

                  -sysmanPassword <SYSMAN user password>

                  [-hostUserName <Host user name for EM backup job>

                   -hostUserPassword <Host user password for EM backup job>

                   -backupSchedule <Daily backup schedule in the form of hh:mm>]

                  [-smtpServer <Outgoing mail (SMTP) server for email notifications>

                   -emailAddress <Email address for email notifications>]

                  [-centralAgent <Enterprise Manager central agent home>]]

            [-datafileDestination <destination directory for all database files> |  -datafileNames <a text file containing database objects such as controlfiles, tablespaces, redo log files and spfile to their corresponding raw device file names mappings in name=value format.>]

            [-recoveryAreaDestination <destination directory for all recovery files>]

            [-datafileJarLocation  <location of the data file jar, used only for clone database creation>]

            [-storageType < FS | ASM | RAW>

                  [-asmSysPassword     <SYS password for ASM instance>]

                  [-diskString      <disk discovery path to be used by ASM>]

                  [-diskList        <comma seperated list of disks for the database area disk group>

                   -diskGroupName   <database area disk group name>

                   -redundancy      <HIGH|NORMAL|EXTERNAL>]

                  [-recoveryDiskList        <comma seperated list of disks for the recovery area disk group>

                   -recoveryGroupName       <recovery area disk group name>

                   -recoveryGroupRedundancy <HIGH|NORMAL|EXTERNAL>]]

            [-characterSet <character set for the database>]

            [-nationalCharacterSet  <national character set for the database>]

            [-registerWithDirService <true | false>

                  -dirServiceUserName    <user name for directory service>

                  -dirServicePassword    <password for directory service >

                  -walletPassword    <password for database wallet >]

            [-listeners  <list of listeners to configure the database with>]

            [-variablesFile   <file name for the variable-value pair for variables in the template>]]

            [-variables  <comma seperated list of name=value pairs>]

            [-initParams <comma seperated list of name=value pairs>]

            [-memoryPercentage <percentage of physical memory for Oracle>]

                  [-databaseType <MULTIPURPOSE|DATA_WAREHOUSING|OLTP>]]

 

Configure a database by specifying the following parameters:

      -configureDatabase

            -sourceDB    <source database sid>

            [-sysDBAUserName     <user name  with SYSDBA privileges>

             -sysDBAPassword     <password for sysDBAUserName user name>]

            [-registerWithDirService|-unregisterWithDirService|-regenerateDBPassword <true | false>

                  -dirServiceUserName    <user name for directory service>

                  -dirServicePassword    <password for directory service >

                  -walletPassword    <password for database wallet >]

            [-emConfiguration <CENTRAL|LOCAL|ALL|NOBACKUP|NOEMAIL|NONE>

                  -dbsnmpPassword <DBSNMP user password>

                  -symanPassword <SYSMAN user password>

                  [-hostUserName <Host user name for EM backup job>

                   -hostUserPassword <Host user password for EM backup job>

                   -backupSchedule <Daily backup schedule in the form of hh:mm>]

                  [-smtpServer <Outgoing mail (SMTP) server for email notifications>

                   -emailAddress <Email address for email notifications>]

                  [-centralAgent <Enterprise Manager central agent home>]]

 

 

Create a template from an existing database by specifying the following parameters:

      -createTemplateFromDB

            -sourceDB    <service in the form of <host>:<port>:<sid>>

            -templateName      <new template name>

            -sysDBAUserName     <user name  with SYSDBA privileges>

            -sysDBAPassword     <password for sysDBAUserName user name>

            [-maintainFileLocations <true | false>]

 

 

Create a clone template from an existing database by specifying the following parameters:

      -createCloneTemplate

            -sourceSID    <source database sid>

            -templateName      <new template name>

            [-sysDBAUserName     <user name  with SYSDBA privileges>

             -sysDBAPassword     <password for sysDBAUserName user name>]

            [-maintainFileLocations <true | false>]

            [-datafileJarLocation       <directory to place the datafiles in a compressed format>]

 

Generate scripts to create database by specifying the following parameters:

      -generateScripts

            -templateName <name of an existing  template>

            -gdbName <global database name>

            [-scriptDest       <destination for all the scriptfiles>]

 

Delete a database by specifying the following parameters:

      -deleteDatabase

            -sourceDB    <source database sid>

            [-sysDBAUserName     <user name  with SYSDBA privileges>

             -sysDBAPassword     <password for sysDBAUserName user name>]

 

Configure ASM DiskGroups by specifying the following parameters:

      -configureASM

            [-asmSysPassword   <SYS password for ASM instance>]

            [-diskString    <disk discovery path to be used by ASM>]

            [-diskList      <comma seperated list of disks for the database area disk group>

             -diskGroupName <database area disk group name>

             -redundancy    <HIGH|NORMAL|EXTERNAL>]]

            [-recoveryDiskList        <comma seperated list of disks for the database area disk group>

             -recoveryGroupName       <database area disk group name>

             -recoveryGroupRedundancy <HIGH|NORMAL|EXTERNAL>]

            [-emConfiguration <CENTRAL|NONE>

             -centralAgent <Enterprise Manager central agent home>]]

Query for help by specifying the following options: -h | -help