dsadm-dsconf数据导入导出

时间:2021-06-10 11:41:26

cd instance-path/ds6/bin   #注意黄色参数修改为跟实际环境一致

-c,--accept-cert
Does not ask for confirmation before accepting non-trusted server certificates
-?,--help
Displays this message or subcommand help message
-h HOST, --hostname HOST
Connects to Directory Server on HOST (Default: $DIRSERV_HOST or localhost)
-i,--no-inter
Does not ask for confirmation
-p PORT, --port PORT
Connects to Directory Server on PORT (Default: $DIRSERV_PORT or )
-w FILE, --pwd-file FILE
Binds with pwd read from FILE (Default:$LDAP_ADMIN_PWF or prompt for pwd)
-j,--reject-cert
Does not ask for confirmation before rejecting non-trusted server certificates (for this session only)
-P PORT, --secure-port PORT
Connects to Directory Server on secure port PORT
-e,--unsecured
Connects over LDAP with no secure connection (Enabled if $DIRSERV_UNSECURED is set)
-D USER_DN, --user-dn USER_DN
Binds as USER_DN (Default: $LDAP_ADMIN_USER or cn=Directory Manager)
-v,--verbose
Displays extra information
-V,--version
Displays dsconf version

1.基本索引查看:
./dsconf list-indexes -D cn=admin --pwd-file password -e -p  端口号-v dc=test

cn是目录管理员名字;  password是登录DSCC的密码文件,用vi编辑器在instalnce-path/ds6/bin目录下新建password文件,里面输入DSCC密码。也可跟例4一样,前面指定password的路径。test是后缀名;-e

2.ldap离线导出数据命令:

停止ldap服务
./dsadm export  /home/ldap/amsldap/(实例路径)  dc=test   /home/20140510.ldif(导入数据库路径及数据名)

3.ldapl离线导入数据:

停止ldap服务
./dsadm import /home/yn4a/ldap/amsldap(实例路径) /home/yn4a/20140510.ldif(导入数据库路径及数据名) dc=test
4.LDAP在线导出数据命令:

启动ldap服务
./dsconf export -h ip地址 -p 端口号 -e -D cn=admin -w
/home/ldap/iamldap/ds6/bin/password -Q dc=test /home/20140510.ldif
5.LDAP在线导入数据命令:

启动ldap服务
./dsconf import -h ip地址 -p 端口号 -e -D cn=admin -w /home/ldap/iamldap/ds6/bin/password
-Q dc=test /home/20140510.ldif