跳至主要内容

Oracle学习笔记20080111

Example on UNIX
$ ORACLE_SID=db01; export ORACLE_SID
$ rman target /
RMAN> connect catalog rman_db01/rman_db01@catdb
Example on Windows NT
C:\> set ORACLE_SID=db01
C:\> rman target /
RMAN> connect catalog rman_db01/rman_db01@catdb

同步回复目录
自动的使用backup和copy手动的使用resync catalog
假如要使用resync catlog你必须增加或删除一个表空间,数据文件,或者移动了数据库文件
$ rman target / catalog rman/rman@catdb
RMAN> RESYNC CATALOG;

从新修改数据库incarnation用reset database命令,直接将RMAN用来建一个新的incarnation数据库记录,To distinguish(区别) between opening with RESETLOGS and an accidental restore operation of an old control file在用RESET DATABASE以后用RESETLOGS
数据字典
RC_DATABASE
RC_DATAFILE
RC_STORED_SCRIPT
RC_STORED_SCRIPT_LINE
RC_TABLESPACE

Script Examples
Use CREATE SCRIPT to store a script.
RMAN> create script Level0Backup {
backup incremental level 0 format '/u01/db01/backup/%d_%s_%p'
fileperset 5 (database include current controlfile);
sql 'alter database archive log current';
}

Use EXECUTE SCRIPT to run a script.
RMAN > run {execute script Level0Backup;}

管理脚本Use REPLACE SCRIPT to rewrite a script
RMAN> REPLACE SCRIPT Level0Backup { ..... fileperset 3 .... }

Use DELETE SCRIPT to remove a script
RMAN> DELETE SCRIPT Level0Backup;
Use PRINT SCRIPT to display a script
RMAN> PRINT SCRIPT Level0Backup;
备份恢复目录整个数据库和表空间备份的时候都已经备份了恢复目录,导出如果不大,导出数据库,如果大到处schema
恢复恢复日志建立一个数据库从先前的恢复日志数据库备份,重移目录到别的数据库和导入进来的数据,导入全部数据从导出
Transporting Data Between Databases输入输出工具
Command-line interfaceAn interactive dialog
Parameter files
Oracle Enterprise Manager

Invoking Export
Syntax:
exp keyword = value, value2, ... ,valun

Examples:
exp hr/hr TABLES=employees,departments rows=y file=exp1.dmp
exp
system/manager OWNER=hr direct=y file=expdat.dmp
exp \'username/password AS
SYSDBA\' TRANSPORT_TABLESPACE=y TABLESPACES=ts_emp log=ts_emp.log

Specifying Direct-Path Export As command line argument to the Export command:
exp userid=hr/hr full=y direct=y

As a keyword in a parameter file:
exp parfile=Parameter file ...(Other Parameters)DIRECT = Y...(Other
Parameters)

Invoking Import Syntax:
imp keyword = value or keyword = value, value2, ... value Examples:imp hr/hr TABLES=employees,departments rows=y file=exp1.dmpimp system/manager FROMUSER=hr file=exp2.dmpimp \'username/password AS SYSDBA\' TRANSPORT_TABLESPACE=y TABLESPACES=ts_employees

Invoking Import as SYSDBA
imp \'username/password AS SYSDBA\'
Import Process Sequence
1. New tables are created
2. Data is imported
3. Indexes are built
4. Triggers are imported
5. Integrity constraints are enabled on the new tables
6. Any bitmap, functional, and/or domain indexes are built

WorkshopEnable TracingOracle Net ManagerEdit sqlnet.
ora fileTRACE_DIRECTORY_CLIENT= /u01/user01/NETWORK/LOGNAMES.DEFAULT_DOMAIN = us.oracle.comTRACE_UNIQUE_CLIENT = onTRACE_FILE_CLIENT = client.trcTRACE_LEVEL_CLIENT = SUPPORTNAMES.DIRECTORY_PATH= (TNSNAMES)
sqlnet.ora的位置还是在$ORACLE_HOME/product/9.2/network/admin

使用trace fileThe flow of packets between network nodes Which component of Oracle Net is failing Pertinent error codes
Loading Data into a Database数据加载的动作Direct-Load INSERTNormal (serially) or in parallelInto partitioned tables, nonpartitioned tables, or single partitions of a tableWith or without logging of redo data
Serial Direct-Load INSERTINSERT /*+ APPEND */ INTO emp NOLOGGINGSELECT * FROM t_employees;COMMIT;
Parallel Direct-Load INSERTALTER SESSION ENABLE PARALLEL DML;INSERT /*+PARALLEL(hr.employees,2) */ INTO hr.employees NOLOGGINGSELECT * FROM hr.old_employees;
到此2张已经都看完了,下面应该更多的实践和练习

评论

此博客中的热门博文

4 steps to delete account in Gerrit DB

4 steps to delete account in DB. Delete from accounts where preferred_email=’’; delete from account_ssh_keys where account_id=''; delete from account_external_ids where external_id='gerrit:*’; delete from account_external_ids where external_id='username:*’; whatever it was in H2 database and postgres db . H2: ssh -p 24198 localhost gerrit gsql Postgres: psql

繁忙的周末

回了杭州,周五跟老爹吃夜宵,周六跟一群人玩,好乐迪9折加对折,然后夜宵,长肉。 跟老妈逛街。。花了我一千大洋,买了2件外套了受不了了。 结果。。唉。。去赶火车结果没坐上,改签,跟老妈发脾气。。让我多睡了10分钟结果拉下了火车。 然后做七点四十七的车,一路出战一路狂奔赶地铁。。 终于赶上了。 真不容易,还是要提早啊

mod

apache安装后,如果想再添加模块,往往不想重新安装一次,再者,我在安装中发现,并不是安装文件中所有的modules都会被默认安装,即使在安装中使用了 ./configure --prefix=/usr/local/apache --enable-so --enable-modules=all --enable-mods-shared=all也是如此。我使用上述方法安装的apache2.2.6就没有安装proxy相关模块。这时,需要手工生成so文件,但会自动的被复制到你的apache安装目录的modules中,然后修改apache的配置文件,加载相关模块,验证apache配置并重启服务即可。以上描述的具体操作步骤如下: 操作系统:linux redhat 4.5 ES apache版本:2.2.6 可自行下载tar包 1. 拷贝安装包到/usr/local,并在目标目录下进行解压。[root@localhost local]# cd /usr/local[root@localhost local]# tar -zxvf httpd-2.2.4.tar.gz2. 配置安装参数,安装的目标目录为/usr/local/apache,建议设置enable-mods-shared=all,不用的module注释掉就行了![root@localhost local]# cd httpd-2.2.4[root@localhost httpd-2.2.4]# ./configure --prefix=/usr/local/apache --enable-so --enable-mods-shared=all3. 编译并安装。[root@localhost httpd-2.2.4]# make[root@localhost httpd-2.2.4]# make install4. 启动Apache,并测试。[root@localhost httpd-2.2.4]# cd /usr/local/apache/bin[root@localhost bin]# ./apachectl start 打开浏览器,并在地址栏中输入主机的IP地址如 http://192.168.1.254/ 如果出现以下画面则说明安装成功。It works! 注意:安装完成后检查系统服务中的HTTPD服务是否已...