1.数据导出导入命令:exp、imp、expdp、impdp
exp win/****grants=y file=c:\win.dmp
imp system/****file= fromuser= touser=
imp win/**** file=
import data from a server to another server
imp system/**** file=c:\win1.dmp fromuser=win touser=win
expdp/impdp
expdp system/****dumpfile=wintest1029.dmp directory=dumpdir schemas=win
impdp system/****directory=dumpdir dumpfile=wintest1029.dmp remap_schema=win:wintest
若导出导入的数据库版本不一样,要加上参数version
expdp system/****dumpfile=wintest1029.dmp directory=dumpdir schemas=win version=11.1
impdp system/****directory=dumpdir dumpfile=wintest1029.dmp remap_schema=win:wintest version=11.1
其中dumpdir需要创建
--create directory
connect system/****as sysdba;
create directory win.dumpdir as 'D:\versiondata';
GRANT READ, WRITE ON DIRECTORY dumpdir TO win;
2.ORA-28002: The password will expire within %s days
ERROR:
ORA-28002: the password will expire within 6 days
===============================================
提示密码快过期了,由于需要连接的测试数据库,所以决定将密码设置成永不过期。
1.查看用户的profile设置:
======================================================
SQL> SELECT username,profile FROM dba_users where username like 'TEST1';
USERNAME PROFILE
------------------------------ ------------------------------
TEST1 DEFAULT
========================================================
一般用户的profile设置都为DEFAULT。
2.查看系统profiles中PASSWORD_LIFE_TIME设置。
============================================================
SQL> SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='P
ASSWORD_LIFE_TIME';
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- ------------------------------------------------
DEFAULT PASSWORD_LIFE_TIME PASSWORD 180dys
==============================================================
3.修改DBA_PROFILES中PASSWORD_LIFE_TIM的设置,改为ULIMITED。
=================================================================
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
=================================================================
修改后设置立即生效,不需要重启数据库,此时密码永远不会过期。
按照如下步骤进行操作:
1、查看用户的proifle是哪个,一般是default:
sql>SELECT username,PROFILE FROM dba_users;
2、查看指定概要文件(如default)的密码有效期设置:
sql>SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='FAILED_LOGIN_ATTEMPTS';
3、将尝试登录失败次数由默认的10次修改成“无限制”:
sql>ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED;
4、修改后,还没有被提示ORA-28000警告的用户不会再碰到同样的提示;
已经被锁定的帐户必须解除锁定,举例如下:
$sqlplus / as sysdba
sql> alter user smsc identified by oracle account unlock;
5、修改后default profile应该如下:
sql> select * from dba_profiles WHERE dba_profiles.profile='DEFAULT';
PROFILE RESOURCE_NAME RESOURCE_TYPE LIMIT
------------------------------ -------------------------------- ------------- ----------------------
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD UNLIMITED
DEFAULT PASSWORD_LIFE_TIME PASSWORD UNLIMITED
修改之后不需要重启动数据库,会立即生效。