[{"title": "CentOS Linux release 7.6.1810\u5b89\u88c5mysql5.1.73", "desc": "\u56e0\u4e3a\u8001\u7684\u6570\u636e\u5e93\u670d\u52a1\u5668\u662f\u662fCentos6,yum\u9ed8\u8ba4\u5b89\u88c5\u7684\u662f5.1.73\u670d\u52a1\u5668\u9700\u8981\u8fc1\u79fb\u4e3a\u4e86\u4e0d\u8282\u5916\u751f\u679d\u5728\u65b0\u7684\u670d\u52a1\u5668\u4e0a\u7ee7\u7eed\u5b89\u88c5mysql5.1.73,\u7528\u6e90\u5b89\u88c5\u8001\u662f\u62a5perl\u7248\u672c\u51b2\u7a81\uff0c\u6240\u4ee5\u91c7\u53d6\u6e90\u7801\u5b89\u88c5\u3002", "content": "

\u5148\u5b89\u88c5\u4f9d\u8d56 yum -y install make gcc-c++ cmake bison-devel  ncurses-devel

\u6e90\u7801\u5305\u4e0b\u8f7d\u5730\u5740\uff1ahttps://cdn.mysql.com//Downloads/MySQL-5.1/mysql-5.1.73.tar.gz

1.\u89e3\u538b\u538b\u7f29\u5305\u540e\u6dfb\u52a0mysql\u8d26\u53f7

groupadd mysql

useradd -g mysql mysql 

2.\u8fdb\u5165mysql\u6e90\u7801\u5305\u5b89\u88c5

[root@iZjfs9zg3q1dxlZ mysql-5.1.73]# ./configure --prefix=/usr/local/mysql  -with-plugins=innobase

config.status: creating plugin/Makefile

config.status: creating win/Makefile

config.status: creating include/config.h

config.status: executing depfiles commands

config.status: executing libtool commands

/usr/bin/rm: cannot remove 'libtoolT': No such file or directory

config.status: executing default commands


Thank you for choosing MySQL!


Remember to check the platform specific part of the reference manual

for hints about installing MySQL on your platform.

Also have a look at the files in the Docs directory.

\u5982\u679c\u62a5\u9519\u770b\u4e0b\u9762ncurses-devel\u5b89\u88c5\uff0c\u5982\u679c\u6ca1\u6709\u62a5\u9519\u5c31make

# make

 -fno-rtti -c -o my_new.o my_new.cc

../depcomp: line 571: exec: g++: not found

make[1]: *** [my_new.o] Error 127

make[1]: Leaving directory `/opt/mysql-5.1.73/mysys'

make: *** [all-recursive] Error 1]

##make \u62a5\u9519\uff0c\u8bf4\u660e\u6ca1\u5b89\u88c5gcc.\u7b2c\u4e00\u6b65\u5b89\u88c5\u4f9d\u8d56\u5e94\u8be5\u662f\u62a5\u9519\uff0c\u68c0\u67e5\u6e90\u6709\u6ca1\u6709\u95ee\u9898\u3002

#make install

test -z \"/usr/local/mysql/libexec\" || /usr/bin/mkdir -p \"/usr/local/mysql/libexec\"

  /bin/sh ../../libtool --preserve-dup-deps   --mode=install /usr/bin/install -c 'mysqlmanager' '/usr/local/mysql/libexec/mysqlmanager'

libtool: install: /usr/bin/install -c mysqlmanager /usr/local/mysql/libexec/mysqlmanager

make[3]: Nothing to be done for `install-data-am'.

make[3]: Leaving directory `/opt/mysql-5.1.73/server-tools/instance-manager'

make[2]: Leaving directory `/opt/mysql-5.1.73/server-tools/instance-manager'

make[1]: Leaving directory `/opt/mysql-5.1.73/server-tools'

Making install in win

make[1]: Entering directory `/opt/mysql-5.1.73/win'

make[2]: Entering directory `/opt/mysql-5.1.73/win'

make[2]: Nothing to be done for `install-exec-am'.

make[2]: Nothing to be done for `install-data-am'.

make[2]: Leaving directory `/opt/mysql-5.1.73/win'

make[1]: Leaving directory `/opt/mysql-5.1.73/win'

3.\u521d\u59cb\u5316\u6570\u636e\u5e93

cp support-files/my-medium.cnf /etc/my.cnf


\u4e3a\u652f\u6301InnoDB\u8868\uff0c\u7f16\u8f91/etc/my.cnf\u6587\u4ef6\uff0c\u53bb\u6389innodb_\u2026\u5f00\u59cb\u9009\u9879\u884c\u524d\u9762\u7684#\u7b26\u3002

# Uncomment the following if you are using InnoDB tables

innodb_data_home_dir = /usr/local/mysql/var

innodb_data_file_path = ibdata1:10M:autoextend

innodb_log_group_home_dir = /usr/local/mysql/var

# You can set .._buffer_pool_size up to 50 - 80 %

# of RAM but beware of setting memory usage too high

innodb_buffer_pool_size = 16M

innodb_additional_mem_pool_size = 2M

# Set .._log_file_size to 25 % of buffer pool size

innodb_log_file_size = 5M

innodb_log_buffer_size = 8M

innodb_flush_log_at_trx_commit = 1

innodb_lock_wait_timeout = 50


chown -R root .       #\u6240\u6709\u4e8c\u8fdb\u5236\u6587\u4ef6\u6240\u6709\u6743\u8bbe\u7f6e\u4e3aroot\uff0c\u56e0\u4e3a\u672c\u5b9e\u9a8c\u662froot\u7528\u6237\u4e0b\u5b89\u88c5\u7684\uff0c\u6240\u4ee5\u4e0d\u9700\u8981\u6539\u3002

chown -R mysql var   #\u6570\u636e\u76ee\u5f55\u6240\u6709\u6743\u6539\u4e3a\u8fd0\u884cmysqld\u7684\u7528\u6237

chgrp -R mysql .            #\u6574\u4e2a\u5b89\u88c5\u76ee\u5f55\u7684\u6240\u5c5e\u7ec4\u6539\u4e3amysql\u7ec4\u3002


###\u5b89\u88c5\u6388\u6743\u8868
[root@iZjfs9zg3q1dxlZ mysql]# su - mysql
Last login: Mon Nov  2 15:57:11 CST 2020 on pts/2
-bash-4.2$ bin/mysql_install_db
Installing MySQL system tables...
201102 16:01:06 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
201102 16:01:06 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h iZjfs9zg3q1dxlZ password 'new-password'

Alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

#####\u8fdb\u5165mysql\u7f16\u8bd1\u76ee\u5f55\u8bbe\u7f6emysql\u670d\u52a1\uff0c\u5e76\u542f\u52a8\u6570\u636e\u5e93####
[root@iZjfs9zg3q1dxlZ mysql-5.1.73]# cp support-files/mysql.server  /etc/init.d/mysql.server
[root@iZjfs9zg3q1dxlZ mysql-5.1.73]# chmod u+x /etc/init.d/mysql.server 
[root@iZjfs9zg3q1dxlZ mysql-5.1.73]# service mysql.server start
Starting MySQL. SUCCESS! 
[root@iZjfs9zg3q1dxlZ mysql-5.1.73]# chkconfig --level 23 mysql.server on
#####\u8bbe\u7f6eroot\u5bc6\u7801
[root@iZjfs9zg3q1dxlZ mysql-5.1.73]# su - mysql
Last login: Mon Nov  2 16:00:58 CST 2020 on pts/2
-bash-4.2$ bin/mysqladmin -u root password '123456'
####\u767b\u5f55#########
[root@iZjfs9zg3q1dxlZ mysql-5.1.73]# su - mysql
Last login: Mon Nov  2 16:26:18 CST 2020 on pts/2
-bash-4.2$ ./bin/mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \\g.
Your MySQL connection id is 2
Server version: 5.1.73-log Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.

mysql> 

#################\u62a5\u9519\u89e3\u51b3################

\u5982\u679c\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u6709\u62a5\u9519\uff0c\u91cd\u65b0\u7f16\u8bd1\u9700\u8981

# make clean

# rm -f CMakeCache.txt

# rm -rf /etc/my.cnf

mysql5.1.73\u6e90\u7801\u5b89\u88c5\u62a5\u9519\u8bef\uff1achecking for termcap functions library... configure: error: No curses/termcap library found

\u9700\u8981\u5b89\u88c5 ncurses-devel \uff0c\u5982\u679c\u7528 # yum install ncurses-devel \u5b89\u88c5\u62a5\u9519\u540c\u6837\u9700\u8981\u6e90\u7801\u5b89\u88c5

ncurses-devel \u4e0b\u8f7d\u5730\u5740 http://ftp.gnu.org/gnu/ncurses/

\u89e3\u538b\u8fdb\u5165\u76ee\u5f55\u6267\u884c

# ./configure --with-shared --without-debug --without-ada --enable-overwrite 

creating headers.sh


** Configuration summary for NCURSES 6.2 20200212:


       extended funcs: yes

       xterm terminfo: xterm-new


        bin directory: /usr/bin

        lib directory: /usr/lib

    include directory: /usr/include

        man directory: /usr/share/man

   terminfo directory: /usr/share/terminfo


# make

# make install 

1750 entries written to /usr/share/terminfo

** built new /usr/share/terminfo

** sym-linked /usr/lib/terminfo for compatibility

installing std

installing stdcrt

installing vt100

installing vt300

finished install.data

/usr/bin/install -c ncurses-config /usr/bin/ncurses6-config

make[1]: Leaving directory `/opt/ncurses-6.2/misc'


"}, {"title": "Tornado\u6279\u91cf\u5904\u7406\u524d\u7aef\u5220\u9664\u6570\u636e", "desc": "\u524d\u7aef\u83b7\u53d6\u5230\u63d0\u4ea4\u7684id,python\u5faa\u73af\u8bfb\u53d6id.\u9010\u6761\u5220\u9664\uff0c\u4e5f\u5c1d\u8bd5\u60f3\u4e00\u6b21\u6027\u67e5\u8be2\u6240\u6709Model\u6267\u884cdelete\u4f46\u662f\u5931\u8d25\uff0c\u53ef\u80fd peewee_async \u4e0d\u652f\u6301\u4e5f\u53ef\u80fd\u662f\u6211\u8bed\u6cd5\u9519\u8bef\u5bfc\u81f4\u3002\u867d\u7136\u65b9\u6cd5\u6bd4\u8f83\u767d\u75f4\uff0c\u4f46\u662f\u8fd8\u633a\u597d\u7528\u3002", "content": "

\u5148\u7ed9\u51fa\u524d\u7aef\u90e8\u5206\u4ee3\u7801\uff1a

    //\u5220\u9664
del = function () {
var checkStatus = table.checkStatus('LAY-app-comment-all')
, checkData = checkStatus.data //\u5f97\u5230\u9009\u4e2d\u7684\u6570\u636e
, ids = []
, data = JSON.stringify(checkData)
for (let key of JSON.parse(data)) {
var id = key.id
ids.push(id)
}
if (checkData.length === 0) {
return layer.msg('\u8bf7\u9009\u62e9\u6570\u636e');
}

layer.confirm('\u786e\u5b9a\u5220\u9664\u5417\uff1f', function (index) {
$.ajax({
url: xxx,
dataType: \"json\",
type: 'POST',
data: JSON.stringify(ids)
});
table.reload('LAY-app-comment-all');
layer.close(index); //\u6267\u884c\u5173\u95ed
});
}
});
\u540e\u7aef\u83b7\u53d6\u5230\u7684\u6570\u636e\u5927\u6982\u662f [13,7,6] \u8fd9\u6837\u7684\uff0c\u770b\u4f3c\u50cf\u5217\u8868\u5176\u5b9e\u662f\u5b57\u7b26\u4e32\u6240\u4ee5\u8981\u8fdb\u884c\u5904\u7406\uff0c\u4e0b\u9762\u662f\u540e\u7aefPython\u90e8\u5206\u4ee3\u7801
# ip = self.request.headers.get('X-Forwarded-For')
ip = self.request.remote_ip
data = self.request.body.decode('utf-8')
print(data)
data = data[1:][:-1].split(',')
if ip == allow:
for i in data:
id = int(i)
query = await self.application.objects.get(Comment, id=id)
await self.application.objects.delete(query)
self.set_status(201)
self.finish(\"\u5df2\u5220\u9664\")
else:
self.set_status(401)
self.finish(\"\u975e\u6cd5\u8bbf\u95ee\")

"}, {"title": "jvisualvm\u8fdc\u7a0b\u76d1\u63a7JAVA\u865a\u62df\u673a\u8fd0\u884c\u60c5\u51b5", "desc": "jvisualvm\u662fJAVA\u81ea\u52a8\u7684\u76d1\u63a7\u8f6f\u4ef6\uff0c\u4f4d\u4e8eJAVA_HOME/bin\u76ee\u5f55\u4e0b\uff0c\u4e3b\u8981\u9700\u6c42\u4ece windows \u4e3b\u673a\u8fd0\u884cjvisualvm.exe\u76d1\u63a7linux\u4e3b\u673a\u4e0aTOMCAT\u8fd0\u884c\u60c5\u51b5\u3002", "content": "

\u56e0\u4e3a\u6211\u4eec\u7684linux\u4e3b\u673a\u4e00\u822c\u90fd\u662f\u6ca1\u6709\u5b89\u88c5\u684c\u9762\uff0c\u91c7\u7528\u7684\u662f CentOS-7-x86_64-Minimal \u7248\u672c\uff0c\u6240\u4ee5\u60f3\u5230\u901a\u8fc7 Windows \u4e3b\u673a\u6765\u76d1\u6d4b TOMCAT \u8fd0\u884c\u60c5\u51b5

\r\n

\u7f51\u4e0a\u641c\u7d22\u5230\u7684\u65b9\u6cd5\u5982\u4e0b\uff08\u592a\u590d\u6742\u4e86\u4e0d\u597d\u7528\uff0c\u7ee7\u7eed\u5f80\u4e0b\u770b\uff09\uff1a

\r\n

\r\n\t1 \u914d\u7f6e\u524d\u7684\u51c6\u5907

\r\n

\u6211\u4eec\u9700\u8981\u5148\u68c0\u67e5linux\u7684hostname\u5339\u914d\u7684IP\uff0c\u6267\u884c

\r\n

hostname -i

\r\n

\u5982\u679c\u5339\u914d\u7684\u7ed3\u679c\u662f\u65e0\u6cd5\u8bc6\u522b\u6216\u8005127.0.0.1, \u5219\u9700\u8981\u624b\u52a8\u914d\u7f6e\u4e3b\u673a\u540d\u548cIP\u6620\u5c04\u3002\u5047\u8bbe\u8981\u7528\u4e8e\u5efa\u7acb\u8fde\u63a5\u7684IP\u662f192.168.11.233\uff0c\u4e3b\u673a\u540d\u662fmylinux\uff1a

\r\n

vi /etc/hosts

\r\n

\u6dfb\u52a0\u4e00\u884c

\r\n

192.168.11.233  mylinux

\r\n

\r\n\t2 \u914d\u7f6eJMX

\r\n

\r\n\t2.1 \u521b\u5efasetenv.sh

\r\n

\u8fdb\u5165tomcat/bin\u76ee\u5f55

\r\n

vi setenv.sh

\r\n
\r\n\t
\r\n\t\t
\u8f93\u5165\u4e0b\u5217\u5185\u5bb9\uff1a
\r\n\t
\r\n\t
    \r\n\t\t
  1. \r\n\t\t\t 
  2. \r\n\t
\r\n
\r\n

JAVA_OPTS="-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=10.20.150.218

\r\n

\u8bbe\u7f6e\u6743\u9650

\r\n

chmod +x setenv.sh

\r\n

\r\n\t2.2 \u5728server.xml\u4e2d\u6dfb\u52a0listener

\r\n

\u8fdb\u5165tomcat/conf\u76ee\u5f55

\r\n

vi server.xml

\r\n
\r\n\t
\r\n\t\t
[java] view plain copy 
\r\n\t
\r\n\t
    \r\n\t\t
  1. \r\n\t\t\t"org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" />  
  2. \r\n\t
\r\n
\r\n

\r\n

\r\n\t2.3 JMX\u8bbf\u95ee\u63a7\u5236\u6587\u4ef6

\r\n

\u8fdb\u5165tomcat/conf\u76ee\u5f55\uff0c\u6267\u884c

\r\n

cp $JAVA_HOME/jre/lib/management/jmxremote.password.template jmxremote.passwordcp $JAVA_HOME/jre/lib/management/jmxremote.access jmxremote.access

\r\n

\u7136\u540e

\r\n

vi jmxremote.password

\r\n

\u53d6\u6d88\u4ee5\u4e0b\u4e24\u884c\u6ce8\u91ca
\r\n\t#monitorRole QED
\r\n\t#controlRole R&D

\r\n

\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u8d26\u53f7\uff0c\u6309username password\u7684\u683c\u5f0f\u6dfb\u52a0\u4e00\u884c\uff0c\u8fd9\u6837\u5c31\u9700\u8981\u540c\u65f6\u4fee\u6539jmxremote.access

\r\n

vi jxmremote.access
\r\n\t\u5728\u6700\u4e0b\u9762\u6dfb\u52a0
\r\n\tusername  readwrite

\r\n

\u4fee\u6539\u6743\u9650

\r\n

chmod 600 jmxremote.password
\r\n\tchmod 600 jxmremote.access

\r\n

\r\n\t2.4 \u6dfb\u52a0catalina-jmx-remote.jar

\r\n

\u4e0b\u8f7d\u5730\u5740  http://mvnrepository.com/artifact/org.apache.tomcat/tomcat-catalina-jmx-remote

\r\n

\u4e0b\u8f7d\u540e\u590d\u5236\u5230 tomcat/lib\u76ee\u5f55

\r\n

\u81f3\u6b64\uff0c\u914d\u7f6e\u5de5\u4f5c\u5b8c\u6210\uff0c\u4f46\u662f\u8fd8\u9700\u8981\u628a2.2\u4e2d\u7684\u4e24\u4e2a\u7aef\u53e3\u52a0\u5165\u5230\u9632\u706b\u5899\u5141\u8bb8\u89c4\u5219\u4e2d

\r\n

\r\n\t2.5 \u8bbe\u7f6e\u9632\u706b\u5899

\r\n

vi /etc/sysconfig/iptables

\r\n

\u5728-A INPUT -j REJECT --reject-with icmp-host-prohibited\u524d\u52a0\u5165

\r\n
\r\n\t
\r\n\t\t
[java] view plain copy 
\r\n\t
\r\n\t
    \r\n\t\t
  1. \r\n\t\t\t-A INPUT -p tcp -m state --state NEW -m tcp --dport 10001 -j ACCEPT   
  2. \r\n\t\t
  3. \r\n\t\t\t-A INPUT -p tcp -m state --state NEW -m tcp --dport 10002 -j ACCEPT  
  4. \r\n\t
\r\n
\r\n

service iptables restart

\r\n

\u5728\u5ba2\u6237\u673a\u4e0atelnet \u670d\u52a1\u5668\u768410001\u548c10002\u7aef\u53e3\uff0c\u5982\u679c\u90fd\u901a\u5c31\u6b63\u786e\u4e86\u3002

\r\n

\u4e0b\u9762\u8fd8\u6709\u832b\u832b\u591a\u6b65\u9aa4\u592a\u590d\u6742\u4e86\uff0c\u4e0d\u9002\u5408\u6211\u3002

\r\n

\u5176\u5b9e\u53ea\u9700\u8981\u4e0b\u9762\u4e24\u6b65\u5c31\u884c\u4e86

\r\n

1.\u65b0\u5efa\u6388\u6743\u6587\u4ef6 javavm(\u540d\u5b57\u53ef\u4ee5\u968f\u610f\u8d77)\uff0c\u5185\u5bb9\u5982\u4e0b

\r\n

grant codebase "file:/usr/java/jdk1.8.0_192-amd64/lib/tools.jar" {   
\r\n\t    permission java.security.AllPermission;
\r\n\t};

\r\n

-----------------------------------------\u6ce8\u610ffile\u540e\u9762\u7684\u8def\u5f84\u6839\u636e\u81ea\u5df1\u5b9e\u9645\u60c5\u51b5\u586b\u5199-------------------------------------------

\r\n

2.\u8fd0\u884cjstatd

\r\n

/usr/java/jdk1.8.0_192-amd64/bin/jstatd -J-Djava.security.policy=/root/javavm -p 1521 &

\r\n

--------------------------------------\u540c\u6837\u4e0a\u9762\u7684\u8def\u5f84\u6839\u636e\u5b9e\u9645\u5b89\u88c5\u8def\u5f84\u4fee\u6539---------------------

\r\n

3.\u914d\u7f6e\u5ba2\u6237\u7aef

\r\n

3.1\u5230 JAVA \u5b89\u88c5\u76ee\u5f55\u7684 bin \u76ee\u5f55\u53cc\u51fb jvisualvm \u6253\u5f00 \u76d1\u63a7\u7a0b\u5e8f

\r\n

3.2 \u5de6\u4fa7\u83dc\u5355 \u53f3\u51fb “\u8fdc\u7a0b” \u70b9\u51fb “\u6dfb\u52a0\u8fdc\u7a0b\u4e3b\u673a(H)”,\u586b\u5199\u670d\u52a1\u5668IP\u5730\u5740\uff08\u6ce8\u610f\u6211\u4e0a\u9762\u7684\u547d\u4ee4\u7528\u7684\u662f1521\u7aef\u53e3\uff0c\u5982\u679clinux\u9632\u706b\u5899\u5f00\u7684\u8bdd\uff0c\u9700\u8981\u5f00\u901a1521\u7aef\u53e3TCP\u534f\u8bae\uff0c\u8fd8\u6709\u4e2a\u968f\u673a\u7aef\u53e3\u4e5f\u8981\u5f00\uff09

\r\n

3.3 \u53f3\u51fb\u521a\u624d\u6dfb\u52a0\u4e3b\u673a\u7684IP\u5730\u5740\u9009\u62e9 “\u6dfb\u52a0jstatd\u8fde\u63a5”\uff0c\u8df3\u51fa\u5c5e\u6027\u6846\uff0c\u7aef\u53e3\u53f7\u586b\u5199 1521 \uff08\u5982\u679c\u8fd0\u884cjstatd\u6ca1\u6709\u6307\u5b9a\u7aef\u53e3\u9ed8\u8ba4\u662f1099\uff0c\u8fd9\u91cc\u4e0d\u7528\u4fee\u6539\uff09\u3002

\r\n

\u53ef\u80fd\u62a5\u9519

\r\n

access denied ("java.util.PropertyPermission" "java.rmi.server.ignoreSubClasses" "write")
\r\n\tjava.security.AccessControlException: access denied ("java.util.PropertyPermission" "java.rmi.server.ignoreSubClasses" "write")
\r\n\t        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
\r\n\t        at java.security.AccessController.checkPermission(AccessController.java:884)
\r\n\t        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
\r\n\t        at java.lang.System.setProperty(System.java:792)
\r\n\t        at sun.tools.jstatd.Jstatd.main(Jstatd.java:139)

\r\n

\u7531\u4e8ejavavm \u6587\u4ef6\u91cc\u9762\u7684\u8def\u5f84\u4e0d\u5bf9\u6216\u8005\u662f\u6267\u884c\u7684\u65f6\u5019 -J-Djava.security.policy=/root/javavm  \u53c2\u6570\u8def\u5f84\uff0c\u6587\u4ef6\u540d\u4e0d\u5bf9\u5bfc\u81f4\u7684\u62a5\u9519\u3002

\r\n

 

\r\n

 

\r\n

 

\r\n

 

\r\n"}, {"title": "oracle\u6570\u636e\u5e93\u6269\u5927sga\u548cpga\u542f\u52a8\u62a5\u9519", "desc": "\u5c06ORACLE\u6570\u636e\u7684 SGA PGA \u6269\u5927\u81f3 4G\u91cd\u65b0\u542f\u52a8\u62a5\u9519\u3002\u5176\u5b9e\u662f\u7531\u4e8e\u5185\u6838\u914d\u7f6ekernel.shmall\u53c2\u6570\u503c\u8bbe\u7f6e\u592a\u5c0f\u5bfc\u81f4\u3002", "content": "
\r\n\t
\u62a5\u9519\u4fe1\u606f
\r\n\t
SQL> startup
\r\n\t
ORA-27102: out of memory
\r\n\t
Linux-x86_64 Error: 28: No space left on device
\r\n\t
Additional information: 2097152
\r\n
\r\n

\u5206\u6790\u539f\u56e0

\r\n

\u56e0\u4e3a\u6211\u5b89\u88c5Oracle\u7684\u65f6\u5019\u5185\u6838\u914d\u7f6e\u4f7f\u7528\u7684\u662f\u5b98\u65b9\u63a8\u8350\u8bbe\u7f6e

\r\n
fs.file-max = 6815744 
\r\n
fs.aio-max-nr = 1048576 
\r\n
kernel.shmall = 2097152 
\r\n
kernel.shmmax = 2147483648 
\r\n
kernel.shmmni = 4096 
\r\n
kernel.sem = 250 32000 100 128 
\r\n
net.ipv4.ip_local_port_range = 32768 65500 
\r\n
net.core.rmem_default = 4194304 
\r\n
net.core.rmem_max = 4194304 
\r\n
net.core.wmem_default = 262144 
\r\n
net.core.wmem_max = 1048576
\r\n
kernel.shmall\u7684\u5927\u5c0f\u53ea\u67092G\uff0c\u4fee\u6539  /etc/sysctl.conf
\r\n
\u5c06 kernel.shmall = 8388608 \u4fee\u6539\u4e3a8G\u4e00\u822c\u8bbe\u7f6e\u4e3a\u5185\u5b58\u7684\u4e00\u534a\uff08\u5df2\u76ee\u524d\u7ecf\u9a8c\u6765\u770b\u8bbe\u7f6e\u5185\u6838\u5176\u5b9e\u4e5f\u4e0d\u5f71\u54cd\u5b89\u88c5\uff0c\u53ea\u662f\u7269\u7406\u5185\u5b58\u8fc7\u5927\u65f6\u9759\u9ed8\u5b89\u88c5\u5e93\u65f6\u5019\u62a5 out of memory\uff09
\r\n
\u4fee\u6539\u5b8c \u4f7f\u7528 sysctl -p \u751f\u6548\uff0c\u7136\u540e\u5728\u542f\u52a8\u6570\u636e\u5e93\u5c31\u53ef\u4ee5\u4e86\u3002
\r\n
\u53ea\u8981 kernel.shmall \u7684\u503c\u5927\u4e8e\u6570\u636e\u5e93\u8bbe\u7f6e\u7684\u5927\u5c0f\u542f\u52a8\u5c31\u4e0d\u4f1a\u62a5\u9519\u4e86\u3002
\r\n"}, {"title": "ORACLE\u670d\u52a1\u5668\u5f02\u5e38\u91cd\u542f\u6587\u4ef6\u4e22\u5931\u62a5\u9519", "desc": "oracle\u7248\u672c\u4e3aOracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production\uff0c\u65ad\u7535\u540e startup \u62a5\u4e0b\u9762\u7684\u9519\u3002", "content": "

\u76f4\u63a5\u4e0a\u62a5\u9519\u4fe1\u606f\uff1a

\r\n

SQL> startup
\r\n\tORACLE instance started.
\r\n\t
\r\n\tTotal System Global Area 1.0055E+10 bytes
\r\n\tFixed Size                  2261888 bytes
\r\n\tVariable Size            2181041280 bytes
\r\n\tDatabase Buffers         7851737088 bytes
\r\n\tRedo Buffers               19742720 bytes
\r\n\tDatabase mounted.
\r\n\tORA-01172: recovery of thread 1 stuck at block 272 of file 3
\r\n\tORA-01151: use media recovery to recover block, restore backup if needed

\r\n

\u89e3\u51b3\u65b9\u6cd5\uff1a

\r\n

\u63d0\u793a\u5f88\u6e05\u695a file3 \u635f\u574f\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a

\r\n

SQL> startup mount
\r\n\tORACLE instance started.
\r\n\t
\r\n\tTotal System Global Area 1.0055E+10 bytes
\r\n\tFixed Size                  2261888 bytes
\r\n\tVariable Size            2181041280 bytes
\r\n\tDatabase Buffers         7851737088 bytes
\r\n\tRedo Buffers               19742720 bytes
\r\n\tDatabase mounted.
\r\n\tSQL> recover datafile 3;
\r\n\tMedia recovery complete.
\r\n\tSQL> shutdown
\r\n\tORA-01109: database not open
\r\n\t
\r\n\t
\r\n\tDatabase dismounted.
\r\n\tORACLE instance shut down.
\r\n\tSQL> startup
\r\n\tORACLE instance started.
\r\n\t
\r\n\tTotal System Global Area 1.0055E+10 bytes
\r\n\tFixed Size                  2261888 bytes
\r\n\tVariable Size            2181041280 bytes
\r\n\tDatabase Buffers         7851737088 bytes
\r\n\tRedo Buffers               19742720 bytes
\r\n\tDatabase mounted.
\r\n\tDatabase opened.

\r\n

\u91cd\u65b0\u542f\u52a8\u6570\u636e\u5e93\u6b63\u5e38\u3002

\r\n"}, {"title": "Spark\u8dd1YARN\u96c6\u7fa4\u67e5\u770b\u65e5\u5fd7\u62a5\u9519", "desc": "\u516c\u53f8\u8e69\u811a\u7a0b\u5e8f\u5458\u8ba9\u4ed6\u628a\u7a0b\u5e8f\u62a5\u9519\u65e5\u5fd7\u5b58\u6570\u636e\u5e93\u6216\u8005\u672c\u5730\u786c\u76d8\u4e0d\u4f1a\uff0c\u975e\u8981\u8bf4\u96c6\u7fa4\u6709\u95ee\u9898\uff0c\u672c\u5730\u8dd1\u6ca1\u95ee\u9898\u3002\u67e5\u770bstderr : \u548cstdout : \u62a5\u4ee5\u4e0b\u9519\u8bef\u3002\u4e3b\u8981\u662f\u56e0\u4e3aNodeManager\u4e0a\u65e5\u5fd7\u6700\u591a\u5b58\u653e\u65f6\u95f4\u9ed8\u8ba4\u4e3a\u4e09\u5c0f\u65f6\u5bfc\u81f4\u7684\u3002", "content": "

\u67e5\u770b\u65e5\u5fd7\u62a5\u9519\u4fe1\u606f\uff1a

\r\n

\r\n\tjava.lang.Exception: Unknown container. Container either has not started or has already completed or doesn't belong to this node at all.

\r\n

\u89e3\u51b3\u65b9\u6cd5\uff1a

\r\n

1.\u4fee\u6539yarn-site.xml \u914d\u7f6e\uff0c\u6dfb\u52a0

\r\n

<property>
\r\n\t<name>yarn.nodemanager.log.retain-seconds</name>
\r\n\t<value>108000</value>
\r\n\t</property>

\r\n

\u8868\u793a30\u4e2a\u5c0f\u65f6\u8fc7\u671f\u3002

\r\n"}, {"title": "HADOOP\u8282\u70b9\u62a5\u9519\u5904\u7406", "desc": "\u4e3b\u8981\u4f7f\u7528hadoop \u7684HDFS\u5b58\u50a8\u6570\u636e\uff0cyarn\u8d44\u6e90\u8c03\u5ea6\uff0cspark\u8fd0\u7b97\uff0c\u672c\u6b21\u6545\u969c\u4e3b\u8981\u662f\u56e0\u4e3a\u8282\u70b9\u670d\u52a1\u5668SPARK\u63d0\u4ea4\u4efb\u52a1\u7684\u65f6\u5019\u4f1a\u5728\u8282\u70b9\u7684work\u76ee\u5f55\u4e0b\u751f\u6210\u4efb\u52a1\u8bb0\u5f55\u5bfc\u81f4\u7684\u786c\u76d8\u5360\u7528\u6ee1\u62a5\u9519\u3002", "content": "

\u62a5\u9519\u4fe1\u606f\uff1a

\r\n

1/1 local-dirs are bad: /usr/local/hadoop-2.7.4/tmp/nm-local-dir; 1/1 log-di

\r\n

\u4e3b\u8981\u539f\u56e0\u662f\u8282\u70b9\u670d\u52a1\u5668\u78c1\u76d8\u6ee1\u5bfc\u81f4\u7684\uff0cSPARK\u63d0\u4ea4\u4efb\u52a1\u7684\u65f6\u5019\u4f1a\u5728\u8282\u70b9\u7684work\u76ee\u5f55\u4e0b\u751f\u6210\u8bb0\u5f55\uff0c\u957f\u65f6\u95f4\u5bfc\u81f4\u786c\u76d8\u5360\u7528\u6ee1\u3002\u53ef\u76f4\u63a5\u5220\u9664

\r\n

\u8282\u70b9\u670d\u52a1\u5668\u7684spark/work \u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u3002

\r\n"}, {"title": "hadoop|spark\u542f\u52a8./sbin/start-all.sh\u542f\u52a8\u4fee\u6539ssh\u7aef\u53e3", "desc": "hadoop\u3001spark\u96c6\u7fa4\u542f\u52a8\u9700\u8981\u673a\u5668\u4e92\u4fe1\u8bbf\u95ee\uff0cMaster\u81ea\u52a8SSH\u767b\u5f55Slave\u673a\u5668\u542f\u52a8\u76f8\u5173\u8fdb\u7a0b.\u9ed8\u8ba4\u4e0d\u914d\u7f6e\u4f7f\u7528\u7684\u662fssh22\u7aef\u53e3\u3002\u8fd1\u6765\u5b89\u5168\u8981\u6c42\u9010\u6b65\u63d0\u9ad8\uff0c\u4e0d\u5141\u8bb8\u4f7f\u7528\u9ed8\u8ba4\u7aef\u53e3\uff0c\u8fd9\u5c31\u9700\u8981\u4fee\u6539hadoop\u3001spark\u542f\u52a8\u7684\u9ed8\u8ba4\u7aef\u53e3\u3002", "content": "

\u5982\u679c\u4e0d\u4fee\u6539\u4f1a\u62a5\u767b\u5f55\u8fde\u63a5\u8d85\u65f6

\r\n

[root@master hadoop]# ./sbin/start-all.sh
\r\n\tThis script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
\r\n\tStarting namenodes on [Master]
\r\n\tMaster: ssh: connect to host Master port 22: Connection refused
\r\n\t10.196.110.88: ssh: connect to host 10.196.110.88 port 22: Connection refused
\r\n\t10.196.110.89: ssh: connect to host 10.196.110.89 port 22: Connection refused
\r\n\tStarting secondary namenodes [Slave1]
\r\n\tSlave1: ssh: connect to host Slave1 port 22: Connection refused
\r\n\tstarting yarn daemons
\r\n\tstarting resourcemanager, logging to /usr/local/hadoop/logs/yarn-root-resourcemanager-master.out
\r\n\t10.196.110.89: ssh: connect to host 10.196.110.89 port 22: Connection refused
\r\n\t10.196.110.88: ssh: connect to host 10.196.110.88 port 22: Connection refused

\r\n

\u89e3\u51b3\u65b9\u6cd5\u5728hadoop/etc/hadoop\u76ee\u5f55\u4fee\u6539 hadoop-env.sh \u6587\u4ef6\u6dfb\u52a0\u5982\u4e0b\u8bed\u53e5\u3002

\r\n

export HADOOP_SSH_OPTS="-p 1212"

\r\n

\u518d\u6b21\u542f\u52a8

\r\n

[root@master hadoop]# ./sbin/start-all.sh
\r\n\tThis script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
\r\n\tStarting namenodes on [Master]
\r\n\tThe authenticity of host '[master]:1212 ([10.196.110.87]:1212)' can't be established.
\r\n\tRSA key fingerprint is c2:36:82:a7:f3:5c:dc:ed:81:95:99:1d:81:5f:6e:79.
\r\n\tAre you sure you want to continue connecting (yes/no)? yes
\r\n\tMaster: Warning: Permanently added '[master]:1212,[10.196.110.87]:1212' (RSA) to the list of known hosts.
\r\n\tMaster: starting namenode, logging to /usr/local/hadoop/logs/hadoop-root-namenode-master.out
\r\n\t10.196.110.89: starting datanode, logging to /usr/local/hadoop/logs/hadoop-root-datanode-Slave2.out
\r\n\t10.196.110.88: starting datanode, logging to /usr/local/hadoop/logs/hadoop-root-datanode-Slave1.out
\r\n\tStarting secondary namenodes [Slave1]
\r\n\tThe authenticity of host '[slave1]:1212 ([10.196.110.88]:1212)' can't be established.
\r\n\tRSA key fingerprint is c2:36:82:a7:f3:5c:dc:ed:81:95:99:1d:81:5f:6e:79.
\r\n\tAre you sure you want to continue connecting (yes/no)? yes
\r\n\tSlave1: Warning: Permanently added '[slave1]:1212' (RSA) to the list of known hosts.
\r\n\tSlave1: starting secondarynamenode, logging to /usr/local/hadoop/logs/hadoop-root-secondarynamenode-Slave1.out
\r\n\tstarting yarn daemons
\r\n\tstarting resourcemanager, logging to /usr/local/hadoop/logs/yarn-root-resourcemanager-master.out
\r\n\t10.196.110.88: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-Slave1.out
\r\n\t10.196.110.89: starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-Slave2.out

\r\n

[root@master hadoop]# jps
\r\n\t24757 NameNode
\r\n\t25048 ResourceManager
\r\n\t25327 Jps

\r\n

\u8282\u70b9\u670d\u52a1\u5668\u8fdb\u7a0b

\r\n

[root@Slave1 local]# jps
\r\n\t30817 Jps
\r\n\t30675 NodeManager
\r\n\t30500 DataNode
\r\n\t30601 SecondaryNameNode

\r\n

\u542f\u52a8\u6b63\u5e38

\r\n

spark
\r\n\t\u5728spark/conf\u76ee\u5f55spark-env.sh\u6587\u4ef6\u6dfb\u52a0
\r\n\texport SPARK_SSH_OPTS="-p 1212"

\r\n"}, {"title": "Centos\u4e0boracle11G\u9759\u9ed8\u5b89\u88c5\u76d1\u542c\u62a5\u9519", "desc": "\u64cd\u4f5c\u7cfb\u7edf\u4e3aCentos6.6\u51fa\u73b0\u6b64\u95ee\u9898\u7684\u670d\u52a1\u5668\u591a\u4e3a\u963f\u91cc\u4e91\u6216\u8005\u5176\u4ed6\u6253\u8fc7gcc gcc-g++\u5347\u7ea7\u8fc7 ssh \u7684\u670d\u52a1\u5668\u3002", "content": "

\u5b89\u88c5\u76d1\u542c\u65f6\u62a5\u9519

\r\n

[oracle@database database]$ $ORACLE_HOME/bin/netca /silent /responseFile /app/database/response/netca.rsp
\r\n\tUnsatisfiedLinkError exception loading native library: njni11
\r\n\tjava.lang.UnsatisfiedLinkError: /app/oracle/product/11.2.0/db/lib/libnjni11.so: libclntsh.so.11.1: cannot open shared object file: No such file or directory
\r\n\tjava.lang.UnsatisfiedLinkError: jniGetOracleHome
\r\n\t        at oracle.net.common.NetGetEnv.jniGetOracleHome(Native Method)
\r\n\t        at oracle.net.common.NetGetEnv.getOracleHome(Unknown Source)
\r\n\t        at oracle.net.ca.NetCALogger.getOracleHome(NetCALogger.java:230)
\r\n\t        at oracle.net.ca.NetCALogger.initOracleParameters(NetCALogger.java:215)
\r\n\t        at oracle.net.ca.NetCALogger.initLogger(NetCALogger.java:130)
\r\n\t        at oracle.net.ca.NetCA.main(NetCA.java:427)
\r\n\t
\r\n\tError: jniGetOracleHome
\r\n\tOracle Net Services configuration failed.  The exit code is 1

\r\n

\u5b89\u88c5\u6570\u636e\u5e93\u62a5\u9519

\r\n

silentInstall2019-04-16_02-59-41PM.log
\r\n\tError in invoking target 'mkldflags ntcontab.o nnfgt.o' of makefile '/app/oracle/product/11.2.0/db/network/lib/ins_net_client.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'client_sharedlib' of makefile '/app/oracle/product/11.2.0/db/rdbms/lib/ins_rdbms.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'links proc gen_pcscfg' of makefile '/app/oracle/product/11.2.0/db/precomp/lib/ins_precomp.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'idg4odbc' of makefile '/app/oracle/product/11.2.0/db/rdbms/lib/ins_rdbms.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'itnsping' of makefile '/app/oracle/product/11.2.0/db/network/lib/ins_net_client.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'install' of makefile '/app/oracle/product/11.2.0/db/ctx/lib/ins_ctx.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'nmo' of makefile '/app/oracle/product/11.2.0/db/sysman/lib/ins_emagent.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'install' of makefile '/app/oracle/product/11.2.0/db/plsql/lib/ins_plsql.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'agent nmhs' of makefile '/app/oracle/product/11.2.0/db/sysman/lib/ins_emagent.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'all_no_orcl' of makefile '/app/oracle/product/11.2.0/db/rdbms/lib/ins_rdbms.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'install' of makefile '/app/oracle/product/11.2.0/db/network/lib/ins_net_client.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'nmb' of makefile '/app/oracle/product/11.2.0/db/sysman/lib/ins_emagent.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'install' of makefile '/app/oracle/product/11.2.0/db/sqlplus/lib/ins_sqlplus.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'clientonlyinstall' of makefile '/app/oracle/product/11.2.0/db/ldap/lib/ins_ldap.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'ioklist' of makefile '/app/oracle/product/11.2.0/db/network/lib/ins_nau.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'install' of makefile '/app/oracle/product/11.2.0/db/srvm/lib/ins_srvm.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'utilities' of makefile '/app/oracle/product/11.2.0/db/rdbms/lib/ins_rdbms.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'iokdstry iokinit' of makefile '/app/oracle/product/11.2.0/db/network/lib/ins_nau.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'install' of makefile '/app/oracle/product/11.2.0/db/network/lib/ins_net_server.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'itrcroute' of makefile '/app/oracle/product/11.2.0/db/network/lib/ins_net_client.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tError in invoking target 'irman ioracle' of makefile '/app/oracle/product/11.2.0/db/rdbms/lib/ins_rdbms.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tFile not found: %fileName%
\r\n\tThe installation of Oracle Database 11g was successful.
\r\n\t\u9759\u9ed8\u5b89\u88c5\u6587\u4ef6\u90e8\u5206\u62a5\u9519

\r\n

Exception Severity: 1
\r\n\tINFO: Retry Handler not registered, using Super class functionality
\r\n\tError in invoking target 'irman ioracle' of makefile '/app/oracle/product/11.2.0/db/rdbms/lib/ins_rdbms.mk'. See '/app/oraInventory/logs/installActions2019-04-16_02-59-41PM.log' for details.
\r\n\tINFO: InstallProgressMonitor: Completed phase 4
\r\n\tINFO: Checkpoint:checkpointfile :/app/oracle/checkpoints/oui/checkpoint_OraDb11g_home1.xml not found,creating one for this session
\r\n\tINFO: Checkpoint:constructing checkpoint with name:oracle.installer.install in checkpoint factory
\r\n\tINFO: InstallProgressMonitor: Starting phase 8
\r\n\tINFO: Setup in progress
\r\n\tINFO: Setup in progress

\r\n

\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u62a5\u9519\u5176\u5b9e\u53ef\u4ee5\u5ffd\u7565\uff0c\u4f46\u662f\u5b89\u88c5\u76d1\u542c\u5f97\u65f6\u5019\u5b89\u88c5\u4e0d\u4e0a\u3002\u4e3b\u8981\u539f\u56e0\u662f\u56e0\u4e3a\u5deegcc gcc-g++ glibc \u7b49\u4f9d\u8d56\u5305\u5bfc\u81f4\uff0c\u6240\u4ee5\u767e\u5ea6\u5f88\u96be\u627e\u5230\u89e3\u51b3\u65b9\u6cd5\u3002

\r\n

\u53ef\u4ee5\u5c06Centos \u7684\u5b8c\u6574\u5b89\u88c5\u76d8\u6302\u8f7d\u5230\u6587\u4ef6\u5939\u4e0b\u8fdb\u5165  Packages \u76ee\u5f55\u5b89\u88c5 \u6240\u9700\u4f9d\u8d56\u5305

\r\n

\u7136\u540e

\r\n

[oracle@database bin]$ $ORACLE_HOME/bin/relink all
\r\n\twriting relink log to: /app/oracle/product/11.2.0/db/install/relink.log

\r\n

\u518d\u6b21\u5b89\u88c5\u76d1\u542c

\r\n

[oracle@database bin]$ $ORACLE_HOME/bin/netca /silent /responseFile /app/database/response/netca.rsp
\r\n\t
\r\n\tParsing command line arguments:
\r\n\t    Parameter "silent" = true
\r\n\t    Parameter "responsefile" = /app/database/response/netca.rsp
\r\n\tDone parsing command line arguments.
\r\n\tOracle Net Services Configuration:
\r\n\tProfile configuration complete.
\r\n\tOracle Net Listener Startup:
\r\n\t    Running Listener Control:
\r\n\t      /app/oracle/product/11.2.0/db/bin/lsnrctl start LISTENER
\r\n\t    Listener Control complete.
\r\n\t    Listener started successfully.
\r\n\tListener configuration complete.
\r\n\tOracle Net Services configuration successful. The exit code is 0

\r\n

\u5b89\u88c5\u6210\u529f

\r\n

 

\r\n"}, {"title": "JAVA_HOME\u4ecejdk8\u53d8\u5230jdk7\u9519\u8bef", "desc": "\u5b89\u88c5\u4e86\u591a\u4e2aJDK\u7248\u672c\u60f3\u901a\u8fc7\u4fee\u6539 JAVA_HOME \u76ee\u5f55\u7684\u8def\u5f84\u66f4\u6539 JAVA \u7248\u672c\u62a5\u9519\u3002", "content": "

\u8fd0\u884cjava -version\uff0c\u62a5\u9519
\r\n\tError: Registry key ‘Software\\JavaSoft\\Java Runtime Environment’\\CurrentVersion’

\r\n

has value ‘1.8’, but ‘1.7’ is required.
\r\n\tError: could not find java.dll
\r\n\tError: Could not find Java SE Runtime Environment.

\r\n

\u89e3\u51b3\u65b9\u6cd5\uff1a

\r\n

1. \u770b\u4e86\u4e00\u4e0b\u73af\u5883\u53d8\u91cf\u7684path \u5c06\u542b\u6709 \u5b89\u88c5JDK \u81ea\u52a8\u8bbe\u7f6e\u7684C:\\ProgramData\\Oracle\\Java\\javapath;\u8def\u5f84\u5220\u9664 \uff0c\u4e5f\u53ef\u76f4\u63a5\u5c06 C:\\ProgramData\\Oracle\\Java\\ \u76ee\u5f55\u5220\u9664\u3002

\r\n

2.\u628a C:\\Windows\\System32\u4e0b java.exe\u3001javaw.exe\u548cjavaws.exe \u4e09\u4e2a\u6587\u4ef6\u5220\u9664

\r\n

3.\u66f4\u6539 \u73af\u5883\u53d8\u91cf\u4e2d\u7684 JAVA_HOME \u7684\u8def\u5f84\u6765\u66f4\u6362JDK\u7248\u672c\u3002

\r\n

\u4ed8\u6211\u7684JAVA \u73af\u5883\u53d8\u91cf\u914d\u7f6e

\r\n

JAVA_HOME
\r\n\tC:\\Program Files\\Java\\jdk1.7.0_80
\r\n\tPATH
\r\n\t%Java_Home%\\bin;%Java_Home%\\jre\\bin;
\r\n\tCLASSPATH
\r\n\t.;%JAVA_HOME%\\lib\\dt.jar;%JAVA_HOME%\\lib\\tools.jar;
\r\n\t 

\r\n"}, {"title": "EXP-00008: \u9047\u5230 ORACLE \u9519\u8bef 904", "desc": "\u4f4e\u7248\u672c\u5ba2\u670d\u7aef\uff08\u6211\u7528\u7684\u662f11.2.0.1.0\uff09 \u5bfc\u51fa\u63d0\u793a\u8fd9\u4e2a\u9519\u8bef\u3002\r\n\u5904\u7406\u65b9\u6cd5\uff1a\u5220\u6389\u5907\u4efd\u7528\u6237\u91cc\u8fb9\u7684\u65e0\u6548dblink\u3002\u53ef\u4ee5\u987a\u5229\u5bfc\u51fa\u3002\r\n\u9ad8\u7248\u672c\u517c\u5bb9\u4f4e\u7248\u672c\u3002", "content": "

\u62a5\u9519\u4fe1\u606f

\r\n


\r\n\t\u8fde\u63a5\u5230: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
\r\n\tWith the Partitioning, OLAP, Data Mining and Real Application Testing options
\r\n\t\u5df2\u5bfc\u51fa ZHS16GBK \u5b57\u7b26\u96c6\u548c AL16UTF16 NCHAR \u5b57\u7b26\u96c6
\r\n\t\u5373\u5c06\u5bfc\u51fa\u6307\u5b9a\u7684\u7528\u6237...
\r\n\t. \u6b63\u5728\u5bfc\u51fa pre-schema \u8fc7\u7a0b\u5bf9\u8c61\u548c\u64cd\u4f5c
\r\n\t. \u6b63\u5728\u5bfc\u51fa\u7528\u6237 HRM \u7684\u5916\u90e8\u51fd\u6570\u5e93\u540d
\r\n\t. \u5bfc\u51fa PUBLIC \u7c7b\u578b\u540c\u4e49\u8bcd
\r\n\t. \u6b63\u5728\u5bfc\u51fa\u4e13\u7528\u7c7b\u578b\u540c\u4e49\u8bcd
\r\n\t. \u6b63\u5728\u5bfc\u51fa\u7528\u6237 HRM \u7684\u5bf9\u8c61\u7c7b\u578b\u5b9a\u4e49
\r\n\t\u5373\u5c06\u5bfc\u51fa HRM \u7684\u5bf9\u8c61...
\r\n\t. \u6b63\u5728\u5bfc\u51fa\u6570\u636e\u5e93\u94fe\u63a5
\r\n\tEXP-00106: \u6570\u636e\u5e93\u94fe\u63a5\u53e3\u4ee4\u65e0\u6548EXP-00000: \u5bfc\u51fa\u7ec8\u6b62\u5931\u8d25
\r\n\t---------------------
\r\n\t\u5bc6\u7801\u660e\u660e\u6b63\u786e\u7684\u63d0\u793a EXP-00106: \u6570\u636e\u5e93\u94fe\u63a5\u53e3\u4ee4\u65e0\u6548

\r\n

\u89e3\u51b3\u529e\u6cd5\uff1a

\r\n

\u67e5\u8be2DBLINK\u4fe1\u606f
\r\n\tselect * from dba_db_links;
\r\n\tselect owner,object_name from dba_objects where object_type='DATABASE LINK';
\r\n\tselect * from ALL_DB_LINKS;

\r\n

\u200b\u5220\u9664\u65e0\u6548\u7684DBLINK

\r\n

--\u5220\u9664DBLINK
\r\n\tDROP DATABASE LINK [name]; 
\r\n\t--\u6216 
\r\n\tDROP PUBLIC DATABASE LINK [name]; 

\r\n

 

\r\n"}, {"title": "oracle\u5ba2\u6237\u7aef\u4e0a\u8fd0\u884c\u6570\u636e\u6cf5", "desc": "\u60c5\u51b5\u662f\u8fd9\u6837\u6ef4\uff0c\u6709\u4e00\u4e2aoracle\u670d\u52a1\u5668\u662fwindows\u7684\u7528expdp\u5bfc\u51fa\u7684dmp\u6587\u4ef6\uff0c\u73b0\u5728\u60f3\u8fd8\u539f\u5230\u672c\u5730\u6570\u636e\u5e93\u670d\u52a1\u5668\uff0c\u672c\u5730oracle\u670d\u52a1\u5668\u5982\u679c\u662fwindows\u7684\u8bbe\u7f6e\u73af\u5883\u53d8\u91cfNLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK", "content": "

\u6709\u4e00\u4e2aoracle\u670d\u52a1\u5668\u662fwindows\u7684\u7528expdp\u5bfc\u51fa\u7684dmp\u6587\u4ef6\uff0c\u73b0\u5728\u60f3\u8fd8\u539f\u5230\u672c\u5730\u6570\u636e\u5e93\u670d\u52a1\u5668\uff0c\u672c\u5730oracle\u670d\u52a1\u5668\u5982\u679c\u662fwindows\u7684\u628aDMP\u6587\u4ef6\u590d\u5236\u5230\u670d\u52a1\u5668\u4e0a\u8bbe\u7f6e\u73af\u5883\u53d8\u91cfNLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK\u200b\uff0c\u7136\u540e\u7528impdp \u5bfc\u5165\u8fd8\u539f\u95ee\u9898\u89e3\u51b3\u3002

\r\n

\u73b0\u5728\u95ee\u9898\u6765\u4e86\uff0c\u672c\u5730 oracle \u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\u4e3acentos \u7684\uff0c\u8fd0\u884c\u547d\u4ee4  export LANG=CHINESE_CHINA.ZHS16GBK

\r\n

\u7136\u540e\u4f7f\u7528 impdp\u547d\u4ee4\u5bfc\u5165 DMP \u6587\u4ef6\uff0c\u53d1\u73b0\u4e2d\u6587\u7684\u6ce8\u89e3\u90fd\u662f\u4e71\u7801\u3002\u60f3\u4e86\u4e0b\u89e3\u51b3\u601d\u8def\u6709\u4e24\u4e2a\uff1a

\r\n

1.\u5c06linux \u7684\u5b57\u7b26\u96c6\u8bbe\u7f6e\u548cwinodws \u670d\u52a1\u5668\u7684\u4e00\u81f4\u3002

\r\n

2.\u4f7f\u7528windows \u5ba2\u6237\u7aef\u7684\u65b9\u5f0f\u5c06dmp \u6587\u4ef6\u5bfc\u5165\u5230linux\u670d\u52a1\u5668\u91cc

\r\n

\u672c\u6b21\u542f\u7528\u65b9\u68482\uff1a

\r\n

\u7b2c\u4e00\u6b65\uff0c\u521b\u5efa DIRECTORY \u76ee\u5f55\u7528\u6765\u5b58\u653e\u6570\u636e\u6587\u4ef6

\r\n

SQL>create directory dump_dir as '/app/oracle/admin/dump/';     //\u8fd9\u91cc\u7684\u76ee\u5f55\u6307\u7684\u662f oracle \u6570\u636e\u5e93\u670d\u52a1\u5668\u4e0a\u7684\u76ee\u5f55\u4e0d\u662f\u5ba2\u6237\u7aef\u7684\u76ee\u5f55

\r\n

\u7b2c\u4e8c\u6b65\uff0c\u7ed9\u76f8\u5173\u8d26\u53f7\u9644\u6743\u3002\uff08\u8fd9\u6b65\u5f88\u5173\u952e\uff09

\r\n

SQL> GRANT READ,WRITE ON DIRECTORY  dump_dir  TO JN   

\r\n

\u7b2c\u4e09\u6b65\uff0c\u4f7f\u7528impdp\u5bfc\u5165dmp\u6587\u4ef6

\r\n

\u5148\u628ajn.dmp\u6587\u4ef6\u590d\u5236\u5230\u670d\u52a1\u5668/app/oracle/admin/dump/\u76ee\u5f55\u4e0b\u7136\u540e\u8fd0\u884cimpdp\u5bfc\u5165\uff0c\u6ce8\u610foracle \u8d26\u53f7\u9700\u8981\u6709jn.dmp\u7684\u8bfb\u53d6\u6743\u9650

\r\n

[oracle@orcle ~]$impdp jn/passwd@ORCL DIRECTORY=dump_dir DUMPFILE='jn.dmp' remap_schema=jn:jnremap_tablespace=jn:jn

\r\n

 

\r\n"}, {"title": "ORACLE\u5ba2\u6237\u7aef\u62a5\u7f3a\u5931msvcrXXX.dll", "desc": "Oracle\u5ba2\u6237\u7aef\u5728exp,imp,sqlplus,\u6216\u8005\u662f\u94fe\u63a5\u6570\u636e\u5e93\u5f97\u65f6\u5019\u62a5\u9519\u6ca1\u6709\u627e\u5230msvcr80.dll\uff0cmsvcr100.dll\uff0cmsvcr140.dll\u7b49\u5404\u79cd\u9519\u3002", "content": "

msvcr\u200bXXX.dll\u6587\u4ef6(XXX\u8868\u793a\u7248\u672c\u53f7)\uff0c\u5176\u5b9e\u662f Microsoft Visual C++ Redistributable \u7684\u7248\u672c\u53f7\uff0c\u6ca1\u6709\u5b89\u88c5 Microsoft Visual C++ \u5c31\u4f1a\u62a5\u627e\u4e0d\u5230 msvcr.dll \u6587\u4ef6\u3002

\r\n

\u8bb0\u4e00\u6b21\u5b89\u88c5 oracle 12C\u5ba2\u6237\u7aef\u8fc7\u7a0b\u5907\u5fd8\uff0c\u9700\u8981\u5bfc\u5165\u3001\u5bfc\u51fa\u548c\u767b\u9646\u6570\u636e\u5e93\u529f\u80fd\u3002

\r\n

1.\u4e0b\u8f7d instantclient-basic-windows.x64-11.2.0.4.0.zip \u7528\u4e8e \u8fd0\u884c OCI\u3001OCCI \u548c JDBC-OCI \u5e94\u7528\u6240\u9700\u7684\u6240\u6709\u6587\u4ef6 \u3002

\r\n

2.instantclient-sqlplus-windows.x64-11.2.0.4.0.zip  \u7528\u4e8e SQL \u548c PL/SQL \u67e5\u8be2\u7684 SQL*Plus \u547d\u4ee4\u884c\u5de5\u5177 \u3002

\r\n

3.instantclient-tools-windows.x64-11.2.0.4.0.zip \u5305\u62ec Data Pump\u3001SQL*Loader \u548c Workload Replay Client \uff0c\u5176\u5b9e\u5c31\u662f\u6570\u636e\u5bfc\u5165\u5bfc\u51fa\u529f\u80fd\u3002

\r\n

\u628a\u4e09\u4e2a\u6587\u4ef6\u89e3\u538b\u5230\u540c\u4e00\u4e2a\u76ee\u5f55\uff0c\u5728\u7cfb\u7edf\u73af\u5883\u53d8\u91cf Path \u91cc\u9762\u628a\u8fd9\u4e2a\u76ee\u5f55\u6dfb\u52a0\u8fdb\u53bb\u5373\u53ef\u3002

\r\n"}, {"title": "\u8bb0\u4e00\u6b21\u5bfc\u5165ORACLE\u8868\u7a7a\u95f4\u4e0d\u5b58\u5728\u9519\u8bef", "desc": "\u5148\u524d\u7684\u4e00\u6bb5\u5bfc\u5165\u547d\u4ee4\u5728linux\u7cfb\u7edf\u4e0a\u6267\u884c\u6b63\u5e38\uff0c\u5728windows\u5b89\u88c5\u7684\u6570\u636e\u5e93\u5bfc\u5165\u5931\u8d25\uff08\u6570\u636e\u5e93\u7684\u7528\u6237\u8868\u7a7a\u95f4\u90fd\u4e00\u6837\uff09\u3002", "content": "

\u5bfc\u5165\u7684\u8bed\u53e5 impdp wx/jschrj@ORCL DIRECTORY=DATA_PUMP_DIR DUMPFILE='base_wtsd.dmp' remap_schema=jxygxf:wx remap_tablespace=jxygxf:wx;

\r\n

\u62a5\u9519

\r\n

 

\r\n
C:\\Users\\Administrator>impdp wx/jschrj@ORCL DIRECTORY=DATA_PUMP_DIR DUMPFILE='ba
\r\n\tse_wtsd.dmp' remap_schema=jxygxf:wx remap_tablespace=jxygxf:wx;
\r\n
Import: Release 11.2.0.1.0 - Production on \u661f\u671f\u4e00 12\u6708 17 13:40:03 2018
\r\n
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
\r\n
\u8fde\u63a5\u5230: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Produc
\r\n\ttion
\r\n\tWith the Partitioning, OLAP, Data Mining and Real Application Testing options
\r\n\t\u5df2\u6210\u529f\u52a0\u8f7d/\u5378\u8f7d\u4e86\u4e3b\u8868 "WX"."SYS_IMPORT_FULL_01"
\r\n\t\u542f\u52a8 "WX"."SYS_IMPORT_FULL_01":  wx/********@ORCL DIRECTORY=DATA_PUMP_DIR DUMPFI
\r\n\tLE='base_wtsd.dmp' remap_schema=jxygxf:wx remap_tablespace=jxygxf:wx;
\r\n\t\u5904\u7406\u5bf9\u8c61\u7c7b\u578b TABLE_EXPORT/TABLE/PROCACT_INSTANCE
\r\n\t\u5904\u7406\u5bf9\u8c61\u7c7b\u578b TABLE_EXPORT/TABLE/TABLE
\r\n\tORA-39083: \u5bf9\u8c61\u7c7b\u578b TABLE:"WX"."BASE_WTSD_COPY_VER" \u521b\u5efa\u5931\u8d25, \u51fa\u73b0\u9519\u8bef:
\r\n\tORA-00959: \u8868\u7a7a\u95f4 'WX;' \u4e0d\u5b58\u5728
\r\n\t\u5931\u8d25\u7684 sql \u4e3a:
\r\n\tCREATE TABLE "WX"."BASE_WTSD_COPY_VER" ("XZQHDM" VARCHAR2(12 BYTE), "WTSDMC" VAR
\r\n\tCHAR2(100 BYTE), "CJ" NUMBER(1,0) DEFAULT NULL, "STATUS" NUMBER(1,0), "WTSDQC" V
\r\n\tARCHAR2(300 BYTE)) SEGMENT CREATION IMMEDIATE PCTFREE 10 PCTUSED 40 INITRANS 1 M
\r\n\tAXTRANS 255 NOCOMPRESS LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 M
\r\n

\u4e4d\u4e00\u770b\u662f\u8868\u7a7a\u95f4\u4e0d\u5b58\u5728\uff0c\u4f46\u662f\u5b9e\u9645\u662f\u6709 WX \u8868\u7a7a\u95f4\u3002\u95ee\u9898\u5728\u4e8e\u5728 Windows CMD\u4e0b\u6267\u884c\u63d2\u5165\u8bed\u53e5\u672b\u5c3e\u4e0d\u80fd\u5e26 “;” \u5206\u53f7\u4e0d\u7136\u4f1a\u628a\u5206\u53f7\u548c\u8868\u7a7a\u95f4\u540d\u5b57\u8fde\u5230\u4e00\u8d77\u3002

\r\n

\u5176\u5b9e\u62a5\u7684\u662f WX\uff1b \u8868\u7a7a\u95f4\u4e0d\u5b58\u5728\uff0c\u8bb0\u5f55\u5907\u5fd8\u3002

\r\n"}, {"title": "oracle\u76d1\u542c\u542f\u52a8\u7279\u522b\u6162", "desc": "\u4eca\u5929\u6709\u53f0\u7ebf\u4e0aORACLE\u6570\u636e\u5e93\u4e1a\u52a1\u6b63\u5e38\uff0cplsql\u5ba2\u6237\u7aef\u94fe\u63a5\u63d0\u793a\u65e0\u76d1\u542c\u3002\u732a\u961f\u53cb\u4e0a\u53bb\u5728\u7cfb\u7edf\u670d\u52a1\u91cc\u91cd\u65b0\u542f\u52a8\u76d1\u542c\u670d\u52a1\u548c\u6570\u636e\u5e93\u5b9e\u4f8b\u670d\u52a1\u4f9d\u7136\u4e0d\u884c\u3002", "content": "

\u6392\u67e5\u6b65\u9aa4\uff1a

\r\n

1.\u6253\u5f00CMD\u547d\u4ee4\u63d0\u793a\u7b26\u8f93\u5165

\r\n

lsnrctl status         //\u67e5\u770b\u76d1\u542c\u72b6\u6001

\r\n

\u505c\u7559\u5728\u94fe\u63a5\u72b6\u6001\u770b\u4f3c\u65e0\u54cd\u5e94\u3002

\r\n

2.\u8fdb\u5165\u76d1\u542c\u65e5\u5fd7\u76ee\u5f55\u4e0b\u67e5\u770b\u65e5\u5fd7\uff0c\u53d1\u73b0\u5927\u5c0f\u5df2\u7ecf\u64cd\u4f5c4G,\u65e0\u6cd5\u5220\u9664\u63d0\u793a\u6b63\u5728\u4f7f\u7528\u4e2d\u3002

\r\n

3.CMD \u8f93\u5165 services.msc \u6253\u5f00\u7cfb\u7edf\u670d\u52a1\u5c06 ORACLE \u670d\u52a1\u505c\u6b62\u3002\u5220\u9664 listener.log \u6587\u4ef6\u3002

\r\n

\u6211\u7684\u65e5\u5fd7\u76ee\u5f55 D:\\app\\Administrator\\diag\\tnslsnr\\WIN-G75CVR58P3G\\listener\\trace 

\r\n

4.lsnrctl start \u542f\u52a8\u76d1\u542c\u6b63\u5e38\u3002

\r\n

\u5ef6\u7533\uff1a

\r\n

\u5173\u95ed\u76d1\u542c\u65e5\u5fd7\uff1a

\r\n

CMD\u8f93\u5165\uff1alsnrctl \u56de\u8f66\u8fdb\u5165\u4ea4\u4e92\u6a21\u5f0f\u3002

\r\n

set log_status off   //\u5173\u95ed\u76d1\u542c\u65e5\u5fd7

\r\n

stop  //\u505c\u6b62\u76d1\u542c

\r\n

start  //\u5f00\u542f

\r\n

startus  //\u67e5\u770b\u72b6\u6001

\r\n

 

\r\n

 

\r\n"}, {"title": "java\u81ea\u5e26HttpURLConnection\u65b9\u6cd5POST\u8bf7\u6c42\u4f20JSON", "desc": "\u4f20JSON\u6216\u8005\u4f20String\u8ddf\u672c\u8eab\u4ee3\u7801\u91cc\u9762\u4f20\u7684\u6570\u636e\u7c7b\u578b\u6ca1\u5173\u7cfb\uff0c\u4e3b\u8981\u8981\u6ce8\u610f\u5982\u679c\u53c2\u6570\u4e2d\u6587\u9700\u8981\u8f6c\u6362\u6210UTF-8\u7f16\u7801\uff0c\u8fd8\u6709 Content-Type \u7684\u8bbe\u7f6e\u3002", "content": "

\u8d34\u51fa\u4e3b\u8981\u4ee3\u7801

\r\n

 

\r\n
\r\nHttpURLConnection connection = (HttpURLConnection) url.openConnection();\r\nconnection.setRequestMethod("POST");\r\n// \u8bbe\u7f6e\u901a\u7528\u7684\u8bf7\u6c42\u5c5e\u6027\r\nconnection.setRequestProperty("Content-Type", "application/json");\r\nconnection.setRequestProperty("Connection", "Keep-Alive");\r\nconnection.setRequestProperty("Charset", "UTF-8");\r\nconnection.setUseCaches(false);\r\nconnection.setDoOutput(true);\r\nconnection.setDoInput(true);\r\nconnection.connect();
\r\n

\u5176\u4e2d

\r\n
\r\nPOST \u662f\u8bf7\u6c42\u65b9\u5f0f\uff0cContent-Type \u51b3\u5b9a\u63d0\u4ea4\u7684\u662f JSON \u8fd8\u662f String, \u63d0\u4ea4JSON\u5c31\u8981 setRequestProperty("Content-Type", "application/json")
\r\n

\u9ed8\u8ba4\u4f7f\u7528\u7684\u662f application/x-www-form-urlencoded

\r\n

\u5982\u679c\u63a5\u53e3\u8fd4\u56de\u7684\u503c\u4e0d\u662f\u60f3\u8981\u7684\u7ed3\u679c\uff0c\u53ef\u80fd\u4f20\u5165\u7684\u5b57\u7b26\u96c6\u6709\u95ee\u9898\u3002

\r\n
\r\n//\u5efa\u7acb\u8f93\u5165\u6d41\uff0c\u5411\u6307\u5411\u7684URL\u4f20\u5165\u53c2\u6570\r\nDataOutputStream dos = new DataOutputStream(connection.getOutputStream());\r\nSystem.out.println(params);\r\ndos.write(params.getBytes("UTF-8"));\r\ndos.flush();\r\ndos.close();
\r\n
\r\n\u4e3b\u8981\u8fd9\u53e5dos.write(params.getBytes("UTF-8"));\u8981\u8bbe\u7f6e\u5b57\u7b26\u96c6\u3002\r\n
\r\n

---------------------------------------------------------------------------------------------------------------------

\r\n

Content-Type\u200b \u7a76\u7adf\u5e94\u8be5\u7528application/x-www-form-urlencoded\u8fd8\u662fapplication/json?

\r\n

 

\r\n
\u7b54\u6848\u662f\u8ddf\u6211\u4eec\u63d0\u4ea4\u7684\u53c2\u6570\u683c\u5f0f\u6709\u5173\u3002
\r\n
\u5982\u679c\u662f\u901a\u8fc7\u9875\u9762\u8868\u5355\u65b9\u5f0f\u63d0\u4ea4\uff0c\u90a3\u5c31\u662f"application/x-www-form-urlencoded"\uff1b\u5982\u679c\u662fjson\uff08\u8981\u53cd\u5e8f\u5217\u5316\u6210\u5b57\u7b26\u4e32\uff09\uff0c\u90a3\u5c31\u662f"application/json"\u3002
\r\n
\u5bf9\u4e8e"application/x-www-form-urlencoded"\uff0c\u5176\u53c2\u6570\u7ec4\u7ec7\u5f62\u5f0f\uff0c\u662f\u952e\u503c\u5bf9\uff0c\u7c7b\u4f3c\u4e8eget\u65b9\u5f0f\u7684\u53c2\u6570\u5f62\u5f0f\uff1aname=\u5f20\u4e09&sex=\u7537&tel=5354169\uff0c\u800cjson\u5927\u5bb6\u90fd\u77e5\u9053\uff0c\u662f\u8fd9\u6837\u7684\uff1a
\r\n
 
\r\n
{
\r\n\t    name:"\u5f20\u4e09",
\r\n\t    sex:"\u7537",
\r\n\t    tel:"5354169",
\r\n\t}
\r\n
 
\r\n

\u6240\u4ee5\uff0c\u5982\u679c\u4f60\u4f20\u9012\u7684\u53c2\u6570\u662fjson ,Content-Type \u5c31\u8bbe\u7f6e webClient.Headers.Add("Content-Type", "application/json");

\r\n

\u200b\u5982\u679c\u4f60\u662f\u901a\u8fc7\u9875\u9762\u8868\u5355\u63d0\u4ea4\u7c7b\u4f3c\u4e8eget\u65b9\u5f0f\u7684\u53c2\u6570\u5f62\u5f0f\uff1aname=\u5f20\u4e09&sex=\u7537&tel=1234582 \u5c31\u8bbe\u7f6ewebClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");

\r\n

\u200b\u9ed8\u8ba4\u7684\u4f7f\u7528 application/x-www-form-urlencoded

\r\n

 

\r\n

 

\r\n"}, {"title": "JAVA\u63a5\u53e3json\u8fd4\u56deDATA\u5168\u4e3anull", "desc": null, "content": "

{"code":0,"count":1240,"data":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"limit":"30","msg":"","page":"2"}

\r\n"}, {"title": "hadoop\u542f\u52a8\u540e\u6709NameNode\u6ca1\u67099000\u7aef\u53e3", "desc": "hadoop\u542f\u52a8\u540e\uff0cjps\u547d\u4ee4\u67e5\u770b\u6709namenode\u4f46\u662fnetstat \u67e5\u770b\u6ca1\u67099000\u7aef\u53e3\u76d1\u542c", "content": "

\u89e3\u51b3\u65b9\u6cd5\uff1a

\r\n

1.\u5173\u95ed\u6240\u6709\u96c6\u7fa4

\r\n

 

\r\n
[root@sxfj-ysfwq-10-4-22-16 sbin]# sh stop-all.sh
\r\n\tThis script is Deprecated. Instead use stop-dfs.sh and stop-yarn.sh
\r\n\tStopping namenodes on [Master]
\r\n\tMaster: stopping namenode
\r\n\t10.4.22.17: no datanode to stop
\r\n\t10.4.22.18: no datanode to stop
\r\n\t10.4.22.19: no datanode to stop
\r\n\tStopping secondary namenodes [0.0.0.0]
\r\n\t0.0.0.0: stopping secondarynamenode
\r\n\tstopping yarn daemons
\r\n\tstopping resourcemanager
\r\n\t10.4.22.17: stopping nodemanager
\r\n\t10.4.22.18: stopping nodemanager
\r\n\t10.4.22.19: stopping nodemanager
\r\n\tno proxyserver to stop
\r\n

2.\u683c\u5f0f\u5316namenode

\r\n

 

\r\n
[root@sxfj-ysfwq-10-4-22-16 sbin]# hadoop namenode -format
\r\n\tDEPRECATED: Use of this script to execute hdfs command is deprecated.
\r\n\tInstead use the hdfs command for it.
\r\n
18/10/22 15:43:17 INFO namenode.NameNode: STARTUP_MSG:
\r\n\t/************************************************************
\r\n\tSTARTUP_MSG: Starting NameNode
\r\n\tSTARTUP_MSG:   host = Master/10.4.22.16
\r\n\tSTARTUP_MSG:   args = [-format]
\r\n\tSTARTUP_MSG:   version = 2.7.4
\r\n

\u7701\u7565\u832b\u832b\u591a------------

\r\n

18/10/22 15:43:48 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
\r\n\t18/10/22 15:43:48 INFO util.ExitUtil: Exiting with status 0
\r\n\t18/10/22 15:43:48 INFO namenode.NameNode: SHUTDOWN_MSG:
\r\n\t/************************************************************
\r\n\tSHUTDOWN_MSG: Shutting down NameNode at Master/10.4.22.16

\r\n

3.\u683c\u5f0f\u5316namenode\u4ee5\u540e\u4f1a\u5bfc\u81f4\u8282\u70b9\u670d\u52a1\u5668jps \u67e5\u770b\u4e0d\u5230DataNode

\r\n

\u200b3.1\u67e5\u770b\u4e3b\u670d\u52a1\u5668\u7684 /hdfs/namenode/current/VERSION \u6587\u4ef6 clusterID

\r\n

[root@sxfj-ysfwq-10-4-22-16 sbin]# more /hdfs/namenode/current/VERSION
\r\n\t#Mon Oct 22 15:43:48 CST 2018
\r\n\tnamespaceID=1743115032
\r\n\tclusterID=CID-a637c6f6-f9da-4988-8209-fd9db3323fe5
\r\n\tcTime=0
\r\n\tstorageType=NAME_NODE
\r\n\tblockpoolID=BP-2037756970-10.4.22.16-1540194206607
\r\n\tlayoutVersion=-63
\r\n\t[root@sxfj-ysfwq-10-4-22-16 sbin]# jps
\r\n\t18050 SecondaryNameNode
\r\n\t18917 Jps
\r\n\t15193 Master
\r\n\t18237 ResourceManager
\r\n\t17822 NameNode

\r\n

3.2\u5c06\u5176\u4ed6\u8282\u70b9\u670d\u52a1\u5668\u7684 clusterID \u6539\u548c\u4e3b\u670d\u52a1\u5668\u4e00\u81f4\u3002\u518d\u6b21\u542f\u52a8

\r\n
[root@sxfj-ysfwq-10-4-22-17 ~]# vi /hdfs/datanode/current/VERSION
\r\n
#Fri Mar 23 12:03:25 CST 2018
\r\n\tstorageID=DS-a54bb9f7-039a-40e9-9d57-9e55ef695fbc
\r\n\tclusterID=CID-a637c6f6-f9da-4988-8209-fd9db3323fe5
\r\n\tcTime=0
\r\n\tdatanodeUuid=0691a769-aa54-49cb-9bd7-83a73b2b207b
\r\n\tstorageType=DATA_NODE
\r\n\tlayoutVersion=-56
\r\n
 
\r\n
\u8282\u70b9\u670d\u52a1\u5668
\r\n
[root@sxfj-ysfwq-10-4-22-17 ~]# jps
\r\n\t1405 Worker
\r\n\t1053 DataNode
\r\n\t22455 Jps
\r\n\t31935 NodeManager
\r\n
 
\r\n
\u4e3b\u670d\u52a1\u5668
\r\n
[root@sxfj-ysfwq-10-4-22-16 ~]# jps
\r\n\t23526 Jps
\r\n\t2127 Master
\r\n\t7396 NameNode
\r\n\t7594 SecondaryNameNode
\r\n\t7681 ResourceManager
\r\n
 
\r\n
\u6ce8\u610f /hdfs/datanode/ \u7684\u8def\u5f84\u548chdfs\u914d\u7f6e\u7684\u8981\u4e00\u81f4\u3002
\r\n

 

\r\n"}, {"title": "expdp\u6570\u636e\u68d2\u5bfc\u51fa\u5355\u8868", "desc": "\u6570\u636e\u91cf\u5927\u7684\u65f6\u5019\u5728\u670d\u52a1\u5668\u4e0a\u4f7f\u7528 expdp \u6570\u636e\u68d2\u5bfc\u51fa\u6548\u7387\u9ad8\uff0c\u5982\u679c\u9700\u8981\u5bfc\u51fa\u7528\u6237\u4e0b\u6240\u6709\u5bf9\u8c61\u4f7f\u7528 SCHEMAS=user \u53c2\u6570\u5bfc\u51fa\u6240\u6709\u76f8\u5f53\u4e8e exp \u4e2d\u7684 full=y \u5982\u679c\u5bfc\u51fa\u5177\u4f53\u8868\u4f7f\u7528 TABLES=table1 \u53c2\u6570\u5982\u679c\u591a\u5f20\u8868\u4f7f\u7528,\u9017\u53f7\u5206\u9694\u3002", "content": "

\u5982\u679c\u540c\u65f6\u52a0\u5165 SCHEMAS\uff0cTABLES \u4e24\u4e2a\u53c2\u6570\u4f1a\u62a5\u9519\u3002\u5982\u4e0b

\r\n

expdp user/password@orcl SCHEMAS=user DIRECTORY=DATA_PUMP_DIR dumpfile=xfj.dmp TABLES=YW_XFJ

\r\n
Export: Release 11.2.0.4.0 - Production on Thu Oct 18 08:50:58 2018
\r\n
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
\r\n
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
\r\n\tWith the Partitioning, OLAP, Data Mining and Real Application Testing options
\r\n\tUDE-00010: multiple job modes requested, schema and tables.
\r\n
 
\r\n
\u603b\u4e4b\uff0c\u5bfc\u51fa\u5177\u4f53\u8868\u4f7f\u7528 TABLES \u53c2\u6570\uff0c\u5bfc\u51fa\u6574\u4e2a\u7528\u6237\u5bf9\u8c61\u4f7f\u7528 SCHEMAS \u53c2\u6570\uff0c\u4e0d\u53ef\u540c\u65f6\u4f7f\u7528\u3002
\r\n

 

\r\n

 

\r\n"}, {"title": "ORACLE\u5220\u9664\u8868\u7a7a\u95f4\u62a5\u9519", "desc": "\u8fd9\u91cc\u6d89\u53ca\u5230recycle bin\u7684\u6982\u5ff5\uff0c\u5979\u662f\u548c\u666e\u901a\u5bf9\u8c61\u516c\u7528\u8868\u7a7a\u95f4\u5b58\u50a8\u7a7a\u95f4\u7684\uff0c\u6216\u8005\u8bf4Recycle bin\u7684\u5bf9\u8c61\u8981\u548c\u666e\u901a\u5bf9\u8c61\u62a2\u593a\u5b58\u50a8\u7a7a\u95f4\u3002\u5f53\u5b58\u50a8\u7a7a\u95f4\u4e0d\u591f\u65f6\uff0coracle\u4f1a\u6309\u7167\u5148\u5165\u5148\u51fa\u7684\u539f\u5219\u8986\u76d6recycle bin\u7684\u5bf9\u8c61\u3002", "content": "

\u62a5\u9519\u4fe1\u606f\u3002
\r\n\tSQL> DROP TABLESPACE GZ INCLUDING CONTENTS AND DATAFILES;
\r\n\tDROP TABLESPACE GZ INCLUDING CONTENTS AND DATAFILES
\r\n\t*
\r\n\tERROR at line 1:
\r\n\tORA-00604: error occurred at recursive SQL level 1
\r\n\tORA-38301: can not perform DDL/DML over objects in Recycle Bin

\r\n


\r\n\t\u8fd9\u91cc\u6d89\u53ca\u5230recycle bin\u7684\u6982\u5ff5\uff0c\u5979\u662f\u548c\u666e\u901a\u5bf9\u8c61\u516c\u7528\u8868\u7a7a\u95f4\u5b58\u50a8\u7a7a\u95f4\u7684\uff0c\u6216\u8005\u8bf4Recycle bin\u7684\u5bf9\u8c61\u8981\u548c\u666e\u901a\u5bf9\u8c61\u62a2\u593a\u5b58\u50a8\u7a7a\u95f4\u3002\u5f53\u5b58\u50a8\u7a7a\u95f4\u4e0d\u591f\u65f6\uff0coracle\u4f1a\u6309\u7167\u5148\u5165\u5148\u51fa\u7684\u539f\u5219\u8986\u76d6recycle bin\u7684\u5bf9\u8c61\u3002

\r\n

\u53ef\u4ee5\u7528\u5982\u4e0b\u65b9\u6cd5\u6e05\u9664 recycle bin \u7684\u7a7a\u95f4\uff1a

\r\n

1. \u6e05\u7a7arecycle bin\u4e2d\u7684\u8868\u7a7a\u95f4\uff1a
\r\n\tpurge tablespace tablespace_name;
\r\n\t2. \u6e05\u7a7a\u67d0\u4e2a\u8868\u7a7a\u95f4\u5185\u7684\u67d0\u4e2a\u7528\u6237\u7684\u5bf9\u8c61\uff1a
\r\n\tpruge tablespace tablespace_name user user_name
\r\n\t3. \u6e05\u9664\u5f53\u524d\u7528\u6237\u7684\u5bf9\u8c61\uff1a
\r\n\tpurge recyclebin
\r\n\t4. \u6e05\u9664\u6240\u6709\u7528\u6237\u7684\u5bf9\u8c61\uff1a
\r\n\tpurge dba_recyclebin
\r\n\t5. sysdba\u6743\u9650
\r\n\tdrop table table_name purge
\r\n\t\u6c38\u4e45\u5220\u9664
\r\n\t6. \u5220\u9664\u5bf9\u8c61\u7684\u5173\u8054\u7d22\u5f15\uff1a
\r\n\tpurge index index_name

\r\n

\u672c\u6b21\u89e3\u51b3\u4f7f\u7528 purge tablespace GZ \u6e05\u7a7arecycle bin\u4e2d\u7684\u8868\u7a7a\u95f4\u3002

\r\n
SQL> purge tablespace GZ ; 
\r\n
Tablespace purged.
\r\n

SQL> DROP TABLESPACE GZ INCLUDING CONTENTS AND DATAFILES;
\r\n\tDROP TABLESPACE GZ INCLUDING CONTENTS AND DATAFILES
\r\n\t*
\r\n\tERROR at line 1:
\r\n\tORA-00604: error occurred at recursive SQL level 1
\r\n\tORA-38301: can not perform DDL/DML over objects in Recycle Bin

\r\n

\u6211\u8fd9\u91cc\u5220\u9664\u8fd8\u662f\u4e0d\u884c\uff0c\u56e0\u4e3a\u6211\u7528\u7684sys\u8d26\u6237\u767b\u9646\u5220\u9664\u7684\u3002\u5fc5\u987b\u8981\u7528 \u8868\u7a7a\u95f4\u7684\u8d26\u6237\u3002

\r\n

 

\r\n
SQL> purge recyclebin;
\r\n
Recyclebin purged.
\r\n

\u7136\u540e\u518d\u5220\u9664

\r\n
SQL> DROP TABLESPACE GZ INCLUDING CONTENTS AND DATAFILES;
\r\n
Tablespace dropped.
\r\n

\u6211\u8fd9\u4e2a\u73b0\u8c61\u662f\u5148\u5220\u9664\u7528\u6237\u7136\u540e\u518d\u5220\u9664\u8868\u7a7a\u95f4\u51fa\u73b0\u7684\uff0c\u6240\u4ee5\u53ef\u80fd\u4f1a\u9047\u5230\u8868\u7a7a\u95f4\u8d26\u53f7\u88ab\u5220\u9664\u7684\u60c5\u51b5\u3002\u6211\u8fd9\u91cc\u89e3\u51b3\u7684\u601d\u8def\u662f\u628aGZ\u8868\u7a7a\u95f4\u5173\u8054\u5230\u522b\u7684\u8d26\u53f7\u4e0b\u3002

\r\n

\u767b\u9646\u8d26\u53f7\u6267\u884c purge recyclebin;

\r\n

\u7136\u540e\u5207\u6362\u8d26\u53f7\u8fd0\u884c DROP TABLESPACE GZ INCLUDING CONTENTS AND DATAFILES; \u5220\u9664\u8868\u7a7a\u95f4\u3002

\r\n

 

\r\n

 

\r\n"}, {"title": "\u901a\u8fc7mysql\u6570\u636e\u5e93\u670d\u52a1\u5668\u5c06jeecms\u6587\u7ae0\u81ea\u52a8\u63a8\u9001\u5230\u767e\u5ea6\u5e73\u53f0", "desc": "\u6211\u7684JEECMS \u7684\u6570\u636e\u5e93\u662f\u7528\u7684linux\u5e73\u53f0\uff0c\u7531\u4e8e\u6c34\u5e73\u70c2\u4eba\u4e5f\u61d2\u6240\u7528\u5c31\u60f3\u5230\u7528 bash \u914d\u5408\u5e73\u53f0\u7ed9\u7684\u4e8b\u4f8b\u8fdb\u884c\u63a8\u9001\uff0c\u5199\u6210\u811a\u672c\u653e\u5728 crontab \u91cc\u81ea\u52a8\u6267\u884c\u3002", "content": "

\u76f4\u63a5\u8d34\u811a\u672c

\r\n

 

\r\n

 

\r\n
#!/bin/bash
\r\n\tusername='root'
\r\n\tpassword='xxxxx'
\r\n\tdatabase='zhoudltest'
\r\n\tselect_sql="SELECT jc_channel.channel_path,jc_content.content_id FROM jc_channel,jc_content WHERE jc_channel.channel_id = jc_content.channel_id ORDER BY jc_content.content_id DESC LIMIT 0,10"
\r\n\t#\u6b64\u5904\u91c7\u7528awk\u547d\u4ee4\u53bb\u9664\u4e86\u6807\u9898\u663e\u793a\uff0c\u4e5f\u53ef\u4ee5\u7528${result##*str}\u65b9\u5f0f\u53bb\u9664\uff0cstr\u4e3a\u5b57\u6bb5\u6700\u540e\u4e00\u4e2a\u5b57\u6bcd
\r\n\tresult=`mysql -u${username} -p${password} ${database} -e "${select_sql}"|awk 'NR>1'`
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$1"""/"$2".htm"}' >urls.txt
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$3"""/"$4".htm"}' >>urls.txt
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$5"""/"$6".htm"}' >>urls.txt
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$7"""/"$8".htm"}' >>urls.txt
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$9"""/"$10".htm"}' >>urls.txt
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$11"""/"$12".htm"}' >>urls.txt
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$13"""/"$14".htm"}' >>urls.txt
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$15"""/"$16".htm"}' >>urls.txt
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$17"""/"$18".htm"}' >>urls.txt
\r\n\techo $result |awk '{print  "http://www.zhoudl.com/"""$19"""/"$20".htm"}' >>urls.txt
\r\n\tcurl -H 'Content-Type:text/plain' --data-binary @urls.txt "http://data.zz.baidu.com/urls?appid=21129221965109sd32&token=MWS6N8llHuGxQEDU03YX&type=realtime"
\r\n
 
\r\n
 
\r\n
#\u5176\u4e2d http://www.zhoudl.com \u662f\u6211\u7684\u57df\u540d\uff0c appid \u548c token \u662f\u767e\u5ea6\u63d0\u4f9b\u7684\u8fd9\u91cc\u5df2\u7ecf\u88ab\u6211\u4e71\u6539\u8fc7\u4e86\u3002
\r\n
\r\n

[root@iZ35fysdmc9Z ~]# crontab -l
\r\n\t30 22 * * * sh /opt/1.sh

\r\n

\u6211\u7684\u4efb\u52a1\u662f\u6bcf\u5929\u665a\u4e0a10\u70b9\u534a\u6267\u884c\u4e00\u6b21\u811a\u672c\u3002

\r\n
 
\r\n

 

\r\n"}, {"title": "ORACLE\u5220\u9664\u65e7\u5f52\u6863\u65e5\u5fd7", "desc": "oracle\u5f52\u6863\u65e5\u5fd7\u4e09\u5e74\u6ca1\u5220\u5df2\u7ecf\u5feb\u63a5\u8fd12T\u4e86\uff0c\u4eca\u5929\u5728rman\u4e0b\u7528 DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-4'; \u5220\u96644\u5929\u524d\u7684\u5f52\u6863\u65e5\u5fd7\uff0c\u53d1\u73b0\u78c1\u76d8\u4e0b\u5c45\u7136\u67092016\u30012017\u5e74\u7684\u6587\u4ef6\u6ca1\u6709\u88ab\u5220\u9664\u3002", "content": "

\u5904\u7406\u8fc7\u7a0b\uff1a
\r\n\t\u200b\u5728rman \u4e0b\u7528

\r\n

RMAN> list archivelog all;

\r\n

\u200b\u67e5\u770b\u65e5\u5fd7\u53ea\u6709\u6700\u8fd13\u5929\u7684\uff0c\u5e76\u6ca1\u6709\u663e\u793a2016\u5e74\u7684\u548c2017\u5e74\u7684\uff0c

\r\n

RMAN> crosscheck archivelog all;

\r\n

\u68c0\u67e5\u4e5f\u6ca1\u6709\u68c0\u67e5\u5230\u65e7\u7684\u5f52\u6863\u65e5\u5fd7\u5185\u5bb9\u3002

\r\n

\u767b\u9646\u6570\u636e\u5e93\u67e5\u8be2 v$archived_log \u89c6\u56fe\u53ea\u80fd\u5b58\u653e28253\u6761\u65e5\u5fd7\u3002

\r\n
SQL> select count(*) from v$archived_log;
\r\n
  COUNT(*)
\r\n\t----------
\r\n\t     28253
\r\n
 
\r\n
\r\n\t
SQL> select * from v$controlfile_record_section where type='ARCHIVED LOG';
\r\n\t
TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID ARCHIVED LOG      
\r\n\t\t---------------------------- ---------------------  -------------------------- ------------------------  ------------------- ------------------- ------------------  
\r\n\t\t                                   584                       273280                   48377                    260114             35210              1563443
\r\n\t
                  
\r\n
\r\n

\u7528RMAN \u628a\u5f52\u6863\u65e5\u5fd7\u5173\u8054\u4e0a\u5728\u5220\u9664

\r\n

RMAN> catalog start with 'F:\\oraarch';

\r\n

\u200b\u7136\u540e\u518d\u6267\u884c

\r\n

RMAN> DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-4'

\r\n"}, {"title": "PLSQL Developer\u8fde\u63a5\u4e0d\u4e0a\u6570\u636e\u5e93", "desc": "ORA-12154: TNS: \u65e0\u6cd5\u89e3\u6790\u6307\u5b9a\u7684\u8fde\u63a5\u6807\u8bc6\u7b26\uff0c\u4f7f\u7528\u547d\u4ee4\u53ef\u4ee5\u767b\u5f55\u3002\u67e5\u4e86\u597d\u4e45\uff0c\u914d\u4e86tnsnames.ora,listener.ora.\u751a\u81f3\u8fde TNS_ADMIN\u8fd9\u4e2a\u73af\u5883\u53d8\u91cf\u90fd\u914d\u4e86\u3002", "content": "

\r\n\t\u95ee\u9898\u63cf\u8ff0

\r\n

\u4e91\u5357\u7684\u4e00\u4e2a\u9879\u76ee\uff0c\u5e94\u7528\u670d\u52a1\u5668\u91cd\u88c5\u7cfb\u7edf\u3002\u91cd\u88c5\u4ee5\u540e\uff0cPLSQL Developer \u8fde\u63a5\u4e0d\u4e0a\uff0c\u7ef4\u62a4\u8c03\u4e86\u534a\u5929\u641e\u4e0d\u5b9a\u3002\u4e00\u76f4\u63d0\u793aORA-12154: TNS: \u65e0\u6cd5\u89e3\u6790\u6307\u5b9a\u7684\u8fde\u63a5\u6807\u8bc6\u7b26\uff0c\u7528 CMD \u547d\u4ee4\u63d0\u793a\u7b26\u767b\u5f55\uff0c\u4f9d\u7136\u63d0\u793a\u8fd9\u4e2a\u3002\u6000\u7591\u6570\u636e\u5e93\u7f51\u7edc\u95ee\u9898\uff0cping -t -l \u6570\u636e\u5e93 IP \u65e0\u4e22\u5305\u3002TELNET 192.168.3.21 1521 \u6570\u636e\u5e93\u7aef\u53e3\u901a\uff0c\u7f51\u7edc\u6ca1\u95ee\u9898\u3002\u6000\u7591\u6570\u636e\u5e93\u672c\u8eab\u76d1\u542c\u914d\u7f6e\u6709\u95ee\u9898\uff0c\u4ece\u53e6\u4e00\u53f0\u5e94\u7528 PLSQL Developer \u8fde\u63a5\u5c45\u7136\u6b63\u5e38\u3002tnsnames.ora,listener.ora\u6587\u4ef6\u6211\u90fd\u624b\u52a8\u914d\u7f6e\u8fc7\u4e86\u3002\u53f3\u51fb ORACLE \u5ba2\u6237\u7aef\u5b89\u88c5\u76ee\u5f55\u6dfb\u52a0\u4e2a \u7528\u6237\u6743\u9650\uff0c\u7ee7\u7eed PLSQL Developer \u8fde\u63a5\u8fd8\u662f\u62a5ORA-12154: TNS: \u65e0\u6cd5\u89e3\u6790\u6307\u5b9a\u7684\u8fde\u63a5\u6807\u8bc6\u7b26\u9519,\u624b\u52a8\u914d\u7f6e ORALE_HOME\u3001TNS_NAME\u3001PATH\u3001LNS_LANG\u5404\u79cd\u53c2\u6570\u3002PLSQL Developer \u8fde\u63a5\u8fd8\u662f\u62a5ORA-12154: TNS: \u65e0\u6cd5\u89e3\u6790\u6307\u5b9a\u7684\u8fde\u63a5\u6807\u8bc6\u7b26\u9519.

\r\n

\r\n\t\u89e3\u51b3\u95ee\u9898

\r\n

\u5df2\u7ecf\u6309\u637a\u4e0d\u4f4f\u5fc3\u4e2d\u7684\u5c0f\u5b87\u5b99\u4e86\uff0c\u7ee7\u7eed\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff1a

\r\n

sqlplus user/password@192.168.3.21/orcl

\r\n

\u5c45\u7136\u5947\u8ff9\u822c\u7684\u8fde\u4e0a\u4e86\uff0c\u4e00\u9635\u7a83\u559c\u554a\u3002\u7ee7\u7eed PLSQL Developer \u8fde\u63a5\u8fd8\u662f\u62a5ORA-12154: TNS: \u65e0\u6cd5\u89e3\u6790\u6307\u5b9a\u7684\u8fde\u63a5\u6807\u8bc6\u7b26\u9519\u3002\u607c\u706b\u4e86\uff0c\u91cd\u5934\u5230\u5c3e\u68c0\u67e5\u4e00\u6b21\u914d\u7f6e\uff0c\u73af\u5883\u53d8\u91cf\u4e5f\u6ca1\u95ee\u9898\u3002\u76f4\u63a5\u5b9a\u4f4d PLSQL Developer \u6709\u95ee\u9898\uff0c\u53f3\u51fb\u7528\u7ba1\u7406\u5458\u8fd0\u884c\uff0c\u8fd8\u662f\u62a5ORA-12154: TNS: \u65e0\u6cd5\u89e3\u6790\u6307\u5b9a\u7684\u8fde\u63a5\u6807\u8bc6\u7b26\u9519\u3002\u5378\u8f7d PLSQL Developer \u91cd\u65b0\u5b89\u88c5\uff0c\u5728\u6b21\u6d4b\u8bd5\u5c45\u7136\u597d\u4e86\u3002

\r\n

\r\n\t\u95ee\u9898\u603b\u7ed3

\r\n

\u8be2\u95ee\u8fd0\u7ef4\u5c0f\u59b9\u600e\u4e48\u5b89\u88c5\u7684 PLSQL Developer \uff0c\u5979\u8bf4\u76f4\u63a5\u4e0b\u4e00\u6b65\u5b89\u88c5\u7684\u3002\u597d\u5427\u95ee\u9898\u627e\u5230\u4e86\uff0c\u65b0\u5b89\u88c5\u7684\u7cfb\u7edf\u662f windows server 2012 64\u4f4d\u7684\uff0c PLSQL Developer\u9ed8\u8ba4\u5b89\u88c5\u5728 C:\\Program Files (x86)\\PLSQL Developer \u8fd9\u4e2a\u76ee\u5f55\u4e0b\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u76ee\u5f55\u6709\u7a7a\u683c\u548c\u62ec\u53f7\uff0c\u4f30\u8ba1\u662f\u8fd9\u4e2a\u539f\u56e0\u9020\u6210\u7684\u3002\u5c45\u7136\u88ab\u8fd9\u4e48\u4e2a\u4f4e\u7aef\u7684\u95ee\u9898\u7ed9\u8017\u8d39\u4e861\u4e2a\u591a\u5c0f\u65f6\"\"\uff0c\u9119\u89c6\u4e0b PLSQL Developer \u62a5\u9519\u4fe1\u606f\u4e0d\u51c6\u5907\u3002\u4e5f\u602a\u81ea\u5df1\u592a\u76f8\u4fe1\u81ea\u5df1\u4e86\uff0c\u628a\u95ee\u9898\u8003\u8651\u590d\u6742\u4e86\uff0c\u6ca1\u4ece\u6700\u7b80\u5355\u7684\u65b9\u9762\u5165\u624b

\r\n"}, {"title": "\u5f88\u597d\u7684javascript\u603b\u7ed3", "desc": "Javascript \u662f\u6700\u6d41\u884c\u7684\u7f51\u9875\u524d\u7aef\u811a\u672c\u8bed\u8a00,\u7528\u4e8e\u5b9e\u73b0\u7f51\u9875\u7279\u6548/\u8868\u5355\u9a8c\u8bc1/AJAX\u7b49\u5de5\u4f5c, \u5176\u8bed\u6cd5\u7c7b\u4f3cC, \u533a\u5206\u5927\u5c0f\u5199\u3002\u5b66\u4e60Javascript \u5efa\u8bae\u5b89\u88c5Firefox\u6216Chrome\u6d4f\u89c8\u5668, \u5728\u6d4f\u89c8\u5668\u4e2d\u6309F12\u952e\u8c03\u51fa\u63a7\u5236\u53f0, \u5728\u63a7\u5236\u53f0\u4e0b\u53ef\u76f4\u63a5\u6267\u884c\u5404\u79cdjavascript\u51fd\u6570\u548c\u547d\u4ee4. JavaScript \u4e0e Java \u662f\u4e24\u79cd\u5b8c\u5168\u4e0d\u540c\u7684\u8bed\u8a00\uff0c\u65e0\u8bba\u5728\u6982\u5ff5\u8fd8\u662f\u8bbe\u8ba1\u4e0a\u3002", "content": "

\r\n\tJavascript \u8bed\u6cd5\u8bf4\u660e

\r\n

\u6ce8\u91ca:

\r\n
    \r\n\t
  1. \r\n\t\t\u5355\u884c\u6ce8\u91ca    //  
  2. \r\n\t
  3. \r\n\t\t\u591a\u884c\u6ce8\u91ca
  4. \r\n
\r\n

/*   \u591a\u884c\u6587\u5b57

\r\n

*/

\r\n

;\u5206\u53f7\u7528\u4e8e\u5206\u9694 JavaScript \u8bed\u53e5,\u7528\u5206\u53f7\u6765\u7ed3\u675f\u8bed\u53e5\u662f\u53ef\u9009\u7684\u3002

\r\n

 

\r\n

\u53d8\u91cf:

\r\n\r\n

 

\r\n

\u53d8\u91cf\u58f0\u660e  var  \u53d8\u91cf\u540d  , \u4f8b\u5982   var  x;   

\r\n

\u53d8\u91cf\u8d4b\u503c  \u53d8\u91cf\u540d=\u503c     \u4f8b\u5982   x=100   x='abc'

\r\n

\r\nJavascript \u6570\u636e\u7c7b\u578b

\r\n

\u6570\u636e\u7c7b\u578b:  \u672a\u5b9a\u4e49(undefined) , \u7a7a(null),  \u5e03\u5c14(Boolean), \u5b57\u7b26\u4e32(String), \u6570\u503c(Number), \u5bf9\u8c61(Object), \u6570\u7ec4\u548c\u51fd\u6570\u90fd\u53ef\u7b97\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u5bf9\u8c61. JS\u4e0d\u533a\u5206\u6574\u6570\u548c\u6d6e\u70b9\u6570, \u6240\u6709\u6570\u5b57\u5747\u7528\u6d6e\u70b9\u6570\u8868\u793a.

\r\n

JavaScript \u62e5\u6709\u52a8\u6001\u7c7b\u578b\u3002\u8fd9\u610f\u5473\u7740\u76f8\u540c\u7684\u53d8\u91cf\u53ef\u7528\u4f5c\u4e0d\u540c\u7684\u7c7b\u578b\uff1a

\r\n
\r\n\t
\r\nvar x                // x \u4e3a undefined
\r\n\t
\r\nvar x = 6;           // x \u4e3a\u6570\u5b57
\r\n\t
\r\nvar x = "Bill";      // x \u4e3a\u5b57\u7b26\u4e32
\r\n
\r\n

\u672a\u5b9a\u4e49(undefined): \u4efb\u4f55\u672a\u88ab\u8d4b\u503c\u8fc7\u7684\u53d8\u91cf

\r\n

\u5b57\u7b26\u4e32\u53ef\u7528\u5355\u6216\u53cc\u5f15\u53f7\u4f5c\u5b9a\u754c\u7b26.  s1='abc'     ;   s2="abc" \u5747\u53ef

\r\n

isNaN(x) : \u5224\u65adx\u662f\u5426\u662f\u6570\u503c\u5f62\u5f0f,   \u5982x\u975e\u6570\u503c,\u8fd4\u56detrue;   \u5982x\u662f\u6570\u503c, \u8fd4\u56defalse. \u4f8b isNaN('12') \u8fd4\u56defalse

\r\n

\u5982\u679c\u628a\u6570\u5b57\u4e0e\u5b57\u7b26\u4e32\u76f8\u52a0\uff0c\u7ed3\u679c\u5c06\u6210\u4e3a\u5b57\u7b26\u4e32, \u4f8b\u5982 5+"6" \u5c06\u5f97\u5230"56",\u5b57\u7b26\u4e32\u548c\u6570\u503c\u53ef\u4ee5\u76f4\u63a5\u6309\u6570\u503c\u89c4\u5f8b\u6bd4\u8f83\u5927\u5c0f.  "123">45

\r\n

\u6570\u636e\u7c7b\u578b\u8f6c\u6362:

\r\n

parseInt(str) : \u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3a\u6574\u6570   parseInt("123.56")\u7ed3\u679c\u4e3a \u6574\u6570123

\r\n

parseInt("12a3")\u7684\u7ed3\u679c\u4e3a12

\r\n

parseFloat(str): \u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3a\u6d6e\u70b9\u6570 parseFloat("1.56") \u5c06\u5f97\u52301.56

\r\n

 

\r\n

\u5e03\u5c14\uff08\u903b\u8f91\uff09\u53ea\u80fd\u6709\u4e24\u4e2a\u503c\uff1atrue \u6216 false\u3002

\r\n

js\u4e2d\u6ca1\u6709\u5e38\u91cf,\u4f46\u4e00\u822c\u7ea6\u5b9a\u5168\u5927\u5199\u5b57\u7b26\u547d\u540d\u7684\u53d8\u91cf\u4e0d\u8981\u53bb\u4fee\u6539.

\r\n

\u5404\u79cd\u8fd0\u7b97\u7b26\u7c7b\u4f3cC \u3002  ++,  -- \u90fd\u548cC\u4e00\u6837.

\r\n

\u5173\u7cfb\u8fd0\u8f93\u7b26:   >   <  ==  ===  <=  >=  !=  !==

\r\n

\u903b\u8f91\u8fd0\u7b97\u7b26 :  &&\u4e0e   ||\u6216    !\u975e

\r\n

 JavaScript \u4fdd\u7559\u5b57

\r\n

break          delete         function            return         typeof

\r\n

case             do                 if                  switch          var

\r\n

catch           else              in                this              void

\r\n

continue     false           instanceof   throw          while

\r\n

debugger     finally         new             true             with

\r\n

default         for               null              try

\r\n

JavaScript  String\u5bf9\u8c61

\r\n

String\u5bf9\u8c61\u662f\u6700\u5e38\u7528\u7684\u5bf9\u8c61, \u5176\u6709\u5f88\u591a\u5c5e\u6027\u548c\u65b9\u6cd5

\r\n

s='AB\u6c49\u5b57\u7cfb\u7edf'

\r\n

s.length   // \u8fd4\u56de6, \u5b57\u7b26\u4e32\u957f\u5ea6

\r\n

s.charAt(2)  // \u8fd4\u56de \u6c49,  \u53d6\u7b2c2\u4e2a\u5b57\u7b26

\r\n

s.indexOf('B')  //  \u8fd4\u56de1, \u67e5\u627eB, \u8868\u660eB\u5728s\u7684\u7b2c1\u4e2a\u4f4d\u7f6e

\r\n

s.indexOf('C')  //  \u8fd4\u56de -1, \u8868\u793a\u672a\u627e\u5230C

\r\n

s.substr(1,3)   //\u8fd4\u56deB\u6c49\u5b57,  \u4ece\u4f4d\u7f6e1\u5f00\u59cb, \u53d63\u4e2a\u5b57\u7b26

\r\n

s.replace('AB', 'DE') // \u5c06AB\u66ff\u6362\u4e3a DE

\r\n

var s = "hello, world"             

\r\n

s.charAt(0)   \u6216s[0]          // => "h": the first character.

\r\n

s.charAt(s.length-1)          // => "d": the last character.

\r\n

s.substring(1,4)                 // => "ell": the 2nd, 3rd and 4th characters.

\r\n

s.slice(1,4)                         // => "ell": same thing

\r\n

s.slice(-3)                          // => "rld": last 3 characters

\r\n

s.indexOf("l")                    // => 2: position of first letter l.

\r\n

s.lastIndexOf("l")                     // => 10: position of last letter l.

\r\n

s.indexOf("l", 3)                // => 3: position of first "l" at or after 3

\r\n

s.split(", ")                         // => ["hello", "world"] split into substrings

\r\n

s.replace("h", "H")            // => "Hello, world": replaces all instances

\r\n

s.toUpperCase()              // => "HELLO, WORLD"

\r\n

s1+s2+s3  \u6216  s1.concat(s2,s3)  // \u4e09\u4e2a\u5b57\u7b26\u4e32\u8fde\u63a5

\r\n

\u5b57\u7b26\u4e32\u5206\u9694

\r\n

var  t="12:10:35";

\r\n

var  tarr=t.split(":");  // \u4ee5:\u4e3a\u5206\u9694\u7b26, \u5206\u9694t, \u5f97\u5230\u4e00\u4e2a\u6570\u7ec4

\r\n

  hour=tarr[0];  minute=tarr[1];  second=tarr[2]

\r\n

JavaScript  json\u5bf9\u8c61

\r\n

json\u5bf9\u8c61\u7531\u82b1\u62ec\u53f7\u5b9a\u754c\uff0c\u5728\u82b1\u62ec\u53f7\u5185\u90e8\uff0c\u5bf9\u8c61\u7684\u5c5e\u6027\u4ee5\u540d\u79f0\u548c\u503c\u5bf9\u7684\u5f62\u5f0f (name : value) \u6765\u5b9a\u4e49\uff0c\u5c5e\u6027\u7531\u9017\u53f7\u5206\u9694\uff1a

\r\n
\r\n\t
\r\nperson={firstname:"Bill", lastname:"Gates", id:5566};
\r\n\t
\r\n\u6216person={"firstname":"Bill", "lastname":"Gates", "id":5566};
\r\n
\r\n

\u8bbf\u95eejson\u5bf9\u8c61\u5c5e\u6027\u53ef\u7528\u5982\u4e0b\u4e24\u79cd\u65b9\u5f0f\uff1a

\r\n
\r\n\t
\r\nname=person.lastname;
\r\n\t
\r\nname=person["lastname"];
\r\n\t
\r\nstr='{"name":"Bill",  "id":"5566"}'; //\u5b57\u7b26\u4e32
\r\n\t
\r\nperson=JSON.parse(str); //\u7531\u5b57\u7b26\u4e32\u6784\u9020json\u5bf9\u8c61
\r\n\t
\r\ndocument.write(person['name']+' '+person.id);
\r\n
\r\n

\r\n\u5c40\u90e8Javascript \u53d8\u91cf

\r\n

\u5728 JavaScript \u51fd\u6570\u5185\u90e8\u7528var \u5f00\u5934\u58f0\u660e\u7684\u53d8\u91cf\u662f\u5c40\u90e8\u53d8\u91cf\uff0c\u53ea\u80fd\u5728\u51fd\u6570\u5185\u90e8\u8bbf\u95ee\u5b83\u3002\u51fd\u6570\u8fd0\u884c\u5b8c\u6bd5\uff0c\u5c40\u90e8\u53d8\u91cf\u5c31\u4f1a\u88ab\u5220\u9664\u3002

\r\n

function  fun1(){

\r\n

  var  x=1, str='abc';  // \u5c40\u90e8\u53d8\u91cf

\r\n

   z=100 ; // \u6ca1\u6709\u7528var\u5f00\u5934, \u6240\u4ee5z\u662f\u5168\u5c40\u53d8\u91cf  

\r\n

}

\r\n

\r\n\u5168\u5c40Javascript \u53d8\u91cf

\r\n

(1)\u5728\u51fd\u6570\u5916\u58f0\u660e\u7684\u53d8\u91cf

\r\n

(2)\u5728\u51fd\u6570\u5185\u6ca1\u6709\u4f7f\u7528var \u5f00\u5934\u5b9a\u4e49\u7684\u53d8\u91cf

\r\n

\u90fd\u662f\u5168\u5c40\u53d8\u91cf\uff0c\u7f51\u9875\u4e0a\u7684\u6240\u6709\u811a\u672c\u548c\u51fd\u6570\u90fd\u80fd\u8bbf\u95ee\u5b83\u3002\u5168\u5c40\u53d8\u91cf\u4f1a\u5728\u9875\u9762\u5173\u95ed\u540e\u88ab\u5220\u9664\u3002

\r\n

x=100;    // \u5168\u5c40\u53d8\u91cf

\r\n

function  fun1( ){

\r\n

  y=200;      // \u5168\u5c40\u53d8\u91cf

\r\n

  var  x=20;  // \u7528var\u5bf9x\u91cd\u65b0\u7533\u660e, \u6b64\u65f6\u5728\u51fd\u6570\u5185\u90e8x\u662f\u5c40\u90e8\u53d8\u91cf, \u524d\u9762\u7684\u5168\u5c40\u53d8\u91cfx\u4e0d\u53ef\u89c1\u4e86

\r\n

}

\r\n

 

\r\n

\r\nJavascript \u6d41\u7a0b\u63a7\u5236

\r\n
    \r\n\t
  1. \r\n\t\t if  (\u6761\u4ef6)  {  \u8bed\u53e51 }
  2. \r\n
\r\n

    else  {  \u8bed\u53e52 }

\r\n
    \r\n\t
  1. \r\n\t\tif  (\u6761\u4ef6)  {  \u8bed\u53e51 }
  2. \r\n
\r\n

    else  if  (\u6761\u4ef6)  {\u8bed\u53e52 }

\r\n

else  {  \u8bed\u53e53 }

\r\n
    \r\n\t
  1. \r\n\t\t switch (\u8868\u8fbe\u5f0f) {
  2. \r\n
\r\n

  case   \u5339\u914d\u6761\u4ef61:  \u8bed\u53e51;  break;

\r\n

  case   \u5339\u914d\u6761\u4ef62:  \u8bed\u53e52;  break;

\r\n

  …

\r\n

default:  \u9ed8\u8ba4\u8bed\u53e5;

\r\n

}

\r\n

 

\r\n
    \r\n\t
  1. \r\n\t\t\u6761\u4ef6\u8868\u8fbe\u5f0f   \u53d8\u91cf=\u5e03\u5c14\u503c? \u503c1:  \u503c2  . \u6761\u4ef6\u4e3a\u771f\u53d6\u503c1, \u4e3a\u5047\u53d6\u503c2
  2. \r\n
\r\n

a=x >y? '\u5927\u4e8e': '\u4e0d\u5927\u4e8e'

\r\n
    \r\n\t
  1. \r\n\t\t while  (\u6761\u4ef6) {
  2. \r\n
\r\n

\u5faa\u73af\u8bed\u53e5\u4f53

\r\n

 }

\r\n
    \r\n\t
  1. \r\n\t\t do  {
  2. \r\n
\r\n

\u5faa\u73af\u8bed\u53e5\u4f53

\r\n

 } while  (\u6761\u4ef6)

\r\n
    \r\n\t
  1. \r\n\t\t for  (var  x=1;  x<100;  x++) {
  2. \r\n
\r\n

\u5faa\u73af\u8bed\u53e5\u4f53

\r\n

 }

\r\n
    \r\n\t
  1. \r\n\t\t  for/in \u8bed\u53e5\u5faa\u73af\u904d\u5386\u5bf9\u8c61\u7684\u5c5e\u6027\uff1a
  2. \r\n
\r\n
\r\n\t
\r\nvar person={fname:"John",lname:"Doe",age:25};
\r\n\t
\r\nvar txt='';
\r\n\t
\r\nfor (x in person){
\r\n\t
\r\n   txt= txt + x+":"+ person[x]+" ";
\r\n\t
\r\n  }
\r\n\t
\r\ndocument.write(txt);
\r\n
\r\n
    \r\n\t
  1. \r\n  \u5f02\u5e38\u5904\u7406
  2. \r\n
\r\n

try {

\r\n

\u8bed\u53e5

\r\n

} catch(e) {

\r\n

\u5f02\u5e38\u5904\u7406

\r\n

alert (e.message)  // \u663e\u793a\u5f02\u5e38\u9519\u8bef\u4fe1\u606f

\r\n

} finally  {

\r\n

\u6700\u540e\u4e00\u5b9a\u4f1a\u6267\u884c\u8bed\u53e5(\u65e0\u8bba\u662f\u5426\u6709\u5f02\u5e38)

\r\n

}

\r\n

\r\nJavascript \u6570\u7ec4

\r\n

(1) \u521b\u5efa\u6570\u7ec4\u65b9\u6cd51, \u76f4\u63a5\u8d4b\u503c 

\r\n

var  arr=[1,2,3];  alert( arr[0]+ arr[1]+arr[2]) ;

\r\n

(2)\u521b\u5efa\u6570\u7ec4\u65b9\u6cd52, \u7528new\u8bed\u53e5

\r\n

var  arr=new  Array(\u6570\u7ec4\u957f\u5ea6)  \u6216  arr=new  Array(\u6570\u7ec4\u7684\u503c)

\r\n

var  arr1=new Array(5);

\r\n

alert('\u6570\u7ec41\u957f\u5ea6\u4e3a:'+ arr1.length); 

\r\n

var  arr2=new Array(1,2,3);

\r\n

\u6ce8:js \u7684\u6570\u7ec4\u53ef\u4ee5\u5b58\u653e\u4efb\u4f55\u7c7b\u578b\u7684\u6570\u636e, \u4e00\u4e2a\u6570\u7ec4\u4e2d\u7684\u5404\u4e2a\u6570\u636e\u5143\u7d20\u53ef\u4ee5\u662f\u4e0d\u540c\u7c7b\u578b;\u8bbf\u95ee\u6570\u7ec4\u5143\u7d20\u65f6\u53ef\u901a\u8fc7\u7d22\u5f15\uff0c\u7d22\u5f15\u4ece0\u5f00\u59cb\u3002 \u5f53\u8bbf\u95ee\u5230\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u7d22\u5f15\u65f6, \u5e76\u4e0d\u4f1a\u62a5\u9519, \u800c\u662f\u8fd4\u56de\u4e00\u4e2aundefined\u503c\uff0c\u5982\u679c\u8bd5\u56fe\u8d4b\u503c\u7ed9\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u7d22\u5f15\u503c, \u4e5f\u4e0d\u4f1a\u5f15\u53d1\u9519\u8bef, \u800c\u662f\u81ea\u52a8\u6269\u5c55\u6570\u7ec4.

\r\n

\u6570\u7ec4\u7684\u5e38\u7528\u65b9\u6cd5:

\r\n

(1)\u6570\u7ec4\u5143\u7d20\u7684\u6dfb\u52a0

\r\n

arrayObj. push( item1 , item2 );// \u5c06\u4e00\u4e2a\u6216\u591a\u4e2a\u65b0\u5143\u7d20\u6dfb\u52a0\u5230\u6570\u7ec4\u7ed3\u5c3e\uff0c\u5e76\u8fd4\u56de\u6570\u7ec4\u65b0\u957f\u5ea6

\r\n

arrayObj.unshift(item1 ,item2);// \u5c06\u4e00\u4e2a\u6216\u591a\u4e2a\u65b0\u5143\u7d20\u6dfb\u52a0\u5230\u6570\u7ec4\u5f00\u59cb\uff0c\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u81ea\u52a8\u540e\u79fb\uff0c\u5e76\u8fd4\u56de\u6570\u7ec4\u65b0\u957f\u5ea6

\r\n

(2)\u6570\u7ec4\u5143\u7d20\u7684\u5220\u9664

\r\n

arrayObj.pop();   //\u79fb\u9664\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u5e76\u8fd4\u56de\u8be5\u5143\u7d20\u503c

\r\n

arrayObj.shift();  //\u79fb\u9664\u7b2c0\u4e2a\u5143\u7d20\u5e76\u8fd4\u56de\u5176\u503c\uff0c\u6570\u7ec4\u4e2d\u5143\u7d20\u81ea\u52a8\u524d\u79fb

\r\n

(3)\u6570\u7ec4\u7684\u622a\u53d6

\r\n

arrayObj.slice(start, [end]); //\u4ee5\u6570\u7ec4\u7684\u5f62\u5f0f\u8fd4\u56de\u6570\u7ec4\u7684\u4e00\u90e8\u5206\uff0c\u6ce8\u610f\u4e0d\u5305\u62ec end \u5bf9\u5e94\u7684\u5143\u7d20\uff0c\u5982\u679c\u7701\u7565 end \u5c06\u590d\u5236 start \u4e4b\u540e\u7684\u6240\u6709\u5143\u7d20.\u539f\u6570\u7ec4\u4e0d\u53d8

\r\n

[1,3,5,7,9].slice(2,4)  \u8fd4\u56de [5,7]

\r\n

arrayObj.splice(start, [length]); //\u5728\u539f\u6570\u7ec4\u4e2d\u4ecestart\u5f00\u59cb, \u622a\u53d6\u957f\u5ea6length\u7684\u5b50\u6570\u7ec4, \u622a\u53d6\u540e, \u539f\u6570\u7ec4\u4e2d\u5c06\u5220\u9664\u5b50\u6570\u7ec4

\r\n

arr=[1,3,5,7,9]

\r\n

arr.splice(2,3) \u8fd4\u56de [5,7,9],  arr\u4e2d\u5220\u9664\u8be5\u5b50\u6570\u7ec4,  arr=[1,3]

\r\n

 (4)\u6570\u7ec4\u7684\u62f7\u8d1d

\r\n

arrayObj.slice(0); //\u8fd4\u56de\u6570\u7ec4\u7684\u62f7\u8d1d\u6570\u7ec4\uff0c\u6ce8\u610f\u662f\u4e00\u4e2a\u65b0\u7684\u6570\u7ec4\uff0c\u4e0d\u662f\u6307\u5411\u539f\u6570\u7ec4

\r\n

arrayObj.concat(); //\u8fd4\u56de\u6570\u7ec4\u7684\u62f7\u8d1d\u6570\u7ec4\uff0c\u6ce8\u610f\u662f\u4e00\u4e2a\u65b0\u7684\u6570\u7ec4\uff0c\u4e0d\u662f\u6307\u5411\u539f\u6570\u7ec4

\r\n

(5)\u6570\u7ec4\u5143\u7d20\u7684\u6392\u5e8f

\r\n

arrayObj.reverse(); //\u53cd\u8f6c\u5143\u7d20\uff08\u6700\u524d\u7684\u6392\u5230\u6700\u540e\u3001\u6700\u540e\u7684\u6392\u5230\u6700\u524d\uff09\uff0c\u8fd4\u56de\u6570\u7ec4\u5730\u5740

\r\n

arrayObj.sort();  //\u5bf9\u6570\u7ec4\u5143\u7d20\u6392\u5e8f\uff0c\u8fd4\u56de\u6570\u7ec4\u5730\u5740

\r\n

arr1=[8, 10, 1, 2, 100, 3, 4, 5, 6]

\r\n

arr1.sort()   //[1, 10, 100, 2, 3, 4, 5, 6, 8]  \u9ed8\u8ba4\u5c06\u6309ascii\u7801\u6392\u5e8f

\r\n

//  \u5982\u9700\u6309\u6570\u503c\u5927\u5c0f\u6392\u5e8f, \u9700\u81ea\u5df1\u5b9a\u4e49\u4e00\u4e2a\u6bd4\u8f83\u51fd\u6570

\r\n

// \u6bd4\u8f83\u51fd\u6570\u9700\u4e24\u4e2a\u53c2\u6570a,b;  \u5982a>b\u8fd4\u56de1,  \u5426\u5219\u8fd4\u56de-1

\r\n

arr1.sort( function(a,b){ if (a>b) { return 1;} else {return -1} }  )

\r\n

[1, 2, 3, 4, 5, 6, 8, 10, 100]

\r\n

(6)\u3001\u6570\u7ec4\u5143\u7d20\u7684\u5b57\u7b26\u4e32\u5316

\r\n

arrayObj.join(separator); //\u8fd4\u56de\u5b57\u7b26\u4e32\uff0c\u8fd9\u4e2a\u5b57\u7b26\u4e32\u5c06\u6570\u7ec4\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u503c\u8fde\u63a5\u5728\u4e00\u8d77\uff0c\u4e2d\u95f4\u7528 separator \u9694\u5f00\u3002

\r\n

arr1=['a',1,5,'c']

\r\n

arr1.join(':')  \u5c06\u5f97\u5230"a:1:5:c"

\r\n

(7) \u67e5\u627e

\r\n

arrayObj.indexOf(value)  // \u8fd4\u56devalue\u503c\u5728\u6570\u7ec4\u4e2d\u7684\u7d22\u5f15, \u5982\u65e0,\u8fd4\u56de-1

\r\n

[1,3,5,7].indexOf(3) \u8fd4\u56de 1

\r\n

\u4e8c\u7ef4\u6570\u7ec4  arr=[ [0,1,2],  [3,4,5], [6,7,8] ]  ,  \u5219 arr[1][1]\u7684\u503c\u4e3a4

\r\n

\r\nJavascript \u51fd\u6570

\r\n

function  \u51fd\u6570\u540d(\u53c2\u65701, \u53c2\u65702…){

\r\n

  \u8bed\u53e5

\r\n

  return  \u8fd4\u56de\u503c;

\r\n

}

\r\n

\u8c03\u7528\u51fd\u6570\u65f6, \u5982\u4f20\u9012\u7684\u53c2\u6570\u4e2a\u6570\u4e0d\u5339\u914d, \u4e0d\u4f1a\u62a5\u9519, \u672a\u4f20\u9012\u7684\u53c2\u6570\u503c\u4e3aundefined

\r\n

Math  \u5e93

\r\n

Math.random()  // \u8fd4\u56de0-1\u7684\u968f\u673a\u5c0f\u6570

\r\n

Math.floor (5/2)  // \u5411\u4e0b\u53d6\u503c, \u8fd4\u56de2

\r\n

Math.ceil(5/2)    // \u5411\u4e0a\u53d6\u6574, \u8fd4\u56de3

\r\n

Math.round(5/2)  // \u4ee5\u56db\u820d\u4e94\u5165\u65b9\u5f0f\u53d6\u6574, \u8fd4\u56de3

\r\n

js \u56db\u820d\u4e94\u5165\u51fd\u6570 toFixed\uff08n\uff09 // n\u662f\u5c0f\u6570\u4f4d\u6570

\r\n

x=2.345

\r\n

x.toFixed(1)  // 2.3

\r\n

x.toFixed(2)  / /2.35

\r\n

\r\n\tJavascript \u4e3b\u8981\u4f5c\u7528

\r\n\r\n

\u63d2\u5165\u65b0\u7684 HTML \u5143\u7d20

\r\n
\r\n\t
\r\nlog = document.createElement("div"); // \u521b\u5efa\u4e00\u4e2a <div> \u5143\u7d20
\r\n\t
\r\nlog.id = "debuglog";
\r\n\t
\r\nlog.innerHTML = "<h1>Debug Log</h1>"; //\u8d4b\u4e88\u5185\u5bb9
\r\n\t
\r\ndocument.body.appendChild(log); // \u5c06div\u63d2\u5165\u5230body
\r\n\t
\r\nvar pre = document.createElement("pre"); // \u521b\u5efa\u4e00\u4e2a <pre> 
\r\n\t
\r\nvar text = document.createTextNode("\u6587\u5b57\u4e32"); // \u521b\u5efa\u4e00\u4e2a\u6587\u672c\u8282\u70b9
\r\n\t
\r\npre.appendChild(text); // \u5c06\u6587\u672c\u8282\u70b9\u6dfb\u52a0\u5230<pre>\u4e2d
\r\n\t
\r\nlog.appendChild(pre); // \u5c06<pre> \u6dfb\u52a0\u5230<div>\u4e2d
\r\n
\r\n

\u6539\u53d8 HTML \u5c5e\u6027

\r\n

\u5982\u9700\u6539\u53d8 HTML \u5143\u7d20\u7684\u5c5e\u6027\uff0c\u8bf7\u4f7f\u7528\u8fd9\u4e2a\u8bed\u6cd5\uff1a

\r\n
\r\n\t
\r\ndocument.getElementById(id).attribute=new value
\r\n\t
\r\n\u4f8b:document.getElementById("image").src="landscape.jpg";
\r\n
\r\n

\u6539\u53d8 CSS \u6837\u5f0f

\r\n

\u5982\u9700\u6539\u53d8 HTML \u5143\u7d20\u7684\u6837\u5f0f\uff0c\u8bf7\u4f7f\u7528\u8fd9\u4e2a\u8bed\u6cd5\uff1a

\r\n
\r\n\t
\r\ndocument.getElementById(id).style.property=new style
\r\n\t
\r\n\u4f8b:
\r\n\t
\r\n<p id="p2">Hello World!</p>
\r\n\t
\r\n<script>
\r\n\t
\r\nvar p=document.getElementById("p2");
\r\n\t
\r\np.style.color="blue";
\r\n\t
\r\np.style.fontSize="24px";
\r\n\t
\r\n</script>
\r\n
\r\n

 

\r\n
\r\n\t
\r\nfunction show(){
\r\n\t
\r\ndocument.getElementById('img1').style.visibility="visible";  //\u663e\u793a\u5143\u7d20
\r\n\t
\r\n}
\r\n\t
\r\nfunction  hide(){
\r\n\t
\r\ndocument.getElementById('img1').style.visibility="hidden"; // \u9690\u85cf\u5143\u7d20
\r\n\t
\r\n}
\r\n
\r\n

css\u7684\u5f88\u591a\u5c5e\u6027\u542b\u6709\u51cf\u53f7\u8fde\u5b57\u7b26\uff0c\u5982font-Size, background-Color\uff0c\u8fd9\u4e9b\u79f0\u4e3a\u6807\u7b7e\u5c5e\u6027\u3002\u5982\u679c\u8981\u7f16\u5199\u7a0b\u5e8f\u6765\u8bbe\u7f6e\u8fd9\u4e9b\u5c5e\u6027\uff0c\u7531\u4e8e\u51cf\u53f7\u4e0d\u80fd\u51fa\u73b0\u5728\u8868\u8fbe\u5f0f\u4e2d\uff0c\u6240\u4ee5\u8981\u5c06\u8fd9\u4e9b\u6807\u7b7e\u5c5e\u6027\u6539\u5199\u4e3a\u6837\u5f0f\u5c5e\u6027\u3002\u6807\u7b7e\u5c5e\u6027\u548c\u6837\u5f0f\u5c5e\u6027\u57fa\u672c\u4e0a\u662f\u76f8\u4e92\u5bf9\u5e94\u7684\uff0c\u4e24\u8005\u5f88\u591a\u65f6\u5019\u5c31\u76f8\u5dee\u4e00\u4e2a\u8fde\u5b57\u7b26\u3002\u6807\u7b7e\u5c5e\u6027\u662f\u5728html\u6807\u7b7e\u6216CSS\u4e2d\u8bbe\u7f6e\u65f6\u4f7f\u7528\u7684, \u4e0d\u533a\u5206\u5927\u5c0f\u5199\u3002\u7f16\u5199\u811a\u672c\u52a8\u6001\u6307\u5b9astyle\u5c5e\u6027\u65f6\u8981\u7528\u6837\u5f0f\u5c5e\u6027,\u8981\u533a\u5206\u5927\u5c0f\u5199\u3002\u4f8b\u5982:

\r\n
\r\n\t
\r\n<style>
\r\n\t
\r\np {font-size:24px;}
\r\n\t
\r\n</style>
\r\n\t
\r\n<script>
\r\n\t
\r\ndocument.getElementById("p2").style.fontSize="24px";
\r\n\t
\r\n</script>
\r\n
\r\n

js\u4e2d\u5f97\u5230\u7f51\u9875\u5143\u7d20\u7684\u51e0\u79cd\u5178\u578b\u65b9\u6cd5:

\r\n

(1)var  x=document.getElementById(id);

\r\n

x.innerHTML='\u65b0\u7684\u5185\u5bb9'

\r\n

x.className='ys1';  //\u8bbe\u7f6ex\u5143\u7d20\u7684\u7c7b\u6837\u5f0f

\r\n

num=x.value;      //\u53d6\u5f97x\u5143\u7d20\u7684\u503c

\r\n

x.value='abc';      //\u5411x\u5143\u7d20\u4e2d\u8d4b\u503c

\r\n

 

\r\n

\u7531\u4e8eid\u662f\u552f\u4e00\u7684, \u8fd9\u79cd\u65b9\u6cd5\u4e00\u822c\u8fd4\u56de\u552f\u4e00\u7684\u4e00\u4e2a\u5143\u7d20

\r\n

(2)var  arr=document.getElementsByTagName(tag);

\r\n

var  arr=document.getElementsByTagName('p');

\r\n

for ( var x=0;  x<arr.length;  x++)

\r\n

     arr[x].style.color="red"     // \u4fee\u6539\u6bcf\u4e2ap\u6807\u7b7e\u7684\u6587\u672c\u989c\u8272

\r\n

\u7f51\u9875\u4e2d\u53ef\u80fd\u6709\u591a\u4e2a\u540c\u6837\u7684\u6807\u7b7e, \u8be5\u65b9\u6cd5\u8fd4\u56de\u4e00\u4e2a\u6570\u7ec4. \u7528for\u5faa\u73af\u8bbf\u95ee\u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20

\r\n

(3) var  arr=document.getElementsByName(name);

\r\n

var  arr=document.getElementsByName('gender');

\r\n

for ( var x=0; x<arr.length;  x++)

\r\n

     if  (arr[x].checked) ; // \u68c0\u67e5\u540d\u4e3agender\u7684\u6240\u6709\u5355\u9009\u6309\u94ae\u7684\u9009\u4e2d\u72b6\u6001

\r\n

\u7f51\u9875\u4e2d\u53ef\u80fd\u6709\u591a\u4e2a\u540c\u540d\u7684\u5143\u7d20, \u8be5\u65b9\u6cd5\u8fd4\u56de\u4e00\u4e2a\u6570\u7ec4. \u7528for\u5faa\u73af\u8bbf\u95ee\u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20

\r\n

(4)  \u5728html5\u4e2d\u589e\u52a0\u4e86 \u4e00\u79cd\u65b0\u65b9\u6cd5, \u901a\u8fc7class\u540d\u6765\u83b7\u53d6\u5143\u7d20

\r\n

var  arr=document.getElementsByClassName('red')

\r\n

\u8fd4\u56de\u6240\u6709class\u5c5e\u6027\u542b\u6709 red\u7c7b\u6837\u5f0f\u7684\u6570\u7ec4\u5bf9\u8c61

\r\n

\r\nDOM \u4e8b\u4ef6\u6a21\u578b

\r\n

\u5728\u7f51\u9875\u4e2d\u4f1a\u53d1\u751f\u5f88\u591a\u4e8b\u4ef6, \u4f8b\u5982click,  dblclick, focus, mouseover \u7b49, \u4e00\u822c\u53ef\u7f16\u5199\u56de\u8c03\u51fd\u6570, \u5c06\u51fd\u6570\u4e0e\u4e8b\u4ef6\u7ed1\u5b9a, \u4e8b\u4ef6\u53d1\u751f\u65f6\u5c06\u81ea\u52a8\u8c03\u7528\u56de\u8c03\u51fd\u6570\u8fdb\u884c\u5904\u7406. \u5728\u6807\u51c6\u4e8b\u4ef6\u6a21\u578b\u4e2d, \u4e8b\u4ef6\u5bf9\u8c61event\u5728\u4e8b\u4ef6\u53d1\u751f\u65f6\u7531\u7cfb\u7edf\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u56de\u8c03\u51fd\u6570.

\r\n
\r\n\t
\r\n<script>
\r\n\t
\r\nfunction  handle(obj,e)
\r\n\t
\r\n{alert(obj.innerHTML+":"+obj.id);  // \u663e\u793a\u8be5\u5143\u7d20\u4e2d\u7684\u5185\u5bb9\u548cid\u540d  
\r\n\t
\r\nalert(e.clientX+":"+e.clientY);    // \u663e\u793a\u4e8b\u4ef6\u53d1\u751f\u65f6\u7684\u9f20\u6807\u5750\u6807
\r\n\t
\r\n}
\r\n\t
\r\n</script>
\r\n\t
\r\n<span  id="a" name="a" onclick=" handle(this,event);"> a12345 </span> 
\r\n\t
\r\n<span  id="b" name="b" onclick="handle(this,event);"> b56789 </span>
\r\n
\r\n

this: \u4ee3\u8868\u53d1\u751f\u4e8b\u4ef6\u7684\u5bf9\u8c61;  event: \u4ee3\u8868\u4e8b\u4ef6 ,\u662f\u6bd4\u8f83\u56fa\u5b9a\u7684\u5199\u6cd5

\r\n

\u4e8b\u4ef6\u76d1\u542c\u5668\u6ce8\u518c\u5e38\u7528\u7684\u4e09\u79cd\u65b9\u5f0f

\r\n

<script>

\r\n

function  fun1(obj, e) {   };  // \u6709\u51fd\u6570 fun1

\r\n

</script>

\r\n

\u65b9\u5f0f1 : \u5728\u6807\u7b7e\u4e2d\u7ed1\u5b9a

\r\n

<span  id="a" name="a" onclick="fun1(this,event);"> a12345 </span>

\r\n

\u65b9\u5f0f2:  \u6267\u884c\u811a\u672c,\u5728\u811a\u672c\u4e2d\u7ed1\u5b9a

\r\n

<script> 

\r\n

document.getElementById('a').onclick=fun1;  //\u6ce8\u610ffun1\u540e\u9762\u4e0d\u80fd\u6709( )

\r\n

</script>

\r\n

\u65b9\u5f0f3:  \u6807\u51c6\u6a21\u578b\u65b9\u5f0f, \u7528addEventListener\u7ed1\u5b9a

\r\n

<script>

\r\n

var  a=document.getElementById('a');

\r\n

a.addEventListener('click', fun1, 0 ); //\u7b2c3\u4e2a\u53c2\u6570\u4e3a1:\u4e8b\u4ef6\u6355\u83b7,\u4e3a 0: \u4e8b\u4ef6\u5192\u6ce1

\r\n

</script>

\r\n

\r\n\u5e38\u89c1\u4e8b\u4ef6

\r\n

(1)onload \u4e8b\u4ef6

\r\n

onload \u4e8b\u4ef6\u5728\u7f51\u9875\u52a0\u8f7d\u540e\u81ea\u52a8\u53d1\u751f, \u4e00\u822c\u53ef\u505a\u4e00\u4e9b\u521d\u59cb\u5316\u5904\u7406

\r\n
\r\n\t
\r\n<body onload="doinit()">
\r\n
\r\n

(2)onchange \u4e8b\u4ef6

\r\n

onchange \u4e8b\u4ef6\u5e38\u7528\u4e8e\u68c0\u67e5\u6587\u672c\u6846\u7684\u8f93\u5165\u5185\u5bb9

\r\n
\r\n\t
\r\n<input type="text" id="fname" onchange="upperCase()">
\r\n
\r\n

(3)onmouseover \u548c onmouseout \u4e8b\u4ef6

\r\n

onmouseover \u548c onmouseout \u4e8b\u4ef6\u53ef\u7528\u4e8e\u5728\u7528\u6237\u7684\u9f20\u6807\u79fb\u81f3 HTML \u5143\u7d20\u4e0a\u65b9\u6216\u79fb\u51fa\u5143\u7d20\u65f6\u89e6\u53d1\u51fd\u6570

\r\n

<script>

\r\n

function  mOver(obj){

\r\n

obj.innerHTML="\u8c22\u8c22"

\r\n

}

\r\n

 

\r\n

function  mOut(obj){

\r\n

obj.innerHTML="\u628a\u9f20\u6807\u79fb\u5230\u4e0a\u9762"

\r\n

}

\r\n

</script>

\r\n

<div onmouseover="mOver(this)" onmouseout="mOut(this)" ">\u628a\u9f20\u6807\u79fb\u5230\u4e0a\u9762</div>

\r\n

(4)onclick  \u5355\u51fb\u4e8b\u4ef6

\r\n

onclick \u4e8b\u4ef6\u4f1a\u5728\u5bf9\u8c61\u88ab\u70b9\u51fb\u65f6\u53d1\u751f\u3002

\r\n

\u8bf7\u6ce8\u610f\uff0c onclick \u4e0e onmousedown \u4e0d\u540c\u3002\u5355\u51fb\u4e8b\u4ef6\u662f\u5728\u540c\u4e00\u5143\u7d20\u4e0a\u53d1\u751f\u4e86\u9f20\u6807\u6309\u4e0b\u4e8b\u4ef6\u4e4b\u540e\u53c8\u53d1\u751f\u4e86\u9f20\u6807\u653e\u5f00\u4e8b\u4ef6\u65f6\u624d\u53d1\u751f\u7684\u3002

\r\n

(5)onfocus \u83b7\u5f97\u8f93\u5165\u7126\u70b9\u4e8b\u4ef6

\r\n

onfocus \u83b7\u5f97\u8f93\u5165\u7126\u70b9\u4e8b\u4ef6\uff0c\u5f53\u8f93\u5165\u5b57\u6bb5\u83b7\u5f97\u5149\u6807\u7126\u70b9\u65f6\u53d1\u751f

\r\n

javascript \u8bed\u8a00\u6838\u5fc3\u5b9a\u4e49\u4e86: Array \u6570\u7ec4, Function \u51fd\u6570, Date \u65e5\u671f, RegExp \u6b63\u5219, Error \u9519\u8bef\u7c7b.

\r\n"}, {"title": "ORACLEshutdown\u6ca1\u53cd\u5e94", "desc": "\u4eca\u5929\u624b\u6b8b alter system set deferred_segment_creation=false;\u8bbe\u7f6e\u4ee5\u540e\u91cd\u542f\u6570\u636e\u5e93\u5fd8\u8bb0\u4f7f\u7528 shutdown immediate\u76f4\u63a5\u4f7f\u7528shutdown\u4e86\u3002", "content": "

1.\u60c5\u51b5\u662f\u8fd9\u6837\u7684

\r\n

ORCLE11G\u65b0\u589e\u4e86\u4e00\u4e2a\u53c2\u6570“deferred_segment_creation”\u542b\u4e49\u662f\u6bb5\u5ef6\u8fdf\u521b\u5efa\uff0c\u9ed8\u8ba4\u662ftrue\u3002\u8fd9\u4e2a\u53c2\u6570\u5177\u4f53\u5e72\u4ec0\u4e48\u7684\u8fd9\u91cc\u5c31\u4e0d\u8be6\u7ec6\u8bb2\u4e86\uff0c\u4e3b\u8981\u5bfc\u81f4\u4e0d\u80fd\u5bfc\u51fa\u7a7a\u8868\u3002\u6240\u4ee5\u5728 CMD \u4e0b

\r\n

sqlplus user/password@192.168.19.19/orcl

\r\n

\u767b\u5f55\u6570\u636e\u5e93\u6267\u884c\u3002

\r\n

alter system set deferred_segment_creation=false;

\r\n

\u6267\u884c\u5b8c\u9700\u8981\u91cd\u542f\u6570\u636e\u5e93\u3002

\r\n

sqlplus sys/password@192.168.19.19/orcl as sysdba

\r\n

\u76f4\u63a5shutdown \uff0c\u60b2\u5267\u4e86\u7b49\u4e86\u4e2a\u628a\u5c0f\u65f6\u6ca1\u53cd\u5e94\u3002

\r\n

2.\u767e\u5ea6\u641c\u7d22\u89e3\u51b3\u65b9\u6cd5

\r\n

\u65b9\u6cd51

\r\n

SQL> conn /as sysdba
\r\n\tConnected.
\r\n\tSQL>
\r\n\tSQL> shutdown abort;
\r\n\tORACLE instance shut down.
\r\n\tSQL> startup restrict;
\r\n\tORACLE instance started.
\r\n\tSQL> shutdown
\r\n\tDatabase closed.
\r\n\tDatabase dismounted.
\r\n\tORACLE instance shut down.
\r\n\tSQL> quit

\r\n

\u65b9\u6cd52

\r\n

1. \u67e5\u770boracle\u7684\u540e\u53f0\u65e5\u5fd7
\r\n\t[root@ebslouis VIS_ebslouis]# cd /d01/oracle/visdb/9.2.0/admin/VIS_ebslouis
\r\n\t[root@ebslouis VIS_ebslouis]# ls
\r\n\tbdump  cdump  udump
\r\n\t[root@ebslouis VIS_ebslouis]# cd bdump/
\r\n\t[root@ebslouis bdump]# cat alert_VIS.log
\r\n\t2. \u67e5\u770b\u54ea\u4e9b\u8fdb\u7a0b\u662f\u6d3b\u52a8\u7684\uff0c\u7136\u540e\u770b\u5b83\u7684\u8fdb\u7a0b\u53f7\u3002
\r\n\t3. kill -9 \u8fdb\u7a0b\u53f7
\r\n\t4. \u5728\u6267\u884c\u4e00\u904d\u5173\u95ed\u64cd\u4f5c\uff1ashutdown immediate

\r\n

3.\u6211\u81ea\u5df1\u7684\u89e3\u51b3\u65b9\u6cd5

\r\n

\u6839\u636e\u767e\u5ea6\u641c\u7d22\u51fa\u6765\u7684\u65b9\u6cd5\u4e8c\u60f3\u5230\u7684\uff0c\u611f\u89c9\u66f4\u7a33\u59a5\u70b9\u3002

\r\n

\u6570\u636e\u5e93\u670d\u52a1\u5668CMD \u4e0b\u8f93\u5165\uff1a

\r\n

netstat -anop tcp

\r\n

\u770b\u5230\u672c\u5730\u5730\u5740:1521 \u540e\u9762 PID \u90fd\u4e00\u6837\u7684\u628a PID \u53f7\u8bb0\u4e0b\u6765

\r\n

\u7ee7\u7eed\u8f93\u5165

\r\n

task /F /PID \u4e0a\u6b65\u67e5\u8be2\u5230\u7684 PID \u53f7

\r\n

\u5728\u5207\u6362\u5230\u521a\u624d\u8f93\u5165 shutdown \u7684\u90a3\u4e2a CMD \u7a97\u53e3\u770b\u5230\u6570\u636e\u5e93\u5df2\u7ecf\u987a\u5229\u5173\u95ed\u4e86\u3002

\r\n

 

\r\n"}, {"title": "oracle\u5bfc\u51fa\u7a7a\u8868", "desc": "ORACLE11G\u9ed8\u8ba4\u4e0d\u7ed9\u7a7a\u8868\u5206\u914dextent\uff0c\u4e0d\u5360\u6570\u636e\u7a7a\u95f4\uff0c\u5373\u8868\u4e5f\u4e0d\u5206\u914d segment \u4ee5\u8282\u7701\u7a7a\u95f4\uff0c\u6240\u4ee5\u8fd9\u4e9b\u8868\u4e5f\u6ca1\u80fd\u5bfc\u51fa\u6765\uff0c\u5bfc\u51fa\u6570\u636e\u5e93\u7ed3\u6784\u4e0d\u5b8c\u6574\u3002", "content": "

1.\u95ee\u9898\u4ea7\u751f\u539f\u56e0

\r\n

Oracle 11g\u4e2d\u6709\u4e2a\u65b0\u7279\u6027\uff1a\u65b0\u589e\u4e86\u4e00\u4e2a\u53c2\u6570“deferred_segment_creation”\u542b\u4e49\u662f\u6bb5\u5ef6\u8fdf\u521b\u5efa\uff0c\u9ed8\u8ba4\u662ftrue\u3002
\r\n\t
\r\n\t\u5177\u4f53\u662f\u4ec0\u4e48\u610f\u601d\u5462\uff1f
\r\n\t
\r\n\t\u5982\u679c\u8fd9\u4e2a\u53c2\u6570\u8bbe\u7f6e\u4e3atrue\uff0c\u4f60\u65b0\u5efa\u4e86\u4e00\u4e2a\u8868Table1\uff0c\u5e76\u4e14\u6ca1\u6709\u5411\u5176\u4e2d\u63d2\u5165\u6570\u636e\uff0c\u90a3\u4e48\u8fd9\u4e2a\u8868\u4e0d\u4f1a\u7acb\u5373\u5206\u914dextent\uff0c\u4e5f\u5c31\u662f\u4e0d\u5360\u6570\u636e\u7a7a\u95f4\uff0c\u5373\u8868\u4e5f\u4e0d\u5206\u914d segment \u4ee5\u8282\u7701\u7a7a\u95f4\uff0c\u6240\u4ee5\u8fd9\u4e9b\u8868\u4e5f\u6ca1\u80fd\u5bfc\u51fa\u6765\u3002\u5728\u7cfb\u7edf\u8868user_tables\u4e2d\u4e5f\u53ef\u4ee5\u770b\u5230segment_treated\u7684\u5b57\u6bb5\u91cc\u662f“NO”\u6216\u8005“YES”\u8bf4\u660e\u4e86\u67d0\u5f20\u8868\u662f\u5426\u5206\u914d\u4e86segment\u3002\u8bf4\u767d\u4e86\u662f\u4e3a\u4e86\u53ef\u4ee5\u8282\u7701\u5c11\u91cf\u7684\u7a7a\u95f4\u3002
\r\n\t
\r\n\t\u7528\u4e0b\u9762\u7684SQL\u8bed\u53e5\u67e5\u8be2\uff0c\u53ef\u4ee5\u53d1\u73b0\u6ca1\u6709\u5bfc\u51fa\u7684\u8868\u5176 segment_created \u5b57\u6bb5\u503c\u90fd\u662f 'NO'\u3002
\r\n\t
\r\n\tSelect segment_created,table_name from user_tables where segment_created = 'NO';

\r\n

2.\u89e3\u51b3\u65b9\u6cd5

\r\n

\u6ca1\u7528\u7684\u65b9\u6cd5\u5c31\u4e0d\u8bb2\u4e86\uff0c\u76f4\u63a5\u6765\u5b9e\u7528\u7684\u3002

\r\n

\u7b2c\u4e00\u6b65:\u62fc\u63a5\u8bed\u53e5\u67e5\u51fa\u6240\u6709\u7a7a\u8868

\r\n

Select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0 or num_rows is null

\r\n

\u5efa\u8bae\u5728 PLSQL Developer \u91cc\u9762\u6267\u884c\uff0c\u5c06\u67e5\u8be2\u5230\u7684\u8bed\u53e5\u65b0\u5efa SQL \u67e5\u8be2\u6846\u5728\u6267\u884c\u4e00\u6b21\u3002

\r\n

\u7b2c\u4e8c\u6b65\uff1a\u53c2\u6570“deferred_segment_creation” \u8bbe\u7f6e\u4e3a flase;

\r\n

 SQL>alter system set deferred_segment_creation=false;

\r\n

\u7b2c\u4e00\u6b65\u5176\u5b9e\u5df2\u7ecf\u53ef\u4ee5\u628a\u7a7a\u8868\u5c9b\u51fa\u6765\u4e86\uff0c\u8fd9\u6b65\u662f\u9632\u6b62\u65b0\u5efa\u7a7a\u8868\u6ca1\u529e\u6cd5\u5bfc\u51fa\u3002

\r\n

\u7b2c\u4e09\u6b65\uff1a\u91cd\u542f\u6570\u636e\u5e93\u4e0d\u7136\u65b0\u5efa\u8868\u4e0d\u751f\u6548

\r\n

\u8bb0\u5f97\u7528 shutdown immediate \u5173\u95ed\u6570\u636e\u5e93\uff0c\u4e0d\u8981\u76f4\u63a5\u7528 shutdown ,shutdown\u9ed8\u8ba4\u4e3ashutdown normal\uff0c\u4e0d\u80fd\u63a5\u53d7\u65b0\u7684\u8fde\u63a5\uff0c\u4f46\u662f\u9700\u8981\u7b49\u5f85\u539f\u6709\u7684\u6d3b\u52a8\u8fde\u63a5\u5b8c\u6210\u5de5\u4f5c\u9000\u51fa\u540e\u624d\u4f1a\u6b63\u5f0f\u6267\u884c\u5173\u95ed\u3002\u7b49\u6b7b\u4eba\u4e86\u3002

\r\n

\u5982\u679c\u4e00\u4e0d\u5c0f\u5fc3\u76f4\u63a5\u4f7f\u7528 shutdown \u5173\u95ed\u4e86\u53c2\u7167 \u300aORACLEshutdown\u6ca1\u53cd\u5e94\u300b\u8fd9\u7bc7\u6587\u7ae0\u6765\u5904\u7406\u3002

\r\n"}, {"title": "oracle\u6570\u636e\u5e93\u5b9e\u73b0\u81ea\u589e\u4e3b\u952e", "desc": "mysql\u6570\u636e\u5e93\u6709\u81ea\u589e\u578b\u5b57\u6bb5\uff0cORACLE\u6ca1\u6709\u81ea\u589e\u5b57\u6bb5\u5fc5\u987b\u4f7f\u7528\u5e8f\u5217\u7ed3\u5408\u89e6\u53d1\u5668\u6765\u5b9e\u73b0\u81ea\u589e\u578b\u5b57\u6bb5\u3002", "content": "

\r\n\t1.\u521b\u5efa\u6837\u4f8b\u8868\u5e76\u4e14\u8bbe\u7f6e\u4e3b\u952e

\r\n

CREATE TABLE username
\r\n\t(
\r\n\tID INT NOT NULL,
\r\n\tNAME VARCHAR(20) NOT NULL,
\r\n\tPASSWORD VARCHAR(36) NOT NULL,
\r\n\tPRIMARY KEY(ID)
\r\n\t)

\r\n

TABLESPACE JSCHRJ

\r\n

\u521b\u5efa\u4e00\u5f20\u8868\u8868\u540d username \u5305\u542b\u4e09\u4e2a\u5217 ID, NAME, PASSWORD \u4e3b\u952e\u4e3a ID \u5217\u3002\u8868\u7a7a\u95f4\u4e3a JSCHRJ \uff0c\u8868\u7a7a\u95f4\u9700\u8981\u66f4\u6539\u4e3a\u81ea\u5df1\u4f7f\u7528\u7684\u8868\u7a7a\u95f4\u3002

\r\n

 

\r\n

\r\n\t2.\u521b\u5efa\u81ea\u589e\u5e8f\u5217\u540d\u79f0\u4e3a\uff1a\u8868\u540d_\u5b57\u6bb5\u540d_SEQ

\r\n

CREATE SEQUENCE username_ID_SEQ MINVALUE 1 NOMAXVALUE INCREMENT BY 1 START WITH 1 NOCACHE;

\r\n

 

\r\n

\r\n\t3.\u4e3aInsert\u64cd\u4f5c\u521b\u5efa\u89e6\u53d1\u5668\uff0c\u65e0\u9700\u5728SQL\u8bed\u53e5\u91cc\u5199NEXTVAL\uff0c\u540d\u79f0\u4e3a\u8868\u540d_INS_TRG

\r\n

CREATE OR REPLACE TRIGGER username_INS_TRG BEFORE INSERT ON username FOR EACH ROW WHEN(NEW.ID IS NULL) BEGIN SELECT username_ID_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL; END;

\r\n

 

\r\n

 

\r\n"}, {"title": "ORACLE\u67e5\u8be2\u67d0\u4e2a\u65f6\u95f4\u6bb5\u7684\u6570\u636e", "desc": "\u7f51\u4e0a\u641c\u7d22\u7684SQL\u8bed\u53e5\u67e5\u8be2\u67d0\u4e2a\u65f6\u95f4\u6bb5\u547d\u4ee4\u5728ORACLE\u4e2d\u4e0d\u9002\u7528\uff0c\u53d1\u6b64\u6587\u4ee5\u7559\u5907\u7528\u3002", "content": "

\r\n\t\u7f51\u4e0a\u641c\u7d22\u7684SQL\u547d\u4ee4

\r\n

select *  from table_name where \u53d1\u751f\u65e5\u671f between '2008-07-01'and '2008-12-31' 

\r\n

\u5728 PL/SQL \u5de5\u5177\u91cc\u6309\u8fd9\u4e2a\u683c\u5f0f\u67e5\u8be2\u4e00\u76f4\u63d0\u793a\u6570\u636e\u7c7b\u578b\u9519\u8bef\u3002

\r\n

\r\n\t\u7528\u4e0b\u9762\u8bed\u53e5\u5c31\u6210\u529f\u4e86

\r\n

select count(*) from \u8868\u540d

\r\n

where   

\r\n
 \u5b57\u6bb5 between 
\r\n
trunc(to_date('2016-8-22 09:00:00','yyyy-mm-dd hh24:mi:ss'))
\r\n
and
\r\n
trunc(to_date('2017-1-25 09:00:00','yyyy-mm-dd hh24:mi:ss'))
\r\n"}, {"title": "ORALCE11G\u5bfc\u516510G\u6570\u636e\u5e93", "desc": "\u4e1a\u52a1\u670d\u52a1\u5668\u6570\u636e\u7248\u672c11.2.0.1.0\u7528impdp\u5bfc\u5165\u516c\u53f8\u5185\u7f5110.2.0.1.0\u7248\u672c\u6d4b\u8bd5\u6570\u636e\u5e93\u3002\u5bfc\u51fa\u7684\u65f6\u5019\u6ca1\u5b9a\u4e49\u7248\u672c\u5bfc\u81f4\u5bfc\u5165\u6d4b\u8bd5\u6570\u636e\u5e93\u63d0\u793a\u7248\u672c\u4e0d\u517c\u5bb9\u3002", "content": "

\r\n\t\u9700\u6c42\u63cf\u8ff0

\r\n

\u9700\u8981\u5c06\u751f\u4ea7\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u5e93\u6570\u636e\uff0c\u5bfc\u5165\u516c\u53f8\u5185\u7f51\u6570\u636e\u5e93\u3002\u751f\u4ea7\u670d\u52a1\u5668ORACLE\u7248\u672c\u4e3a11.2.0.1.0\uff0c\u6d4b\u8bd5\u670d\u52a1\u5668ORACLE\u7248\u672c10.2.0.1.0\u3002\u5e76\u4e14\u4e24\u53f0\u6570\u636e\u5e93\u670d\u52a1\u5668\u5b9e\u4f8b\u540d\u79f0\u4e5f\u4e0d\u4e00\u81f4\uff0c\u751f\u4ea7\u6570\u636e\u5e93\u4e0a\u7684\u5b9e\u4f8b\u540d\u79f0\u4e3ajsygxf\uff0c\u6d4b\u8bd5\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u5e93\u5b9e\u4f8b\u540d\u79f0\u4e3aorcl.

\r\n

\r\n\t\u89e3\u51b3\u65b9\u6cd5

\r\n

1.\u5148\u5728\u751f\u4ea7\u6570\u636e\u5e93\u670d\u52a1\u5668\u4e0a\u5bfc\u51fa\u6570\u636e\uff08\u5fc5\u987b\u5728\u6570\u636e\u5e93\u673a\u5668\u4e0a\u624d\u80fd\u5bfc\u51fa\uff09

\r\n

expdp user/password@jsygxf SCHEMAS=jsygxf DIRECTORY=zhoudl_DIR dumpfile=20170207.dmp version=10.2.0.1.0

\r\n

\u5176\u4e2d\u751f\u4ea7\u670d\u52a1\u5668\u4e0a\u7684\u5b9e\u4f8b\u540d\u4e3ajsygxf ,\u6211\u81ea\u5df1\u5b9a\u4e49\u4e86\u4e00\u4e2aDIRECTORY\u522b\u540d\u4e3aZHOUDL_DIR\u3002\u540e\u9762version\u6307\u5b9a\u7684\u662f\u6d4b\u8bd5\u670d\u52a1\u5668ORACLE\u6570\u636e\u5e93\u7684\u7248\u672c\u53f7\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\u9ed8\u8ba4\u5bfc\u51fa\u672c\u673a\u6570\u636e\u5e93\u7248\u672c\u7684DMP\u6587\u4ef6\u3002

\r\n

2.\u5c06\u5bfc\u51fa\u7684DMP\u6587\u4ef6\u62f7\u8d1d\u5230\u6d4b\u8bd5\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u5bfc\u5165

\r\n

impdp user/password@ORCL DIRECTORY=DATA_PUMP_DIR DUMPFILE='20170207.dmp' remap_schema=jxygxf:orcl remap_tablespace=jxygxf:jxygxf;

\r\n

\u7531\u4e8e\u6d4b\u8bd5\u670d\u52a1\u5668\u4e0a\u7684\u5b9e\u4f8b\u540d\u79f0\u4e3aORCL,\u6240\u4ee5\u8981\u52a0remap_schema=jxygxf:orcl\uff0c\u8868\u793a\u4ecejsygxf\u5b9e\u4f8b\u5bfc\u5165\u5230ORCL\u5b9e\u4f8b\u3002

\r\n"}, {"title": "ORACLE\u7ef4\u62a4\u811a\u672c\u4e0d\u65ad\u66f4\u65b0", "desc": "\u4efb\u804c\u6c5f\u82cf\u695a\u6dee\u8f6f\u4ef6\u79d1\u6280\u671f\u95f4\u5904\u7406\u6570\u636e\u5e93\u95ee\u9898\u7528\u7684\u7ef4\u62a4SQL\u5206\u4eab\uff0c\u5b58\u6863\u3002", "content": "

\r\n\t20170104\u8bb0\u5f55\u6570\u636e\u5e93\u7684\u8bbf\u95ee\u91cf

\r\n

1.\u65b0\u5efa\u4e00\u4e2a\u8868\u7528\u6765\u8bb0\u5f55\u7528\u6237\u767b\u5f55\u4f1a\u8bdd\u4fe1\u606f

\r\n
\r\n\t
\r\n\r\n\r\ncreate table log$infomation\r\n(\r\nlogon_time timestamp,\r\nhost_name varchar2(100),\r\nusername varchar2(40),\r\nschemaname varchar2(40),\r\nsessionuser varchar2(40),\r\nip_address varchar2(100)\r\n);\r\n
\r\n
\r\n

2.\u65b0\u5efa\u767b\u9646\u89e6\u53d1\u5668\u6765\u8bb0\u5f55\u767b\u9646\u65f6\u7684\u56de\u8bdd\u4fe1\u606f
\r\n\tcreate or replace trigger tr_login_record
\r\n\t  after logon on database
\r\n\tbegin
\r\n\t  insert into log$infomation
\r\n\t    select systimestamp,
\r\n\t           sys_context('userenv', 'host'),
\r\n\t           sys_context('userenv', 'current_user'),
\r\n\t           sys_context('userenv', 'current_schema'),
\r\n\t           sys_context('userenv', 'session_user'),
\r\n\t           sys_context('userenv', 'ip_address')
\r\n\t      from dual;
\r\n\t  commit;
\r\n\texception
\r\n\t  when others then
\r\n\t    null;
\r\n\tend;
\r\n\t/

\r\n

3.\u8fc7\u6bb5\u65f6\u95f4\u67e5\u770b\u8bb0\u5f55\u7684\u6570\u636e

\r\n
\r\n\t
\r\n\r\nselect host_name, sessionuser, ip_address, count(*)\r\n  from log$infomation\r\n group by host_name, sessionuser, ip_address\r\nhaving count(*) >= 100\r\n order by 4;\r\n
\r\n
\r\n

\r\n\t20170106\u67e5\u770b\u6570\u636e\u5e93sga,pga\u5185\u5b58

\r\n

//\u67e5\u770b\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u4ee5\u53ca\u8fde\u63a5\u6570

\r\n
\r\n\t
\r\n\r\nselect 'SGA' AS NAME,\r\n       ROUND(sum(value) / 1024 / 1024, 2) || 'M' AS "SIZE(M)"\r\n  from v$sga\r\nUNION\r\nselect 'PGA' AS NAME, ROUND(value / 1024 / 1024, 2) || 'M' AS "SIZE(M)"\r\n  from v$pgastat\r\n where name = 'total PGA allocated'\r\nUNION\r\nselect 'TOTAL' AS NAME,\r\n       ((SELECT ROUND(sum(value) / 1024 / 1024, 2) from v$sga) +\r\n       (select ROUND(value / 1024 / 1024, 2)\r\n           from v$pgastat\r\n          where name = 'total PGA allocated')) || 'M' AS "SIZE(M)"\r\n  FROM DUAL\r\nUNION\r\nSELECT NAME,TO_CHAR(VALUE) FROM V$PGASTAT WHERE NAME='process count';\r\n
\r\n
\r\n

//\u4fee\u6539\u5185\u5b58

\r\n

Oracle 11g\u8bbe\u7f6e\u5185\u5b58\u81ea\u52a8\u7ba1\u7406:

\r\n

ALTER SYSTEM SET MEMORY_TARGET = 1024M SCOPE=SPFILE;
\r\n\tALTER SYSTEM SET memory_max_target = 1500M SCOPE=SPFILE;
\r\n\tALTER SYSTEM SET SGA_TARGET = 0 SCOPE=SPFILE;
\r\n\tALTER SYSTEM SET SGA_MAX_SIZE=800M SCOPE=SPFILE;
\r\n\tALTER SYSTEM SET PGA_AGGREGATE_TARGET = 0 SCOPE=SPFILE;
\r\n\talter system set pre_page_sga=FALSE scope=spfile;

\r\n

 

\r\n"}, {"title": "\u4fee\u6539ORACLE\u5185\u5b58\u5bfc\u81f4\u65e0\u6cd5\u542f\u52a8\u6570\u636e\u5e93", "desc": "\u6700\u8fd1\u4f7f\u7528PLSQL Developer\u94fe\u63a5\u6570\u636e\u5e93\u8fde\u63a5\u7684\u65f6\u5019\u603b\u662f\u5361\u987f\u4e24\u79d2\uff0c\u767e\u5ea6\u4e86\u4e0b\u4fee\u6539PGA,SGA\u5185\u5b58\uff0c\u4fee\u6539\u5b8c\u540e\u9700\u8981\u91cd\u542f\u6570\u636e\u5e93\u3002\u7531\u4e8e\u4fee\u6539\u7684\u503c\u8fc7\u5927\u8d85\u8fc7\u5185\u4e00\u534a\u7684\u5185\u5b58\u5bfc\u81f4\u6570\u636e\u5e93\u65e0\u6cd5\u542f\u52a8\u3002", "content": "

\r\n\t\u62a5\u9519\u4fe1\u606f

\r\n

ORA-00845: MEMORY_TARGET not supported on this system

\r\n

\u5728Oracle 11g\u4e2d\u5982\u679c\u91c7\u7528AMM\u5185\u5b58\u7ba1\u7406\uff0c\u90a3\u4e48\u5f53MEMORY_TARGET\u7684\u503c\u5927\u4e8e/dev/shm\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u62a5ORA-00845: MEMORY_TARGET not supported on this system\u9519\u8bef\uff0c\u89e3\u51b3\u529e\u6cd5\u589e\u52a0/dev/shm\u5927\u5c0f\uff0c\u5728redhat\u7cfb\u5217\u7cfb\u7edf\u4e2d\uff0c/dev/shm\u7684\u9ed8\u8ba4\u503c\u662f\u7cfb\u7edf\u603b\u5185\u5b58\u7684\u4e00\u534a\u3002

\r\n

\r\n\t\u67e5\u770b\u4fee\u6539shm\u7684\u5927\u5c0f

\r\n

[root@oracle11G ~]# df -hT

\r\n

/dev/mapper/vg_oracle11g-lv_root
\r\n\t                     ext4    45G   23G   20G  54% /
\r\n\ttmpfs                tmpfs  3.0G  491M  2.6G  16% /dev/shm
\r\n\t/dev/sda1            ext4   477M   32M  420M   8% /boot
\r\n\tshmfs                tmpfs  3.0G  491M  2.6G  16% /dev/shm

\r\n

\r\n\t\u5c06shmfs\u4fee\u6539\u4e3a3g

\r\n

mount -t tmpfs shmfs -o size=3g /dev/shm       //\u6839\u636e\u81ea\u5df1\u4e3b\u673a\u5185\u5b58\u548c\u66f4\u6539\u7684SGA,PGA\u7684\u503c\u6765\u8bbe\u7f6e

\r\n

\u5c06\u4fee\u6539\u52a0\u5165/etc/fstab\u9632\u6b62\u91cd\u542f\u670d\u52a1\u5668\u540e\u8bbe\u7f6e\u5931\u6548

\r\n

[root@oracle11G ~]# vi /etc/fstab

\r\n

shmfs                      /dev/shm tmpfs size=3g 0

\r\n

\u5728\u5207\u6362\u5230oracle\u8d26\u6237\u4e0b\u91cd\u542f\u6570\u636e\u5c31\u4e0d\u4f1a\u62a5\u9519\u4e86

\r\n

 

\r\n"}, {"title": "oracle\u7684sqlnet.ora,tnsnames.ora,listener.ora\u914d\u7f6e\u6587\u4ef6", "desc": "\u603b\u7ed3:1 .\u4e09\u4e2a\u914d\u7f6e\u6587\u4ef6\u90fd\u662f\u653e\u5728$ORACLE_HOME\\network\\admin\u76ee\u5f55\u4e0b\u30022 .sqlnet.ora\u786e\u5b9a\u89e3\u6790\u65b9\u5f0f3 .listener.ora\u4e0a\u8bbeSID_NAME,\u901a\u5e38\u7528\u4e8eJDBC\u8bbf\u95ee,\u5bf9\u5e94\u7684\u9519\u8bef\u7801\u4e3a125054 .tnsnames.ora\u4e0a\u8bbeSERVICE_NAME,\u901a\u5e38\u7528\u4e8elinux sqlplus\u5ba2\u6237\u7aef,\u5bf9\u5e94\u7684\u9519\u8bef\u7801\u4e3a12514", "content": "

\r\n\t\u603b\u7ed3:

\r\n

1 .\u4e09\u4e2a\u914d\u7f6e\u6587\u4ef6\u90fd\u662f\u653e\u5728$ORACLE_HOME\\network\\admin\u76ee\u5f55\u4e0b\u3002
\r\n\t2 .sqlnet.ora\u786e\u5b9a\u89e3\u6790\u65b9\u5f0f
\r\n\t3 .listener.ora\u4e0a\u8bbeSID_NAME,\u901a\u5e38\u7528\u4e8eJDBC\u8bbf\u95ee,\u5bf9\u5e94\u7684\u9519\u8bef\u7801\u4e3a12505
\r\n\t4 .tnsnames.ora\u4e0a\u8bbeSERVICE_NAME,\u901a\u5e38\u7528\u4e8elinux sqlplus\u5ba2\u6237\u7aef,\u5bf9\u5e94\u7684\u9519\u8bef\u7801\u4e3a12514

\r\n

\r\n\tsqlnet.ora

\r\n

\u4f5c\u7528\u7c7b\u4f3c\u4e8elinux\u6216\u8005\u5176\u4ed6unix\u7684 nsswitch.conf\u6587\u4ef6\uff0c\u901a\u8fc7\u8fd9\u4e2a\u6587\u4ef6\u6765\u51b3\u5b9a\u600e\u4e48\u6837\u627e\u4e00\u4e2a\u8fde\u63a5\u4e2d\u51fa\u73b0\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\uff08connect descriptor\uff09
\r\n\t\u3000\u3000\u5047\u5982sqlnet.ora \u662f\u4e0b\u9762\u8fd9\u4e2a\u6837\u5b50
\r\n\tNAMES.DIRECTORY_PATH= (TNSNAMES,HOSTNAME)
\r\n\t\u5f53\u5ba2\u6237\u7aef\u8f93\u5165sqlplus sys/oracle@orcl\u65f6, \u5c31\u4f1a\u9996\u5148\u5728 tnsnames.ora\u6587\u4ef6\u4e2d\u627eorcl\u7684\u8bb0\u5f55.\u5982\u679c\u6ca1\u6709\u76f8\u5e94\u7684\u8bb0\u5f55\u5219\u5c1d\u8bd5\u628aorcl\u5f53\u4f5c\u4e00\u4e2a\u4e3b\u673a\u540d
\r\n\t\u62ec\u53f7\u4e2d\u8fd8\u6709\u5176\u4ed6\u9009\u9879\uff0c\u5982LDAP\u7b49,\u4f46HOSTNAME,LDAP\u901a\u5e38\u5e76\u4e0d\u5e38\u7528,\u901a\u5e38\u53ea\u8bbeTNSNAME\u5373\u53ef.

\r\n

\r\n\ttnsnames.ora

\r\n

1. \u63d0\u4f9btnsname\u5230\u4e3b\u673a\u540d\u6216\u8005ip\u7684\u5bf9\u5e94
\r\n\tORCL =
\r\n\t\u3000(DESCRIPTION =
\r\n\t   \u3000\u3000(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))        #\u5bf9\u5e94\u7684SOCKET\u4fe1\u606f
\r\n\t     \u3000(CONNECT_DATA =                   
\r\n\t         \u3000\u3000(SERVER = DEDICATED)               #\u4f7f\u7528\u4e13\u7528\u670d\u52a1\u5668\u6a21\u5f0f\u53bb\u8fde\u63a5
\r\n\t           \u3000(SERVICE_NAME = orcl)           #\u8fd9\u91cc\u586b\u5165\u5bf9\u5e94 service_name\uff0c
\r\n\t                                            \u53ef\u4ee5\u901a\u8fc7"SQLPLUS>show parameter service_name;"\u67e5\u770b
\r\n\t\u3000 )       
\r\n\t\u3000\u3000
\r\n\tSALES =
\r\n\t\u3000(DESCRIPTION =
\r\n\t  \u3000\u3000(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.188.219)(PORT = 1521))
\r\n\t\u3000\u3000  (CONNECT_DATA =
\r\n\t     \u3000\u3000(SERVER = DEDICATED)
\r\n\t     \u3000\u3000(SERVICE_NAME = sales)
\r\n\t   \u3000\u3000)
\r\n\t\u3000)
\r\n\t   2. \u914dtnsname.ora\u91cc\u9762\u7684service_name,\u53ef\u4ee5\u7528\u4e0b\u9762\u547d\u4ee4\u67e5\u770b:
\r\n\tSQL> show parameter service_name;
\r\n\t
\r\n\tNAME                                 TYPE        VALUE
\r\n\t------------------------------------ ----------- ------------------------------
\r\n\tservice_names                        string      orcl
\r\n\t  3. tnsnames.ora\u662f\u4e3aoracle\u5ba2\u6237\u7aef\u8bbf\u95ee\u6570\u636e\u5e93\u800c\u8bbe\u7684,\u4e0d\u662f\u4e3a\u4e86\u8fdc\u7a0b\u5ba2\u6237\u7aef\u8fde\u63a5oracle \u670d\u52a1\u5668\u800c\u8bbe\u7684
\r\n\t\u5220\u9664tnsnames.ora
\r\n\t[oracle@oracle admin]$ rm tnsnames.ora
\r\n\t\u91cd\u542foracle
\r\n\t
\r\n\t\u672c\u5730\u5ba2\u6237\u7aef\u65e0\u6cd5\u8bbf\u95ee\u6570\u636e\u5e93\u4e86
\r\n\t[oracle@oracle ~]$ sqlplus scott/scott@orcl
\r\n\t
\r\n\tSQL*Plus: Release 10.2.0.1.0 - Production on Tue Feb 16 17:32:41 2010
\r\n\t
\r\n\tCopyright (c) 1982, 2005, Oracle.  All rights reserved.
\r\n\t
\r\n\tERROR:
\r\n\tORA-12154: TNS:could not resolve the connect identifier specified
\r\n\t\u5728\u8fdc\u7aef(\u53e6\u4e00\u53f0\u673a\u5668)
\r\n\t\u901a\u8fc7sqlplus\u65b9\u5f0f\u8fde\u63a5oracle\u6570\u636e\u5e93,\u6ca1\u95ee\u9898
\r\n\t\u901a\u8fc7jdbc\u8fde\u63a5orcle\u6570\u636e\u5e93\uff0c\u6ca1\u95ee\u9898

\r\n

\r\n\tlistener.ora

\r\n

listener\u8fdb\u7a0b\u63a5\u53d7\u8fdc\u7a0b\u5bf9\u6570\u636e\u5e93\u7684\u63a5\u5165\u8bf7\u6c42
\r\n\tListener.ora
\r\n\t    #SID_LIST_LISTENER \u5b9a\u4e49, \u5b9a\u4e49LISTENER\u8fdb\u7a0b\u76d1\u542cSID
\r\n\t\u3000\u3000SID_LIST_LISTENER =
\r\n\t\u3000\u3000(SID_LIST =                            #\u53ef\u4ee5\u76d1\u542c\u591a\u4e2aSID,\u90fd\u5b58\u5728\u4e00\u4e2aSID\u8868\u4e2d
\r\n\t
\r\n\t  \u3000\u3000(SID_DESC =
\r\n\t\u3000      \u3000(GLOBAL_DBNAME = boway)         # GLOBAL_DBNAME\u4e0d\u662f\u5fc5\u9700\u7684\u9664\u975e\u4f7f\u7528HOSTNAME\u505a\u6570\u636e\u5e93\u8fde\u63a5
\r\n\t      \u3000\u3000(ORACLE_HOME = E:\\oracle\\product\\10.1.0\\Db_2)
\r\n\t      \u3000\u3000(SID_NAME = orcl)
\r\n\t  \u3000\u3000)
\r\n\t\u3000\u3000)
\r\n\t\u3000\u3000
\r\n\t\u3000\u3000#\u76d1\u542c\u5668\u5b9a\u4e49\uff0c\u4e00\u53f0\u6570\u636e\u5e93\u53ef\u4ee5\u6709\u4e0d\u6b62\u4e00\u4e2a\u76d1\u542c\u5668
\r\n\t\u3000\u3000LISTENER =
\r\n\t  \u3000\u3000(DESCRIPTION =
\r\n\t       \u3000\u3000(ADDRESS = (PROTOCOL = TCP)(HOST = boway)(PORT = 1521))
\r\n\t   \u3000\u3000)
\r\n\tJDBC\u8fde\u63a5\u8bf7\u6c42\u7684URL \u8981\u5bf9\u5e94Listener.ora\u3000
\r\n\t jdbc:oracle:thin:@192.168.3.98:1521:orcl

\r\n

 

\r\n"}, {"title": "ORACLE\u8fde\u63a5\u6570\u592a\u5927\u5bfc\u81f4\u7a0b\u5e8f\u62a5\u9519\u6216\u8005PLSQL\u94fe\u63a5\u4e0d\u4e0a\u7684\u89e3\u51b3\u65b9\u6cd5", "desc": "\u4fee\u6539processes\u548csessions\u503c\u5fc5\u987b\u91cd\u542foracle\u670d\u52a1\u5668\u624d\u80fd\u751f\u6548\uff0cORACLE\u7684\u8fde\u63a5\u6570(sessions)\u4e0e\u5176\u53c2\u6570\u6587\u4ef6\u4e2d\u7684\u8fdb\u7a0b\u6570(process)\u6709\u5173\uff0c\u5b83\u4eec\u7684\u5173\u7cfb\uff1asessions=(1.1*process+5)\r\n", "content": "

\r\n\t1.\u6253\u5f00CMD\u547d\u4ee4\u63a7\u5236\u53f0

\r\n

sqlplus sys/pwd as sysdba

\r\n

\r\n\t2.\u67e5\u770bprocesses\u548csessions\u53c2\u6570

\r\n

\u3000\u3000SQL> show parameter processes

\r\n

\u3000\u3000NAME                                  TYPE         VALUE

\r\n

\u3000\u3000db_writer_processes                  integer     1

\r\n

\u3000\u3000gcs_server_processes                 integer     0

\r\n

\u3000\u3000job_queue_processes                  integer     10

\r\n

\u3000\u3000log_archive_max_processes            integer     2

\r\n

\u3000\u3000processes                            integer     50

\r\n

\u3000\u3000SQL> show parameter sessions

\r\n

\u3000\u3000NAME                                  TYPE         VALUE

\r\n

\u3000\u3000license_max_sessions                 integer     0

\r\n

\u3000\u3000license_sessions_warning             integer     0

\r\n

\u3000\u3000logmnr_max_persistent_sessions       integer     1

\r\n

\u3000\u3000sessions                             integer     60

\r\n

\u3000\u3000shared_server_sessions               integer

\r\n

\r\n\t3.\u67e5\u8be2ORACLE\u6570\u636e\u5e93\u94fe\u63a5\u60c5\u51b5\u3002

\r\n

\u3000\u3000\u67e5\u8be2\u6570\u636e\u5e93\u5f53\u524d\u8fdb\u7a0b\u7684\u8fde\u63a5\u6570\uff1a

\r\n

\u3000\u3000select count(*) from v$process;

\r\n

\u3000\u3000\u67e5\u770b\u6570\u636e\u5e93\u5f53\u524d\u4f1a\u8bdd\u7684\u8fde\u63a5\u6570\uff1a

\r\n

\u3000\u3000elect count(*) from v$session;

\r\n

\u3000\u3000\u67e5\u770b\u6570\u636e\u5e93\u7684\u5e76\u53d1\u8fde\u63a5\u6570\uff1a

\r\n

\u3000\u3000select count(*) from v$session where status='ACTIVE';

\r\n

\u3000\u3000\u67e5\u770b\u5f53\u524d\u6570\u636e\u5e93\u5efa\u7acb\u7684\u4f1a\u8bdd\u60c5\u51b5\uff1a

\r\n

\u3000\u3000select sid,serial#,username,program,machine,status from v$session;

\r\n

\u3000\u67e5\u8be2\u6570\u636e\u5e93\u5141\u8bb8\u7684\u6700\u5927\u8fde\u63a5\u6570\uff1a

\r\n

\u3000\u3000select value from v$parameter where name = 'processes';

\r\n

\u3000\u3000\u6216\u8005\uff1ashow parameter processes;

\r\n

\u3000\u3000\u67e5\u770b\u5f53\u524d\u6709\u54ea\u4e9b\u7528\u6237\u6b63\u5728\u4f7f\u7528\u6570\u636e\uff1a

\r\n

\u3000\u3000select osuser,a.username,cpu_time/executions/1000000||'s',sql_fulltext,machine

\r\n

\u3000\u3000from v$session a,v$sqlarea b

\r\n

\u3000\u3000where a.sql_address = b.address

\r\n

\u3000\u3000order by cpu_time/executions desc;

\r\n

\r\n\t4.\u4fee\u6539processes\u548csessions\u503c\uff08sessions=(1.1*process+5\uff09

\r\n

\u3000\u3000SQL> alter system set processes=300 scope=spfile;

\r\n

\u3000\u3000\u7cfb\u7edf\u5df2\u66f4\u6539\u3002

\r\n

\u3000\u3000SQL> alter system set sessions=335 scope=spfile;

\r\n

\u3000\u3000\u7cfb\u7edf\u5df2\u66f4\u6539\u3002

\r\n

\r\n\t5.\u91cd\u542f\u6570\u636e\u5e93

\r\n

\u3000SQL>shutdown immediate;

\r\n

\u3000SQL>startup;

\r\n

LINUX\u7cfb\u7edf\u4e0b\u6570\u636e\u5e93\u542f\u52a8\u65b9\u6cd5\uff1a

\r\n

\u3000\u3000\u542f\u52a8oracle

\r\n

\u3000\u3000su - oracle   //\u5207\u6362oralce\u7528\u6237

\r\n

\u3000\u3000lsnrctl start    //\u542f\u52a8\u76d1\u542c

\r\n

\u3000\u3000sqlplus system/pwd as sysdba   //\u8fdb\u5165sql

\r\n

\u3000\u3000startup                                      //\u542f\u52a8\u6570\u636e\u5e93

\r\n

\u5173\u95ed\u91cd\u65b0\u542f\u52a8\u65b9\u6cd5

\r\n

\u3000\u3000shutdown immediate;

\r\n

\u3000\u3000startup mount;

\r\n

\u3000\u3000alter database open;

\r\n

 

\r\n

 

\r\n"}]