Oracle Database Sqldatabaseloggingfile
–=====================
– Manually delete the Oracle database
–=====================
In many cases, or unable to use the DBCA tool, we need to manually delete the database. This can be accomplished with the drop Database command, which is given in the following description to manually delete the databases
, including the file system database and the ASM database. Environment: Oracle Enterprise Linux 5.4 + Oracle 10g R2.
First, manually delete the file system database
1. Stop listening with OEM $ lsnrctl stop listener_name $ emctl Stop dbconsole2. Get information about data files, log files, and control files, including archive $ sqlplus/as SYSDBA sql> Select Status,name from V$controlfile; --Get the location information of the control file sql> select * from V$dbfile; --Get the location information of the data file sql> select * from V$logfile; --Get the log file location information sql> archive log list; --View archived sequence and location information sql> shutdown abort; -The data is no longer needed, direct shutdown abort3. Boot to mount status (using exclusive restart) sql> startup Mount exclusive restrict;4. Modify parameters to allow restricted session mode Sql> alter system enable restricted SESSION;5. Use the Drop DATABASE command to clear the Databases sql> drop DB; Sql> exit6. Manually purge related files $ echo $ORACLE _sid--Confirm current Oracle_sid $ rm-rf $ORACLE _base/admin/$ORACLE _sid--Delete o Racle all contents of $oracle_sid under the BASE directory $ rm-rf $ORACLE _base/oradata/data files under _sid--oradata, according to the previous query, note to delete data files under different paths $ rm-rf $ORACLE _base/arch/$ORACLE _sid--Clear the archive log and note the correctness of the archive pathRM-RF $ORACLE _base/flash_recovery_area/$ORACLE _sid--Clear the contents of the Flash back zone $ rm-rf $ORACLE _home/dbs/* $ORACLE _sid* --Clear the parameter file */7. Clear the Listener related files (recommended) $ RM $TNS _admin/*.ora--If the $tns_admin variable is set, delete the listening file under the default path */$ RM $ORACLE _home/n Etwork/admin/*.ora */8. Modify the Oratab file and. Bash_profile $ vi/etc/oratab--remove instance related settings $ VI ~/.bash_profile --Remove the settings associated with the instance
Second, clear the ASM database
The difference between the removal of ASM databases and the file system database is that data files, control files, log files, parameter files, etc. are all stored in the ASM system, so it is necessary to do the corresponding actions in the ASM instance to completely clear the database. 1. Perform the file system database Cleanup Step 3-4 step (first shutdown) 2. Use the drop DATABASE command to clear the databases (the command will purge the data files, log files, temp files) sql> drop db; sql> exit3. Connecting to ASM instance $ export oracle_sid=+asm $ sqlplus/as sysdba4. Purge residual files sql> Select Name,file_number,gro Up_number,file_incarnation from V$asm_alias; --View the file, note that Group_number is located in a different disk group sql> alter diskgroup DG1 drop directory ' +dg1/asmdb/file_name '; --can be used to delete files that need to be deleted sql> alter diskgroup REV drop directory ' +rev/asmdb/file_name '; Sql> select Name,file_number,group_number,file_incarnation from V$asm_alias; --Verify that the deleted results can also be removed by using the following method (Asmcmd command) to delete the remaining files $ export oracle_sid=+asm $ asmcmd asmcmd> ls-l State Type Rebal unbal Name mounted extern n n dg1/mounted extern n n rev/asmcmd> ls-s Se ctor Block AU total_mb free_mb req_mir_free_mb usable_file_mb offline_disks Name 512 4096 1048576 3067 2974 0 2974 0 dg1/512 4096 1048576 20 1996 0 1996 0 rev/asmcmd> cd +DG1 asmcmd> ls ASMDB/ASMC md> rm-rf asmdb asmcmd> ls asmcmd> cd +rev asmcmd> pwd +rev asmcmd> ls asmcmd> CD + asmcmd> ls-s Sector Block AU total_mb free_mb req_mir_free_mb usable_file_mb offline_disks Name 4096 1048576 3067 3016 0 3016 0 dg1/512 4096 104857 6 2047 1996 0 1996 0 rev/for files that are located directly under the disk group, you can also use the RM command to directly delete files 5. Clear other Files Although the data files, archive logs, online logs, temp files, parameter files are stored on the ASM disk, but the dump file, the alarm log is still located on the disk, need to manually clear the Echo $ORACLE _sid--Confirm the current Oracle_sid $ rm-rf $OR acle_base/admin/$ORACLE _sid--Delete all contents of $oracle_sid in ORACLE BASE directory $ rm-rf $ORACLE _home/dbs/* $ORACLE _sid* --Clear the parameter file */
6. Perform the file system database cleanup step 7-8 step
Third, quick reference
For performance tuning, refer to
Oracle hard and soft parse shared pool tuning and optimization (Shared pool Tuning) Buffer Cache tuning and optimization (i) Use of the Oracle table cache (caching table)
For Oracle architecture, refer to
Oracle tablespace and data file Oracle password file oracle parameter file Oracle online redo log file (online log file) Oracle Control file (controlfile) Oracle Archive log Oracle Rollback ( ROLLBACK) and undo (undo) Oracle DB instance start shutdown process automated management of Oracle 10g SGA Oracle Instances and Oracle Databases (Oracle architecture)
For a flashback feature, refer to
Oracle Flashback feature (FLASHBACK DATABASE) Oracle Flashback feature (FLASHBACK DROP & RecycleBin) Oracle Flashback feature (FLASHBACK Query, FLASHBACK Table) Oracle Flashback Feature (Flashback Version, Flashback Transaction)
For information on the concept of user-managed backup and backup recovery, refer to
Oracle Cold backup Oracle Hot backup Oracle Backup Recovery concept Oracle Instance Recovery Oracle User-managed recovery processing (detailed description of media recovery and its processing) SYSTEM table space Management and backup recovery Sysaux table space Management and recovery
For backup recovery and management of Rman, refer to
Rman Overview and its architecture Rman configuration, monitoring and management Rman Backup in detail Rman restore and Recovery Rman catalog creation and use create Rman storage scripts based on catalog
Catalog-based Rman backup and recovery
Migrating file system databases to ASM using Rman
RMAN Backup path Confusion (when using plus archivelog)
For Oracle failures, refer to
ORA-32004 error Handling ORA-01658 error CRS-0215 error handling ora-00119,ora-00132 error Handling Another example SPFile setting error causes database to fail to start on parameter Fast_start_mttr_target = 0 Misunderstanding and setting SPFile errors cause the database to fail to start (ORA-01565)
For ASM please refer to
Create ASM instances and ASM databases ASM disk, directory Management use the Asmcmd tool to manage ASM catalogs and files
For Sql/plsql please refer to
SQLPlus Common command substitution variables and sql*plus environment settings use Uniread to implement SQLPlus paging feature SQL Foundation-->select Query SQL Basics--new_value Using SQL Basics--set operations ( Union and UNION All) SQL Foundation--Common functions SQL Foundation---view (CREATE VIEW) SQL Foundation----Creating and Managing Table SQL Basics--multi-table query SQL basics--filtering and sorting SQL basics --Subquery SQL Basics--grouping and grouping functions SQL-based--hierarchical query (START by ... CONNECT by PRIOR) SQL Basics--Rollup and cube operators implement data summarization--PL/SQL-------------PL/C --Process Control PL/SQL Recording PL/SQL-------------" The _DDL package uses PL/SQL--and DML triggers PL/SQL--INSTEAD of triggers PL/SQL--and stored procedures PL/SQL--PL---Dynamic Sqlpl/sql ; Common errors for Dynamic SQL
Other features about Oracle
Oracle Common directory Structure (10g) uses Oem,sql*plus,isql*plus to manage Oracle instance logging patterns (LOGGING, Force LOGGING, nologging), Logging and Nologgingoralce OMF features on the index segment Oracle user, object permissions, System permissions Oracle role, profile Oracle partition table Oracle external tables use external tables to manage Oracle alarm logs ( Alaert_$sid. LOG) cluster table and cluster table management (Index clustered tables) Data pump EXPDP Export tool using the data Pump IMPDP Import Tool Import export Oracle partition table data sql* Loader using a method to enable user process tracking Configure dynamic service enrollment for nondefault ports Configure the differences between Oracle Client connection to database system Sys,sysoper SYSDBA Oracle_sid, db_name, instance_name, DB _domian, Global_nameoracle Patch complete (Oracle 9i 10g 11g Path) Oracle 10.2.0.1 upgrade to 10.2.0.4Oracle complete kill session
Manually delete an Oracle database