sqlplus连接oracle
tns文件配置
cd /usr/local/oracle/instantclient_11_2
mkdir -p network/admin
cd network/admin
新建tnsnames.ora文件
CM =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.11)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
sqlplus连接数据库
sqlplus username/passwd@cm
或者
sqlplus /nolog
conn user/"pwd"@127.0.0.1:1521/orcl
或者
sqlplus user/"pwd"@127.0.0.1:1521/orcl
导出表命令:
导出指定表
exp 'crmreade/"Snsp@2018"'@10.13.190.193:1521/orcl file=/data/k3_1.dmp tables=K3P30.t_bd_material;
导出整个owner
exp 'crmreade/"Snsp@2018"'@10.13.190.193:1521/orcl file=/data/k3_1.dmp owner=K3P30;
赋值导出权限给用户
grant exp_full_database to crmreade;