@tony-yin
2017-06-30T10:22:40.000000Z
字数 3525
阅读 909
Resource
备份原理
数据库安装
数据库创建
安装后的默认数据库为orcl,如需创建新的数据库
root@oracledb: xhost local:oracledb
root@oracledb: su - oracle
oracle@oracledb: dbca
创建表空间
su - oracle (Windows下此步骤省略)
sqlplus / as sysdba
create tablespace test_space datafile '/opt/oracle/oradata/test_data.dbf' size 500M
创建用户
su - oracle (Windows下此步骤省略)
sqlplus / as sysdba
create user test identified by test default tablespace test_space;
授权用户权限
su - oracle (Windows下此步骤省略)
sqlplus / as sysdba
grant connect, resource to test;
授权DBA权限(RMAN需要dba权限来运行)
su - oracle (Windows下此步骤省略)
sqlplus / as sysdba
grant sysdba to test;
数据库启动/关闭
切换用户
root@oracledb: su - oracle
启动监听
lsnrctl start
启动实例
su - oracle (Windows下此步骤省略)
sqlplus /nolog
conn /as sysdba
startup
关闭实例
su - oracle (Windows下此步骤省略)
sqlplus /nolog
conn /as sysdba
shutdown immediate
exit
lsnrctl stop
归档日志模式启动/关闭
启动归档日志模式
sqlplus /as sysdba
shutdown immediate
startup mount
alter database archivelog
alter database open
关闭归档日志模式
sqlplus /as sysdba
shutdown immediate
startup mount
alter database noarchivelog
alter database open
Backup scripts
Questions
Issues
Q: How to recover to specific SCN with backupset?
id int, name varchar(16)
Insert records and backup
Restore