当前位置: 数据库>其它
本页文章导读:
▪DB2数据库备份还原 db2在线备份命令:
db2 connect to
DBName user userName using
password
db2 update db cfg for DBName using logretain on
db2 force applications all
db2 backup db DBName online tod:/db2bak
可以将上面4条命令写在一个ba.........
▪Warning: prerequisite DBD::mysql 1 not found错误解决方案 在使用perl编译的 DBD::mysql 的时候,进程提示无法编译成功,这里想需要我们手动进行编译相关的包文件;相关错误如下所示;
dbdimp.c: In function 鈓ysql_db_async_result?
dbdimp.c:5049: error: 釳YSQL?und.........
▪innotop性能监视mysql,innodb工具 下载相关的innotop包;
http://code.google.com/p/innotop/downloads/list
安装;
[root@Slave02 local]# ls
bin mysql
cmake-2.8.5 mysqlsla-2.03
doc mysqlsla-2.03.tar.gz
etc puppetlabs.........
[1]DB2数据库备份还原
来源: 互联网 发布时间: 2013-11-07
db2在线备份命令:
db2 connect to
DBName user userName using
password
db2 update db cfg for DBName using logretain on
db2 force applications all
db2 backup db DBName online tod:/db2bak
可以将上面4条命令写在一个bat文件中,每条命令占一行,在装有DB2数据库的机器上运行bat文件即可。
如果DB2的版本是9,备份出来的文件名称如“DBName.0.DB2.NODE0000.CATN0000.20130220171655.001”
如果DB2的版本是8,备份出来的文件名称如“171655.001”,该文件时存储在目录“DBName.0/DB2/NODE0000/CATN0000/20130220/”下的
db2还原命令:
db2 restore database DBName fromD:\db2bak taken at 20130227143108 WITHOUT ROLLING FORWARD WITHOUT PROMPTING
可以将该命令写入一个bat文件来运行还原,将该命令加上双引号,前面加上“db2cmd”,也就是将db2cmd “db2 restore database DBName fromD:\db2bak
taken at 20130227143108 WITHOUT ROLLING FORWARD WITHOUT PROMPTING”写入到一个bat文件中,运行bat文件即可还原。
如果是由DB2 9备份的,则from后面的路径写到文件的直接父目录,如果是由DB2 8备份的,则from后面的路径写到DBName.0的直接父目录。
作者:lyqin2008 发表于2013-3-13 19:11:59 原文链接
阅读:7 评论:0 查看评论
[2]Warning: prerequisite DBD::mysql 1 not found错误解决方案
来源: 互联网 发布时间: 2013-11-07
在使用perl编译的 DBD::mysql 的时候,进程提示无法编译成功,这里想需要我们手动进行编译相关的包文件;相关错误如下所示;
dbdimp.c: In function 鈓ysql_db_async_result? dbdimp.c:5049: error: 釳YSQL?undeclared (first use in this function) dbdimp.c:5049: error: 鈙vsock?undeclared (first use in this function) dbdimp.c:5049: error: invalid operands to binary * dbdimp.c:5049: warning: statement with no effect dbdimp.c:5050: error: 釳YSQL_RES?undeclared (first use in this function) dbdimp.c:5050: error: 鈅res?undeclared (first use in this function) dbdimp.c:5050: error: invalid operands to binary * dbdimp.c:5050: warning: statement with no effect dbdimp.c:5051: warning: ISO C90 forbids mixed declarations and code dbdimp.c:5054: error: 鈘esp?undeclared (first use in this function) dbdimp.c:5055: warning: statement with no effect dbdimp.c:5069: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight? dbdimp.c:5073: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight? dbdimp.c:5073: warning: comparison of distinct pointer types lacks a cast dbdimp.c:5077: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight? dbdimp.c:5077: warning: statement with no effect dbdimp.c:5079: error: 鈏mp_dbh_t?has no member named 鈖mysql? dbdimp.c:5079: warning: statement with no effect dbdimp.c:5080: warning: implicit declaration of function 鈓ysql_read_query_result? dbdimp.c:5082: warning: implicit declaration of function 鈓ysql_store_result? dbdimp.c:5082: error: assignment of read-only location dbdimp.c:5082: warning: statement with no effect dbdimp.c:5085: warning: passing argument 3 of 鈓ysql_dr_error?makes pointer from integer without a cast dbdimp.c:5086: error: wrong type argument to unary exclamation mark dbdimp.c:5090: warning: comparison of distinct pointer types lacks a cast dbdimp.c:5098: error: 鈓y_ulonglong?undeclared (first use in this function) dbdimp.c:5098: warning: comparison between pointer and integer dbdimp.c:5099: error: wrong type argument to unary exclamation mark dbdimp.c:5100: error: 鈏mp_sth_t?has no member named 鈏nsertid? dbdimp.c:5100: warning: statement with no effect dbdimp.c:5106: error: 鈏mp_sth_t?has no member named 鈘esult? dbdimp.c:5107: error: 鈏mp_sth_t?has no member named 鈊one_desc? dbdimp.c:5107: warning: statement with no effect dbdimp.c:5108: error: 鈏mp_sth_t?has no member named 鈌etch_done? dbdimp.c:5108: warning: statement with no effect dbdimp.c:5111: error: 鈏mp_sth_t?has no member named 鈝arning_count? dbdimp.c:5111: warning: statement with no effect dbdimp.c:5096: warning: unused variable 鈏mp_dbh? dbdimp.c:5115: warning: passing argument 3 of 鈓ysql_dr_error?makes pointer from integer without a cast dbdimp.c: In function 鈓ysql_db_async_ready? dbdimp.c:5139: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight? dbdimp.c:5140: error: 鈏mp_dbh_t?has no member named 鈇sync_query_in_flight? dbdimp.c:5140: warning: comparison of distinct pointer types lacks a cast dbdimp.c:5144: error: 鈏mp_dbh_t?has no member named 鈖mysql? dbdimp.c:5144: error: 鈙ql_type_info_t?has no member named 鈔et? dbdimp.c:5144: error: request for member 鈌d?in something not a structure or union dbdimp.c:5144: warning: assignment makes integer from pointer without a cast make: *** [dbdimp.o] Error 1 CAPTTOFU/DBD-mysql-4.022.tar.gz /usr/bin/make -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: CAPTTOFU/DBD-mysql-4.022.tar.gz : make NO
解决方法如下,手动编译包文件即可;
[root@Slave02 ~]# ls anaconda-ks.cfg innotop-1.8.1.tar.gz sleep.sh a.pl input.txt success_test.sh a.txt install.log tablesize.sql bug.sh install.log.syslog temp.tt cmake-2.8.5.tar.gz let.sh time_take.sh DBD-mysql-4.018.tar.gz log.txt tuning-primer.sh debug.sh my_program us.sh Desktop mysqlspp.sql xtrabackup-1.6.5.tar.gz file.sh out.txt [root@Slave02 ~]# tar xzvf DBD-mysql-4.018.tar.gz DBD-mysql-4.018/ DBD-mysql-4.018/ChangeLog DBD-mysql-4.018/constants.h DBD-mysql-4.018/dbdimp.c DBD-mysql-4.018/dbdimp.h DBD-mysql-4.018/eg/ DBD-mysql-4.018/eg/bug14979.pl DBD-mysql-4.018/eg/bug21028.pl DBD-mysql-4.018/eg/bug30033.pl DBD-mysql-4.018/eg/bug30033pg.pl DBD-mysql-4.018/eg/decimal_test.pl DBD-mysql-4.018/eg/issue21946.pl DBD-mysql-4.018/eg/prepare_memory_usage.pl DBD-mysql-4.018/eg/proc_example1.pl DBD-mysql-4.018/eg/proc_example2.pl DBD-mysql-4.018/eg/proc_example2a.pl DBD-mysql-4.018/eg/proc_example2b.pl DBD-mysql-4.018/eg/proc_example3.pl DBD-mysql-4.018/eg/proc_example4.pl DBD-mysql-4.018/INSTALL.html DBD-mysql-4.018/lib/ DBD-mysql-4.018/lib/Bundle/ DBD-mysql-4.018/lib/Bundle/DBD/ DBD-mysql-4.018/lib/Bundle/DBD/mysql.pm DBD-mysql-4.018/lib/DBD/ DBD-mysql-4.018/lib/DBD/mysql/ DBD-mysql-4.018/lib/DBD/mysql/GetInfo.pm DBD-mysql-4.018/lib/DBD/mysql/INSTALL.pod DBD-mysql-4.018/lib/DBD/mysql.pm DBD-mysql-4.018/Makefile.PL DBD-mysql-4.018/Makefile.PL.embedded DBD-mysql-4.018/MANIFEST DBD-mysql-4.018/MANIFEST.SKIP DBD-mysql-4.018/META.yml DBD-mysql-4.018/myld DBD-mysql-4.018/mysql.xs DBD-mysql-4.018/README DBD-mysql-4.018/t/ DBD-mysql-4.018/t/00base.t DBD-mysql-4.018/t/10connect.t DBD-mysql-4.018/t/20createdrop.t DBD-mysql-4.018/t/25lockunlock.t DBD-mysql-4.018/t/29warnings.t DBD-mysql-4.018/t/30insertfetch.t DBD-mysql-4.018/t/31insertid.t DBD-mysql-4.018/t/32insert_error.t DBD-mysql-4.018/t/35limit.t DBD-mysql-4.018/t/35prepare.t DBD-mysql-4.018/t/40bindparam.t DBD-mysql-4.018/t/40bindparam2.t DBD-mysql-4.018/t/40blobs.t DBD-mysql-4.018/t/40catalog.t DBD-mysql-4.018/t/40keyinfo.t DBD-mysql-4.018/t/40listfields.t DBD-mysql-4.018/t/40nulls.t DBD-mysql-4.018/t/40nulls_prepare.t DBD-mysql-4.018/t/40numrows.t DBD-mysql-4.018/t/40server_prepare.t DBD-mysql-4.018/t/40server_prepare_error.t DBD-mysql-4.018/t/40types.t DBD-mysql-4.018/t/41bindparam.t DBD-mysql-4.018/t/41blobs_prepare.t DBD-mysql-4.018/t/42bindparam.t DBD-mysql-4.018/t/50chopblanks.t DBD-mysql-4.018/t/50commit.t DBD-mysql-4.018/t/51bind_type_guessing.t DBD-mysql-4.018/t/52comment.t DBD-mysql-4.018/t/53comment.t DBD-mysql-4.018/t/55utf8.t DBD-mysql-4.018/t/60leaks.t DBD-mysql-4.018/t/65types.t DBD-mysql-4.018/t/70takeimp.t DBD-mysql-4.018/t/71impdata.t DBD-mysql-4.018/t/75supported_sql.t DBD-mysql-4.018/t/76multi_statement.t DBD-mysql-4.018/t/80procs.t DBD-mysql-4.018/t/85init_command.t DBD-mysql-4.018/t/86_bug_36972.t DBD-mysql-4.018/t/lib.pl DBD-mysql-4.018/t/mem_leak.pl DBD-mysql-4.018/t/mysql.dbtest DBD-mysql-4.018/t/mysql.mtest DBD-mysql-4.018/TODO [root@Slave02 ~]# cd DBD-mysql-4.018 [root@Slave02 DBD-mysql-4.018]# perl Makefile.PL --mysql_config=/usr/local/mysql/bin/mysql_config PLEASE NOTE: For 'make test' to run properly, you must ensure that the database user 'root' can connect to your MySQL server and has the proper privileges that these tests require such as 'drop table', 'create table', 'drop procedure', 'create procedure' as well as others. mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t'; You can also optionally set the user to run 'make test' with: perl Makefile.PL --testuser=username I will use the following settings for compiling and testing: cflags (mysql_config) = -I/usr/local/mysql/include -g embedded (mysql_config) = libs (mysql_config) = -L/usr/local/mysql/lib -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl mysql_config (Users choice) = /usr/local/mysql/bin/mysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 ssl (guessed ) = 1 testdb (default ) = test testhost (default ) = testpassword (default ) = testsocket (default ) = testuser (guessed ) = root To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'. Checking if your kit is complete... Looks good Multiple copies of Driver.xst found in: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI/ /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/DBI/ at Makefile.PL line 907 Using DBI 1.623 (for perl 5.008008 on i386-linux-thread-multi) installed in /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI/ Writing Makefile for DBD::mysql Writing MYMETA.yml and MYMETA.json [root@Slave02 DBD-mysql-4.018]# make cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm gcc -c -I/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBI -I/usr/local/mysql/include -g -DDBD_MYSQL_WITH_SSL -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DVERSION=\"4.018\" -DXS_VERSION=\"4.018\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE" dbdimp.c dbdimp.c: In function 鈉ount_params? dbdimp.c:94: warning: suggest parentheses around assignment used as truth value dbdimp.c:137: warning: suggest parentheses around assignment used as truth value dbdimp.c: In function 鈊bd_discon_all? dbdimp.c:2172: warn
[3]innotop性能监视mysql,innodb工具
来源: 互联网 发布时间: 2013-11-07
下载相关的innotop包;
http://code.google.com/p/innotop/downloads/list
安装;
[root@Slave02 local]# ls bin mysql cmake-2.8.5 mysqlsla-2.03 doc mysqlsla-2.03.tar.gz etc puppetlabs-release-6-1.noarch.rpm games sbin include share innotop-1.8.1.tar.gz software lib src libexec xtrabackup-1.6.2 man xtrabackup-1.6.2.tar.gz [root@Slave02 local]# tar -zxvf innotop-1.8.1.tar.gz innotop-1.8.1/ innotop-1.8.1/COPYING innotop-1.8.1/t/ innotop-1.8.1/t/innodb-status-005 innotop-1.8.1/t/innodb-status-002 innotop-1.8.1/t/InnoDBParser.t innotop-1.8.1/t/innodb-status-006 innotop-1.8.1/t/innodb-status-001 innotop-1.8.1/t/innodb-status-004 innotop-1.8.1/t/innodb-status-003 innotop-1.8.1/Makefile.PL innotop-1.8.1/innotop innotop-1.8.1/innotop.spec innotop-1.8.1/MANIFEST innotop-1.8.1/Changelog innotop-1.8.1/INSTALL [root@Slave02 local]# cd innotop-1.8.1 [root@Slave02 innotop-1.8.1]# perl Makefile.PL Checking if your kit is complete... Looks good Warning: prerequisite DBD::mysql 1 not found.--缺少相关的perl编译包 Warning: prerequisite Term::ReadKey 2.1 not found.--缺少相关的perl编译包 Writing Makefile for innotop [root@Slave02 innotop-1.8.1]#
[root@Slave02 innotop-1.8.1]# perl -MCPAN -e shell /usr/lib/perl5/5.8.8/CPAN/Config.pm initialized. CPAN is the world-wide archive of perl resources. It consists of about 100 sites that all replicate the same contents all around the globe. Many countries have at least one CPAN site already. The resources found on CPAN are easily accessible with the CPAN.pm module. If you want to use CPAN.pm, you have to configure it properly. If you do not want to enter a dialog now, you can answer 'no' to this question and I'll try to autoconfigure. (Note: you can revisit this dialog anytime later by typing 'o conf init' at the cpan prompt.) Are you ready for manual configuration? [yes] yes The following questions are intended to help you with the configuration. The CPAN module needs a directory of its own to cache important index files and maybe keep a temporary mirror of CPAN files. This may be a site-wide directory or a personal directory. First of all, I'd like to create this directory. Where? CPAN build and cache directory? [/root/.cpan] If you want, I can keep the source files after a build in the cpan home directory. If you choose so then future builds will take the files from there. If you don't want to keep them, answer 0 to the next question. How big should the disk cache be for keeping the build directories with all the intermediate files? Cache size for build directory (in MB)? [10] By default, each time the CPAN module is started, cache scanning is performed to keep the cache size in sync. To prevent from this, disable the cache scanning with 'never'. Perform cache scanning (atstart or never)? [atstart] To considerably speed up the initial CPAN shell startup, it is possible to use Storable to create a cache of metadata. If Storable is not available, the normal index mechanism will be used. Cache metadata (yes/no)? [yes] The next option deals with the charset your terminal supports. In general CPAN is English speaking territory, thus the charset does not matter much, but some of the aliens out there who upload their software to CPAN bear names that are outside the ASCII range. If your terminal supports UTF-8, you say no to the next question, if it supports ISO-8859-1 (also known as LATIN1) then you say yes, and if it supports neither nor, your answer does not matter, you will not be able to read the names of some authors anyway. If you answer no, names will be output in UTF-8. Your terminal expects ISO-8859-1 (yes/no)? [yes] If you have one of the readline packages (Term::ReadLine::Perl, Term::ReadLine::Gnu, possibly others) installed, the interactive CPAN shell will have history support. The next two questions deal with the filename of the history file and with its size. If you do not want to set this variable, please hit SPACE RETURN to the following question. File to save your history? [/root/.cpan/histfile] Number of lines to save? [100] The CPAN module can detect when a module that which you are trying to build depends on prerequisites. If this happens, it can build the prerequisites for you automatically ('follow'), ask you for confirmation ('ask'), or just ignore them ('ignore'). Please set your policy to one of the three values. Policy on building prerequisites (follow, ask or ignore)? [ask] The CPAN module will need a few external programs to work properly. Please correct me, if I guess the wrong path for a program. Don't panic if you do not have some of them, just press ENTER for those. To disable the use of a download program, you can type a space followed by ENTER. Where is your gzip program? [/bin/gzip] Where is your tar program? [/bin/tar] Where is your unzip program? [/usr/bin/unzip] Where is your make program? [/usr/bin/make] Where is your links program? [/usr/bin/links] Where is your wget program? [/usr/bin/wget] Warning: ncftpget not found in PATH Where is your ncftpget program? [] Warning: ncftp not found in PATH Where is your ncftp program? [] Where is your ftp program? [/usr/kerberos/bin/ftp] Where is your gpg program? [/usr/bin/gpg] What is your favorite pager program? [/usr/bin/less] What is your favorite shell? [/bin/bash] Every Makefile.PL is run by perl in a separate process. Likewise we run 'make' and 'make install' in processes. If you have any parameters (e.g. PREFIX, LIB, UNINST or the like) you want to pass to the calls, please specify them here. If you don't understand this question, just press ENTER. Parameters for the 'perl Makefile.PL' command? Typical frequently used settings: PREFIX=~/perl non-root users (please see manual for more hints) Your choice: [] Parameters for the 'make' command? Typical frequently used setting: -j3 dual processor system Your choice: [] Parameters for the 'make install' command? Typical frequently used setting: UNINST=1 to always uninstall potentially conflicting files Your choice: [] Sometimes you may wish to leave the processes run by CPAN alone without caring about them. As sometimes the Makefile.PL contains question you're expected to answer, you can set a timer that will kill a 'perl Makefile.PL' process after the specified time in seconds. If you set this value to 0, these processes will wait forever. This is the default and recommended setting. Timeout for inactivity during Makefile.PL? [0] If you're accessing the net via proxies, you can specify them in the CPAN configuration or via environment variables. The variable in the $CPAN::Config takes precedence. Your ftp_proxy? Your http_proxy? Your no_proxy? You have no /root/.cpan/sources/MIRRORED.BY I'm trying to fetch one CPAN: LWP::UserAgent loaded ok Fetching with LWP: ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY Now we need to know where your favorite CPAN sites are located. Push a few sites onto the array (just in case the first on the array won't work). If you are mirroring CPAN to your local workstation, specify a file: URL. First, pick a nearby continent and country (you can pick several of each, separated by spaces, or none if you just want to keep your existing selections). Then, you will be presented with a list of URLs of CPAN mirrors in the countries you selected, along with previously selected URLs. Select some of those URLs, or just keep the old list. Finally, you will be prompted for any extra URLs -- file:, ftp:, or http: -- that host a CPAN mirror. (1) Africa (2) Asia (3) Europe (4) North America (5) Oceania (6) South America Select your continent (or several nearby continents) [] 2 Sorry! since you don't have any existing picks, you must make a geographic selection. (1) China (2) India (3) Indonesia (4) Israel (5) Japan (6) Kazakhstan (7) Pakistan (8) Republic of Korea (9) Singapore (10) Taiwan (11) Thailand (12) Turkey (13) Viet Nam Select your country (or several nearby countries) [] 1 Sorry! since you don't have any existing picks, you must make a geographic selection. (1) ftp://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/ (2) ftp://mirror.communilink.net/CPAN/ (3) ftp://mirrors.neusoft.edu.cn/mirror/cpan/ (4) ftp://mirrors.ustc.edu.cn/CPAN/ (5) ftp://mirrors.xmu.edu.cn/CPAN/ (6) http://mirrors.163.com/cpan/ (7) http://mirrors.btte.net/CPAN/ (8) http://mirrors.devlib.org/cpan/ (9) http://mirrors.sohu.com/CPAN/ Select as many URLs as you like (by number), put them on one line, separated by blanks, e.g. '1 4 5' [] 9 Enter another URL or RETURN to quit: [] New set of picks: http://mirrors.sohu.com/CPAN/ commit: wrote /usr/lib/perl5/5.8.8/CPAN/Config.pm Terminal does not support AddHistory. cpan shell -- CPAN exploration and modules installation (v1.7602) ReadLine support available (try 'install Bundle::CPAN') cpan> --在此编译perl缺少的相关包文件即可cpan> install Term::ReadKey Running install for module Term::ReadKey Running make for J/JS/JSTOWE/TermReadKey-2.30.tar.gz Fetching with LWP: http://mirrors.sohu.com/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz Fetching with LWP: http://mirrors.sohu.com/CPAN/authors/id/J/JS/JSTOWE/CHECKSUMS Checksum for /root/.cpan/sources/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz ok TermReadKey-2.30/ TermReadKey-2.30/genchars.pl TermReadKey-2.30/Makefile.PL TermReadKey-2.30/Configure.pm TermReadKey-2.30/test.pl TermReadKey-2
最新技术文章: