In this tutorial, we will show you How to check dump file size in Oracle. Sometimes, you need to export the entire database and may not know the exact space required for the dump file. Oracle provides the expdp command to perform this export.
Check dump file size in Oracle
The query calculates how much dump file table data each schema on your databases.
SELECT owner, segment_type, SUM(bytes)/1024/1024/1024 GB
FROM dba_segments
WHERE owner IN ('huupv') AND segment_type NOT LIKE '%INDEX'
GROUP BY owner, segment_type
ORDER BY 1, 2;
Note:
Replace [USER_NAME] with the specific username for which you want to get the dump size.
For example, if [USER_NAME] is huupv, the query becomes:
SELECT owner, segment_type, SUM(bytes)/1024/1024/1024 GB
FROM dba_segments
WHERE owner IN ('huupv') AND segment_type NOT LIKE '%INDEX'
GROUP BY owner, segment_type
ORDER BY 1, 2;
Conclusion
Throughout the article, you can learn how to “check dump file size in Oracle” as described above. I hope you find this information helpful. Thank you for reading the DevopsRoles page!
In this tutorial, How to install MySQL Server on Centos/RedHat. The default local repository only supports MySQL packages including MySQL (replaced by Mariadb), Mongodb, so forth. In some cases, you need to install the correct MySQL Community server. I will point to a local repository dedicated to MySQL. Linux the essential for DevOps Roles.
Create a “/etc/yum.repos.d/MySQL.repo” file with the content as below:
# Enable to use MySQL 5.5
[Local-mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/\$releasever/\$basearch/
enabled=0
gpgcheck=0
# Enable to use MySQL 5.6
[Local-mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/\$releasever/\$basearch/
enabled=0
gpgcheck=0
# Enable to use MySQL 5.7
[Local-mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/\$releasever/\$basearch/
enabled=0
gpgcheck=0
[Local-mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/\$releasever/\$basearch/
enabled=1
gpgcheck=0
[Local-mysql80-mysql-cluster-7.6-community]
name=MySQL cluster 7.6 community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.6-community/el/\$releasever/\$basearch/
enabled=1
gpgcheck=0
[Local-mysql-cluster-7.5-community]
name=MySQL Cluster 7.5 Community
baseurl=http://repo.mysql.com/yum/mysql-cluster-7.5-community/el/7/\$basearch/
enabled=0
gpgcheck=0
[Local-mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/\$releasever/\$basearch/
enabled=1
gpgcheck=0
[Local-mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/\$releasever/\$basearch/
enabled=1
gpgcheck=0
[Local-mysql-tools-preview]
name=MySQL Tools Preview
baseurl=http://repo.mysql.com/yum/mysql-tools-preview/el/7/\$basearch/
enabled=1
gpgcheck=0
Install the MySQL Community Server package:
$ sudo yum install mysql-community-server
Install another library for MySQL Server (if necessary)
In this tutorial, How to install MongoDB on Centos. The Local Remi Repository only supports the old MongoDB packages by default. Need to upgrade to higher version need to point to the server of MongoDB. Linux the essential for DevOps Roles.
My environment
Centos 7/6, Redhat.
MongoDB Version 4.0
Install Mongodb on Centos/Redhat
Step 1. Disable the current Repository on Centos.
Failure to do this will result in conflicting package MongoDB on Epel Repository. Installing a package management software package:
$ sudo yum install yum-utils
Disable Repository ‘remi- *’ and internet MongoDB package if Pre-ordered:
In today’s fast-paced DevOps environment, Docker has become a cornerstone technology, simplifying the process of deploying and managing applications in containerized environments. Whether you’re a beginner or an experienced professional, having a handy reference for Docker CLI commands is essential. This Docker CLI cheat sheet will guide you through the most important commands you need to know, helping you manage containers and images with ease.
Why Docker is Essential for DevOps
Docker has revolutionized the way we deploy applications, offering a consistent environment across various stages of development, testing, and production. It enables teams to package applications with all their dependencies, ensuring they run seamlessly across different computing environments. This capability makes Docker an indispensable tool in DevOps, where speed, consistency, and reliability are key.
Building Docker Images
How to Build an Image from a Dockerfile
One of the first steps in using Docker is building an image from a Dockerfile. This command packages your application and its dependencies into an image that can be run anywhere Docker is installed.
$ docker build -t devopsroles/centos:latest .
Explanation: The -t option tags the image with a name (devopsroles/centos) and a version (latest). The . at the end specifies the build context, which is typically the directory containing your Dockerfile.
Common Issues When Building Images
Building Docker images is generally straightforward, but you may encounter issues such as large image sizes or failed builds. To minimize image size, consider using multi-stage builds or Alpine-based images. If a build fails, check your Dockerfile for syntax errors or missing dependencies.
Running Containers
Running a Command in an Image
Running a command in a Docker container is as simple as using the docker run command. This command starts a new container and executes the specified command.
docker run [options] IMAGE
Options: Docker provides various options to customize how your container runs. For example, you can use the -d option to run the container in detached mode or the -it options to run it interactively.
Example: Running a Bash Shell in Fedora
$ docker run -it fedora bash
Explanation: This command runs a Bash shell in an interactive Fedora container. The -it options allow you to interact with the container in real time.
Managing Docker Containers
Creating and Starting Containers
Creating a Docker container from an image is often the first step in deploying an application. The docker create command allows you to set various options for your container.
-t, --tty: Pseudo-tty (useful for terminal-based applications).
--name NAME: Name your container for easier management.
-p, --publish 5000:5000: Port mapping from the container to the host.
--expose 5432: Expose a specific port to linked containers.
-v, --volume $(pwd):/app: Mount a directory from the host to the container.
-e, --env NAME=hello: Set environment variables.
Example: Creating and Starting a Container
$ docker create -t -i fedora bash
Explanation: This command creates a Fedora container with an interactive Bash shell. The -t and -i options allow for terminal interaction.
Executing Commands in Running Containers
Docker allows you to run commands inside a running container using the docker exec command. This is useful for tasks such as troubleshooting or running administrative tasks.
docker exec [options] CONTAINER COMMAND
Key Options for docker exec
-d, --detach: Run the command in the background.
-i, --interactive: Keep stdin open even if not attached.
-t, --tty: Allocate a pseudo-TTY for interactive use.
Example: SSH into a Docker Container
$ docker exec -it 59e59adcc0b4 /bin/bash
Explanation: This command opens an interactive Bash shell in a running container with the ID 59e59adcc0b4.
Starting and Stopping Containers
How to Start a Docker Container
Starting a stopped container is straightforward with the docker start command. This command resumes a container that was previously stopped.
docker start [options] CONTAINER
Options: The -a and -i options attach to stdout/err and stdin, respectively, allowing you to interact with the container as it starts.
Stopping a Running Docker Container
To stop a running container, use the docker stop command. This gracefully shuts down the container.
docker stop [options] CONTAINER
Tip: If you need to force-stop a container, use docker kill instead of docker stop.
Docker Images Management
Viewing Docker Images
Docker images are the building blocks of containers. You can view the images on your system using the docker images command.
$ docker images
Explanation: This command lists all images available locally, showing details such as repository name, tags, and image IDs.
Deleting Docker Images
To free up disk space or remove outdated images, you can delete Docker images using the docker rmi command.
$ docker rmi b750fe78269d
Explanation: This command removes the image with the ID b750fe78269d. Be cautious when removing images, as containers depending on them will fail to start.
Advanced Container Management
Using docker ps to Manage Containers
The docker ps the command is your go-to tool for listing running containers. You can view all containers, including stopped ones, by adding the -a option.
$ docker ps
$ docker ps -a
Explanation: The first command lists only running containers, while the second lists all containers, regardless of their state.
Killing a Docker Container
Sometimes, a container may become unresponsive and need to be forcefully terminated. The docker kill command sends a SIGKILL signal to the container, immediately stopping it.
$ docker kill $ID
Tip: Use the container’s ID or name to target the right one. Be careful with this command, as it does not allow the container to gracefully shut down.
Frequently Asked Questions (FAQs)
What is Docker used for?
Docker is a platform that enables developers to package applications into containers—standardized units of software that include everything the app needs to run. This ensures consistency across different environments, from development to production.
How does Docker differ from a virtual machine (VM)?
Docker containers share the host system’s kernel, making them more lightweight and faster to start than VMs. While VMs include a full OS, containers only include the application and its dependencies.
What are the key benefits of using Docker in DevOps?
Docker offers several benefits, including consistent environments across different stages, rapid deployment, efficient resource utilization, and ease of scaling applications.
Can I run multiple containers on the same host?
Yes, Docker allows you to run multiple containers on the same host. Each container operates in isolation but can communicate with others if needed through networks.
How do I update a running Docker container?
To update a running container, you typically create a new image with the desired changes, stop the old container, and start a new one with the updated image. You can use docker commit to save changes from a running container, but this is generally not recommended for production environments.
Conclusion
Docker CLI is a powerful tool that can significantly simplify the management and deployment of applications in containerized environments. Whether you’re building images, running containers, or managing your Docker infrastructure, this cheat sheet provides the essential commands you need to master Docker. As you continue to work with Docker, you’ll find these commands becoming second nature, enabling you to focus more on developing and deploying great software.
By using this Docker CLI cheat sheet, you’ll be well-equipped to handle various tasks in your DevOps role efficiently. Remember, Docker is continuously evolving, so staying up-to-date with the latest commands and best practices is crucial for maximizing your productivity. Thank you for reading the DevopsRoles page!
In the world of DevOps, setting up and managing consistent development environments is crucial for ensuring application performance and reliability. Vagrant, a powerful tool, has become a popular choice to quickly and easily create virtual environments for developers. In this article, we provide a detailed Vagrant Cheat Sheet to help you quickly grasp the basic commands and configurations of this tool. Let’s explore how Vagrant can enhance your development workflow! The Vagrant is building an isolated virtual environment for the app. Vagrant is essential for DevOps Roles.
Vagrant is an essential tool in the modern DevOps toolkit, simplifying the setup and management of development environments. With this Cheat Sheet, you now have the basic commands and configurations to start using Vagrant effectively.
Make the most of Vagrant’s capabilities to boost your productivity and ensure consistency across your projects. If you need more detailed information or encounter any issues, don’t hesitate to seek help from the DevOps community. Good luck!
How to use Angular build production on server Linux VPS. Deploying Angular applications in a production environment requires a strategic approach to optimization and server configuration. This guide will delve into best practices for building Angular apps for production, emphasizing effective command-line techniques and server setup to enhance performance and stability.
Angular build production
In development, you have run the ng serve command for your application. What about Angular production? If you look at package.json the file below
Now, To build the script use the Angular CLI ng build with the –prod flag as below
$ ng build --prod
The during run “build –prod” also creates a new folder called distfolder. You need to have server Nginx or Apache for all requests to this index.html
How to configure Nginx in production to serve an Angular app
With the right setup and commands, you can seamlessly transition your Angular application from development to a production-ready state on Linux servers. By adhering to the outlined strategies, developers can ensure their applications are optimized for efficiency and ready for real-world deployment.
Through the article, You can use “Angular build production” as above. I hope this will be helpful to you. Thank you for reading the DevopsRoles page!
In this tutorial, How to install nodejs npm and Angular on Centos 7.
NodeJS is a cross-platform, opensource Javascript for server-side.
npm is the package management utility for Javascript.
Angular is an opensource Javascript front-end web.
Install NodeJS NPM and Angular
The prerequisite for NodeJS NPM and Angular.
$ sudo yum update
$ sudo yum -y install epel-release
$ sudo yum -y install gcc c++ make
Install NodeJS
$ sudo yum -y install nodejs
To install Angular
$ npm install -g @angular/cli
To start a Angular project
$ ng new <your-project>
Staring the development server
$ cd <your-project>
$ ng serve
The Angular app is access via http://localhost:8005 on your browser.
Conclusion
Thought the article, You can “install NodeJS NPM and Angular on Centos 7x” as above . I hope will this your helpful. Thank you for reading the DevopsRoles page!
This guide provides a comprehensive overview of installing essential development tools on CentOS. By using the yum groupinstall command, users can efficiently manage and install packages required for development, such as GNU GCC C/C++ compilers. This process is crucial for developers working in CentOS environments, aiming to streamline their setup and increase productivity.
In this tutorial, I used Centos “install development tools”. The Ubuntu distribution install method is equivalent to “apt-get build-essential, while the Centos called groupinstall with yum command. How do I install all developer tools such as GNU GCC C/C++ compilers and others? You need to “install Development Tools“.
Development Tools for CentOS: Overview of tools and installation via Yum.
Development Tools for RHEL 7: Recommended tools and installation tips for Red Hat Enterprise Linux.
Development Tools for Ubuntu: Effective tools for Ubuntu and installation using apt-get.
Comparing Toolsets Across OS: Differences and similarities in toolkits across CentOS, RHEL 7, and Ubuntu.
How to Install Development Tools on Centos
For Centos, RHEL, and Fedora
Installing groupinstall use the yum command on Centos, RHEL, and Fedora.
By following the steps outlined in this tutorial, users can successfully install all necessary development tools on CentOS, ensuring a robust environment for programming and development tasks.
This guide simplifies the process, making it accessible even for those new to Linux systems, ultimately enhancing their capabilities in handling various software development requirements. I hope will this your helpful. Thank you for reading the DevopsRoles page!
I use Vagrant version 2.2.0 Link here. Installing the Vagrant is very easy, then restart your machine.
Download and run Centos 7 Vagrant Box on Windows 10
Open Git Bash as below
HuuPV@LAPTOP-HKT198TT MINGW64 ~
$ pwd
/c/Users/HuuPV
HuuPV@LAPTOP-HKT198TT MINGW64 ~
$ mkdir VMs_vagrant
HuuPV@LAPTOP-HKT198TT MINGW64 ~
$ cd VMs_vagrant/
HuuPV@LAPTOP-HKT198TT MINGW64 ~/VMs_vagrant
$ mkdir Centos7
HuuPV@LAPTOP-HKT198TT MINGW64 ~/VMs_vagrant
$ cd Centos7/
HuuPV@LAPTOP-HKT198TT MINGW64 ~/VMs_vagrant/Centos7
$ vagrant.exe init
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
HuuPV@LAPTOP-HKT198TT MINGW64 ~/VMs_vagrant/Centos7
$ notepad Vagrantfile
The result as the picture below
The content “Vagrantfile” file
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
config.vm.provider :virtualbox do |vb|
vb.memory = 256
vb.cpus = 1
end
# Application server 1.
config.vm.define "app1" do |app1|
app1.vm.hostname = "app1.dev"
app1.vm.box = "centos/7"
app1.vm.network :private_network, ip: "192.168.3.4"
end
end
Vagrant ssh (Connecting non-GUI Linux OS)
$ vagrant.exe ssh
The result as the picture below
Most Common Vagrant Commands
vagrant init: initialize
vagrant up: Download image and do rest of the settings and power-up the box