========================================================== ============================######### Create a database ---- look $ ORACLE_HOME/rdbms/admin/buildall. SQL ############ CREATE DATABASE db01maxlogfiles 10 maxdatafiles 1024 maxinstances 2 logfilegroup 1 ('/u01/oradata/db01/log_01_db01.rdo') size 15 m, group 2 ('/u01/oradata/db01/log_02_db01.rdo') size 15 m, group 3 ('/u01/oradata/db01/log_03_db01.rdo') size 15 m, datafile 'u01/oradata/db01/system_01_db01.dbf') size 100 m, undo tablespace undodatafile '/u01/oradata/db01/comment 'size 40 mdefault temporary tablespace temptempfile'/u01/oradata/db01/comment 'size 20 Mexico tent management local uniform size 128 kcharacter set comment character Set al16utf16set time_zone = 'America/new_york '; ############## data dictionary ########## set wrap offselect * from V $ dba_users; grant select on table_name to user/rule; select * From user_tables; select * From all_tables; select * From dba_tables; Revoke DBA from user_name; shutdown immediatestartup nomountselect * from V $ instance; select * from V $ SGA; select * from V $ tablespace; Alter session set nls_language = American; Alter database Mount; select * from V $ database; Alter database open; desc dictionaryselect * From dict; DESC v $ fixed_table; select * from V $ fixed_table; Set oracle_sid = foxconnselect * From dba_objects; Set serveroutput onexecute dbms_output.put_line ('sf' ASD '); ############ control file ########### select * from V $ database; select * from V $ tablespace; select * from V $ logfile; select * from V $ log; select * from V $ backup;/* Backup user tablespace */alter tablespace users begin backup; select * from V $ archived_log; select * from V $ controlfile; Alter system set control_files = '$ ORACLE_HOME/oradata/u01/ctrl01.ctl ', '$ ORACLE_HOME/oradata/u01/ctrl02.ctl' scope = spfile; CP $ ORACLE_HOME/oradata/u01/ctrl01.ctl $ ORACLE_HOME/oradata/u01/ctrl02.ctlstartup pfile = '.. /initsid. ora 'select * from V $ parameter where name like 'control % '; show parameter control; select * from V $ controlfile_record_section; select * from V $ tempfile; /* backup control file */alter Database Backup controlfile '.. /filepath/control. bak';/* back up the control file and change the binary control file to an ASC text file */alter Database Backup controlfile to trace; ############## redo log ############### archive log list; alter system archive log start; -- enable automatic archiving alter system switch logfile; -- Force One log switchalter system checkpoint; -- Force One checkpointalter tablspace users begin backup; Alter tablespace offline; /* the checkpoint synchronization frequency parameter fast_start_mttr_target. The higher the synchronization frequency, the shorter the system recovery time */show parameter fast; show parameter log_checkpoint; /* join a log Group */alter database add logfile group 3 ('/$ ORACLE_HOME/Oracle/ora_log_file6.rdo' size 10 m ); /* Add a member to the log Group */alter database add logfile member '/$ ORACLE_HOME/Oracle/ora_log_file6.rdo' to group 3;/* delete a log group: The current log group cannot be deleted; active log groups cannot be deleted; non-archive log groups cannot be deleted */alter database drop logfile group 3;/* delete a member in a log group, however, the last member of each group cannot be deleted */alter Databse drop logfile member '$ ORACLE_HOME/Oracle/ora_log_file6.rdo '; /* clear online logs */alter database clear logfile '$ ORACLE_HOME/Oracle/ora_log_file6.rdo'; Alter database clear logfile group 3; /* clear non-archive logs */alter database clear Unarchived logfile group 3; /* rename the log file */alter database rename File '$ ORACLE_HOME/Oracle/ora_log_file6.rdo' to '$ ORACLE_HOME/Oracle/ora_log_file6a.rdo'; show parameter db_create; alter system set db_create_online_log_dest_1 = 'path _ name'; select * from V $ log; select * from V $ logfile;/* interchange between database archive mode and non-archive mode, it can be changed only after it is started to the Mount state; Startup Mount; then open the database. */alter database noarchivelog/archivelog; achive log start; --- start automatic archiving alter system archive all; -- manually archiving all log files select * from V $ archived_log; show parameter log_archive;