实习日志第45天

这两天主要学习RAC的安装和administrator,混合起来一步步学习命令

 

第二章:Creating an Oracle Database
建库方法(3种)
DBCA建库
create database语句
upgrade an existing database
建库时要考虑的问题
数据库结构、存储的方案对象
存储方式:OMF、ASM
数据库名,实例名
初始化参数
全球化支持(字符集问题)
Timezone时区问题
Db
db_block_size
SYSAUX、永久表空间、UNDO tablespace
Redolog、archived redolog
Control files
Creating the Database
Step 1: Decide on Your Instance Identifier (SID)
Step 2: Establish the Database Administrator Authentication Method
Step 3: Create the Initialization Parameter File
Step 4: Connect to the Instance
Step 5: Create a Server Parameter File (Recommended)
Step 6: Start the Instance
Step 7: Issue the CREATE DATABASE Statement
Step 8: Create Additional Tablespaces
Step 9: Run Scripts to Build Data Dictionary Views
Step 10: Run Scripts to Install Additional Options (Optional)
Step 11: Back Up the Database.
Understanding the CREATE DATABASE Statement
CREATE DATABASE mynewdb
   USER SYS IDENTIFIED BY pz6r58
   USER SYSTEM IDENTIFIED BY y1tz5p
   LOGFILE GROUP 1 ('/u01/oracle/oradata/mynewdb/redo01.log') SIZE 100M,
           GROUP 2 ('/u01/oracle/oradata/mynewdb/redo02.log') SIZE 100M,
           GROUP 3 ('/u01/oracle/oradata/mynewdb/redo03.log') SIZE 100M
   MAXLOGFILES 5
   MAXLOGMEMBERS 5
   MAXLOGHISTORY 1
   MAXDATAFILES 100
   MAXINSTANCES 1
   CHARACTER SET US7ASCII
   NATIONAL CHARACTER SET AL16UTF16
   DATAFILE '/u01/oracle/oradata/mynewdb/system01.dbf' SIZE 325M REUSE
   EXTENT MANAGEMENT LOCAL
   SYSAUX DATAFILE '/u01/oracle/oradata/mynewdb/sysaux01.dbf' SIZE 325M REUSE
   DEFAULT TABLESPACE tbs_1
   DEFAULT TEMPORARY TABLESPACE tempts1
      TEMPFILE '/u01/oracle/oradata/mynewdb/temp01.dbf'
      SIZE 20M REUSE
   UNDO TABLESPACE undotbs
      DATAFILE '/u01/oracle/oradata/mynewdb/undotbs01.dbf'
      SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
Protecting Your Database: Specifying Passwords for Users SYS and SYSTEM
Creating a Locally Managed SYSTEM Tablespace
Creating the SYSAUX Tablespace
Using Automatic Undo Management: Creating an Undo Tablespace
Creating a Default Permanent Tablespace
Specifying Oracle-Managed Files at Database Creation
Supporting Bigfile Tablespaces During Database Creation
Specifying the Database Time Zone and Time Zone File
Specifying FORCE LOGGING Mode
Understanding Initialization Parameters
control_files                 = (/u0d/lcg03/control.001.dbf,
                              /u0d/lcg03/control.002.dbf,
                              /u0d/lcg03/control.003.dbf)
db_name                    = lcg03
db_domain                  = us.oracle.com
log_archive_dest_1           =
"LOCATION=/net/fstlcg03/private/yaliu/testlog/log.lcg03.fstlcg03/lcg03/arch"
log_archive_dest_state_1      = enable
db_block_size               = 8192
pga_aggregate_target         = 2500M
processes                  = 1000
sessions                   = 1200
open_cursors               = 1024
undo_management          = AUTO
shared_servers             = 3
remote_listener             = tnsfstlcg03
undo_tablespace            = smu_nd1
compatible                 = 10.2.0
sga_target                 = 1500M
nls_language               = AMERICAN
nls_territory                = AMERICA
db_recovery_file_dest        =
/net/fstlcg03/private/yaliu/testlog/log.lcg03.fstlcg03/lcg03/arch
db_recovery_file_dest_size = 100G
 
Determining the Global Database Name Determining the Global Database Name
Specifying a Flash Recovery Area
Specifying Control Files
Specifying Database Block Sizes
Managing the System Global Area (SGA)
SELECT (
   (SELECT SUM(value) FROM V$SGA) -
   (SELECT CURRENT_SIZE FROM V$SGA_DYNAMIC_FREE_MEMORY)
   ) "SGA_TARGET"
FROM DUAL;
ALTER SYSTEM SET SGA_TARGET=value [SCOPE={SPFILE|MEMORY|BOTH}]
Specifying the Maximum Number of Processes
Specifying the Method of Undo Space Management
The COMPATIBLE Initialization Parameter and Irreversible Compatibility(兼容和不可逆兼容)
Troubleshooting Database Creation
在创建数据库失败时,可以从alert log里找到相关的记录
关闭数据库,在重建DB前删除所有create database语句创建的文件
Dropping a Database
Dropping a database包括数据文件,日志文件,控制文件和初始化参数文件
To use the DROP DATABASE statement successfully, all of the following conditions must apply:
■ The database must be mounted and closed.
■ The database must be mounted exclusively--not in shared mode.
■ The database must be mounted as RESTRICTED.
SQL> DROP DATABASE;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24005010/viewspace-691484/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/24005010/viewspace-691484/

你可能感兴趣的:(实习日志第45天)